vendor.js 362 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748
  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. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  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. var realAtob;
  13. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  14. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15. if (typeof atob !== 'function') {
  16. realAtob = function realAtob(str) {
  17. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  18. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  19. // Adding the padding if missing, for semplicity
  20. str += '=='.slice(2 - (str.length & 3));
  21. var bitmap;var result = '';var r1;var r2;var i = 0;
  22. for (; i < str.length;) {
  23. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  24. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  25. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  26. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  27. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  28. }
  29. return result;
  30. };
  31. } else {
  32. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  33. realAtob = atob;
  34. }
  35. function b64DecodeUnicode(str) {
  36. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  37. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  38. }).join(''));
  39. }
  40. function getCurrentUserInfo() {
  41. var token = wx.getStorageSync('uni_id_token') || '';
  42. var tokenArr = token.split('.');
  43. if (!token || tokenArr.length !== 3) {
  44. return {
  45. uid: null,
  46. role: [],
  47. permission: [],
  48. tokenExpired: 0 };
  49. }
  50. var userInfo;
  51. try {
  52. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  53. } catch (error) {
  54. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  55. }
  56. userInfo.tokenExpired = userInfo.exp * 1000;
  57. delete userInfo.exp;
  58. delete userInfo.iat;
  59. return userInfo;
  60. }
  61. function uniIdMixin(Vue) {
  62. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  63. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  64. return role.indexOf(roleId) > -1;
  65. };
  66. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  67. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  68. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  69. };
  70. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  71. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  72. return tokenExpired > Date.now();
  73. };
  74. }
  75. var _toString = Object.prototype.toString;
  76. var hasOwnProperty = Object.prototype.hasOwnProperty;
  77. function isFn(fn) {
  78. return typeof fn === 'function';
  79. }
  80. function isStr(str) {
  81. return typeof str === 'string';
  82. }
  83. function isPlainObject(obj) {
  84. return _toString.call(obj) === '[object Object]';
  85. }
  86. function hasOwn(obj, key) {
  87. return hasOwnProperty.call(obj, key);
  88. }
  89. function noop() {}
  90. /**
  91. * Create a cached version of a pure function.
  92. */
  93. function cached(fn) {
  94. var cache = Object.create(null);
  95. return function cachedFn(str) {
  96. var hit = cache[str];
  97. return hit || (cache[str] = fn(str));
  98. };
  99. }
  100. /**
  101. * Camelize a hyphen-delimited string.
  102. */
  103. var camelizeRE = /-(\w)/g;
  104. var camelize = cached(function (str) {
  105. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  106. });
  107. var HOOKS = [
  108. 'invoke',
  109. 'success',
  110. 'fail',
  111. 'complete',
  112. 'returnValue'];
  113. var globalInterceptors = {};
  114. var scopedInterceptors = {};
  115. function mergeHook(parentVal, childVal) {
  116. var res = childVal ?
  117. parentVal ?
  118. parentVal.concat(childVal) :
  119. Array.isArray(childVal) ?
  120. childVal : [childVal] :
  121. parentVal;
  122. return res ?
  123. dedupeHooks(res) :
  124. res;
  125. }
  126. function dedupeHooks(hooks) {
  127. var res = [];
  128. for (var i = 0; i < hooks.length; i++) {
  129. if (res.indexOf(hooks[i]) === -1) {
  130. res.push(hooks[i]);
  131. }
  132. }
  133. return res;
  134. }
  135. function removeHook(hooks, hook) {
  136. var index = hooks.indexOf(hook);
  137. if (index !== -1) {
  138. hooks.splice(index, 1);
  139. }
  140. }
  141. function mergeInterceptorHook(interceptor, option) {
  142. Object.keys(option).forEach(function (hook) {
  143. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  144. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  145. }
  146. });
  147. }
  148. function removeInterceptorHook(interceptor, option) {
  149. if (!interceptor || !option) {
  150. return;
  151. }
  152. Object.keys(option).forEach(function (hook) {
  153. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  154. removeHook(interceptor[hook], option[hook]);
  155. }
  156. });
  157. }
  158. function addInterceptor(method, option) {
  159. if (typeof method === 'string' && isPlainObject(option)) {
  160. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  161. } else if (isPlainObject(method)) {
  162. mergeInterceptorHook(globalInterceptors, method);
  163. }
  164. }
  165. function removeInterceptor(method, option) {
  166. if (typeof method === 'string') {
  167. if (isPlainObject(option)) {
  168. removeInterceptorHook(scopedInterceptors[method], option);
  169. } else {
  170. delete scopedInterceptors[method];
  171. }
  172. } else if (isPlainObject(method)) {
  173. removeInterceptorHook(globalInterceptors, method);
  174. }
  175. }
  176. function wrapperHook(hook) {
  177. return function (data) {
  178. return hook(data) || data;
  179. };
  180. }
  181. function isPromise(obj) {
  182. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  183. }
  184. function queue(hooks, data) {
  185. var promise = false;
  186. for (var i = 0; i < hooks.length; i++) {
  187. var hook = hooks[i];
  188. if (promise) {
  189. promise = Promise.resolve(wrapperHook(hook));
  190. } else {
  191. var res = hook(data);
  192. if (isPromise(res)) {
  193. promise = Promise.resolve(res);
  194. }
  195. if (res === false) {
  196. return {
  197. then: function then() {} };
  198. }
  199. }
  200. }
  201. return promise || {
  202. then: function then(callback) {
  203. return callback(data);
  204. } };
  205. }
  206. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  207. ['success', 'fail', 'complete'].forEach(function (name) {
  208. if (Array.isArray(interceptor[name])) {
  209. var oldCallback = options[name];
  210. options[name] = function callbackInterceptor(res) {
  211. queue(interceptor[name], res).then(function (res) {
  212. /* eslint-disable no-mixed-operators */
  213. return isFn(oldCallback) && oldCallback(res) || res;
  214. });
  215. };
  216. }
  217. });
  218. return options;
  219. }
  220. function wrapperReturnValue(method, returnValue) {
  221. var returnValueHooks = [];
  222. if (Array.isArray(globalInterceptors.returnValue)) {
  223. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  224. }
  225. var interceptor = scopedInterceptors[method];
  226. if (interceptor && Array.isArray(interceptor.returnValue)) {
  227. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  228. }
  229. returnValueHooks.forEach(function (hook) {
  230. returnValue = hook(returnValue) || returnValue;
  231. });
  232. return returnValue;
  233. }
  234. function getApiInterceptorHooks(method) {
  235. var interceptor = Object.create(null);
  236. Object.keys(globalInterceptors).forEach(function (hook) {
  237. if (hook !== 'returnValue') {
  238. interceptor[hook] = globalInterceptors[hook].slice();
  239. }
  240. });
  241. var scopedInterceptor = scopedInterceptors[method];
  242. if (scopedInterceptor) {
  243. Object.keys(scopedInterceptor).forEach(function (hook) {
  244. if (hook !== 'returnValue') {
  245. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  246. }
  247. });
  248. }
  249. return interceptor;
  250. }
  251. 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];}
  252. var interceptor = getApiInterceptorHooks(method);
  253. if (interceptor && Object.keys(interceptor).length) {
  254. if (Array.isArray(interceptor.invoke)) {
  255. var res = queue(interceptor.invoke, options);
  256. return res.then(function (options) {
  257. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  258. });
  259. } else {
  260. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  261. }
  262. }
  263. return api.apply(void 0, [options].concat(params));
  264. }
  265. var promiseInterceptor = {
  266. returnValue: function returnValue(res) {
  267. if (!isPromise(res)) {
  268. return res;
  269. }
  270. return new Promise(function (resolve, reject) {
  271. res.then(function (res) {
  272. if (res[0]) {
  273. reject(res[0]);
  274. } else {
  275. resolve(res[1]);
  276. }
  277. });
  278. });
  279. } };
  280. var SYNC_API_RE =
  281. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  282. var CONTEXT_API_RE = /^create|Manager$/;
  283. // Context例外情况
  284. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  285. // 同步例外情况
  286. var ASYNC_API = ['createBLEConnection'];
  287. var CALLBACK_API_RE = /^on|^off/;
  288. function isContextApi(name) {
  289. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  290. }
  291. function isSyncApi(name) {
  292. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  293. }
  294. function isCallbackApi(name) {
  295. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  296. }
  297. function handlePromise(promise) {
  298. return promise.then(function (data) {
  299. return [null, data];
  300. }).
  301. catch(function (err) {return [err];});
  302. }
  303. function shouldPromise(name) {
  304. if (
  305. isContextApi(name) ||
  306. isSyncApi(name) ||
  307. isCallbackApi(name))
  308. {
  309. return false;
  310. }
  311. return true;
  312. }
  313. /* eslint-disable no-extend-native */
  314. if (!Promise.prototype.finally) {
  315. Promise.prototype.finally = function (callback) {
  316. var promise = this.constructor;
  317. return this.then(
  318. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  319. function (reason) {return promise.resolve(callback()).then(function () {
  320. throw reason;
  321. });});
  322. };
  323. }
  324. function promisify(name, api) {
  325. if (!shouldPromise(name)) {
  326. return api;
  327. }
  328. 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];}
  329. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  330. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  331. }
  332. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  333. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  334. success: resolve,
  335. fail: reject })].concat(
  336. params));
  337. })));
  338. };
  339. }
  340. var EPS = 1e-4;
  341. var BASE_DEVICE_WIDTH = 750;
  342. var isIOS = false;
  343. var deviceWidth = 0;
  344. var deviceDPR = 0;
  345. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  346. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  347. deviceWidth = windowWidth;
  348. deviceDPR = pixelRatio;
  349. isIOS = platform === 'ios';
  350. }
  351. function upx2px(number, newDeviceWidth) {
  352. if (deviceWidth === 0) {
  353. checkDeviceWidth();
  354. }
  355. number = Number(number);
  356. if (number === 0) {
  357. return 0;
  358. }
  359. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  360. if (result < 0) {
  361. result = -result;
  362. }
  363. result = Math.floor(result + EPS);
  364. if (result === 0) {
  365. if (deviceDPR === 1 || !isIOS) {
  366. result = 1;
  367. } else {
  368. result = 0.5;
  369. }
  370. }
  371. return number < 0 ? -result : result;
  372. }
  373. function getLocale() {
  374. // 优先使用 $locale
  375. var app = getApp({
  376. allowDefault: true });
  377. if (app && app.$vm) {
  378. return app.$vm.$locale;
  379. }
  380. return wx.getSystemInfoSync().language || 'zh-Hans';
  381. }
  382. function setLocale(locale) {
  383. var app = getApp();
  384. if (!app) {
  385. return false;
  386. }
  387. var oldLocale = app.$vm.$locale;
  388. if (oldLocale !== locale) {
  389. app.$vm.$locale = locale;
  390. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  391. locale: locale });});
  392. return true;
  393. }
  394. return false;
  395. }
  396. var onLocaleChangeCallbacks = [];
  397. function onLocaleChange(fn) {
  398. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  399. onLocaleChangeCallbacks.push(fn);
  400. }
  401. }
  402. if (typeof global !== 'undefined') {
  403. global.getLocale = getLocale;
  404. }
  405. var interceptors = {
  406. promiseInterceptor: promiseInterceptor };
  407. var baseApi = /*#__PURE__*/Object.freeze({
  408. __proto__: null,
  409. upx2px: upx2px,
  410. getLocale: getLocale,
  411. setLocale: setLocale,
  412. onLocaleChange: onLocaleChange,
  413. addInterceptor: addInterceptor,
  414. removeInterceptor: removeInterceptor,
  415. interceptors: interceptors });
  416. function findExistsPageIndex(url) {
  417. var pages = getCurrentPages();
  418. var len = pages.length;
  419. while (len--) {
  420. var page = pages[len];
  421. if (page.$page && page.$page.fullPath === url) {
  422. return len;
  423. }
  424. }
  425. return -1;
  426. }
  427. var redirectTo = {
  428. name: function name(fromArgs) {
  429. if (fromArgs.exists === 'back' && fromArgs.delta) {
  430. return 'navigateBack';
  431. }
  432. return 'redirectTo';
  433. },
  434. args: function args(fromArgs) {
  435. if (fromArgs.exists === 'back' && fromArgs.url) {
  436. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  437. if (existsPageIndex !== -1) {
  438. var delta = getCurrentPages().length - 1 - existsPageIndex;
  439. if (delta > 0) {
  440. fromArgs.delta = delta;
  441. }
  442. }
  443. }
  444. } };
  445. var previewImage = {
  446. args: function args(fromArgs) {
  447. var currentIndex = parseInt(fromArgs.current);
  448. if (isNaN(currentIndex)) {
  449. return;
  450. }
  451. var urls = fromArgs.urls;
  452. if (!Array.isArray(urls)) {
  453. return;
  454. }
  455. var len = urls.length;
  456. if (!len) {
  457. return;
  458. }
  459. if (currentIndex < 0) {
  460. currentIndex = 0;
  461. } else if (currentIndex >= len) {
  462. currentIndex = len - 1;
  463. }
  464. if (currentIndex > 0) {
  465. fromArgs.current = urls[currentIndex];
  466. fromArgs.urls = urls.filter(
  467. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  468. } else {
  469. fromArgs.current = urls[0];
  470. }
  471. return {
  472. indicator: false,
  473. loop: false };
  474. } };
  475. var UUID_KEY = '__DC_STAT_UUID';
  476. var deviceId;
  477. function addUuid(result) {
  478. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  479. if (!deviceId) {
  480. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  481. wx.setStorage({
  482. key: UUID_KEY,
  483. data: deviceId });
  484. }
  485. result.deviceId = deviceId;
  486. }
  487. function addSafeAreaInsets(result) {
  488. if (result.safeArea) {
  489. var safeArea = result.safeArea;
  490. result.safeAreaInsets = {
  491. top: safeArea.top,
  492. left: safeArea.left,
  493. right: result.windowWidth - safeArea.right,
  494. bottom: result.windowHeight - safeArea.bottom };
  495. }
  496. }
  497. var getSystemInfo = {
  498. returnValue: function returnValue(result) {
  499. addUuid(result);
  500. addSafeAreaInsets(result);
  501. } };
  502. // import navigateTo from 'uni-helpers/navigate-to'
  503. var protocols = {
  504. redirectTo: redirectTo,
  505. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  506. previewImage: previewImage,
  507. getSystemInfo: getSystemInfo,
  508. getSystemInfoSync: getSystemInfo };
  509. var todos = [
  510. 'vibrate',
  511. 'preloadPage',
  512. 'unPreloadPage',
  513. 'loadSubPackage'];
  514. var canIUses = [];
  515. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  516. function processCallback(methodName, method, returnValue) {
  517. return function (res) {
  518. return method(processReturnValue(methodName, res, returnValue));
  519. };
  520. }
  521. 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;
  522. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  523. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  524. if (isFn(argsOption)) {
  525. argsOption = argsOption(fromArgs, toArgs) || {};
  526. }
  527. for (var key in fromArgs) {
  528. if (hasOwn(argsOption, key)) {
  529. var keyOption = argsOption[key];
  530. if (isFn(keyOption)) {
  531. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  532. }
  533. if (!keyOption) {// 不支持的参数
  534. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  535. } else if (isStr(keyOption)) {// 重写参数 key
  536. toArgs[keyOption] = fromArgs[key];
  537. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  538. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  539. }
  540. } else if (CALLBACKS.indexOf(key) !== -1) {
  541. if (isFn(fromArgs[key])) {
  542. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  543. }
  544. } else {
  545. if (!keepFromArgs) {
  546. toArgs[key] = fromArgs[key];
  547. }
  548. }
  549. }
  550. return toArgs;
  551. } else if (isFn(fromArgs)) {
  552. fromArgs = processCallback(methodName, fromArgs, returnValue);
  553. }
  554. return fromArgs;
  555. }
  556. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  557. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  558. res = protocols.returnValue(methodName, res);
  559. }
  560. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  561. }
  562. function wrapper(methodName, method) {
  563. if (hasOwn(protocols, methodName)) {
  564. var protocol = protocols[methodName];
  565. if (!protocol) {// 暂不支持的 api
  566. return function () {
  567. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  568. };
  569. }
  570. return function (arg1, arg2) {// 目前 api 最多两个参数
  571. var options = protocol;
  572. if (isFn(protocol)) {
  573. options = protocol(arg1);
  574. }
  575. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  576. var args = [arg1];
  577. if (typeof arg2 !== 'undefined') {
  578. args.push(arg2);
  579. }
  580. if (isFn(options.name)) {
  581. methodName = options.name(arg1);
  582. } else if (isStr(options.name)) {
  583. methodName = options.name;
  584. }
  585. var returnValue = wx[methodName].apply(wx, args);
  586. if (isSyncApi(methodName)) {// 同步 api
  587. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  588. }
  589. return returnValue;
  590. };
  591. }
  592. return method;
  593. }
  594. var todoApis = Object.create(null);
  595. var TODOS = [
  596. 'onTabBarMidButtonTap',
  597. 'subscribePush',
  598. 'unsubscribePush',
  599. 'onPush',
  600. 'offPush',
  601. 'share'];
  602. function createTodoApi(name) {
  603. return function todoApi(_ref)
  604. {var fail = _ref.fail,complete = _ref.complete;
  605. var res = {
  606. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  607. isFn(fail) && fail(res);
  608. isFn(complete) && complete(res);
  609. };
  610. }
  611. TODOS.forEach(function (name) {
  612. todoApis[name] = createTodoApi(name);
  613. });
  614. var providers = {
  615. oauth: ['weixin'],
  616. share: ['weixin'],
  617. payment: ['wxpay'],
  618. push: ['weixin'] };
  619. function getProvider(_ref2)
  620. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  621. var res = false;
  622. if (providers[service]) {
  623. res = {
  624. errMsg: 'getProvider:ok',
  625. service: service,
  626. provider: providers[service] };
  627. isFn(success) && success(res);
  628. } else {
  629. res = {
  630. errMsg: 'getProvider:fail service not found' };
  631. isFn(fail) && fail(res);
  632. }
  633. isFn(complete) && complete(res);
  634. }
  635. var extraApi = /*#__PURE__*/Object.freeze({
  636. __proto__: null,
  637. getProvider: getProvider });
  638. var getEmitter = function () {
  639. var Emitter;
  640. return function getUniEmitter() {
  641. if (!Emitter) {
  642. Emitter = new _vue.default();
  643. }
  644. return Emitter;
  645. };
  646. }();
  647. function apply(ctx, method, args) {
  648. return ctx[method].apply(ctx, args);
  649. }
  650. function $on() {
  651. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  652. }
  653. function $off() {
  654. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  655. }
  656. function $once() {
  657. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  658. }
  659. function $emit() {
  660. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  661. }
  662. var eventApi = /*#__PURE__*/Object.freeze({
  663. __proto__: null,
  664. $on: $on,
  665. $off: $off,
  666. $once: $once,
  667. $emit: $emit });
  668. var api = /*#__PURE__*/Object.freeze({
  669. __proto__: null });
  670. var MPPage = Page;
  671. var MPComponent = Component;
  672. var customizeRE = /:/g;
  673. var customize = cached(function (str) {
  674. return camelize(str.replace(customizeRE, '-'));
  675. });
  676. function initTriggerEvent(mpInstance) {
  677. var oldTriggerEvent = mpInstance.triggerEvent;
  678. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  679. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  680. };
  681. try {
  682. // 京东小程序 triggerEvent 为只读
  683. mpInstance.triggerEvent = newTriggerEvent;
  684. } catch (error) {
  685. mpInstance._triggerEvent = newTriggerEvent;
  686. }
  687. }
  688. function initHook(name, options, isComponent) {
  689. var oldHook = options[name];
  690. if (!oldHook) {
  691. options[name] = function () {
  692. initTriggerEvent(this);
  693. };
  694. } else {
  695. options[name] = function () {
  696. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  697. return oldHook.apply(this, args);
  698. };
  699. }
  700. }
  701. if (!MPPage.__$wrappered) {
  702. MPPage.__$wrappered = true;
  703. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  704. initHook('onLoad', options);
  705. return MPPage(options);
  706. };
  707. Page.after = MPPage.after;
  708. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  709. initHook('created', options);
  710. return MPComponent(options);
  711. };
  712. }
  713. var PAGE_EVENT_HOOKS = [
  714. 'onPullDownRefresh',
  715. 'onReachBottom',
  716. 'onAddToFavorites',
  717. 'onShareTimeline',
  718. 'onShareAppMessage',
  719. 'onPageScroll',
  720. 'onResize',
  721. 'onTabItemTap'];
  722. function initMocks(vm, mocks) {
  723. var mpInstance = vm.$mp[vm.mpType];
  724. mocks.forEach(function (mock) {
  725. if (hasOwn(mpInstance, mock)) {
  726. vm[mock] = mpInstance[mock];
  727. }
  728. });
  729. }
  730. function hasHook(hook, vueOptions) {
  731. if (!vueOptions) {
  732. return true;
  733. }
  734. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  735. return true;
  736. }
  737. vueOptions = vueOptions.default || vueOptions;
  738. if (isFn(vueOptions)) {
  739. if (isFn(vueOptions.extendOptions[hook])) {
  740. return true;
  741. }
  742. if (vueOptions.super &&
  743. vueOptions.super.options &&
  744. Array.isArray(vueOptions.super.options[hook])) {
  745. return true;
  746. }
  747. return false;
  748. }
  749. if (isFn(vueOptions[hook])) {
  750. return true;
  751. }
  752. var mixins = vueOptions.mixins;
  753. if (Array.isArray(mixins)) {
  754. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  755. }
  756. }
  757. function initHooks(mpOptions, hooks, vueOptions) {
  758. hooks.forEach(function (hook) {
  759. if (hasHook(hook, vueOptions)) {
  760. mpOptions[hook] = function (args) {
  761. return this.$vm && this.$vm.__call_hook(hook, args);
  762. };
  763. }
  764. });
  765. }
  766. function initVueComponent(Vue, vueOptions) {
  767. vueOptions = vueOptions.default || vueOptions;
  768. var VueComponent;
  769. if (isFn(vueOptions)) {
  770. VueComponent = vueOptions;
  771. } else {
  772. VueComponent = Vue.extend(vueOptions);
  773. }
  774. vueOptions = VueComponent.options;
  775. return [VueComponent, vueOptions];
  776. }
  777. function initSlots(vm, vueSlots) {
  778. if (Array.isArray(vueSlots) && vueSlots.length) {
  779. var $slots = Object.create(null);
  780. vueSlots.forEach(function (slotName) {
  781. $slots[slotName] = true;
  782. });
  783. vm.$scopedSlots = vm.$slots = $slots;
  784. }
  785. }
  786. function initVueIds(vueIds, mpInstance) {
  787. vueIds = (vueIds || '').split(',');
  788. var len = vueIds.length;
  789. if (len === 1) {
  790. mpInstance._$vueId = vueIds[0];
  791. } else if (len === 2) {
  792. mpInstance._$vueId = vueIds[0];
  793. mpInstance._$vuePid = vueIds[1];
  794. }
  795. }
  796. function initData(vueOptions, context) {
  797. var data = vueOptions.data || {};
  798. var methods = vueOptions.methods || {};
  799. if (typeof data === 'function') {
  800. try {
  801. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  802. } catch (e) {
  803. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  804. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  805. }
  806. }
  807. } else {
  808. try {
  809. // 对 data 格式化
  810. data = JSON.parse(JSON.stringify(data));
  811. } catch (e) {}
  812. }
  813. if (!isPlainObject(data)) {
  814. data = {};
  815. }
  816. Object.keys(methods).forEach(function (methodName) {
  817. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  818. data[methodName] = methods[methodName];
  819. }
  820. });
  821. return data;
  822. }
  823. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  824. function createObserver(name) {
  825. return function observer(newVal, oldVal) {
  826. if (this.$vm) {
  827. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  828. }
  829. };
  830. }
  831. function initBehaviors(vueOptions, initBehavior) {
  832. var vueBehaviors = vueOptions.behaviors;
  833. var vueExtends = vueOptions.extends;
  834. var vueMixins = vueOptions.mixins;
  835. var vueProps = vueOptions.props;
  836. if (!vueProps) {
  837. vueOptions.props = vueProps = [];
  838. }
  839. var behaviors = [];
  840. if (Array.isArray(vueBehaviors)) {
  841. vueBehaviors.forEach(function (behavior) {
  842. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  843. if (behavior === 'uni://form-field') {
  844. if (Array.isArray(vueProps)) {
  845. vueProps.push('name');
  846. vueProps.push('value');
  847. } else {
  848. vueProps.name = {
  849. type: String,
  850. default: '' };
  851. vueProps.value = {
  852. type: [String, Number, Boolean, Array, Object, Date],
  853. default: '' };
  854. }
  855. }
  856. });
  857. }
  858. if (isPlainObject(vueExtends) && vueExtends.props) {
  859. behaviors.push(
  860. initBehavior({
  861. properties: initProperties(vueExtends.props, true) }));
  862. }
  863. if (Array.isArray(vueMixins)) {
  864. vueMixins.forEach(function (vueMixin) {
  865. if (isPlainObject(vueMixin) && vueMixin.props) {
  866. behaviors.push(
  867. initBehavior({
  868. properties: initProperties(vueMixin.props, true) }));
  869. }
  870. });
  871. }
  872. return behaviors;
  873. }
  874. function parsePropType(key, type, defaultValue, file) {
  875. // [String]=>String
  876. if (Array.isArray(type) && type.length === 1) {
  877. return type[0];
  878. }
  879. return type;
  880. }
  881. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  882. var properties = {};
  883. if (!isBehavior) {
  884. properties.vueId = {
  885. type: String,
  886. value: '' };
  887. // 用于字节跳动小程序模拟抽象节点
  888. properties.generic = {
  889. type: Object,
  890. value: null };
  891. // scopedSlotsCompiler auto
  892. properties.scopedSlotsCompiler = {
  893. type: String,
  894. value: '' };
  895. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  896. type: null,
  897. value: [],
  898. observer: function observer(newVal, oldVal) {
  899. var $slots = Object.create(null);
  900. newVal.forEach(function (slotName) {
  901. $slots[slotName] = true;
  902. });
  903. this.setData({
  904. $slots: $slots });
  905. } };
  906. }
  907. if (Array.isArray(props)) {// ['title']
  908. props.forEach(function (key) {
  909. properties[key] = {
  910. type: null,
  911. observer: createObserver(key) };
  912. });
  913. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  914. Object.keys(props).forEach(function (key) {
  915. var opts = props[key];
  916. if (isPlainObject(opts)) {// title:{type:String,default:''}
  917. var value = opts.default;
  918. if (isFn(value)) {
  919. value = value();
  920. }
  921. opts.type = parsePropType(key, opts.type);
  922. properties[key] = {
  923. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  924. value: value,
  925. observer: createObserver(key) };
  926. } else {// content:String
  927. var type = parsePropType(key, opts);
  928. properties[key] = {
  929. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  930. observer: createObserver(key) };
  931. }
  932. });
  933. }
  934. return properties;
  935. }
  936. function wrapper$1(event) {
  937. // TODO 又得兼容 mpvue 的 mp 对象
  938. try {
  939. event.mp = JSON.parse(JSON.stringify(event));
  940. } catch (e) {}
  941. event.stopPropagation = noop;
  942. event.preventDefault = noop;
  943. event.target = event.target || {};
  944. if (!hasOwn(event, 'detail')) {
  945. event.detail = {};
  946. }
  947. if (hasOwn(event, 'markerId')) {
  948. event.detail = typeof event.detail === 'object' ? event.detail : {};
  949. event.detail.markerId = event.markerId;
  950. }
  951. if (isPlainObject(event.detail)) {
  952. event.target = Object.assign({}, event.target, event.detail);
  953. }
  954. return event;
  955. }
  956. function getExtraValue(vm, dataPathsArray) {
  957. var context = vm;
  958. dataPathsArray.forEach(function (dataPathArray) {
  959. var dataPath = dataPathArray[0];
  960. var value = dataPathArray[2];
  961. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  962. var propPath = dataPathArray[1];
  963. var valuePath = dataPathArray[3];
  964. var vFor;
  965. if (Number.isInteger(dataPath)) {
  966. vFor = dataPath;
  967. } else if (!dataPath) {
  968. vFor = context;
  969. } else if (typeof dataPath === 'string' && dataPath) {
  970. if (dataPath.indexOf('#s#') === 0) {
  971. vFor = dataPath.substr(3);
  972. } else {
  973. vFor = vm.__get_value(dataPath, context);
  974. }
  975. }
  976. if (Number.isInteger(vFor)) {
  977. context = value;
  978. } else if (!propPath) {
  979. context = vFor[value];
  980. } else {
  981. if (Array.isArray(vFor)) {
  982. context = vFor.find(function (vForItem) {
  983. return vm.__get_value(propPath, vForItem) === value;
  984. });
  985. } else if (isPlainObject(vFor)) {
  986. context = Object.keys(vFor).find(function (vForKey) {
  987. return vm.__get_value(propPath, vFor[vForKey]) === value;
  988. });
  989. } else {
  990. console.error('v-for 暂不支持循环数据:', vFor);
  991. }
  992. }
  993. if (valuePath) {
  994. context = vm.__get_value(valuePath, context);
  995. }
  996. }
  997. });
  998. return context;
  999. }
  1000. function processEventExtra(vm, extra, event) {
  1001. var extraObj = {};
  1002. if (Array.isArray(extra) && extra.length) {
  1003. /**
  1004. *[
  1005. * ['data.items', 'data.id', item.data.id],
  1006. * ['metas', 'id', meta.id]
  1007. *],
  1008. *[
  1009. * ['data.items', 'data.id', item.data.id],
  1010. * ['metas', 'id', meta.id]
  1011. *],
  1012. *'test'
  1013. */
  1014. extra.forEach(function (dataPath, index) {
  1015. if (typeof dataPath === 'string') {
  1016. if (!dataPath) {// model,prop.sync
  1017. extraObj['$' + index] = vm;
  1018. } else {
  1019. if (dataPath === '$event') {// $event
  1020. extraObj['$' + index] = event;
  1021. } else if (dataPath === 'arguments') {
  1022. if (event.detail && event.detail.__args__) {
  1023. extraObj['$' + index] = event.detail.__args__;
  1024. } else {
  1025. extraObj['$' + index] = [event];
  1026. }
  1027. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1028. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1029. } else {
  1030. extraObj['$' + index] = vm.__get_value(dataPath);
  1031. }
  1032. }
  1033. } else {
  1034. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1035. }
  1036. });
  1037. }
  1038. return extraObj;
  1039. }
  1040. function getObjByArray(arr) {
  1041. var obj = {};
  1042. for (var i = 1; i < arr.length; i++) {
  1043. var element = arr[i];
  1044. obj[element[0]] = element[1];
  1045. }
  1046. return obj;
  1047. }
  1048. 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;
  1049. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1050. if (isCustom) {// 自定义事件
  1051. isCustomMPEvent = event.currentTarget &&
  1052. event.currentTarget.dataset &&
  1053. event.currentTarget.dataset.comType === 'wx';
  1054. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1055. if (isCustomMPEvent) {
  1056. return [event];
  1057. }
  1058. return event.detail.__args__ || event.detail;
  1059. }
  1060. }
  1061. var extraObj = processEventExtra(vm, extra, event);
  1062. var ret = [];
  1063. args.forEach(function (arg) {
  1064. if (arg === '$event') {
  1065. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1066. ret.push(event.target.value);
  1067. } else {
  1068. if (isCustom && !isCustomMPEvent) {
  1069. ret.push(event.detail.__args__[0]);
  1070. } else {// wxcomponent 组件或内置组件
  1071. ret.push(event);
  1072. }
  1073. }
  1074. } else {
  1075. if (Array.isArray(arg) && arg[0] === 'o') {
  1076. ret.push(getObjByArray(arg));
  1077. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1078. ret.push(extraObj[arg]);
  1079. } else {
  1080. ret.push(arg);
  1081. }
  1082. }
  1083. });
  1084. return ret;
  1085. }
  1086. var ONCE = '~';
  1087. var CUSTOM = '^';
  1088. function isMatchEventType(eventType, optType) {
  1089. return eventType === optType ||
  1090. optType === 'regionchange' && (
  1091. eventType === 'begin' ||
  1092. eventType === 'end');
  1093. }
  1094. function getContextVm(vm) {
  1095. var $parent = vm.$parent;
  1096. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1097. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1098. $parent = $parent.$parent;
  1099. }
  1100. return $parent && $parent.$parent;
  1101. }
  1102. function handleEvent(event) {var _this = this;
  1103. event = wrapper$1(event);
  1104. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1105. var dataset = (event.currentTarget || event.target).dataset;
  1106. if (!dataset) {
  1107. return console.warn('事件信息不存在');
  1108. }
  1109. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1110. if (!eventOpts) {
  1111. return console.warn('事件信息不存在');
  1112. }
  1113. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1114. var eventType = event.type;
  1115. var ret = [];
  1116. eventOpts.forEach(function (eventOpt) {
  1117. var type = eventOpt[0];
  1118. var eventsArray = eventOpt[1];
  1119. var isCustom = type.charAt(0) === CUSTOM;
  1120. type = isCustom ? type.slice(1) : type;
  1121. var isOnce = type.charAt(0) === ONCE;
  1122. type = isOnce ? type.slice(1) : type;
  1123. if (eventsArray && isMatchEventType(eventType, type)) {
  1124. eventsArray.forEach(function (eventArray) {
  1125. var methodName = eventArray[0];
  1126. if (methodName) {
  1127. var handlerCtx = _this.$vm;
  1128. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1129. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1130. }
  1131. if (methodName === '$emit') {
  1132. handlerCtx.$emit.apply(handlerCtx,
  1133. processEventArgs(
  1134. _this.$vm,
  1135. event,
  1136. eventArray[1],
  1137. eventArray[2],
  1138. isCustom,
  1139. methodName));
  1140. return;
  1141. }
  1142. var handler = handlerCtx[methodName];
  1143. if (!isFn(handler)) {
  1144. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1145. }
  1146. if (isOnce) {
  1147. if (handler.once) {
  1148. return;
  1149. }
  1150. handler.once = true;
  1151. }
  1152. var params = processEventArgs(
  1153. _this.$vm,
  1154. event,
  1155. eventArray[1],
  1156. eventArray[2],
  1157. isCustom,
  1158. methodName);
  1159. params = Array.isArray(params) ? params : [];
  1160. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1161. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1162. // eslint-disable-next-line no-sparse-arrays
  1163. params = params.concat([,,,,,,,,,, event]);
  1164. }
  1165. ret.push(handler.apply(handlerCtx, params));
  1166. }
  1167. });
  1168. }
  1169. });
  1170. if (
  1171. eventType === 'input' &&
  1172. ret.length === 1 &&
  1173. typeof ret[0] !== 'undefined')
  1174. {
  1175. return ret[0];
  1176. }
  1177. }
  1178. var messages = {};
  1179. var locale;
  1180. {
  1181. locale = wx.getSystemInfoSync().language;
  1182. }
  1183. function initI18nMessages() {
  1184. if (!isEnableLocale()) {
  1185. return;
  1186. }
  1187. var localeKeys = Object.keys(__uniConfig.locales);
  1188. if (localeKeys.length) {
  1189. localeKeys.forEach(function (locale) {
  1190. var curMessages = messages[locale];
  1191. var userMessages = __uniConfig.locales[locale];
  1192. if (curMessages) {
  1193. Object.assign(curMessages, userMessages);
  1194. } else {
  1195. messages[locale] = userMessages;
  1196. }
  1197. });
  1198. }
  1199. }
  1200. initI18nMessages();
  1201. var i18n = (0, _uniI18n.initVueI18n)(
  1202. locale,
  1203. {});
  1204. var t = i18n.t;
  1205. var i18nMixin = i18n.mixin = {
  1206. beforeCreate: function beforeCreate() {var _this2 = this;
  1207. var unwatch = i18n.i18n.watchLocale(function () {
  1208. _this2.$forceUpdate();
  1209. });
  1210. this.$once('hook:beforeDestroy', function () {
  1211. unwatch();
  1212. });
  1213. },
  1214. methods: {
  1215. $$t: function $$t(key, values) {
  1216. return t(key, values);
  1217. } } };
  1218. var setLocale$1 = i18n.setLocale;
  1219. var getLocale$1 = i18n.getLocale;
  1220. function initAppLocale(Vue, appVm, locale) {
  1221. var state = Vue.observable({
  1222. locale: locale || i18n.getLocale() });
  1223. var localeWatchers = [];
  1224. appVm.$watchLocale = function (fn) {
  1225. localeWatchers.push(fn);
  1226. };
  1227. Object.defineProperty(appVm, '$locale', {
  1228. get: function get() {
  1229. return state.locale;
  1230. },
  1231. set: function set(v) {
  1232. state.locale = v;
  1233. localeWatchers.forEach(function (watch) {return watch(v);});
  1234. } });
  1235. }
  1236. function isEnableLocale() {
  1237. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1238. }
  1239. // export function initI18n() {
  1240. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1241. // if (localeKeys.length) {
  1242. // localeKeys.forEach((locale) =>
  1243. // i18n.add(locale, __uniConfig.locales[locale])
  1244. // )
  1245. // }
  1246. // }
  1247. var eventChannels = {};
  1248. var eventChannelStack = [];
  1249. function getEventChannel(id) {
  1250. if (id) {
  1251. var eventChannel = eventChannels[id];
  1252. delete eventChannels[id];
  1253. return eventChannel;
  1254. }
  1255. return eventChannelStack.shift();
  1256. }
  1257. var hooks = [
  1258. 'onShow',
  1259. 'onHide',
  1260. 'onError',
  1261. 'onPageNotFound',
  1262. 'onThemeChange',
  1263. 'onUnhandledRejection'];
  1264. function initEventChannel() {
  1265. _vue.default.prototype.getOpenerEventChannel = function () {
  1266. // 微信小程序使用自身getOpenerEventChannel
  1267. {
  1268. return this.$scope.getOpenerEventChannel();
  1269. }
  1270. };
  1271. var callHook = _vue.default.prototype.__call_hook;
  1272. _vue.default.prototype.__call_hook = function (hook, args) {
  1273. if (hook === 'onLoad' && args && args.__id__) {
  1274. this.__eventChannel__ = getEventChannel(args.__id__);
  1275. delete args.__id__;
  1276. }
  1277. return callHook.call(this, hook, args);
  1278. };
  1279. }
  1280. function initScopedSlotsParams() {
  1281. var center = {};
  1282. var parents = {};
  1283. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1284. var has = center[vueId];
  1285. if (!has) {
  1286. parents[vueId] = this;
  1287. this.$on('hook:destroyed', function () {
  1288. delete parents[vueId];
  1289. });
  1290. }
  1291. return has;
  1292. };
  1293. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1294. var data = center[vueId];
  1295. if (data) {
  1296. var object = data[name] || {};
  1297. return key ? object[key] : object;
  1298. } else {
  1299. parents[vueId] = this;
  1300. this.$on('hook:destroyed', function () {
  1301. delete parents[vueId];
  1302. });
  1303. }
  1304. };
  1305. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1306. var vueIds = this.$options.propsData.vueId;
  1307. if (vueIds) {
  1308. var vueId = vueIds.split(',')[0];
  1309. var object = center[vueId] = center[vueId] || {};
  1310. object[name] = value;
  1311. if (parents[vueId]) {
  1312. parents[vueId].$forceUpdate();
  1313. }
  1314. }
  1315. };
  1316. _vue.default.mixin({
  1317. destroyed: function destroyed() {
  1318. var propsData = this.$options.propsData;
  1319. var vueId = propsData && propsData.vueId;
  1320. if (vueId) {
  1321. delete center[vueId];
  1322. delete parents[vueId];
  1323. }
  1324. } });
  1325. }
  1326. function parseBaseApp(vm, _ref3)
  1327. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1328. initEventChannel();
  1329. {
  1330. initScopedSlotsParams();
  1331. }
  1332. if (vm.$options.store) {
  1333. _vue.default.prototype.$store = vm.$options.store;
  1334. }
  1335. uniIdMixin(_vue.default);
  1336. _vue.default.prototype.mpHost = "mp-weixin";
  1337. _vue.default.mixin({
  1338. beforeCreate: function beforeCreate() {
  1339. if (!this.$options.mpType) {
  1340. return;
  1341. }
  1342. this.mpType = this.$options.mpType;
  1343. this.$mp = _defineProperty({
  1344. data: {} },
  1345. this.mpType, this.$options.mpInstance);
  1346. this.$scope = this.$options.mpInstance;
  1347. delete this.$options.mpType;
  1348. delete this.$options.mpInstance;
  1349. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1350. var app = getApp();
  1351. if (app.$vm && app.$vm.$i18n) {
  1352. this._i18n = app.$vm.$i18n;
  1353. }
  1354. }
  1355. if (this.mpType !== 'app') {
  1356. initRefs(this);
  1357. initMocks(this, mocks);
  1358. }
  1359. } });
  1360. var appOptions = {
  1361. onLaunch: function onLaunch(args) {
  1362. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1363. return;
  1364. }
  1365. {
  1366. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1367. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1368. }
  1369. }
  1370. this.$vm = vm;
  1371. this.$vm.$mp = {
  1372. app: this };
  1373. this.$vm.$scope = this;
  1374. // vm 上也挂载 globalData
  1375. this.$vm.globalData = this.globalData;
  1376. this.$vm._isMounted = true;
  1377. this.$vm.__call_hook('mounted', args);
  1378. this.$vm.__call_hook('onLaunch', args);
  1379. } };
  1380. // 兼容旧版本 globalData
  1381. appOptions.globalData = vm.$options.globalData || {};
  1382. // 将 methods 中的方法挂在 getApp() 中
  1383. var methods = vm.$options.methods;
  1384. if (methods) {
  1385. Object.keys(methods).forEach(function (name) {
  1386. appOptions[name] = methods[name];
  1387. });
  1388. }
  1389. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1390. initHooks(appOptions, hooks);
  1391. return appOptions;
  1392. }
  1393. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1394. function findVmByVueId(vm, vuePid) {
  1395. var $children = vm.$children;
  1396. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1397. for (var i = $children.length - 1; i >= 0; i--) {
  1398. var childVm = $children[i];
  1399. if (childVm.$scope._$vueId === vuePid) {
  1400. return childVm;
  1401. }
  1402. }
  1403. // 反向递归查找
  1404. var parentVm;
  1405. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1406. parentVm = findVmByVueId($children[_i], vuePid);
  1407. if (parentVm) {
  1408. return parentVm;
  1409. }
  1410. }
  1411. }
  1412. function initBehavior(options) {
  1413. return Behavior(options);
  1414. }
  1415. function isPage() {
  1416. return !!this.route;
  1417. }
  1418. function initRelation(detail) {
  1419. this.triggerEvent('__l', detail);
  1420. }
  1421. function selectAllComponents(mpInstance, selector, $refs) {
  1422. var components = mpInstance.selectAllComponents(selector);
  1423. components.forEach(function (component) {
  1424. var ref = component.dataset.ref;
  1425. $refs[ref] = component.$vm || component;
  1426. {
  1427. if (component.dataset.vueGeneric === 'scoped') {
  1428. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1429. selectAllComponents(scopedComponent, selector, $refs);
  1430. });
  1431. }
  1432. }
  1433. });
  1434. }
  1435. function initRefs(vm) {
  1436. var mpInstance = vm.$scope;
  1437. Object.defineProperty(vm, '$refs', {
  1438. get: function get() {
  1439. var $refs = {};
  1440. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1441. // TODO 暂不考虑 for 中的 scoped
  1442. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1443. forComponents.forEach(function (component) {
  1444. var ref = component.dataset.ref;
  1445. if (!$refs[ref]) {
  1446. $refs[ref] = [];
  1447. }
  1448. $refs[ref].push(component.$vm || component);
  1449. });
  1450. return $refs;
  1451. } });
  1452. }
  1453. function handleLink(event) {var _ref4 =
  1454. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1455. var parentVm;
  1456. if (vuePid) {
  1457. parentVm = findVmByVueId(this.$vm, vuePid);
  1458. }
  1459. if (!parentVm) {
  1460. parentVm = this.$vm;
  1461. }
  1462. vueOptions.parent = parentVm;
  1463. }
  1464. function parseApp(vm) {
  1465. return parseBaseApp(vm, {
  1466. mocks: mocks,
  1467. initRefs: initRefs });
  1468. }
  1469. function createApp(vm) {
  1470. App(parseApp(vm));
  1471. return vm;
  1472. }
  1473. var encodeReserveRE = /[!'()*]/g;
  1474. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1475. var commaRE = /%2C/g;
  1476. // fixed encodeURIComponent which is more conformant to RFC3986:
  1477. // - escapes [!'()*]
  1478. // - preserve commas
  1479. var encode = function encode(str) {return encodeURIComponent(str).
  1480. replace(encodeReserveRE, encodeReserveReplacer).
  1481. replace(commaRE, ',');};
  1482. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1483. var res = obj ? Object.keys(obj).map(function (key) {
  1484. var val = obj[key];
  1485. if (val === undefined) {
  1486. return '';
  1487. }
  1488. if (val === null) {
  1489. return encodeStr(key);
  1490. }
  1491. if (Array.isArray(val)) {
  1492. var result = [];
  1493. val.forEach(function (val2) {
  1494. if (val2 === undefined) {
  1495. return;
  1496. }
  1497. if (val2 === null) {
  1498. result.push(encodeStr(key));
  1499. } else {
  1500. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1501. }
  1502. });
  1503. return result.join('&');
  1504. }
  1505. return encodeStr(key) + '=' + encodeStr(val);
  1506. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1507. return res ? "?".concat(res) : '';
  1508. }
  1509. function parseBaseComponent(vueComponentOptions)
  1510. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1511. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1512. var options = _objectSpread({
  1513. multipleSlots: true,
  1514. addGlobalClass: true },
  1515. vueOptions.options || {});
  1516. {
  1517. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1518. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1519. Object.assign(options, vueOptions['mp-weixin'].options);
  1520. }
  1521. }
  1522. var componentOptions = {
  1523. options: options,
  1524. data: initData(vueOptions, _vue.default.prototype),
  1525. behaviors: initBehaviors(vueOptions, initBehavior),
  1526. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1527. lifetimes: {
  1528. attached: function attached() {
  1529. var properties = this.properties;
  1530. var options = {
  1531. mpType: isPage.call(this) ? 'page' : 'component',
  1532. mpInstance: this,
  1533. propsData: properties };
  1534. initVueIds(properties.vueId, this);
  1535. // 处理父子关系
  1536. initRelation.call(this, {
  1537. vuePid: this._$vuePid,
  1538. vueOptions: options });
  1539. // 初始化 vue 实例
  1540. this.$vm = new VueComponent(options);
  1541. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1542. initSlots(this.$vm, properties.vueSlots);
  1543. // 触发首次 setData
  1544. this.$vm.$mount();
  1545. },
  1546. ready: function ready() {
  1547. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1548. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1549. if (this.$vm) {
  1550. this.$vm._isMounted = true;
  1551. this.$vm.__call_hook('mounted');
  1552. this.$vm.__call_hook('onReady');
  1553. }
  1554. },
  1555. detached: function detached() {
  1556. this.$vm && this.$vm.$destroy();
  1557. } },
  1558. pageLifetimes: {
  1559. show: function show(args) {
  1560. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1561. },
  1562. hide: function hide() {
  1563. this.$vm && this.$vm.__call_hook('onPageHide');
  1564. },
  1565. resize: function resize(size) {
  1566. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1567. } },
  1568. methods: {
  1569. __l: handleLink,
  1570. __e: handleEvent } };
  1571. // externalClasses
  1572. if (vueOptions.externalClasses) {
  1573. componentOptions.externalClasses = vueOptions.externalClasses;
  1574. }
  1575. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1576. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1577. componentOptions.methods[callMethod] = function (args) {
  1578. return this.$vm[callMethod](args);
  1579. };
  1580. });
  1581. }
  1582. if (isPage) {
  1583. return componentOptions;
  1584. }
  1585. return [componentOptions, VueComponent];
  1586. }
  1587. function parseComponent(vueComponentOptions) {
  1588. return parseBaseComponent(vueComponentOptions, {
  1589. isPage: isPage,
  1590. initRelation: initRelation });
  1591. }
  1592. var hooks$1 = [
  1593. 'onShow',
  1594. 'onHide',
  1595. 'onUnload'];
  1596. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1597. function parseBasePage(vuePageOptions, _ref6)
  1598. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1599. var pageOptions = parseComponent(vuePageOptions);
  1600. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1601. pageOptions.methods.onLoad = function (query) {
  1602. this.options = query;
  1603. var copyQuery = Object.assign({}, query);
  1604. delete copyQuery.__id__;
  1605. this.$page = {
  1606. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1607. this.$vm.$mp.query = query; // 兼容 mpvue
  1608. this.$vm.__call_hook('onLoad', query);
  1609. };
  1610. return pageOptions;
  1611. }
  1612. function parsePage(vuePageOptions) {
  1613. return parseBasePage(vuePageOptions, {
  1614. isPage: isPage,
  1615. initRelation: initRelation });
  1616. }
  1617. function createPage(vuePageOptions) {
  1618. {
  1619. return Component(parsePage(vuePageOptions));
  1620. }
  1621. }
  1622. function createComponent(vueOptions) {
  1623. {
  1624. return Component(parseComponent(vueOptions));
  1625. }
  1626. }
  1627. function createSubpackageApp(vm) {
  1628. var appOptions = parseApp(vm);
  1629. var app = getApp({
  1630. allowDefault: true });
  1631. vm.$scope = app;
  1632. var globalData = app.globalData;
  1633. if (globalData) {
  1634. Object.keys(appOptions.globalData).forEach(function (name) {
  1635. if (!hasOwn(globalData, name)) {
  1636. globalData[name] = appOptions.globalData[name];
  1637. }
  1638. });
  1639. }
  1640. Object.keys(appOptions).forEach(function (name) {
  1641. if (!hasOwn(app, name)) {
  1642. app[name] = appOptions[name];
  1643. }
  1644. });
  1645. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1646. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1647. vm.__call_hook('onShow', args);
  1648. });
  1649. }
  1650. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1651. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1652. vm.__call_hook('onHide', args);
  1653. });
  1654. }
  1655. if (isFn(appOptions.onLaunch)) {
  1656. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1657. vm.__call_hook('onLaunch', args);
  1658. }
  1659. return vm;
  1660. }
  1661. function createPlugin(vm) {
  1662. var appOptions = parseApp(vm);
  1663. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1664. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1665. vm.__call_hook('onShow', args);
  1666. });
  1667. }
  1668. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1669. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1670. vm.__call_hook('onHide', args);
  1671. });
  1672. }
  1673. if (isFn(appOptions.onLaunch)) {
  1674. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1675. vm.__call_hook('onLaunch', args);
  1676. }
  1677. return vm;
  1678. }
  1679. todos.forEach(function (todoApi) {
  1680. protocols[todoApi] = false;
  1681. });
  1682. canIUses.forEach(function (canIUseApi) {
  1683. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1684. canIUseApi;
  1685. if (!wx.canIUse(apiName)) {
  1686. protocols[canIUseApi] = false;
  1687. }
  1688. });
  1689. var uni = {};
  1690. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1691. uni = new Proxy({}, {
  1692. get: function get(target, name) {
  1693. if (hasOwn(target, name)) {
  1694. return target[name];
  1695. }
  1696. if (baseApi[name]) {
  1697. return baseApi[name];
  1698. }
  1699. if (api[name]) {
  1700. return promisify(name, api[name]);
  1701. }
  1702. {
  1703. if (extraApi[name]) {
  1704. return promisify(name, extraApi[name]);
  1705. }
  1706. if (todoApis[name]) {
  1707. return promisify(name, todoApis[name]);
  1708. }
  1709. }
  1710. if (eventApi[name]) {
  1711. return eventApi[name];
  1712. }
  1713. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1714. return;
  1715. }
  1716. return promisify(name, wrapper(name, wx[name]));
  1717. },
  1718. set: function set(target, name, value) {
  1719. target[name] = value;
  1720. return true;
  1721. } });
  1722. } else {
  1723. Object.keys(baseApi).forEach(function (name) {
  1724. uni[name] = baseApi[name];
  1725. });
  1726. {
  1727. Object.keys(todoApis).forEach(function (name) {
  1728. uni[name] = promisify(name, todoApis[name]);
  1729. });
  1730. Object.keys(extraApi).forEach(function (name) {
  1731. uni[name] = promisify(name, todoApis[name]);
  1732. });
  1733. }
  1734. Object.keys(eventApi).forEach(function (name) {
  1735. uni[name] = eventApi[name];
  1736. });
  1737. Object.keys(api).forEach(function (name) {
  1738. uni[name] = promisify(name, api[name]);
  1739. });
  1740. Object.keys(wx).forEach(function (name) {
  1741. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1742. uni[name] = promisify(name, wrapper(name, wx[name]));
  1743. }
  1744. });
  1745. }
  1746. wx.createApp = createApp;
  1747. wx.createPage = createPage;
  1748. wx.createComponent = createComponent;
  1749. wx.createSubpackageApp = createSubpackageApp;
  1750. wx.createPlugin = createPlugin;
  1751. var uni$1 = uni;var _default =
  1752. uni$1;exports.default = _default;
  1753. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1754. /***/ }),
  1755. /* 2 */
  1756. /*!***********************************!*\
  1757. !*** (webpack)/buildin/global.js ***!
  1758. \***********************************/
  1759. /*! no static exports found */
  1760. /***/ (function(module, exports) {
  1761. var g;
  1762. // This works in non-strict mode
  1763. g = (function() {
  1764. return this;
  1765. })();
  1766. try {
  1767. // This works if eval is allowed (see CSP)
  1768. g = g || new Function("return this")();
  1769. } catch (e) {
  1770. // This works if the window reference is available
  1771. if (typeof window === "object") g = window;
  1772. }
  1773. // g can still be undefined, but nothing to do about it...
  1774. // We return undefined, instead of nothing here, so it's
  1775. // easier to handle this case. if(!global) { ...}
  1776. module.exports = g;
  1777. /***/ }),
  1778. /* 3 */
  1779. /*!******************************************************************************************!*\
  1780. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1781. \******************************************************************************************/
  1782. /*! exports provided: default */
  1783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1784. "use strict";
  1785. __webpack_require__.r(__webpack_exports__);
  1786. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1787. * Vue.js v2.6.11
  1788. * (c) 2014-2021 Evan You
  1789. * Released under the MIT License.
  1790. */
  1791. /* */
  1792. var emptyObject = Object.freeze({});
  1793. // These helpers produce better VM code in JS engines due to their
  1794. // explicitness and function inlining.
  1795. function isUndef (v) {
  1796. return v === undefined || v === null
  1797. }
  1798. function isDef (v) {
  1799. return v !== undefined && v !== null
  1800. }
  1801. function isTrue (v) {
  1802. return v === true
  1803. }
  1804. function isFalse (v) {
  1805. return v === false
  1806. }
  1807. /**
  1808. * Check if value is primitive.
  1809. */
  1810. function isPrimitive (value) {
  1811. return (
  1812. typeof value === 'string' ||
  1813. typeof value === 'number' ||
  1814. // $flow-disable-line
  1815. typeof value === 'symbol' ||
  1816. typeof value === 'boolean'
  1817. )
  1818. }
  1819. /**
  1820. * Quick object check - this is primarily used to tell
  1821. * Objects from primitive values when we know the value
  1822. * is a JSON-compliant type.
  1823. */
  1824. function isObject (obj) {
  1825. return obj !== null && typeof obj === 'object'
  1826. }
  1827. /**
  1828. * Get the raw type string of a value, e.g., [object Object].
  1829. */
  1830. var _toString = Object.prototype.toString;
  1831. function toRawType (value) {
  1832. return _toString.call(value).slice(8, -1)
  1833. }
  1834. /**
  1835. * Strict object type check. Only returns true
  1836. * for plain JavaScript objects.
  1837. */
  1838. function isPlainObject (obj) {
  1839. return _toString.call(obj) === '[object Object]'
  1840. }
  1841. function isRegExp (v) {
  1842. return _toString.call(v) === '[object RegExp]'
  1843. }
  1844. /**
  1845. * Check if val is a valid array index.
  1846. */
  1847. function isValidArrayIndex (val) {
  1848. var n = parseFloat(String(val));
  1849. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1850. }
  1851. function isPromise (val) {
  1852. return (
  1853. isDef(val) &&
  1854. typeof val.then === 'function' &&
  1855. typeof val.catch === 'function'
  1856. )
  1857. }
  1858. /**
  1859. * Convert a value to a string that is actually rendered.
  1860. */
  1861. function toString (val) {
  1862. return val == null
  1863. ? ''
  1864. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1865. ? JSON.stringify(val, null, 2)
  1866. : String(val)
  1867. }
  1868. /**
  1869. * Convert an input value to a number for persistence.
  1870. * If the conversion fails, return original string.
  1871. */
  1872. function toNumber (val) {
  1873. var n = parseFloat(val);
  1874. return isNaN(n) ? val : n
  1875. }
  1876. /**
  1877. * Make a map and return a function for checking if a key
  1878. * is in that map.
  1879. */
  1880. function makeMap (
  1881. str,
  1882. expectsLowerCase
  1883. ) {
  1884. var map = Object.create(null);
  1885. var list = str.split(',');
  1886. for (var i = 0; i < list.length; i++) {
  1887. map[list[i]] = true;
  1888. }
  1889. return expectsLowerCase
  1890. ? function (val) { return map[val.toLowerCase()]; }
  1891. : function (val) { return map[val]; }
  1892. }
  1893. /**
  1894. * Check if a tag is a built-in tag.
  1895. */
  1896. var isBuiltInTag = makeMap('slot,component', true);
  1897. /**
  1898. * Check if an attribute is a reserved attribute.
  1899. */
  1900. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1901. /**
  1902. * Remove an item from an array.
  1903. */
  1904. function remove (arr, item) {
  1905. if (arr.length) {
  1906. var index = arr.indexOf(item);
  1907. if (index > -1) {
  1908. return arr.splice(index, 1)
  1909. }
  1910. }
  1911. }
  1912. /**
  1913. * Check whether an object has the property.
  1914. */
  1915. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1916. function hasOwn (obj, key) {
  1917. return hasOwnProperty.call(obj, key)
  1918. }
  1919. /**
  1920. * Create a cached version of a pure function.
  1921. */
  1922. function cached (fn) {
  1923. var cache = Object.create(null);
  1924. return (function cachedFn (str) {
  1925. var hit = cache[str];
  1926. return hit || (cache[str] = fn(str))
  1927. })
  1928. }
  1929. /**
  1930. * Camelize a hyphen-delimited string.
  1931. */
  1932. var camelizeRE = /-(\w)/g;
  1933. var camelize = cached(function (str) {
  1934. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1935. });
  1936. /**
  1937. * Capitalize a string.
  1938. */
  1939. var capitalize = cached(function (str) {
  1940. return str.charAt(0).toUpperCase() + str.slice(1)
  1941. });
  1942. /**
  1943. * Hyphenate a camelCase string.
  1944. */
  1945. var hyphenateRE = /\B([A-Z])/g;
  1946. var hyphenate = cached(function (str) {
  1947. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1948. });
  1949. /**
  1950. * Simple bind polyfill for environments that do not support it,
  1951. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1952. * since native bind is now performant enough in most browsers.
  1953. * But removing it would mean breaking code that was able to run in
  1954. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1955. */
  1956. /* istanbul ignore next */
  1957. function polyfillBind (fn, ctx) {
  1958. function boundFn (a) {
  1959. var l = arguments.length;
  1960. return l
  1961. ? l > 1
  1962. ? fn.apply(ctx, arguments)
  1963. : fn.call(ctx, a)
  1964. : fn.call(ctx)
  1965. }
  1966. boundFn._length = fn.length;
  1967. return boundFn
  1968. }
  1969. function nativeBind (fn, ctx) {
  1970. return fn.bind(ctx)
  1971. }
  1972. var bind = Function.prototype.bind
  1973. ? nativeBind
  1974. : polyfillBind;
  1975. /**
  1976. * Convert an Array-like object to a real Array.
  1977. */
  1978. function toArray (list, start) {
  1979. start = start || 0;
  1980. var i = list.length - start;
  1981. var ret = new Array(i);
  1982. while (i--) {
  1983. ret[i] = list[i + start];
  1984. }
  1985. return ret
  1986. }
  1987. /**
  1988. * Mix properties into target object.
  1989. */
  1990. function extend (to, _from) {
  1991. for (var key in _from) {
  1992. to[key] = _from[key];
  1993. }
  1994. return to
  1995. }
  1996. /**
  1997. * Merge an Array of Objects into a single Object.
  1998. */
  1999. function toObject (arr) {
  2000. var res = {};
  2001. for (var i = 0; i < arr.length; i++) {
  2002. if (arr[i]) {
  2003. extend(res, arr[i]);
  2004. }
  2005. }
  2006. return res
  2007. }
  2008. /* eslint-disable no-unused-vars */
  2009. /**
  2010. * Perform no operation.
  2011. * Stubbing args to make Flow happy without leaving useless transpiled code
  2012. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2013. */
  2014. function noop (a, b, c) {}
  2015. /**
  2016. * Always return false.
  2017. */
  2018. var no = function (a, b, c) { return false; };
  2019. /* eslint-enable no-unused-vars */
  2020. /**
  2021. * Return the same value.
  2022. */
  2023. var identity = function (_) { return _; };
  2024. /**
  2025. * Check if two values are loosely equal - that is,
  2026. * if they are plain objects, do they have the same shape?
  2027. */
  2028. function looseEqual (a, b) {
  2029. if (a === b) { return true }
  2030. var isObjectA = isObject(a);
  2031. var isObjectB = isObject(b);
  2032. if (isObjectA && isObjectB) {
  2033. try {
  2034. var isArrayA = Array.isArray(a);
  2035. var isArrayB = Array.isArray(b);
  2036. if (isArrayA && isArrayB) {
  2037. return a.length === b.length && a.every(function (e, i) {
  2038. return looseEqual(e, b[i])
  2039. })
  2040. } else if (a instanceof Date && b instanceof Date) {
  2041. return a.getTime() === b.getTime()
  2042. } else if (!isArrayA && !isArrayB) {
  2043. var keysA = Object.keys(a);
  2044. var keysB = Object.keys(b);
  2045. return keysA.length === keysB.length && keysA.every(function (key) {
  2046. return looseEqual(a[key], b[key])
  2047. })
  2048. } else {
  2049. /* istanbul ignore next */
  2050. return false
  2051. }
  2052. } catch (e) {
  2053. /* istanbul ignore next */
  2054. return false
  2055. }
  2056. } else if (!isObjectA && !isObjectB) {
  2057. return String(a) === String(b)
  2058. } else {
  2059. return false
  2060. }
  2061. }
  2062. /**
  2063. * Return the first index at which a loosely equal value can be
  2064. * found in the array (if value is a plain object, the array must
  2065. * contain an object of the same shape), or -1 if it is not present.
  2066. */
  2067. function looseIndexOf (arr, val) {
  2068. for (var i = 0; i < arr.length; i++) {
  2069. if (looseEqual(arr[i], val)) { return i }
  2070. }
  2071. return -1
  2072. }
  2073. /**
  2074. * Ensure a function is called only once.
  2075. */
  2076. function once (fn) {
  2077. var called = false;
  2078. return function () {
  2079. if (!called) {
  2080. called = true;
  2081. fn.apply(this, arguments);
  2082. }
  2083. }
  2084. }
  2085. var ASSET_TYPES = [
  2086. 'component',
  2087. 'directive',
  2088. 'filter'
  2089. ];
  2090. var LIFECYCLE_HOOKS = [
  2091. 'beforeCreate',
  2092. 'created',
  2093. 'beforeMount',
  2094. 'mounted',
  2095. 'beforeUpdate',
  2096. 'updated',
  2097. 'beforeDestroy',
  2098. 'destroyed',
  2099. 'activated',
  2100. 'deactivated',
  2101. 'errorCaptured',
  2102. 'serverPrefetch'
  2103. ];
  2104. /* */
  2105. var config = ({
  2106. /**
  2107. * Option merge strategies (used in core/util/options)
  2108. */
  2109. // $flow-disable-line
  2110. optionMergeStrategies: Object.create(null),
  2111. /**
  2112. * Whether to suppress warnings.
  2113. */
  2114. silent: false,
  2115. /**
  2116. * Show production mode tip message on boot?
  2117. */
  2118. productionTip: "development" !== 'production',
  2119. /**
  2120. * Whether to enable devtools
  2121. */
  2122. devtools: "development" !== 'production',
  2123. /**
  2124. * Whether to record perf
  2125. */
  2126. performance: false,
  2127. /**
  2128. * Error handler for watcher errors
  2129. */
  2130. errorHandler: null,
  2131. /**
  2132. * Warn handler for watcher warns
  2133. */
  2134. warnHandler: null,
  2135. /**
  2136. * Ignore certain custom elements
  2137. */
  2138. ignoredElements: [],
  2139. /**
  2140. * Custom user key aliases for v-on
  2141. */
  2142. // $flow-disable-line
  2143. keyCodes: Object.create(null),
  2144. /**
  2145. * Check if a tag is reserved so that it cannot be registered as a
  2146. * component. This is platform-dependent and may be overwritten.
  2147. */
  2148. isReservedTag: no,
  2149. /**
  2150. * Check if an attribute is reserved so that it cannot be used as a component
  2151. * prop. This is platform-dependent and may be overwritten.
  2152. */
  2153. isReservedAttr: no,
  2154. /**
  2155. * Check if a tag is an unknown element.
  2156. * Platform-dependent.
  2157. */
  2158. isUnknownElement: no,
  2159. /**
  2160. * Get the namespace of an element
  2161. */
  2162. getTagNamespace: noop,
  2163. /**
  2164. * Parse the real tag name for the specific platform.
  2165. */
  2166. parsePlatformTagName: identity,
  2167. /**
  2168. * Check if an attribute must be bound using property, e.g. value
  2169. * Platform-dependent.
  2170. */
  2171. mustUseProp: no,
  2172. /**
  2173. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2174. * This will significantly reduce performance if set to false.
  2175. */
  2176. async: true,
  2177. /**
  2178. * Exposed for legacy reasons
  2179. */
  2180. _lifecycleHooks: LIFECYCLE_HOOKS
  2181. });
  2182. /* */
  2183. /**
  2184. * unicode letters used for parsing html tags, component names and property paths.
  2185. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2186. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2187. */
  2188. 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/;
  2189. /**
  2190. * Check if a string starts with $ or _
  2191. */
  2192. function isReserved (str) {
  2193. var c = (str + '').charCodeAt(0);
  2194. return c === 0x24 || c === 0x5F
  2195. }
  2196. /**
  2197. * Define a property.
  2198. */
  2199. function def (obj, key, val, enumerable) {
  2200. Object.defineProperty(obj, key, {
  2201. value: val,
  2202. enumerable: !!enumerable,
  2203. writable: true,
  2204. configurable: true
  2205. });
  2206. }
  2207. /**
  2208. * Parse simple path.
  2209. */
  2210. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2211. function parsePath (path) {
  2212. if (bailRE.test(path)) {
  2213. return
  2214. }
  2215. var segments = path.split('.');
  2216. return function (obj) {
  2217. for (var i = 0; i < segments.length; i++) {
  2218. if (!obj) { return }
  2219. obj = obj[segments[i]];
  2220. }
  2221. return obj
  2222. }
  2223. }
  2224. /* */
  2225. // can we use __proto__?
  2226. var hasProto = '__proto__' in {};
  2227. // Browser environment sniffing
  2228. var inBrowser = typeof window !== 'undefined';
  2229. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2230. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2231. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2232. var isIE = UA && /msie|trident/.test(UA);
  2233. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2234. var isEdge = UA && UA.indexOf('edge/') > 0;
  2235. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2236. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2237. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2238. var isPhantomJS = UA && /phantomjs/.test(UA);
  2239. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2240. // Firefox has a "watch" function on Object.prototype...
  2241. var nativeWatch = ({}).watch;
  2242. if (inBrowser) {
  2243. try {
  2244. var opts = {};
  2245. Object.defineProperty(opts, 'passive', ({
  2246. get: function get () {
  2247. }
  2248. })); // https://github.com/facebook/flow/issues/285
  2249. window.addEventListener('test-passive', null, opts);
  2250. } catch (e) {}
  2251. }
  2252. // this needs to be lazy-evaled because vue may be required before
  2253. // vue-server-renderer can set VUE_ENV
  2254. var _isServer;
  2255. var isServerRendering = function () {
  2256. if (_isServer === undefined) {
  2257. /* istanbul ignore if */
  2258. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2259. // detect presence of vue-server-renderer and avoid
  2260. // Webpack shimming the process
  2261. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2262. } else {
  2263. _isServer = false;
  2264. }
  2265. }
  2266. return _isServer
  2267. };
  2268. // detect devtools
  2269. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2270. /* istanbul ignore next */
  2271. function isNative (Ctor) {
  2272. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2273. }
  2274. var hasSymbol =
  2275. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2276. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2277. var _Set;
  2278. /* istanbul ignore if */ // $flow-disable-line
  2279. if (typeof Set !== 'undefined' && isNative(Set)) {
  2280. // use native Set when available.
  2281. _Set = Set;
  2282. } else {
  2283. // a non-standard Set polyfill that only works with primitive keys.
  2284. _Set = /*@__PURE__*/(function () {
  2285. function Set () {
  2286. this.set = Object.create(null);
  2287. }
  2288. Set.prototype.has = function has (key) {
  2289. return this.set[key] === true
  2290. };
  2291. Set.prototype.add = function add (key) {
  2292. this.set[key] = true;
  2293. };
  2294. Set.prototype.clear = function clear () {
  2295. this.set = Object.create(null);
  2296. };
  2297. return Set;
  2298. }());
  2299. }
  2300. /* */
  2301. var warn = noop;
  2302. var tip = noop;
  2303. var generateComponentTrace = (noop); // work around flow check
  2304. var formatComponentName = (noop);
  2305. if (true) {
  2306. var hasConsole = typeof console !== 'undefined';
  2307. var classifyRE = /(?:^|[-_])(\w)/g;
  2308. var classify = function (str) { return str
  2309. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2310. .replace(/[-_]/g, ''); };
  2311. warn = function (msg, vm) {
  2312. var trace = vm ? generateComponentTrace(vm) : '';
  2313. if (config.warnHandler) {
  2314. config.warnHandler.call(null, msg, vm, trace);
  2315. } else if (hasConsole && (!config.silent)) {
  2316. console.error(("[Vue warn]: " + msg + trace));
  2317. }
  2318. };
  2319. tip = function (msg, vm) {
  2320. if (hasConsole && (!config.silent)) {
  2321. console.warn("[Vue tip]: " + msg + (
  2322. vm ? generateComponentTrace(vm) : ''
  2323. ));
  2324. }
  2325. };
  2326. formatComponentName = function (vm, includeFile) {
  2327. if (vm.$root === vm) {
  2328. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2329. return ('') + vm.$options.__file
  2330. }
  2331. return '<Root>'
  2332. }
  2333. var options = typeof vm === 'function' && vm.cid != null
  2334. ? vm.options
  2335. : vm._isVue
  2336. ? vm.$options || vm.constructor.options
  2337. : vm;
  2338. var name = options.name || options._componentTag;
  2339. var file = options.__file;
  2340. if (!name && file) {
  2341. var match = file.match(/([^/\\]+)\.vue$/);
  2342. name = match && match[1];
  2343. }
  2344. return (
  2345. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2346. (file && includeFile !== false ? (" at " + file) : '')
  2347. )
  2348. };
  2349. var repeat = function (str, n) {
  2350. var res = '';
  2351. while (n) {
  2352. if (n % 2 === 1) { res += str; }
  2353. if (n > 1) { str += str; }
  2354. n >>= 1;
  2355. }
  2356. return res
  2357. };
  2358. generateComponentTrace = function (vm) {
  2359. if (vm._isVue && vm.$parent) {
  2360. var tree = [];
  2361. var currentRecursiveSequence = 0;
  2362. while (vm && vm.$options.name !== 'PageBody') {
  2363. if (tree.length > 0) {
  2364. var last = tree[tree.length - 1];
  2365. if (last.constructor === vm.constructor) {
  2366. currentRecursiveSequence++;
  2367. vm = vm.$parent;
  2368. continue
  2369. } else if (currentRecursiveSequence > 0) {
  2370. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2371. currentRecursiveSequence = 0;
  2372. }
  2373. }
  2374. !vm.$options.isReserved && tree.push(vm);
  2375. vm = vm.$parent;
  2376. }
  2377. return '\n\nfound in\n\n' + tree
  2378. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2379. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2380. : formatComponentName(vm))); })
  2381. .join('\n')
  2382. } else {
  2383. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2384. }
  2385. };
  2386. }
  2387. /* */
  2388. var uid = 0;
  2389. /**
  2390. * A dep is an observable that can have multiple
  2391. * directives subscribing to it.
  2392. */
  2393. var Dep = function Dep () {
  2394. this.id = uid++;
  2395. this.subs = [];
  2396. };
  2397. Dep.prototype.addSub = function addSub (sub) {
  2398. this.subs.push(sub);
  2399. };
  2400. Dep.prototype.removeSub = function removeSub (sub) {
  2401. remove(this.subs, sub);
  2402. };
  2403. Dep.prototype.depend = function depend () {
  2404. if (Dep.SharedObject.target) {
  2405. Dep.SharedObject.target.addDep(this);
  2406. }
  2407. };
  2408. Dep.prototype.notify = function notify () {
  2409. // stabilize the subscriber list first
  2410. var subs = this.subs.slice();
  2411. if ( true && !config.async) {
  2412. // subs aren't sorted in scheduler if not running async
  2413. // we need to sort them now to make sure they fire in correct
  2414. // order
  2415. subs.sort(function (a, b) { return a.id - b.id; });
  2416. }
  2417. for (var i = 0, l = subs.length; i < l; i++) {
  2418. subs[i].update();
  2419. }
  2420. };
  2421. // The current target watcher being evaluated.
  2422. // This is globally unique because only one watcher
  2423. // can be evaluated at a time.
  2424. // fixed by xxxxxx (nvue shared vuex)
  2425. /* eslint-disable no-undef */
  2426. Dep.SharedObject = {};
  2427. Dep.SharedObject.target = null;
  2428. Dep.SharedObject.targetStack = [];
  2429. function pushTarget (target) {
  2430. Dep.SharedObject.targetStack.push(target);
  2431. Dep.SharedObject.target = target;
  2432. Dep.target = target;
  2433. }
  2434. function popTarget () {
  2435. Dep.SharedObject.targetStack.pop();
  2436. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2437. Dep.target = Dep.SharedObject.target;
  2438. }
  2439. /* */
  2440. var VNode = function VNode (
  2441. tag,
  2442. data,
  2443. children,
  2444. text,
  2445. elm,
  2446. context,
  2447. componentOptions,
  2448. asyncFactory
  2449. ) {
  2450. this.tag = tag;
  2451. this.data = data;
  2452. this.children = children;
  2453. this.text = text;
  2454. this.elm = elm;
  2455. this.ns = undefined;
  2456. this.context = context;
  2457. this.fnContext = undefined;
  2458. this.fnOptions = undefined;
  2459. this.fnScopeId = undefined;
  2460. this.key = data && data.key;
  2461. this.componentOptions = componentOptions;
  2462. this.componentInstance = undefined;
  2463. this.parent = undefined;
  2464. this.raw = false;
  2465. this.isStatic = false;
  2466. this.isRootInsert = true;
  2467. this.isComment = false;
  2468. this.isCloned = false;
  2469. this.isOnce = false;
  2470. this.asyncFactory = asyncFactory;
  2471. this.asyncMeta = undefined;
  2472. this.isAsyncPlaceholder = false;
  2473. };
  2474. var prototypeAccessors = { child: { configurable: true } };
  2475. // DEPRECATED: alias for componentInstance for backwards compat.
  2476. /* istanbul ignore next */
  2477. prototypeAccessors.child.get = function () {
  2478. return this.componentInstance
  2479. };
  2480. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2481. var createEmptyVNode = function (text) {
  2482. if ( text === void 0 ) text = '';
  2483. var node = new VNode();
  2484. node.text = text;
  2485. node.isComment = true;
  2486. return node
  2487. };
  2488. function createTextVNode (val) {
  2489. return new VNode(undefined, undefined, undefined, String(val))
  2490. }
  2491. // optimized shallow clone
  2492. // used for static nodes and slot nodes because they may be reused across
  2493. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2494. // on their elm reference.
  2495. function cloneVNode (vnode) {
  2496. var cloned = new VNode(
  2497. vnode.tag,
  2498. vnode.data,
  2499. // #7975
  2500. // clone children array to avoid mutating original in case of cloning
  2501. // a child.
  2502. vnode.children && vnode.children.slice(),
  2503. vnode.text,
  2504. vnode.elm,
  2505. vnode.context,
  2506. vnode.componentOptions,
  2507. vnode.asyncFactory
  2508. );
  2509. cloned.ns = vnode.ns;
  2510. cloned.isStatic = vnode.isStatic;
  2511. cloned.key = vnode.key;
  2512. cloned.isComment = vnode.isComment;
  2513. cloned.fnContext = vnode.fnContext;
  2514. cloned.fnOptions = vnode.fnOptions;
  2515. cloned.fnScopeId = vnode.fnScopeId;
  2516. cloned.asyncMeta = vnode.asyncMeta;
  2517. cloned.isCloned = true;
  2518. return cloned
  2519. }
  2520. /*
  2521. * not type checking this file because flow doesn't play well with
  2522. * dynamically accessing methods on Array prototype
  2523. */
  2524. var arrayProto = Array.prototype;
  2525. var arrayMethods = Object.create(arrayProto);
  2526. var methodsToPatch = [
  2527. 'push',
  2528. 'pop',
  2529. 'shift',
  2530. 'unshift',
  2531. 'splice',
  2532. 'sort',
  2533. 'reverse'
  2534. ];
  2535. /**
  2536. * Intercept mutating methods and emit events
  2537. */
  2538. methodsToPatch.forEach(function (method) {
  2539. // cache original method
  2540. var original = arrayProto[method];
  2541. def(arrayMethods, method, function mutator () {
  2542. var args = [], len = arguments.length;
  2543. while ( len-- ) args[ len ] = arguments[ len ];
  2544. var result = original.apply(this, args);
  2545. var ob = this.__ob__;
  2546. var inserted;
  2547. switch (method) {
  2548. case 'push':
  2549. case 'unshift':
  2550. inserted = args;
  2551. break
  2552. case 'splice':
  2553. inserted = args.slice(2);
  2554. break
  2555. }
  2556. if (inserted) { ob.observeArray(inserted); }
  2557. // notify change
  2558. ob.dep.notify();
  2559. return result
  2560. });
  2561. });
  2562. /* */
  2563. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2564. /**
  2565. * In some cases we may want to disable observation inside a component's
  2566. * update computation.
  2567. */
  2568. var shouldObserve = true;
  2569. function toggleObserving (value) {
  2570. shouldObserve = value;
  2571. }
  2572. /**
  2573. * Observer class that is attached to each observed
  2574. * object. Once attached, the observer converts the target
  2575. * object's property keys into getter/setters that
  2576. * collect dependencies and dispatch updates.
  2577. */
  2578. var Observer = function Observer (value) {
  2579. this.value = value;
  2580. this.dep = new Dep();
  2581. this.vmCount = 0;
  2582. def(value, '__ob__', this);
  2583. if (Array.isArray(value)) {
  2584. if (hasProto) {
  2585. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2586. if(value.push !== value.__proto__.push){
  2587. copyAugment(value, arrayMethods, arrayKeys);
  2588. } else {
  2589. protoAugment(value, arrayMethods);
  2590. }
  2591. }
  2592. } else {
  2593. copyAugment(value, arrayMethods, arrayKeys);
  2594. }
  2595. this.observeArray(value);
  2596. } else {
  2597. this.walk(value);
  2598. }
  2599. };
  2600. /**
  2601. * Walk through all properties and convert them into
  2602. * getter/setters. This method should only be called when
  2603. * value type is Object.
  2604. */
  2605. Observer.prototype.walk = function walk (obj) {
  2606. var keys = Object.keys(obj);
  2607. for (var i = 0; i < keys.length; i++) {
  2608. defineReactive$$1(obj, keys[i]);
  2609. }
  2610. };
  2611. /**
  2612. * Observe a list of Array items.
  2613. */
  2614. Observer.prototype.observeArray = function observeArray (items) {
  2615. for (var i = 0, l = items.length; i < l; i++) {
  2616. observe(items[i]);
  2617. }
  2618. };
  2619. // helpers
  2620. /**
  2621. * Augment a target Object or Array by intercepting
  2622. * the prototype chain using __proto__
  2623. */
  2624. function protoAugment (target, src) {
  2625. /* eslint-disable no-proto */
  2626. target.__proto__ = src;
  2627. /* eslint-enable no-proto */
  2628. }
  2629. /**
  2630. * Augment a target Object or Array by defining
  2631. * hidden properties.
  2632. */
  2633. /* istanbul ignore next */
  2634. function copyAugment (target, src, keys) {
  2635. for (var i = 0, l = keys.length; i < l; i++) {
  2636. var key = keys[i];
  2637. def(target, key, src[key]);
  2638. }
  2639. }
  2640. /**
  2641. * Attempt to create an observer instance for a value,
  2642. * returns the new observer if successfully observed,
  2643. * or the existing observer if the value already has one.
  2644. */
  2645. function observe (value, asRootData) {
  2646. if (!isObject(value) || value instanceof VNode) {
  2647. return
  2648. }
  2649. var ob;
  2650. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2651. ob = value.__ob__;
  2652. } else if (
  2653. shouldObserve &&
  2654. !isServerRendering() &&
  2655. (Array.isArray(value) || isPlainObject(value)) &&
  2656. Object.isExtensible(value) &&
  2657. !value._isVue
  2658. ) {
  2659. ob = new Observer(value);
  2660. }
  2661. if (asRootData && ob) {
  2662. ob.vmCount++;
  2663. }
  2664. return ob
  2665. }
  2666. /**
  2667. * Define a reactive property on an Object.
  2668. */
  2669. function defineReactive$$1 (
  2670. obj,
  2671. key,
  2672. val,
  2673. customSetter,
  2674. shallow
  2675. ) {
  2676. var dep = new Dep();
  2677. var property = Object.getOwnPropertyDescriptor(obj, key);
  2678. if (property && property.configurable === false) {
  2679. return
  2680. }
  2681. // cater for pre-defined getter/setters
  2682. var getter = property && property.get;
  2683. var setter = property && property.set;
  2684. if ((!getter || setter) && arguments.length === 2) {
  2685. val = obj[key];
  2686. }
  2687. var childOb = !shallow && observe(val);
  2688. Object.defineProperty(obj, key, {
  2689. enumerable: true,
  2690. configurable: true,
  2691. get: function reactiveGetter () {
  2692. var value = getter ? getter.call(obj) : val;
  2693. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2694. dep.depend();
  2695. if (childOb) {
  2696. childOb.dep.depend();
  2697. if (Array.isArray(value)) {
  2698. dependArray(value);
  2699. }
  2700. }
  2701. }
  2702. return value
  2703. },
  2704. set: function reactiveSetter (newVal) {
  2705. var value = getter ? getter.call(obj) : val;
  2706. /* eslint-disable no-self-compare */
  2707. if (newVal === value || (newVal !== newVal && value !== value)) {
  2708. return
  2709. }
  2710. /* eslint-enable no-self-compare */
  2711. if ( true && customSetter) {
  2712. customSetter();
  2713. }
  2714. // #7981: for accessor properties without setter
  2715. if (getter && !setter) { return }
  2716. if (setter) {
  2717. setter.call(obj, newVal);
  2718. } else {
  2719. val = newVal;
  2720. }
  2721. childOb = !shallow && observe(newVal);
  2722. dep.notify();
  2723. }
  2724. });
  2725. }
  2726. /**
  2727. * Set a property on an object. Adds the new property and
  2728. * triggers change notification if the property doesn't
  2729. * already exist.
  2730. */
  2731. function set (target, key, val) {
  2732. if ( true &&
  2733. (isUndef(target) || isPrimitive(target))
  2734. ) {
  2735. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2736. }
  2737. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2738. target.length = Math.max(target.length, key);
  2739. target.splice(key, 1, val);
  2740. return val
  2741. }
  2742. if (key in target && !(key in Object.prototype)) {
  2743. target[key] = val;
  2744. return val
  2745. }
  2746. var ob = (target).__ob__;
  2747. if (target._isVue || (ob && ob.vmCount)) {
  2748. true && warn(
  2749. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2750. 'at runtime - declare it upfront in the data option.'
  2751. );
  2752. return val
  2753. }
  2754. if (!ob) {
  2755. target[key] = val;
  2756. return val
  2757. }
  2758. defineReactive$$1(ob.value, key, val);
  2759. ob.dep.notify();
  2760. return val
  2761. }
  2762. /**
  2763. * Delete a property and trigger change if necessary.
  2764. */
  2765. function del (target, key) {
  2766. if ( true &&
  2767. (isUndef(target) || isPrimitive(target))
  2768. ) {
  2769. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2770. }
  2771. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2772. target.splice(key, 1);
  2773. return
  2774. }
  2775. var ob = (target).__ob__;
  2776. if (target._isVue || (ob && ob.vmCount)) {
  2777. true && warn(
  2778. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2779. '- just set it to null.'
  2780. );
  2781. return
  2782. }
  2783. if (!hasOwn(target, key)) {
  2784. return
  2785. }
  2786. delete target[key];
  2787. if (!ob) {
  2788. return
  2789. }
  2790. ob.dep.notify();
  2791. }
  2792. /**
  2793. * Collect dependencies on array elements when the array is touched, since
  2794. * we cannot intercept array element access like property getters.
  2795. */
  2796. function dependArray (value) {
  2797. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2798. e = value[i];
  2799. e && e.__ob__ && e.__ob__.dep.depend();
  2800. if (Array.isArray(e)) {
  2801. dependArray(e);
  2802. }
  2803. }
  2804. }
  2805. /* */
  2806. /**
  2807. * Option overwriting strategies are functions that handle
  2808. * how to merge a parent option value and a child option
  2809. * value into the final value.
  2810. */
  2811. var strats = config.optionMergeStrategies;
  2812. /**
  2813. * Options with restrictions
  2814. */
  2815. if (true) {
  2816. strats.el = strats.propsData = function (parent, child, vm, key) {
  2817. if (!vm) {
  2818. warn(
  2819. "option \"" + key + "\" can only be used during instance " +
  2820. 'creation with the `new` keyword.'
  2821. );
  2822. }
  2823. return defaultStrat(parent, child)
  2824. };
  2825. }
  2826. /**
  2827. * Helper that recursively merges two data objects together.
  2828. */
  2829. function mergeData (to, from) {
  2830. if (!from) { return to }
  2831. var key, toVal, fromVal;
  2832. var keys = hasSymbol
  2833. ? Reflect.ownKeys(from)
  2834. : Object.keys(from);
  2835. for (var i = 0; i < keys.length; i++) {
  2836. key = keys[i];
  2837. // in case the object is already observed...
  2838. if (key === '__ob__') { continue }
  2839. toVal = to[key];
  2840. fromVal = from[key];
  2841. if (!hasOwn(to, key)) {
  2842. set(to, key, fromVal);
  2843. } else if (
  2844. toVal !== fromVal &&
  2845. isPlainObject(toVal) &&
  2846. isPlainObject(fromVal)
  2847. ) {
  2848. mergeData(toVal, fromVal);
  2849. }
  2850. }
  2851. return to
  2852. }
  2853. /**
  2854. * Data
  2855. */
  2856. function mergeDataOrFn (
  2857. parentVal,
  2858. childVal,
  2859. vm
  2860. ) {
  2861. if (!vm) {
  2862. // in a Vue.extend merge, both should be functions
  2863. if (!childVal) {
  2864. return parentVal
  2865. }
  2866. if (!parentVal) {
  2867. return childVal
  2868. }
  2869. // when parentVal & childVal are both present,
  2870. // we need to return a function that returns the
  2871. // merged result of both functions... no need to
  2872. // check if parentVal is a function here because
  2873. // it has to be a function to pass previous merges.
  2874. return function mergedDataFn () {
  2875. return mergeData(
  2876. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2877. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2878. )
  2879. }
  2880. } else {
  2881. return function mergedInstanceDataFn () {
  2882. // instance merge
  2883. var instanceData = typeof childVal === 'function'
  2884. ? childVal.call(vm, vm)
  2885. : childVal;
  2886. var defaultData = typeof parentVal === 'function'
  2887. ? parentVal.call(vm, vm)
  2888. : parentVal;
  2889. if (instanceData) {
  2890. return mergeData(instanceData, defaultData)
  2891. } else {
  2892. return defaultData
  2893. }
  2894. }
  2895. }
  2896. }
  2897. strats.data = function (
  2898. parentVal,
  2899. childVal,
  2900. vm
  2901. ) {
  2902. if (!vm) {
  2903. if (childVal && typeof childVal !== 'function') {
  2904. true && warn(
  2905. 'The "data" option should be a function ' +
  2906. 'that returns a per-instance value in component ' +
  2907. 'definitions.',
  2908. vm
  2909. );
  2910. return parentVal
  2911. }
  2912. return mergeDataOrFn(parentVal, childVal)
  2913. }
  2914. return mergeDataOrFn(parentVal, childVal, vm)
  2915. };
  2916. /**
  2917. * Hooks and props are merged as arrays.
  2918. */
  2919. function mergeHook (
  2920. parentVal,
  2921. childVal
  2922. ) {
  2923. var res = childVal
  2924. ? parentVal
  2925. ? parentVal.concat(childVal)
  2926. : Array.isArray(childVal)
  2927. ? childVal
  2928. : [childVal]
  2929. : parentVal;
  2930. return res
  2931. ? dedupeHooks(res)
  2932. : res
  2933. }
  2934. function dedupeHooks (hooks) {
  2935. var res = [];
  2936. for (var i = 0; i < hooks.length; i++) {
  2937. if (res.indexOf(hooks[i]) === -1) {
  2938. res.push(hooks[i]);
  2939. }
  2940. }
  2941. return res
  2942. }
  2943. LIFECYCLE_HOOKS.forEach(function (hook) {
  2944. strats[hook] = mergeHook;
  2945. });
  2946. /**
  2947. * Assets
  2948. *
  2949. * When a vm is present (instance creation), we need to do
  2950. * a three-way merge between constructor options, instance
  2951. * options and parent options.
  2952. */
  2953. function mergeAssets (
  2954. parentVal,
  2955. childVal,
  2956. vm,
  2957. key
  2958. ) {
  2959. var res = Object.create(parentVal || null);
  2960. if (childVal) {
  2961. true && assertObjectType(key, childVal, vm);
  2962. return extend(res, childVal)
  2963. } else {
  2964. return res
  2965. }
  2966. }
  2967. ASSET_TYPES.forEach(function (type) {
  2968. strats[type + 's'] = mergeAssets;
  2969. });
  2970. /**
  2971. * Watchers.
  2972. *
  2973. * Watchers hashes should not overwrite one
  2974. * another, so we merge them as arrays.
  2975. */
  2976. strats.watch = function (
  2977. parentVal,
  2978. childVal,
  2979. vm,
  2980. key
  2981. ) {
  2982. // work around Firefox's Object.prototype.watch...
  2983. if (parentVal === nativeWatch) { parentVal = undefined; }
  2984. if (childVal === nativeWatch) { childVal = undefined; }
  2985. /* istanbul ignore if */
  2986. if (!childVal) { return Object.create(parentVal || null) }
  2987. if (true) {
  2988. assertObjectType(key, childVal, vm);
  2989. }
  2990. if (!parentVal) { return childVal }
  2991. var ret = {};
  2992. extend(ret, parentVal);
  2993. for (var key$1 in childVal) {
  2994. var parent = ret[key$1];
  2995. var child = childVal[key$1];
  2996. if (parent && !Array.isArray(parent)) {
  2997. parent = [parent];
  2998. }
  2999. ret[key$1] = parent
  3000. ? parent.concat(child)
  3001. : Array.isArray(child) ? child : [child];
  3002. }
  3003. return ret
  3004. };
  3005. /**
  3006. * Other object hashes.
  3007. */
  3008. strats.props =
  3009. strats.methods =
  3010. strats.inject =
  3011. strats.computed = function (
  3012. parentVal,
  3013. childVal,
  3014. vm,
  3015. key
  3016. ) {
  3017. if (childVal && "development" !== 'production') {
  3018. assertObjectType(key, childVal, vm);
  3019. }
  3020. if (!parentVal) { return childVal }
  3021. var ret = Object.create(null);
  3022. extend(ret, parentVal);
  3023. if (childVal) { extend(ret, childVal); }
  3024. return ret
  3025. };
  3026. strats.provide = mergeDataOrFn;
  3027. /**
  3028. * Default strategy.
  3029. */
  3030. var defaultStrat = function (parentVal, childVal) {
  3031. return childVal === undefined
  3032. ? parentVal
  3033. : childVal
  3034. };
  3035. /**
  3036. * Validate component names
  3037. */
  3038. function checkComponents (options) {
  3039. for (var key in options.components) {
  3040. validateComponentName(key);
  3041. }
  3042. }
  3043. function validateComponentName (name) {
  3044. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3045. warn(
  3046. 'Invalid component name: "' + name + '". Component names ' +
  3047. 'should conform to valid custom element name in html5 specification.'
  3048. );
  3049. }
  3050. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3051. warn(
  3052. 'Do not use built-in or reserved HTML elements as component ' +
  3053. 'id: ' + name
  3054. );
  3055. }
  3056. }
  3057. /**
  3058. * Ensure all props option syntax are normalized into the
  3059. * Object-based format.
  3060. */
  3061. function normalizeProps (options, vm) {
  3062. var props = options.props;
  3063. if (!props) { return }
  3064. var res = {};
  3065. var i, val, name;
  3066. if (Array.isArray(props)) {
  3067. i = props.length;
  3068. while (i--) {
  3069. val = props[i];
  3070. if (typeof val === 'string') {
  3071. name = camelize(val);
  3072. res[name] = { type: null };
  3073. } else if (true) {
  3074. warn('props must be strings when using array syntax.');
  3075. }
  3076. }
  3077. } else if (isPlainObject(props)) {
  3078. for (var key in props) {
  3079. val = props[key];
  3080. name = camelize(key);
  3081. res[name] = isPlainObject(val)
  3082. ? val
  3083. : { type: val };
  3084. }
  3085. } else if (true) {
  3086. warn(
  3087. "Invalid value for option \"props\": expected an Array or an Object, " +
  3088. "but got " + (toRawType(props)) + ".",
  3089. vm
  3090. );
  3091. }
  3092. options.props = res;
  3093. }
  3094. /**
  3095. * Normalize all injections into Object-based format
  3096. */
  3097. function normalizeInject (options, vm) {
  3098. var inject = options.inject;
  3099. if (!inject) { return }
  3100. var normalized = options.inject = {};
  3101. if (Array.isArray(inject)) {
  3102. for (var i = 0; i < inject.length; i++) {
  3103. normalized[inject[i]] = { from: inject[i] };
  3104. }
  3105. } else if (isPlainObject(inject)) {
  3106. for (var key in inject) {
  3107. var val = inject[key];
  3108. normalized[key] = isPlainObject(val)
  3109. ? extend({ from: key }, val)
  3110. : { from: val };
  3111. }
  3112. } else if (true) {
  3113. warn(
  3114. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3115. "but got " + (toRawType(inject)) + ".",
  3116. vm
  3117. );
  3118. }
  3119. }
  3120. /**
  3121. * Normalize raw function directives into object format.
  3122. */
  3123. function normalizeDirectives (options) {
  3124. var dirs = options.directives;
  3125. if (dirs) {
  3126. for (var key in dirs) {
  3127. var def$$1 = dirs[key];
  3128. if (typeof def$$1 === 'function') {
  3129. dirs[key] = { bind: def$$1, update: def$$1 };
  3130. }
  3131. }
  3132. }
  3133. }
  3134. function assertObjectType (name, value, vm) {
  3135. if (!isPlainObject(value)) {
  3136. warn(
  3137. "Invalid value for option \"" + name + "\": expected an Object, " +
  3138. "but got " + (toRawType(value)) + ".",
  3139. vm
  3140. );
  3141. }
  3142. }
  3143. /**
  3144. * Merge two option objects into a new one.
  3145. * Core utility used in both instantiation and inheritance.
  3146. */
  3147. function mergeOptions (
  3148. parent,
  3149. child,
  3150. vm
  3151. ) {
  3152. if (true) {
  3153. checkComponents(child);
  3154. }
  3155. if (typeof child === 'function') {
  3156. child = child.options;
  3157. }
  3158. normalizeProps(child, vm);
  3159. normalizeInject(child, vm);
  3160. normalizeDirectives(child);
  3161. // Apply extends and mixins on the child options,
  3162. // but only if it is a raw options object that isn't
  3163. // the result of another mergeOptions call.
  3164. // Only merged options has the _base property.
  3165. if (!child._base) {
  3166. if (child.extends) {
  3167. parent = mergeOptions(parent, child.extends, vm);
  3168. }
  3169. if (child.mixins) {
  3170. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3171. parent = mergeOptions(parent, child.mixins[i], vm);
  3172. }
  3173. }
  3174. }
  3175. var options = {};
  3176. var key;
  3177. for (key in parent) {
  3178. mergeField(key);
  3179. }
  3180. for (key in child) {
  3181. if (!hasOwn(parent, key)) {
  3182. mergeField(key);
  3183. }
  3184. }
  3185. function mergeField (key) {
  3186. var strat = strats[key] || defaultStrat;
  3187. options[key] = strat(parent[key], child[key], vm, key);
  3188. }
  3189. return options
  3190. }
  3191. /**
  3192. * Resolve an asset.
  3193. * This function is used because child instances need access
  3194. * to assets defined in its ancestor chain.
  3195. */
  3196. function resolveAsset (
  3197. options,
  3198. type,
  3199. id,
  3200. warnMissing
  3201. ) {
  3202. /* istanbul ignore if */
  3203. if (typeof id !== 'string') {
  3204. return
  3205. }
  3206. var assets = options[type];
  3207. // check local registration variations first
  3208. if (hasOwn(assets, id)) { return assets[id] }
  3209. var camelizedId = camelize(id);
  3210. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3211. var PascalCaseId = capitalize(camelizedId);
  3212. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3213. // fallback to prototype chain
  3214. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3215. if ( true && warnMissing && !res) {
  3216. warn(
  3217. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3218. options
  3219. );
  3220. }
  3221. return res
  3222. }
  3223. /* */
  3224. function validateProp (
  3225. key,
  3226. propOptions,
  3227. propsData,
  3228. vm
  3229. ) {
  3230. var prop = propOptions[key];
  3231. var absent = !hasOwn(propsData, key);
  3232. var value = propsData[key];
  3233. // boolean casting
  3234. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3235. if (booleanIndex > -1) {
  3236. if (absent && !hasOwn(prop, 'default')) {
  3237. value = false;
  3238. } else if (value === '' || value === hyphenate(key)) {
  3239. // only cast empty string / same name to boolean if
  3240. // boolean has higher priority
  3241. var stringIndex = getTypeIndex(String, prop.type);
  3242. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3243. value = true;
  3244. }
  3245. }
  3246. }
  3247. // check default value
  3248. if (value === undefined) {
  3249. value = getPropDefaultValue(vm, prop, key);
  3250. // since the default value is a fresh copy,
  3251. // make sure to observe it.
  3252. var prevShouldObserve = shouldObserve;
  3253. toggleObserving(true);
  3254. observe(value);
  3255. toggleObserving(prevShouldObserve);
  3256. }
  3257. if (
  3258. true
  3259. ) {
  3260. assertProp(prop, key, value, vm, absent);
  3261. }
  3262. return value
  3263. }
  3264. /**
  3265. * Get the default value of a prop.
  3266. */
  3267. function getPropDefaultValue (vm, prop, key) {
  3268. // no default, return undefined
  3269. if (!hasOwn(prop, 'default')) {
  3270. return undefined
  3271. }
  3272. var def = prop.default;
  3273. // warn against non-factory defaults for Object & Array
  3274. if ( true && isObject(def)) {
  3275. warn(
  3276. 'Invalid default value for prop "' + key + '": ' +
  3277. 'Props with type Object/Array must use a factory function ' +
  3278. 'to return the default value.',
  3279. vm
  3280. );
  3281. }
  3282. // the raw prop value was also undefined from previous render,
  3283. // return previous default value to avoid unnecessary watcher trigger
  3284. if (vm && vm.$options.propsData &&
  3285. vm.$options.propsData[key] === undefined &&
  3286. vm._props[key] !== undefined
  3287. ) {
  3288. return vm._props[key]
  3289. }
  3290. // call factory function for non-Function types
  3291. // a value is Function if its prototype is function even across different execution context
  3292. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3293. ? def.call(vm)
  3294. : def
  3295. }
  3296. /**
  3297. * Assert whether a prop is valid.
  3298. */
  3299. function assertProp (
  3300. prop,
  3301. name,
  3302. value,
  3303. vm,
  3304. absent
  3305. ) {
  3306. if (prop.required && absent) {
  3307. warn(
  3308. 'Missing required prop: "' + name + '"',
  3309. vm
  3310. );
  3311. return
  3312. }
  3313. if (value == null && !prop.required) {
  3314. return
  3315. }
  3316. var type = prop.type;
  3317. var valid = !type || type === true;
  3318. var expectedTypes = [];
  3319. if (type) {
  3320. if (!Array.isArray(type)) {
  3321. type = [type];
  3322. }
  3323. for (var i = 0; i < type.length && !valid; i++) {
  3324. var assertedType = assertType(value, type[i]);
  3325. expectedTypes.push(assertedType.expectedType || '');
  3326. valid = assertedType.valid;
  3327. }
  3328. }
  3329. if (!valid) {
  3330. warn(
  3331. getInvalidTypeMessage(name, value, expectedTypes),
  3332. vm
  3333. );
  3334. return
  3335. }
  3336. var validator = prop.validator;
  3337. if (validator) {
  3338. if (!validator(value)) {
  3339. warn(
  3340. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3341. vm
  3342. );
  3343. }
  3344. }
  3345. }
  3346. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3347. function assertType (value, type) {
  3348. var valid;
  3349. var expectedType = getType(type);
  3350. if (simpleCheckRE.test(expectedType)) {
  3351. var t = typeof value;
  3352. valid = t === expectedType.toLowerCase();
  3353. // for primitive wrapper objects
  3354. if (!valid && t === 'object') {
  3355. valid = value instanceof type;
  3356. }
  3357. } else if (expectedType === 'Object') {
  3358. valid = isPlainObject(value);
  3359. } else if (expectedType === 'Array') {
  3360. valid = Array.isArray(value);
  3361. } else {
  3362. valid = value instanceof type;
  3363. }
  3364. return {
  3365. valid: valid,
  3366. expectedType: expectedType
  3367. }
  3368. }
  3369. /**
  3370. * Use function string name to check built-in types,
  3371. * because a simple equality check will fail when running
  3372. * across different vms / iframes.
  3373. */
  3374. function getType (fn) {
  3375. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3376. return match ? match[1] : ''
  3377. }
  3378. function isSameType (a, b) {
  3379. return getType(a) === getType(b)
  3380. }
  3381. function getTypeIndex (type, expectedTypes) {
  3382. if (!Array.isArray(expectedTypes)) {
  3383. return isSameType(expectedTypes, type) ? 0 : -1
  3384. }
  3385. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3386. if (isSameType(expectedTypes[i], type)) {
  3387. return i
  3388. }
  3389. }
  3390. return -1
  3391. }
  3392. function getInvalidTypeMessage (name, value, expectedTypes) {
  3393. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3394. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3395. var expectedType = expectedTypes[0];
  3396. var receivedType = toRawType(value);
  3397. var expectedValue = styleValue(value, expectedType);
  3398. var receivedValue = styleValue(value, receivedType);
  3399. // check if we need to specify expected value
  3400. if (expectedTypes.length === 1 &&
  3401. isExplicable(expectedType) &&
  3402. !isBoolean(expectedType, receivedType)) {
  3403. message += " with value " + expectedValue;
  3404. }
  3405. message += ", got " + receivedType + " ";
  3406. // check if we need to specify received value
  3407. if (isExplicable(receivedType)) {
  3408. message += "with value " + receivedValue + ".";
  3409. }
  3410. return message
  3411. }
  3412. function styleValue (value, type) {
  3413. if (type === 'String') {
  3414. return ("\"" + value + "\"")
  3415. } else if (type === 'Number') {
  3416. return ("" + (Number(value)))
  3417. } else {
  3418. return ("" + value)
  3419. }
  3420. }
  3421. function isExplicable (value) {
  3422. var explicitTypes = ['string', 'number', 'boolean'];
  3423. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3424. }
  3425. function isBoolean () {
  3426. var args = [], len = arguments.length;
  3427. while ( len-- ) args[ len ] = arguments[ len ];
  3428. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3429. }
  3430. /* */
  3431. function handleError (err, vm, info) {
  3432. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3433. // See: https://github.com/vuejs/vuex/issues/1505
  3434. pushTarget();
  3435. try {
  3436. if (vm) {
  3437. var cur = vm;
  3438. while ((cur = cur.$parent)) {
  3439. var hooks = cur.$options.errorCaptured;
  3440. if (hooks) {
  3441. for (var i = 0; i < hooks.length; i++) {
  3442. try {
  3443. var capture = hooks[i].call(cur, err, vm, info) === false;
  3444. if (capture) { return }
  3445. } catch (e) {
  3446. globalHandleError(e, cur, 'errorCaptured hook');
  3447. }
  3448. }
  3449. }
  3450. }
  3451. }
  3452. globalHandleError(err, vm, info);
  3453. } finally {
  3454. popTarget();
  3455. }
  3456. }
  3457. function invokeWithErrorHandling (
  3458. handler,
  3459. context,
  3460. args,
  3461. vm,
  3462. info
  3463. ) {
  3464. var res;
  3465. try {
  3466. res = args ? handler.apply(context, args) : handler.call(context);
  3467. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3468. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3469. // issue #9511
  3470. // avoid catch triggering multiple times when nested calls
  3471. res._handled = true;
  3472. }
  3473. } catch (e) {
  3474. handleError(e, vm, info);
  3475. }
  3476. return res
  3477. }
  3478. function globalHandleError (err, vm, info) {
  3479. if (config.errorHandler) {
  3480. try {
  3481. return config.errorHandler.call(null, err, vm, info)
  3482. } catch (e) {
  3483. // if the user intentionally throws the original error in the handler,
  3484. // do not log it twice
  3485. if (e !== err) {
  3486. logError(e, null, 'config.errorHandler');
  3487. }
  3488. }
  3489. }
  3490. logError(err, vm, info);
  3491. }
  3492. function logError (err, vm, info) {
  3493. if (true) {
  3494. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3495. }
  3496. /* istanbul ignore else */
  3497. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3498. console.error(err);
  3499. } else {
  3500. throw err
  3501. }
  3502. }
  3503. /* */
  3504. var callbacks = [];
  3505. var pending = false;
  3506. function flushCallbacks () {
  3507. pending = false;
  3508. var copies = callbacks.slice(0);
  3509. callbacks.length = 0;
  3510. for (var i = 0; i < copies.length; i++) {
  3511. copies[i]();
  3512. }
  3513. }
  3514. // Here we have async deferring wrappers using microtasks.
  3515. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3516. // However, it has subtle problems when state is changed right before repaint
  3517. // (e.g. #6813, out-in transitions).
  3518. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3519. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3520. // So we now use microtasks everywhere, again.
  3521. // A major drawback of this tradeoff is that there are some scenarios
  3522. // where microtasks have too high a priority and fire in between supposedly
  3523. // sequential events (e.g. #4521, #6690, which have workarounds)
  3524. // or even between bubbling of the same event (#6566).
  3525. var timerFunc;
  3526. // The nextTick behavior leverages the microtask queue, which can be accessed
  3527. // via either native Promise.then or MutationObserver.
  3528. // MutationObserver has wider support, however it is seriously bugged in
  3529. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3530. // completely stops working after triggering a few times... so, if native
  3531. // Promise is available, we will use it:
  3532. /* istanbul ignore next, $flow-disable-line */
  3533. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3534. var p = Promise.resolve();
  3535. timerFunc = function () {
  3536. p.then(flushCallbacks);
  3537. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3538. // it can get stuck in a weird state where callbacks are pushed into the
  3539. // microtask queue but the queue isn't being flushed, until the browser
  3540. // needs to do some other work, e.g. handle a timer. Therefore we can
  3541. // "force" the microtask queue to be flushed by adding an empty timer.
  3542. if (isIOS) { setTimeout(noop); }
  3543. };
  3544. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3545. isNative(MutationObserver) ||
  3546. // PhantomJS and iOS 7.x
  3547. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3548. )) {
  3549. // Use MutationObserver where native Promise is not available,
  3550. // e.g. PhantomJS, iOS7, Android 4.4
  3551. // (#6466 MutationObserver is unreliable in IE11)
  3552. var counter = 1;
  3553. var observer = new MutationObserver(flushCallbacks);
  3554. var textNode = document.createTextNode(String(counter));
  3555. observer.observe(textNode, {
  3556. characterData: true
  3557. });
  3558. timerFunc = function () {
  3559. counter = (counter + 1) % 2;
  3560. textNode.data = String(counter);
  3561. };
  3562. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3563. // Fallback to setImmediate.
  3564. // Technically it leverages the (macro) task queue,
  3565. // but it is still a better choice than setTimeout.
  3566. timerFunc = function () {
  3567. setImmediate(flushCallbacks);
  3568. };
  3569. } else {
  3570. // Fallback to setTimeout.
  3571. timerFunc = function () {
  3572. setTimeout(flushCallbacks, 0);
  3573. };
  3574. }
  3575. function nextTick (cb, ctx) {
  3576. var _resolve;
  3577. callbacks.push(function () {
  3578. if (cb) {
  3579. try {
  3580. cb.call(ctx);
  3581. } catch (e) {
  3582. handleError(e, ctx, 'nextTick');
  3583. }
  3584. } else if (_resolve) {
  3585. _resolve(ctx);
  3586. }
  3587. });
  3588. if (!pending) {
  3589. pending = true;
  3590. timerFunc();
  3591. }
  3592. // $flow-disable-line
  3593. if (!cb && typeof Promise !== 'undefined') {
  3594. return new Promise(function (resolve) {
  3595. _resolve = resolve;
  3596. })
  3597. }
  3598. }
  3599. /* */
  3600. /* not type checking this file because flow doesn't play well with Proxy */
  3601. var initProxy;
  3602. if (true) {
  3603. var allowedGlobals = makeMap(
  3604. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3605. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3606. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3607. 'require' // for Webpack/Browserify
  3608. );
  3609. var warnNonPresent = function (target, key) {
  3610. warn(
  3611. "Property or method \"" + key + "\" is not defined on the instance but " +
  3612. 'referenced during render. Make sure that this property is reactive, ' +
  3613. 'either in the data option, or for class-based components, by ' +
  3614. 'initializing the property. ' +
  3615. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3616. target
  3617. );
  3618. };
  3619. var warnReservedPrefix = function (target, key) {
  3620. warn(
  3621. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3622. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3623. 'prevent conflicts with Vue internals. ' +
  3624. 'See: https://vuejs.org/v2/api/#data',
  3625. target
  3626. );
  3627. };
  3628. var hasProxy =
  3629. typeof Proxy !== 'undefined' && isNative(Proxy);
  3630. if (hasProxy) {
  3631. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3632. config.keyCodes = new Proxy(config.keyCodes, {
  3633. set: function set (target, key, value) {
  3634. if (isBuiltInModifier(key)) {
  3635. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3636. return false
  3637. } else {
  3638. target[key] = value;
  3639. return true
  3640. }
  3641. }
  3642. });
  3643. }
  3644. var hasHandler = {
  3645. has: function has (target, key) {
  3646. var has = key in target;
  3647. var isAllowed = allowedGlobals(key) ||
  3648. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3649. if (!has && !isAllowed) {
  3650. if (key in target.$data) { warnReservedPrefix(target, key); }
  3651. else { warnNonPresent(target, key); }
  3652. }
  3653. return has || !isAllowed
  3654. }
  3655. };
  3656. var getHandler = {
  3657. get: function get (target, key) {
  3658. if (typeof key === 'string' && !(key in target)) {
  3659. if (key in target.$data) { warnReservedPrefix(target, key); }
  3660. else { warnNonPresent(target, key); }
  3661. }
  3662. return target[key]
  3663. }
  3664. };
  3665. initProxy = function initProxy (vm) {
  3666. if (hasProxy) {
  3667. // determine which proxy handler to use
  3668. var options = vm.$options;
  3669. var handlers = options.render && options.render._withStripped
  3670. ? getHandler
  3671. : hasHandler;
  3672. vm._renderProxy = new Proxy(vm, handlers);
  3673. } else {
  3674. vm._renderProxy = vm;
  3675. }
  3676. };
  3677. }
  3678. /* */
  3679. var seenObjects = new _Set();
  3680. /**
  3681. * Recursively traverse an object to evoke all converted
  3682. * getters, so that every nested property inside the object
  3683. * is collected as a "deep" dependency.
  3684. */
  3685. function traverse (val) {
  3686. _traverse(val, seenObjects);
  3687. seenObjects.clear();
  3688. }
  3689. function _traverse (val, seen) {
  3690. var i, keys;
  3691. var isA = Array.isArray(val);
  3692. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3693. return
  3694. }
  3695. if (val.__ob__) {
  3696. var depId = val.__ob__.dep.id;
  3697. if (seen.has(depId)) {
  3698. return
  3699. }
  3700. seen.add(depId);
  3701. }
  3702. if (isA) {
  3703. i = val.length;
  3704. while (i--) { _traverse(val[i], seen); }
  3705. } else {
  3706. keys = Object.keys(val);
  3707. i = keys.length;
  3708. while (i--) { _traverse(val[keys[i]], seen); }
  3709. }
  3710. }
  3711. var mark;
  3712. var measure;
  3713. if (true) {
  3714. var perf = inBrowser && window.performance;
  3715. /* istanbul ignore if */
  3716. if (
  3717. perf &&
  3718. perf.mark &&
  3719. perf.measure &&
  3720. perf.clearMarks &&
  3721. perf.clearMeasures
  3722. ) {
  3723. mark = function (tag) { return perf.mark(tag); };
  3724. measure = function (name, startTag, endTag) {
  3725. perf.measure(name, startTag, endTag);
  3726. perf.clearMarks(startTag);
  3727. perf.clearMarks(endTag);
  3728. // perf.clearMeasures(name)
  3729. };
  3730. }
  3731. }
  3732. /* */
  3733. var normalizeEvent = cached(function (name) {
  3734. var passive = name.charAt(0) === '&';
  3735. name = passive ? name.slice(1) : name;
  3736. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3737. name = once$$1 ? name.slice(1) : name;
  3738. var capture = name.charAt(0) === '!';
  3739. name = capture ? name.slice(1) : name;
  3740. return {
  3741. name: name,
  3742. once: once$$1,
  3743. capture: capture,
  3744. passive: passive
  3745. }
  3746. });
  3747. function createFnInvoker (fns, vm) {
  3748. function invoker () {
  3749. var arguments$1 = arguments;
  3750. var fns = invoker.fns;
  3751. if (Array.isArray(fns)) {
  3752. var cloned = fns.slice();
  3753. for (var i = 0; i < cloned.length; i++) {
  3754. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3755. }
  3756. } else {
  3757. // return handler return value for single handlers
  3758. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3759. }
  3760. }
  3761. invoker.fns = fns;
  3762. return invoker
  3763. }
  3764. function updateListeners (
  3765. on,
  3766. oldOn,
  3767. add,
  3768. remove$$1,
  3769. createOnceHandler,
  3770. vm
  3771. ) {
  3772. var name, def$$1, cur, old, event;
  3773. for (name in on) {
  3774. def$$1 = cur = on[name];
  3775. old = oldOn[name];
  3776. event = normalizeEvent(name);
  3777. if (isUndef(cur)) {
  3778. true && warn(
  3779. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3780. vm
  3781. );
  3782. } else if (isUndef(old)) {
  3783. if (isUndef(cur.fns)) {
  3784. cur = on[name] = createFnInvoker(cur, vm);
  3785. }
  3786. if (isTrue(event.once)) {
  3787. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3788. }
  3789. add(event.name, cur, event.capture, event.passive, event.params);
  3790. } else if (cur !== old) {
  3791. old.fns = cur;
  3792. on[name] = old;
  3793. }
  3794. }
  3795. for (name in oldOn) {
  3796. if (isUndef(on[name])) {
  3797. event = normalizeEvent(name);
  3798. remove$$1(event.name, oldOn[name], event.capture);
  3799. }
  3800. }
  3801. }
  3802. /* */
  3803. /* */
  3804. // fixed by xxxxxx (mp properties)
  3805. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3806. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3807. if (isUndef(propOptions)) {
  3808. return res
  3809. }
  3810. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3811. var attrs = data.attrs;
  3812. var props = data.props;
  3813. if (isDef(attrs) || isDef(props)) {
  3814. for (var key in propOptions) {
  3815. var altKey = hyphenate(key);
  3816. var result = checkProp(res, props, key, altKey, true) ||
  3817. checkProp(res, attrs, key, altKey, false);
  3818. // externalClass
  3819. if (
  3820. result &&
  3821. res[key] &&
  3822. externalClasses.indexOf(altKey) !== -1 &&
  3823. context[camelize(res[key])]
  3824. ) {
  3825. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3826. res[key] = context[camelize(res[key])];
  3827. }
  3828. }
  3829. }
  3830. return res
  3831. }
  3832. function extractPropsFromVNodeData (
  3833. data,
  3834. Ctor,
  3835. tag,
  3836. context// fixed by xxxxxx
  3837. ) {
  3838. // we are only extracting raw values here.
  3839. // validation and default values are handled in the child
  3840. // component itself.
  3841. var propOptions = Ctor.options.props;
  3842. if (isUndef(propOptions)) {
  3843. // fixed by xxxxxx
  3844. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3845. }
  3846. var res = {};
  3847. var attrs = data.attrs;
  3848. var props = data.props;
  3849. if (isDef(attrs) || isDef(props)) {
  3850. for (var key in propOptions) {
  3851. var altKey = hyphenate(key);
  3852. if (true) {
  3853. var keyInLowerCase = key.toLowerCase();
  3854. if (
  3855. key !== keyInLowerCase &&
  3856. attrs && hasOwn(attrs, keyInLowerCase)
  3857. ) {
  3858. tip(
  3859. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3860. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3861. " \"" + key + "\". " +
  3862. "Note that HTML attributes are case-insensitive and camelCased " +
  3863. "props need to use their kebab-case equivalents when using in-DOM " +
  3864. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3865. );
  3866. }
  3867. }
  3868. checkProp(res, props, key, altKey, true) ||
  3869. checkProp(res, attrs, key, altKey, false);
  3870. }
  3871. }
  3872. // fixed by xxxxxx
  3873. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3874. }
  3875. function checkProp (
  3876. res,
  3877. hash,
  3878. key,
  3879. altKey,
  3880. preserve
  3881. ) {
  3882. if (isDef(hash)) {
  3883. if (hasOwn(hash, key)) {
  3884. res[key] = hash[key];
  3885. if (!preserve) {
  3886. delete hash[key];
  3887. }
  3888. return true
  3889. } else if (hasOwn(hash, altKey)) {
  3890. res[key] = hash[altKey];
  3891. if (!preserve) {
  3892. delete hash[altKey];
  3893. }
  3894. return true
  3895. }
  3896. }
  3897. return false
  3898. }
  3899. /* */
  3900. // The template compiler attempts to minimize the need for normalization by
  3901. // statically analyzing the template at compile time.
  3902. //
  3903. // For plain HTML markup, normalization can be completely skipped because the
  3904. // generated render function is guaranteed to return Array<VNode>. There are
  3905. // two cases where extra normalization is needed:
  3906. // 1. When the children contains components - because a functional component
  3907. // may return an Array instead of a single root. In this case, just a simple
  3908. // normalization is needed - if any child is an Array, we flatten the whole
  3909. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3910. // because functional components already normalize their own children.
  3911. function simpleNormalizeChildren (children) {
  3912. for (var i = 0; i < children.length; i++) {
  3913. if (Array.isArray(children[i])) {
  3914. return Array.prototype.concat.apply([], children)
  3915. }
  3916. }
  3917. return children
  3918. }
  3919. // 2. When the children contains constructs that always generated nested Arrays,
  3920. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3921. // with hand-written render functions / JSX. In such cases a full normalization
  3922. // is needed to cater to all possible types of children values.
  3923. function normalizeChildren (children) {
  3924. return isPrimitive(children)
  3925. ? [createTextVNode(children)]
  3926. : Array.isArray(children)
  3927. ? normalizeArrayChildren(children)
  3928. : undefined
  3929. }
  3930. function isTextNode (node) {
  3931. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3932. }
  3933. function normalizeArrayChildren (children, nestedIndex) {
  3934. var res = [];
  3935. var i, c, lastIndex, last;
  3936. for (i = 0; i < children.length; i++) {
  3937. c = children[i];
  3938. if (isUndef(c) || typeof c === 'boolean') { continue }
  3939. lastIndex = res.length - 1;
  3940. last = res[lastIndex];
  3941. // nested
  3942. if (Array.isArray(c)) {
  3943. if (c.length > 0) {
  3944. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3945. // merge adjacent text nodes
  3946. if (isTextNode(c[0]) && isTextNode(last)) {
  3947. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3948. c.shift();
  3949. }
  3950. res.push.apply(res, c);
  3951. }
  3952. } else if (isPrimitive(c)) {
  3953. if (isTextNode(last)) {
  3954. // merge adjacent text nodes
  3955. // this is necessary for SSR hydration because text nodes are
  3956. // essentially merged when rendered to HTML strings
  3957. res[lastIndex] = createTextVNode(last.text + c);
  3958. } else if (c !== '') {
  3959. // convert primitive to vnode
  3960. res.push(createTextVNode(c));
  3961. }
  3962. } else {
  3963. if (isTextNode(c) && isTextNode(last)) {
  3964. // merge adjacent text nodes
  3965. res[lastIndex] = createTextVNode(last.text + c.text);
  3966. } else {
  3967. // default key for nested array children (likely generated by v-for)
  3968. if (isTrue(children._isVList) &&
  3969. isDef(c.tag) &&
  3970. isUndef(c.key) &&
  3971. isDef(nestedIndex)) {
  3972. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3973. }
  3974. res.push(c);
  3975. }
  3976. }
  3977. }
  3978. return res
  3979. }
  3980. /* */
  3981. function initProvide (vm) {
  3982. var provide = vm.$options.provide;
  3983. if (provide) {
  3984. vm._provided = typeof provide === 'function'
  3985. ? provide.call(vm)
  3986. : provide;
  3987. }
  3988. }
  3989. function initInjections (vm) {
  3990. var result = resolveInject(vm.$options.inject, vm);
  3991. if (result) {
  3992. toggleObserving(false);
  3993. Object.keys(result).forEach(function (key) {
  3994. /* istanbul ignore else */
  3995. if (true) {
  3996. defineReactive$$1(vm, key, result[key], function () {
  3997. warn(
  3998. "Avoid mutating an injected value directly since the changes will be " +
  3999. "overwritten whenever the provided component re-renders. " +
  4000. "injection being mutated: \"" + key + "\"",
  4001. vm
  4002. );
  4003. });
  4004. } else {}
  4005. });
  4006. toggleObserving(true);
  4007. }
  4008. }
  4009. function resolveInject (inject, vm) {
  4010. if (inject) {
  4011. // inject is :any because flow is not smart enough to figure out cached
  4012. var result = Object.create(null);
  4013. var keys = hasSymbol
  4014. ? Reflect.ownKeys(inject)
  4015. : Object.keys(inject);
  4016. for (var i = 0; i < keys.length; i++) {
  4017. var key = keys[i];
  4018. // #6574 in case the inject object is observed...
  4019. if (key === '__ob__') { continue }
  4020. var provideKey = inject[key].from;
  4021. var source = vm;
  4022. while (source) {
  4023. if (source._provided && hasOwn(source._provided, provideKey)) {
  4024. result[key] = source._provided[provideKey];
  4025. break
  4026. }
  4027. source = source.$parent;
  4028. }
  4029. if (!source) {
  4030. if ('default' in inject[key]) {
  4031. var provideDefault = inject[key].default;
  4032. result[key] = typeof provideDefault === 'function'
  4033. ? provideDefault.call(vm)
  4034. : provideDefault;
  4035. } else if (true) {
  4036. warn(("Injection \"" + key + "\" not found"), vm);
  4037. }
  4038. }
  4039. }
  4040. return result
  4041. }
  4042. }
  4043. /* */
  4044. /**
  4045. * Runtime helper for resolving raw children VNodes into a slot object.
  4046. */
  4047. function resolveSlots (
  4048. children,
  4049. context
  4050. ) {
  4051. if (!children || !children.length) {
  4052. return {}
  4053. }
  4054. var slots = {};
  4055. for (var i = 0, l = children.length; i < l; i++) {
  4056. var child = children[i];
  4057. var data = child.data;
  4058. // remove slot attribute if the node is resolved as a Vue slot node
  4059. if (data && data.attrs && data.attrs.slot) {
  4060. delete data.attrs.slot;
  4061. }
  4062. // named slots should only be respected if the vnode was rendered in the
  4063. // same context.
  4064. if ((child.context === context || child.fnContext === context) &&
  4065. data && data.slot != null
  4066. ) {
  4067. var name = data.slot;
  4068. var slot = (slots[name] || (slots[name] = []));
  4069. if (child.tag === 'template') {
  4070. slot.push.apply(slot, child.children || []);
  4071. } else {
  4072. slot.push(child);
  4073. }
  4074. } else {
  4075. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4076. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4077. (slots['page'] || (slots['page'] = [])).push(child);
  4078. }else{
  4079. (slots.default || (slots.default = [])).push(child);
  4080. }
  4081. }
  4082. }
  4083. // ignore slots that contains only whitespace
  4084. for (var name$1 in slots) {
  4085. if (slots[name$1].every(isWhitespace)) {
  4086. delete slots[name$1];
  4087. }
  4088. }
  4089. return slots
  4090. }
  4091. function isWhitespace (node) {
  4092. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4093. }
  4094. /* */
  4095. function normalizeScopedSlots (
  4096. slots,
  4097. normalSlots,
  4098. prevSlots
  4099. ) {
  4100. var res;
  4101. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4102. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4103. var key = slots && slots.$key;
  4104. if (!slots) {
  4105. res = {};
  4106. } else if (slots._normalized) {
  4107. // fast path 1: child component re-render only, parent did not change
  4108. return slots._normalized
  4109. } else if (
  4110. isStable &&
  4111. prevSlots &&
  4112. prevSlots !== emptyObject &&
  4113. key === prevSlots.$key &&
  4114. !hasNormalSlots &&
  4115. !prevSlots.$hasNormal
  4116. ) {
  4117. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4118. // only need to normalize once
  4119. return prevSlots
  4120. } else {
  4121. res = {};
  4122. for (var key$1 in slots) {
  4123. if (slots[key$1] && key$1[0] !== '$') {
  4124. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4125. }
  4126. }
  4127. }
  4128. // expose normal slots on scopedSlots
  4129. for (var key$2 in normalSlots) {
  4130. if (!(key$2 in res)) {
  4131. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4132. }
  4133. }
  4134. // avoriaz seems to mock a non-extensible $scopedSlots object
  4135. // and when that is passed down this would cause an error
  4136. if (slots && Object.isExtensible(slots)) {
  4137. (slots)._normalized = res;
  4138. }
  4139. def(res, '$stable', isStable);
  4140. def(res, '$key', key);
  4141. def(res, '$hasNormal', hasNormalSlots);
  4142. return res
  4143. }
  4144. function normalizeScopedSlot(normalSlots, key, fn) {
  4145. var normalized = function () {
  4146. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4147. res = res && typeof res === 'object' && !Array.isArray(res)
  4148. ? [res] // single vnode
  4149. : normalizeChildren(res);
  4150. return res && (
  4151. res.length === 0 ||
  4152. (res.length === 1 && res[0].isComment) // #9658
  4153. ) ? undefined
  4154. : res
  4155. };
  4156. // this is a slot using the new v-slot syntax without scope. although it is
  4157. // compiled as a scoped slot, render fn users would expect it to be present
  4158. // on this.$slots because the usage is semantically a normal slot.
  4159. if (fn.proxy) {
  4160. Object.defineProperty(normalSlots, key, {
  4161. get: normalized,
  4162. enumerable: true,
  4163. configurable: true
  4164. });
  4165. }
  4166. return normalized
  4167. }
  4168. function proxyNormalSlot(slots, key) {
  4169. return function () { return slots[key]; }
  4170. }
  4171. /* */
  4172. /**
  4173. * Runtime helper for rendering v-for lists.
  4174. */
  4175. function renderList (
  4176. val,
  4177. render
  4178. ) {
  4179. var ret, i, l, keys, key;
  4180. if (Array.isArray(val) || typeof val === 'string') {
  4181. ret = new Array(val.length);
  4182. for (i = 0, l = val.length; i < l; i++) {
  4183. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4184. }
  4185. } else if (typeof val === 'number') {
  4186. ret = new Array(val);
  4187. for (i = 0; i < val; i++) {
  4188. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4189. }
  4190. } else if (isObject(val)) {
  4191. if (hasSymbol && val[Symbol.iterator]) {
  4192. ret = [];
  4193. var iterator = val[Symbol.iterator]();
  4194. var result = iterator.next();
  4195. while (!result.done) {
  4196. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4197. result = iterator.next();
  4198. }
  4199. } else {
  4200. keys = Object.keys(val);
  4201. ret = new Array(keys.length);
  4202. for (i = 0, l = keys.length; i < l; i++) {
  4203. key = keys[i];
  4204. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4205. }
  4206. }
  4207. }
  4208. if (!isDef(ret)) {
  4209. ret = [];
  4210. }
  4211. (ret)._isVList = true;
  4212. return ret
  4213. }
  4214. /* */
  4215. /**
  4216. * Runtime helper for rendering <slot>
  4217. */
  4218. function renderSlot (
  4219. name,
  4220. fallback,
  4221. props,
  4222. bindObject
  4223. ) {
  4224. var scopedSlotFn = this.$scopedSlots[name];
  4225. var nodes;
  4226. if (scopedSlotFn) { // scoped slot
  4227. props = props || {};
  4228. if (bindObject) {
  4229. if ( true && !isObject(bindObject)) {
  4230. warn(
  4231. 'slot v-bind without argument expects an Object',
  4232. this
  4233. );
  4234. }
  4235. props = extend(extend({}, bindObject), props);
  4236. }
  4237. // fixed by xxxxxx app-plus scopedSlot
  4238. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4239. } else {
  4240. nodes = this.$slots[name] || fallback;
  4241. }
  4242. var target = props && props.slot;
  4243. if (target) {
  4244. return this.$createElement('template', { slot: target }, nodes)
  4245. } else {
  4246. return nodes
  4247. }
  4248. }
  4249. /* */
  4250. /**
  4251. * Runtime helper for resolving filters
  4252. */
  4253. function resolveFilter (id) {
  4254. return resolveAsset(this.$options, 'filters', id, true) || identity
  4255. }
  4256. /* */
  4257. function isKeyNotMatch (expect, actual) {
  4258. if (Array.isArray(expect)) {
  4259. return expect.indexOf(actual) === -1
  4260. } else {
  4261. return expect !== actual
  4262. }
  4263. }
  4264. /**
  4265. * Runtime helper for checking keyCodes from config.
  4266. * exposed as Vue.prototype._k
  4267. * passing in eventKeyName as last argument separately for backwards compat
  4268. */
  4269. function checkKeyCodes (
  4270. eventKeyCode,
  4271. key,
  4272. builtInKeyCode,
  4273. eventKeyName,
  4274. builtInKeyName
  4275. ) {
  4276. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4277. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4278. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4279. } else if (mappedKeyCode) {
  4280. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4281. } else if (eventKeyName) {
  4282. return hyphenate(eventKeyName) !== key
  4283. }
  4284. }
  4285. /* */
  4286. /**
  4287. * Runtime helper for merging v-bind="object" into a VNode's data.
  4288. */
  4289. function bindObjectProps (
  4290. data,
  4291. tag,
  4292. value,
  4293. asProp,
  4294. isSync
  4295. ) {
  4296. if (value) {
  4297. if (!isObject(value)) {
  4298. true && warn(
  4299. 'v-bind without argument expects an Object or Array value',
  4300. this
  4301. );
  4302. } else {
  4303. if (Array.isArray(value)) {
  4304. value = toObject(value);
  4305. }
  4306. var hash;
  4307. var loop = function ( key ) {
  4308. if (
  4309. key === 'class' ||
  4310. key === 'style' ||
  4311. isReservedAttribute(key)
  4312. ) {
  4313. hash = data;
  4314. } else {
  4315. var type = data.attrs && data.attrs.type;
  4316. hash = asProp || config.mustUseProp(tag, type, key)
  4317. ? data.domProps || (data.domProps = {})
  4318. : data.attrs || (data.attrs = {});
  4319. }
  4320. var camelizedKey = camelize(key);
  4321. var hyphenatedKey = hyphenate(key);
  4322. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4323. hash[key] = value[key];
  4324. if (isSync) {
  4325. var on = data.on || (data.on = {});
  4326. on[("update:" + key)] = function ($event) {
  4327. value[key] = $event;
  4328. };
  4329. }
  4330. }
  4331. };
  4332. for (var key in value) loop( key );
  4333. }
  4334. }
  4335. return data
  4336. }
  4337. /* */
  4338. /**
  4339. * Runtime helper for rendering static trees.
  4340. */
  4341. function renderStatic (
  4342. index,
  4343. isInFor
  4344. ) {
  4345. var cached = this._staticTrees || (this._staticTrees = []);
  4346. var tree = cached[index];
  4347. // if has already-rendered static tree and not inside v-for,
  4348. // we can reuse the same tree.
  4349. if (tree && !isInFor) {
  4350. return tree
  4351. }
  4352. // otherwise, render a fresh tree.
  4353. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4354. this._renderProxy,
  4355. null,
  4356. this // for render fns generated for functional component templates
  4357. );
  4358. markStatic(tree, ("__static__" + index), false);
  4359. return tree
  4360. }
  4361. /**
  4362. * Runtime helper for v-once.
  4363. * Effectively it means marking the node as static with a unique key.
  4364. */
  4365. function markOnce (
  4366. tree,
  4367. index,
  4368. key
  4369. ) {
  4370. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4371. return tree
  4372. }
  4373. function markStatic (
  4374. tree,
  4375. key,
  4376. isOnce
  4377. ) {
  4378. if (Array.isArray(tree)) {
  4379. for (var i = 0; i < tree.length; i++) {
  4380. if (tree[i] && typeof tree[i] !== 'string') {
  4381. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4382. }
  4383. }
  4384. } else {
  4385. markStaticNode(tree, key, isOnce);
  4386. }
  4387. }
  4388. function markStaticNode (node, key, isOnce) {
  4389. node.isStatic = true;
  4390. node.key = key;
  4391. node.isOnce = isOnce;
  4392. }
  4393. /* */
  4394. function bindObjectListeners (data, value) {
  4395. if (value) {
  4396. if (!isPlainObject(value)) {
  4397. true && warn(
  4398. 'v-on without argument expects an Object value',
  4399. this
  4400. );
  4401. } else {
  4402. var on = data.on = data.on ? extend({}, data.on) : {};
  4403. for (var key in value) {
  4404. var existing = on[key];
  4405. var ours = value[key];
  4406. on[key] = existing ? [].concat(existing, ours) : ours;
  4407. }
  4408. }
  4409. }
  4410. return data
  4411. }
  4412. /* */
  4413. function resolveScopedSlots (
  4414. fns, // see flow/vnode
  4415. res,
  4416. // the following are added in 2.6
  4417. hasDynamicKeys,
  4418. contentHashKey
  4419. ) {
  4420. res = res || { $stable: !hasDynamicKeys };
  4421. for (var i = 0; i < fns.length; i++) {
  4422. var slot = fns[i];
  4423. if (Array.isArray(slot)) {
  4424. resolveScopedSlots(slot, res, hasDynamicKeys);
  4425. } else if (slot) {
  4426. // marker for reverse proxying v-slot without scope on this.$slots
  4427. if (slot.proxy) {
  4428. slot.fn.proxy = true;
  4429. }
  4430. res[slot.key] = slot.fn;
  4431. }
  4432. }
  4433. if (contentHashKey) {
  4434. (res).$key = contentHashKey;
  4435. }
  4436. return res
  4437. }
  4438. /* */
  4439. function bindDynamicKeys (baseObj, values) {
  4440. for (var i = 0; i < values.length; i += 2) {
  4441. var key = values[i];
  4442. if (typeof key === 'string' && key) {
  4443. baseObj[values[i]] = values[i + 1];
  4444. } else if ( true && key !== '' && key !== null) {
  4445. // null is a special value for explicitly removing a binding
  4446. warn(
  4447. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4448. this
  4449. );
  4450. }
  4451. }
  4452. return baseObj
  4453. }
  4454. // helper to dynamically append modifier runtime markers to event names.
  4455. // ensure only append when value is already string, otherwise it will be cast
  4456. // to string and cause the type check to miss.
  4457. function prependModifier (value, symbol) {
  4458. return typeof value === 'string' ? symbol + value : value
  4459. }
  4460. /* */
  4461. function installRenderHelpers (target) {
  4462. target._o = markOnce;
  4463. target._n = toNumber;
  4464. target._s = toString;
  4465. target._l = renderList;
  4466. target._t = renderSlot;
  4467. target._q = looseEqual;
  4468. target._i = looseIndexOf;
  4469. target._m = renderStatic;
  4470. target._f = resolveFilter;
  4471. target._k = checkKeyCodes;
  4472. target._b = bindObjectProps;
  4473. target._v = createTextVNode;
  4474. target._e = createEmptyVNode;
  4475. target._u = resolveScopedSlots;
  4476. target._g = bindObjectListeners;
  4477. target._d = bindDynamicKeys;
  4478. target._p = prependModifier;
  4479. }
  4480. /* */
  4481. function FunctionalRenderContext (
  4482. data,
  4483. props,
  4484. children,
  4485. parent,
  4486. Ctor
  4487. ) {
  4488. var this$1 = this;
  4489. var options = Ctor.options;
  4490. // ensure the createElement function in functional components
  4491. // gets a unique context - this is necessary for correct named slot check
  4492. var contextVm;
  4493. if (hasOwn(parent, '_uid')) {
  4494. contextVm = Object.create(parent);
  4495. // $flow-disable-line
  4496. contextVm._original = parent;
  4497. } else {
  4498. // the context vm passed in is a functional context as well.
  4499. // in this case we want to make sure we are able to get a hold to the
  4500. // real context instance.
  4501. contextVm = parent;
  4502. // $flow-disable-line
  4503. parent = parent._original;
  4504. }
  4505. var isCompiled = isTrue(options._compiled);
  4506. var needNormalization = !isCompiled;
  4507. this.data = data;
  4508. this.props = props;
  4509. this.children = children;
  4510. this.parent = parent;
  4511. this.listeners = data.on || emptyObject;
  4512. this.injections = resolveInject(options.inject, parent);
  4513. this.slots = function () {
  4514. if (!this$1.$slots) {
  4515. normalizeScopedSlots(
  4516. data.scopedSlots,
  4517. this$1.$slots = resolveSlots(children, parent)
  4518. );
  4519. }
  4520. return this$1.$slots
  4521. };
  4522. Object.defineProperty(this, 'scopedSlots', ({
  4523. enumerable: true,
  4524. get: function get () {
  4525. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4526. }
  4527. }));
  4528. // support for compiled functional template
  4529. if (isCompiled) {
  4530. // exposing $options for renderStatic()
  4531. this.$options = options;
  4532. // pre-resolve slots for renderSlot()
  4533. this.$slots = this.slots();
  4534. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4535. }
  4536. if (options._scopeId) {
  4537. this._c = function (a, b, c, d) {
  4538. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4539. if (vnode && !Array.isArray(vnode)) {
  4540. vnode.fnScopeId = options._scopeId;
  4541. vnode.fnContext = parent;
  4542. }
  4543. return vnode
  4544. };
  4545. } else {
  4546. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4547. }
  4548. }
  4549. installRenderHelpers(FunctionalRenderContext.prototype);
  4550. function createFunctionalComponent (
  4551. Ctor,
  4552. propsData,
  4553. data,
  4554. contextVm,
  4555. children
  4556. ) {
  4557. var options = Ctor.options;
  4558. var props = {};
  4559. var propOptions = options.props;
  4560. if (isDef(propOptions)) {
  4561. for (var key in propOptions) {
  4562. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4563. }
  4564. } else {
  4565. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4566. if (isDef(data.props)) { mergeProps(props, data.props); }
  4567. }
  4568. var renderContext = new FunctionalRenderContext(
  4569. data,
  4570. props,
  4571. children,
  4572. contextVm,
  4573. Ctor
  4574. );
  4575. var vnode = options.render.call(null, renderContext._c, renderContext);
  4576. if (vnode instanceof VNode) {
  4577. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4578. } else if (Array.isArray(vnode)) {
  4579. var vnodes = normalizeChildren(vnode) || [];
  4580. var res = new Array(vnodes.length);
  4581. for (var i = 0; i < vnodes.length; i++) {
  4582. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4583. }
  4584. return res
  4585. }
  4586. }
  4587. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4588. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4589. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4590. // that should not be matched to match.
  4591. var clone = cloneVNode(vnode);
  4592. clone.fnContext = contextVm;
  4593. clone.fnOptions = options;
  4594. if (true) {
  4595. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4596. }
  4597. if (data.slot) {
  4598. (clone.data || (clone.data = {})).slot = data.slot;
  4599. }
  4600. return clone
  4601. }
  4602. function mergeProps (to, from) {
  4603. for (var key in from) {
  4604. to[camelize(key)] = from[key];
  4605. }
  4606. }
  4607. /* */
  4608. /* */
  4609. /* */
  4610. /* */
  4611. // inline hooks to be invoked on component VNodes during patch
  4612. var componentVNodeHooks = {
  4613. init: function init (vnode, hydrating) {
  4614. if (
  4615. vnode.componentInstance &&
  4616. !vnode.componentInstance._isDestroyed &&
  4617. vnode.data.keepAlive
  4618. ) {
  4619. // kept-alive components, treat as a patch
  4620. var mountedNode = vnode; // work around flow
  4621. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4622. } else {
  4623. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4624. vnode,
  4625. activeInstance
  4626. );
  4627. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4628. }
  4629. },
  4630. prepatch: function prepatch (oldVnode, vnode) {
  4631. var options = vnode.componentOptions;
  4632. var child = vnode.componentInstance = oldVnode.componentInstance;
  4633. updateChildComponent(
  4634. child,
  4635. options.propsData, // updated props
  4636. options.listeners, // updated listeners
  4637. vnode, // new parent vnode
  4638. options.children // new children
  4639. );
  4640. },
  4641. insert: function insert (vnode) {
  4642. var context = vnode.context;
  4643. var componentInstance = vnode.componentInstance;
  4644. if (!componentInstance._isMounted) {
  4645. callHook(componentInstance, 'onServiceCreated');
  4646. callHook(componentInstance, 'onServiceAttached');
  4647. componentInstance._isMounted = true;
  4648. callHook(componentInstance, 'mounted');
  4649. }
  4650. if (vnode.data.keepAlive) {
  4651. if (context._isMounted) {
  4652. // vue-router#1212
  4653. // During updates, a kept-alive component's child components may
  4654. // change, so directly walking the tree here may call activated hooks
  4655. // on incorrect children. Instead we push them into a queue which will
  4656. // be processed after the whole patch process ended.
  4657. queueActivatedComponent(componentInstance);
  4658. } else {
  4659. activateChildComponent(componentInstance, true /* direct */);
  4660. }
  4661. }
  4662. },
  4663. destroy: function destroy (vnode) {
  4664. var componentInstance = vnode.componentInstance;
  4665. if (!componentInstance._isDestroyed) {
  4666. if (!vnode.data.keepAlive) {
  4667. componentInstance.$destroy();
  4668. } else {
  4669. deactivateChildComponent(componentInstance, true /* direct */);
  4670. }
  4671. }
  4672. }
  4673. };
  4674. var hooksToMerge = Object.keys(componentVNodeHooks);
  4675. function createComponent (
  4676. Ctor,
  4677. data,
  4678. context,
  4679. children,
  4680. tag
  4681. ) {
  4682. if (isUndef(Ctor)) {
  4683. return
  4684. }
  4685. var baseCtor = context.$options._base;
  4686. // plain options object: turn it into a constructor
  4687. if (isObject(Ctor)) {
  4688. Ctor = baseCtor.extend(Ctor);
  4689. }
  4690. // if at this stage it's not a constructor or an async component factory,
  4691. // reject.
  4692. if (typeof Ctor !== 'function') {
  4693. if (true) {
  4694. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4695. }
  4696. return
  4697. }
  4698. // async component
  4699. var asyncFactory;
  4700. if (isUndef(Ctor.cid)) {
  4701. asyncFactory = Ctor;
  4702. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4703. if (Ctor === undefined) {
  4704. // return a placeholder node for async component, which is rendered
  4705. // as a comment node but preserves all the raw information for the node.
  4706. // the information will be used for async server-rendering and hydration.
  4707. return createAsyncPlaceholder(
  4708. asyncFactory,
  4709. data,
  4710. context,
  4711. children,
  4712. tag
  4713. )
  4714. }
  4715. }
  4716. data = data || {};
  4717. // resolve constructor options in case global mixins are applied after
  4718. // component constructor creation
  4719. resolveConstructorOptions(Ctor);
  4720. // transform component v-model data into props & events
  4721. if (isDef(data.model)) {
  4722. transformModel(Ctor.options, data);
  4723. }
  4724. // extract props
  4725. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4726. // functional component
  4727. if (isTrue(Ctor.options.functional)) {
  4728. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4729. }
  4730. // extract listeners, since these needs to be treated as
  4731. // child component listeners instead of DOM listeners
  4732. var listeners = data.on;
  4733. // replace with listeners with .native modifier
  4734. // so it gets processed during parent component patch.
  4735. data.on = data.nativeOn;
  4736. if (isTrue(Ctor.options.abstract)) {
  4737. // abstract components do not keep anything
  4738. // other than props & listeners & slot
  4739. // work around flow
  4740. var slot = data.slot;
  4741. data = {};
  4742. if (slot) {
  4743. data.slot = slot;
  4744. }
  4745. }
  4746. // install component management hooks onto the placeholder node
  4747. installComponentHooks(data);
  4748. // return a placeholder vnode
  4749. var name = Ctor.options.name || tag;
  4750. var vnode = new VNode(
  4751. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4752. data, undefined, undefined, undefined, context,
  4753. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4754. asyncFactory
  4755. );
  4756. return vnode
  4757. }
  4758. function createComponentInstanceForVnode (
  4759. vnode, // we know it's MountedComponentVNode but flow doesn't
  4760. parent // activeInstance in lifecycle state
  4761. ) {
  4762. var options = {
  4763. _isComponent: true,
  4764. _parentVnode: vnode,
  4765. parent: parent
  4766. };
  4767. // check inline-template render functions
  4768. var inlineTemplate = vnode.data.inlineTemplate;
  4769. if (isDef(inlineTemplate)) {
  4770. options.render = inlineTemplate.render;
  4771. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4772. }
  4773. return new vnode.componentOptions.Ctor(options)
  4774. }
  4775. function installComponentHooks (data) {
  4776. var hooks = data.hook || (data.hook = {});
  4777. for (var i = 0; i < hooksToMerge.length; i++) {
  4778. var key = hooksToMerge[i];
  4779. var existing = hooks[key];
  4780. var toMerge = componentVNodeHooks[key];
  4781. if (existing !== toMerge && !(existing && existing._merged)) {
  4782. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4783. }
  4784. }
  4785. }
  4786. function mergeHook$1 (f1, f2) {
  4787. var merged = function (a, b) {
  4788. // flow complains about extra args which is why we use any
  4789. f1(a, b);
  4790. f2(a, b);
  4791. };
  4792. merged._merged = true;
  4793. return merged
  4794. }
  4795. // transform component v-model info (value and callback) into
  4796. // prop and event handler respectively.
  4797. function transformModel (options, data) {
  4798. var prop = (options.model && options.model.prop) || 'value';
  4799. var event = (options.model && options.model.event) || 'input'
  4800. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4801. var on = data.on || (data.on = {});
  4802. var existing = on[event];
  4803. var callback = data.model.callback;
  4804. if (isDef(existing)) {
  4805. if (
  4806. Array.isArray(existing)
  4807. ? existing.indexOf(callback) === -1
  4808. : existing !== callback
  4809. ) {
  4810. on[event] = [callback].concat(existing);
  4811. }
  4812. } else {
  4813. on[event] = callback;
  4814. }
  4815. }
  4816. /* */
  4817. var SIMPLE_NORMALIZE = 1;
  4818. var ALWAYS_NORMALIZE = 2;
  4819. // wrapper function for providing a more flexible interface
  4820. // without getting yelled at by flow
  4821. function createElement (
  4822. context,
  4823. tag,
  4824. data,
  4825. children,
  4826. normalizationType,
  4827. alwaysNormalize
  4828. ) {
  4829. if (Array.isArray(data) || isPrimitive(data)) {
  4830. normalizationType = children;
  4831. children = data;
  4832. data = undefined;
  4833. }
  4834. if (isTrue(alwaysNormalize)) {
  4835. normalizationType = ALWAYS_NORMALIZE;
  4836. }
  4837. return _createElement(context, tag, data, children, normalizationType)
  4838. }
  4839. function _createElement (
  4840. context,
  4841. tag,
  4842. data,
  4843. children,
  4844. normalizationType
  4845. ) {
  4846. if (isDef(data) && isDef((data).__ob__)) {
  4847. true && warn(
  4848. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4849. 'Always create fresh vnode data objects in each render!',
  4850. context
  4851. );
  4852. return createEmptyVNode()
  4853. }
  4854. // object syntax in v-bind
  4855. if (isDef(data) && isDef(data.is)) {
  4856. tag = data.is;
  4857. }
  4858. if (!tag) {
  4859. // in case of component :is set to falsy value
  4860. return createEmptyVNode()
  4861. }
  4862. // warn against non-primitive key
  4863. if ( true &&
  4864. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4865. ) {
  4866. {
  4867. warn(
  4868. 'Avoid using non-primitive value as key, ' +
  4869. 'use string/number value instead.',
  4870. context
  4871. );
  4872. }
  4873. }
  4874. // support single function children as default scoped slot
  4875. if (Array.isArray(children) &&
  4876. typeof children[0] === 'function'
  4877. ) {
  4878. data = data || {};
  4879. data.scopedSlots = { default: children[0] };
  4880. children.length = 0;
  4881. }
  4882. if (normalizationType === ALWAYS_NORMALIZE) {
  4883. children = normalizeChildren(children);
  4884. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4885. children = simpleNormalizeChildren(children);
  4886. }
  4887. var vnode, ns;
  4888. if (typeof tag === 'string') {
  4889. var Ctor;
  4890. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4891. if (config.isReservedTag(tag)) {
  4892. // platform built-in elements
  4893. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4894. warn(
  4895. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4896. context
  4897. );
  4898. }
  4899. vnode = new VNode(
  4900. config.parsePlatformTagName(tag), data, children,
  4901. undefined, undefined, context
  4902. );
  4903. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4904. // component
  4905. vnode = createComponent(Ctor, data, context, children, tag);
  4906. } else {
  4907. // unknown or unlisted namespaced elements
  4908. // check at runtime because it may get assigned a namespace when its
  4909. // parent normalizes children
  4910. vnode = new VNode(
  4911. tag, data, children,
  4912. undefined, undefined, context
  4913. );
  4914. }
  4915. } else {
  4916. // direct component options / constructor
  4917. vnode = createComponent(tag, data, context, children);
  4918. }
  4919. if (Array.isArray(vnode)) {
  4920. return vnode
  4921. } else if (isDef(vnode)) {
  4922. if (isDef(ns)) { applyNS(vnode, ns); }
  4923. if (isDef(data)) { registerDeepBindings(data); }
  4924. return vnode
  4925. } else {
  4926. return createEmptyVNode()
  4927. }
  4928. }
  4929. function applyNS (vnode, ns, force) {
  4930. vnode.ns = ns;
  4931. if (vnode.tag === 'foreignObject') {
  4932. // use default namespace inside foreignObject
  4933. ns = undefined;
  4934. force = true;
  4935. }
  4936. if (isDef(vnode.children)) {
  4937. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4938. var child = vnode.children[i];
  4939. if (isDef(child.tag) && (
  4940. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4941. applyNS(child, ns, force);
  4942. }
  4943. }
  4944. }
  4945. }
  4946. // ref #5318
  4947. // necessary to ensure parent re-render when deep bindings like :style and
  4948. // :class are used on slot nodes
  4949. function registerDeepBindings (data) {
  4950. if (isObject(data.style)) {
  4951. traverse(data.style);
  4952. }
  4953. if (isObject(data.class)) {
  4954. traverse(data.class);
  4955. }
  4956. }
  4957. /* */
  4958. function initRender (vm) {
  4959. vm._vnode = null; // the root of the child tree
  4960. vm._staticTrees = null; // v-once cached trees
  4961. var options = vm.$options;
  4962. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4963. var renderContext = parentVnode && parentVnode.context;
  4964. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4965. vm.$scopedSlots = emptyObject;
  4966. // bind the createElement fn to this instance
  4967. // so that we get proper render context inside it.
  4968. // args order: tag, data, children, normalizationType, alwaysNormalize
  4969. // internal version is used by render functions compiled from templates
  4970. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4971. // normalization is always applied for the public version, used in
  4972. // user-written render functions.
  4973. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4974. // $attrs & $listeners are exposed for easier HOC creation.
  4975. // they need to be reactive so that HOCs using them are always updated
  4976. var parentData = parentVnode && parentVnode.data;
  4977. /* istanbul ignore else */
  4978. if (true) {
  4979. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4980. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4981. }, true);
  4982. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4983. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4984. }, true);
  4985. } else {}
  4986. }
  4987. var currentRenderingInstance = null;
  4988. function renderMixin (Vue) {
  4989. // install runtime convenience helpers
  4990. installRenderHelpers(Vue.prototype);
  4991. Vue.prototype.$nextTick = function (fn) {
  4992. return nextTick(fn, this)
  4993. };
  4994. Vue.prototype._render = function () {
  4995. var vm = this;
  4996. var ref = vm.$options;
  4997. var render = ref.render;
  4998. var _parentVnode = ref._parentVnode;
  4999. if (_parentVnode) {
  5000. vm.$scopedSlots = normalizeScopedSlots(
  5001. _parentVnode.data.scopedSlots,
  5002. vm.$slots,
  5003. vm.$scopedSlots
  5004. );
  5005. }
  5006. // set parent vnode. this allows render functions to have access
  5007. // to the data on the placeholder node.
  5008. vm.$vnode = _parentVnode;
  5009. // render self
  5010. var vnode;
  5011. try {
  5012. // There's no need to maintain a stack because all render fns are called
  5013. // separately from one another. Nested component's render fns are called
  5014. // when parent component is patched.
  5015. currentRenderingInstance = vm;
  5016. vnode = render.call(vm._renderProxy, vm.$createElement);
  5017. } catch (e) {
  5018. handleError(e, vm, "render");
  5019. // return error render result,
  5020. // or previous vnode to prevent render error causing blank component
  5021. /* istanbul ignore else */
  5022. if ( true && vm.$options.renderError) {
  5023. try {
  5024. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5025. } catch (e) {
  5026. handleError(e, vm, "renderError");
  5027. vnode = vm._vnode;
  5028. }
  5029. } else {
  5030. vnode = vm._vnode;
  5031. }
  5032. } finally {
  5033. currentRenderingInstance = null;
  5034. }
  5035. // if the returned array contains only a single node, allow it
  5036. if (Array.isArray(vnode) && vnode.length === 1) {
  5037. vnode = vnode[0];
  5038. }
  5039. // return empty vnode in case the render function errored out
  5040. if (!(vnode instanceof VNode)) {
  5041. if ( true && Array.isArray(vnode)) {
  5042. warn(
  5043. 'Multiple root nodes returned from render function. Render function ' +
  5044. 'should return a single root node.',
  5045. vm
  5046. );
  5047. }
  5048. vnode = createEmptyVNode();
  5049. }
  5050. // set parent
  5051. vnode.parent = _parentVnode;
  5052. return vnode
  5053. };
  5054. }
  5055. /* */
  5056. function ensureCtor (comp, base) {
  5057. if (
  5058. comp.__esModule ||
  5059. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5060. ) {
  5061. comp = comp.default;
  5062. }
  5063. return isObject(comp)
  5064. ? base.extend(comp)
  5065. : comp
  5066. }
  5067. function createAsyncPlaceholder (
  5068. factory,
  5069. data,
  5070. context,
  5071. children,
  5072. tag
  5073. ) {
  5074. var node = createEmptyVNode();
  5075. node.asyncFactory = factory;
  5076. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5077. return node
  5078. }
  5079. function resolveAsyncComponent (
  5080. factory,
  5081. baseCtor
  5082. ) {
  5083. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5084. return factory.errorComp
  5085. }
  5086. if (isDef(factory.resolved)) {
  5087. return factory.resolved
  5088. }
  5089. var owner = currentRenderingInstance;
  5090. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5091. // already pending
  5092. factory.owners.push(owner);
  5093. }
  5094. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5095. return factory.loadingComp
  5096. }
  5097. if (owner && !isDef(factory.owners)) {
  5098. var owners = factory.owners = [owner];
  5099. var sync = true;
  5100. var timerLoading = null;
  5101. var timerTimeout = null
  5102. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5103. var forceRender = function (renderCompleted) {
  5104. for (var i = 0, l = owners.length; i < l; i++) {
  5105. (owners[i]).$forceUpdate();
  5106. }
  5107. if (renderCompleted) {
  5108. owners.length = 0;
  5109. if (timerLoading !== null) {
  5110. clearTimeout(timerLoading);
  5111. timerLoading = null;
  5112. }
  5113. if (timerTimeout !== null) {
  5114. clearTimeout(timerTimeout);
  5115. timerTimeout = null;
  5116. }
  5117. }
  5118. };
  5119. var resolve = once(function (res) {
  5120. // cache resolved
  5121. factory.resolved = ensureCtor(res, baseCtor);
  5122. // invoke callbacks only if this is not a synchronous resolve
  5123. // (async resolves are shimmed as synchronous during SSR)
  5124. if (!sync) {
  5125. forceRender(true);
  5126. } else {
  5127. owners.length = 0;
  5128. }
  5129. });
  5130. var reject = once(function (reason) {
  5131. true && warn(
  5132. "Failed to resolve async component: " + (String(factory)) +
  5133. (reason ? ("\nReason: " + reason) : '')
  5134. );
  5135. if (isDef(factory.errorComp)) {
  5136. factory.error = true;
  5137. forceRender(true);
  5138. }
  5139. });
  5140. var res = factory(resolve, reject);
  5141. if (isObject(res)) {
  5142. if (isPromise(res)) {
  5143. // () => Promise
  5144. if (isUndef(factory.resolved)) {
  5145. res.then(resolve, reject);
  5146. }
  5147. } else if (isPromise(res.component)) {
  5148. res.component.then(resolve, reject);
  5149. if (isDef(res.error)) {
  5150. factory.errorComp = ensureCtor(res.error, baseCtor);
  5151. }
  5152. if (isDef(res.loading)) {
  5153. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5154. if (res.delay === 0) {
  5155. factory.loading = true;
  5156. } else {
  5157. timerLoading = setTimeout(function () {
  5158. timerLoading = null;
  5159. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5160. factory.loading = true;
  5161. forceRender(false);
  5162. }
  5163. }, res.delay || 200);
  5164. }
  5165. }
  5166. if (isDef(res.timeout)) {
  5167. timerTimeout = setTimeout(function () {
  5168. timerTimeout = null;
  5169. if (isUndef(factory.resolved)) {
  5170. reject(
  5171. true
  5172. ? ("timeout (" + (res.timeout) + "ms)")
  5173. : undefined
  5174. );
  5175. }
  5176. }, res.timeout);
  5177. }
  5178. }
  5179. }
  5180. sync = false;
  5181. // return in case resolved synchronously
  5182. return factory.loading
  5183. ? factory.loadingComp
  5184. : factory.resolved
  5185. }
  5186. }
  5187. /* */
  5188. function isAsyncPlaceholder (node) {
  5189. return node.isComment && node.asyncFactory
  5190. }
  5191. /* */
  5192. function getFirstComponentChild (children) {
  5193. if (Array.isArray(children)) {
  5194. for (var i = 0; i < children.length; i++) {
  5195. var c = children[i];
  5196. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5197. return c
  5198. }
  5199. }
  5200. }
  5201. }
  5202. /* */
  5203. /* */
  5204. function initEvents (vm) {
  5205. vm._events = Object.create(null);
  5206. vm._hasHookEvent = false;
  5207. // init parent attached events
  5208. var listeners = vm.$options._parentListeners;
  5209. if (listeners) {
  5210. updateComponentListeners(vm, listeners);
  5211. }
  5212. }
  5213. var target;
  5214. function add (event, fn) {
  5215. target.$on(event, fn);
  5216. }
  5217. function remove$1 (event, fn) {
  5218. target.$off(event, fn);
  5219. }
  5220. function createOnceHandler (event, fn) {
  5221. var _target = target;
  5222. return function onceHandler () {
  5223. var res = fn.apply(null, arguments);
  5224. if (res !== null) {
  5225. _target.$off(event, onceHandler);
  5226. }
  5227. }
  5228. }
  5229. function updateComponentListeners (
  5230. vm,
  5231. listeners,
  5232. oldListeners
  5233. ) {
  5234. target = vm;
  5235. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5236. target = undefined;
  5237. }
  5238. function eventsMixin (Vue) {
  5239. var hookRE = /^hook:/;
  5240. Vue.prototype.$on = function (event, fn) {
  5241. var vm = this;
  5242. if (Array.isArray(event)) {
  5243. for (var i = 0, l = event.length; i < l; i++) {
  5244. vm.$on(event[i], fn);
  5245. }
  5246. } else {
  5247. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5248. // optimize hook:event cost by using a boolean flag marked at registration
  5249. // instead of a hash lookup
  5250. if (hookRE.test(event)) {
  5251. vm._hasHookEvent = true;
  5252. }
  5253. }
  5254. return vm
  5255. };
  5256. Vue.prototype.$once = function (event, fn) {
  5257. var vm = this;
  5258. function on () {
  5259. vm.$off(event, on);
  5260. fn.apply(vm, arguments);
  5261. }
  5262. on.fn = fn;
  5263. vm.$on(event, on);
  5264. return vm
  5265. };
  5266. Vue.prototype.$off = function (event, fn) {
  5267. var vm = this;
  5268. // all
  5269. if (!arguments.length) {
  5270. vm._events = Object.create(null);
  5271. return vm
  5272. }
  5273. // array of events
  5274. if (Array.isArray(event)) {
  5275. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5276. vm.$off(event[i$1], fn);
  5277. }
  5278. return vm
  5279. }
  5280. // specific event
  5281. var cbs = vm._events[event];
  5282. if (!cbs) {
  5283. return vm
  5284. }
  5285. if (!fn) {
  5286. vm._events[event] = null;
  5287. return vm
  5288. }
  5289. // specific handler
  5290. var cb;
  5291. var i = cbs.length;
  5292. while (i--) {
  5293. cb = cbs[i];
  5294. if (cb === fn || cb.fn === fn) {
  5295. cbs.splice(i, 1);
  5296. break
  5297. }
  5298. }
  5299. return vm
  5300. };
  5301. Vue.prototype.$emit = function (event) {
  5302. var vm = this;
  5303. if (true) {
  5304. var lowerCaseEvent = event.toLowerCase();
  5305. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5306. tip(
  5307. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5308. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5309. "Note that HTML attributes are case-insensitive and you cannot use " +
  5310. "v-on to listen to camelCase events when using in-DOM templates. " +
  5311. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5312. );
  5313. }
  5314. }
  5315. var cbs = vm._events[event];
  5316. if (cbs) {
  5317. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5318. var args = toArray(arguments, 1);
  5319. var info = "event handler for \"" + event + "\"";
  5320. for (var i = 0, l = cbs.length; i < l; i++) {
  5321. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5322. }
  5323. }
  5324. return vm
  5325. };
  5326. }
  5327. /* */
  5328. var activeInstance = null;
  5329. var isUpdatingChildComponent = false;
  5330. function setActiveInstance(vm) {
  5331. var prevActiveInstance = activeInstance;
  5332. activeInstance = vm;
  5333. return function () {
  5334. activeInstance = prevActiveInstance;
  5335. }
  5336. }
  5337. function initLifecycle (vm) {
  5338. var options = vm.$options;
  5339. // locate first non-abstract parent
  5340. var parent = options.parent;
  5341. if (parent && !options.abstract) {
  5342. while (parent.$options.abstract && parent.$parent) {
  5343. parent = parent.$parent;
  5344. }
  5345. parent.$children.push(vm);
  5346. }
  5347. vm.$parent = parent;
  5348. vm.$root = parent ? parent.$root : vm;
  5349. vm.$children = [];
  5350. vm.$refs = {};
  5351. vm._watcher = null;
  5352. vm._inactive = null;
  5353. vm._directInactive = false;
  5354. vm._isMounted = false;
  5355. vm._isDestroyed = false;
  5356. vm._isBeingDestroyed = false;
  5357. }
  5358. function lifecycleMixin (Vue) {
  5359. Vue.prototype._update = function (vnode, hydrating) {
  5360. var vm = this;
  5361. var prevEl = vm.$el;
  5362. var prevVnode = vm._vnode;
  5363. var restoreActiveInstance = setActiveInstance(vm);
  5364. vm._vnode = vnode;
  5365. // Vue.prototype.__patch__ is injected in entry points
  5366. // based on the rendering backend used.
  5367. if (!prevVnode) {
  5368. // initial render
  5369. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5370. } else {
  5371. // updates
  5372. vm.$el = vm.__patch__(prevVnode, vnode);
  5373. }
  5374. restoreActiveInstance();
  5375. // update __vue__ reference
  5376. if (prevEl) {
  5377. prevEl.__vue__ = null;
  5378. }
  5379. if (vm.$el) {
  5380. vm.$el.__vue__ = vm;
  5381. }
  5382. // if parent is an HOC, update its $el as well
  5383. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5384. vm.$parent.$el = vm.$el;
  5385. }
  5386. // updated hook is called by the scheduler to ensure that children are
  5387. // updated in a parent's updated hook.
  5388. };
  5389. Vue.prototype.$forceUpdate = function () {
  5390. var vm = this;
  5391. if (vm._watcher) {
  5392. vm._watcher.update();
  5393. }
  5394. };
  5395. Vue.prototype.$destroy = function () {
  5396. var vm = this;
  5397. if (vm._isBeingDestroyed) {
  5398. return
  5399. }
  5400. callHook(vm, 'beforeDestroy');
  5401. vm._isBeingDestroyed = true;
  5402. // remove self from parent
  5403. var parent = vm.$parent;
  5404. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5405. remove(parent.$children, vm);
  5406. }
  5407. // teardown watchers
  5408. if (vm._watcher) {
  5409. vm._watcher.teardown();
  5410. }
  5411. var i = vm._watchers.length;
  5412. while (i--) {
  5413. vm._watchers[i].teardown();
  5414. }
  5415. // remove reference from data ob
  5416. // frozen object may not have observer.
  5417. if (vm._data.__ob__) {
  5418. vm._data.__ob__.vmCount--;
  5419. }
  5420. // call the last hook...
  5421. vm._isDestroyed = true;
  5422. // invoke destroy hooks on current rendered tree
  5423. vm.__patch__(vm._vnode, null);
  5424. // fire destroyed hook
  5425. callHook(vm, 'destroyed');
  5426. // turn off all instance listeners.
  5427. vm.$off();
  5428. // remove __vue__ reference
  5429. if (vm.$el) {
  5430. vm.$el.__vue__ = null;
  5431. }
  5432. // release circular reference (#6759)
  5433. if (vm.$vnode) {
  5434. vm.$vnode.parent = null;
  5435. }
  5436. };
  5437. }
  5438. function updateChildComponent (
  5439. vm,
  5440. propsData,
  5441. listeners,
  5442. parentVnode,
  5443. renderChildren
  5444. ) {
  5445. if (true) {
  5446. isUpdatingChildComponent = true;
  5447. }
  5448. // determine whether component has slot children
  5449. // we need to do this before overwriting $options._renderChildren.
  5450. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5451. // dynamic slot names). Static scoped slots compiled from template has the
  5452. // "$stable" marker.
  5453. var newScopedSlots = parentVnode.data.scopedSlots;
  5454. var oldScopedSlots = vm.$scopedSlots;
  5455. var hasDynamicScopedSlot = !!(
  5456. (newScopedSlots && !newScopedSlots.$stable) ||
  5457. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5458. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5459. );
  5460. // Any static slot children from the parent may have changed during parent's
  5461. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5462. // update is necessary to ensure correctness.
  5463. var needsForceUpdate = !!(
  5464. renderChildren || // has new static slots
  5465. vm.$options._renderChildren || // has old static slots
  5466. hasDynamicScopedSlot
  5467. );
  5468. vm.$options._parentVnode = parentVnode;
  5469. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5470. if (vm._vnode) { // update child tree's parent
  5471. vm._vnode.parent = parentVnode;
  5472. }
  5473. vm.$options._renderChildren = renderChildren;
  5474. // update $attrs and $listeners hash
  5475. // these are also reactive so they may trigger child update if the child
  5476. // used them during render
  5477. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5478. vm.$listeners = listeners || emptyObject;
  5479. // update props
  5480. if (propsData && vm.$options.props) {
  5481. toggleObserving(false);
  5482. var props = vm._props;
  5483. var propKeys = vm.$options._propKeys || [];
  5484. for (var i = 0; i < propKeys.length; i++) {
  5485. var key = propKeys[i];
  5486. var propOptions = vm.$options.props; // wtf flow?
  5487. props[key] = validateProp(key, propOptions, propsData, vm);
  5488. }
  5489. toggleObserving(true);
  5490. // keep a copy of raw propsData
  5491. vm.$options.propsData = propsData;
  5492. }
  5493. // fixed by xxxxxx update properties(mp runtime)
  5494. vm._$updateProperties && vm._$updateProperties(vm);
  5495. // update listeners
  5496. listeners = listeners || emptyObject;
  5497. var oldListeners = vm.$options._parentListeners;
  5498. vm.$options._parentListeners = listeners;
  5499. updateComponentListeners(vm, listeners, oldListeners);
  5500. // resolve slots + force update if has children
  5501. if (needsForceUpdate) {
  5502. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5503. vm.$forceUpdate();
  5504. }
  5505. if (true) {
  5506. isUpdatingChildComponent = false;
  5507. }
  5508. }
  5509. function isInInactiveTree (vm) {
  5510. while (vm && (vm = vm.$parent)) {
  5511. if (vm._inactive) { return true }
  5512. }
  5513. return false
  5514. }
  5515. function activateChildComponent (vm, direct) {
  5516. if (direct) {
  5517. vm._directInactive = false;
  5518. if (isInInactiveTree(vm)) {
  5519. return
  5520. }
  5521. } else if (vm._directInactive) {
  5522. return
  5523. }
  5524. if (vm._inactive || vm._inactive === null) {
  5525. vm._inactive = false;
  5526. for (var i = 0; i < vm.$children.length; i++) {
  5527. activateChildComponent(vm.$children[i]);
  5528. }
  5529. callHook(vm, 'activated');
  5530. }
  5531. }
  5532. function deactivateChildComponent (vm, direct) {
  5533. if (direct) {
  5534. vm._directInactive = true;
  5535. if (isInInactiveTree(vm)) {
  5536. return
  5537. }
  5538. }
  5539. if (!vm._inactive) {
  5540. vm._inactive = true;
  5541. for (var i = 0; i < vm.$children.length; i++) {
  5542. deactivateChildComponent(vm.$children[i]);
  5543. }
  5544. callHook(vm, 'deactivated');
  5545. }
  5546. }
  5547. function callHook (vm, hook) {
  5548. // #7573 disable dep collection when invoking lifecycle hooks
  5549. pushTarget();
  5550. var handlers = vm.$options[hook];
  5551. var info = hook + " hook";
  5552. if (handlers) {
  5553. for (var i = 0, j = handlers.length; i < j; i++) {
  5554. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5555. }
  5556. }
  5557. if (vm._hasHookEvent) {
  5558. vm.$emit('hook:' + hook);
  5559. }
  5560. popTarget();
  5561. }
  5562. /* */
  5563. var MAX_UPDATE_COUNT = 100;
  5564. var queue = [];
  5565. var activatedChildren = [];
  5566. var has = {};
  5567. var circular = {};
  5568. var waiting = false;
  5569. var flushing = false;
  5570. var index = 0;
  5571. /**
  5572. * Reset the scheduler's state.
  5573. */
  5574. function resetSchedulerState () {
  5575. index = queue.length = activatedChildren.length = 0;
  5576. has = {};
  5577. if (true) {
  5578. circular = {};
  5579. }
  5580. waiting = flushing = false;
  5581. }
  5582. // Async edge case #6566 requires saving the timestamp when event listeners are
  5583. // attached. However, calling performance.now() has a perf overhead especially
  5584. // if the page has thousands of event listeners. Instead, we take a timestamp
  5585. // every time the scheduler flushes and use that for all event listeners
  5586. // attached during that flush.
  5587. var currentFlushTimestamp = 0;
  5588. // Async edge case fix requires storing an event listener's attach timestamp.
  5589. var getNow = Date.now;
  5590. // Determine what event timestamp the browser is using. Annoyingly, the
  5591. // timestamp can either be hi-res (relative to page load) or low-res
  5592. // (relative to UNIX epoch), so in order to compare time we have to use the
  5593. // same timestamp type when saving the flush timestamp.
  5594. // All IE versions use low-res event timestamps, and have problematic clock
  5595. // implementations (#9632)
  5596. if (inBrowser && !isIE) {
  5597. var performance = window.performance;
  5598. if (
  5599. performance &&
  5600. typeof performance.now === 'function' &&
  5601. getNow() > document.createEvent('Event').timeStamp
  5602. ) {
  5603. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5604. // smaller than it, it means the event is using a hi-res timestamp,
  5605. // and we need to use the hi-res version for event listener timestamps as
  5606. // well.
  5607. getNow = function () { return performance.now(); };
  5608. }
  5609. }
  5610. /**
  5611. * Flush both queues and run the watchers.
  5612. */
  5613. function flushSchedulerQueue () {
  5614. currentFlushTimestamp = getNow();
  5615. flushing = true;
  5616. var watcher, id;
  5617. // Sort queue before flush.
  5618. // This ensures that:
  5619. // 1. Components are updated from parent to child. (because parent is always
  5620. // created before the child)
  5621. // 2. A component's user watchers are run before its render watcher (because
  5622. // user watchers are created before the render watcher)
  5623. // 3. If a component is destroyed during a parent component's watcher run,
  5624. // its watchers can be skipped.
  5625. queue.sort(function (a, b) { return a.id - b.id; });
  5626. // do not cache length because more watchers might be pushed
  5627. // as we run existing watchers
  5628. for (index = 0; index < queue.length; index++) {
  5629. watcher = queue[index];
  5630. if (watcher.before) {
  5631. watcher.before();
  5632. }
  5633. id = watcher.id;
  5634. has[id] = null;
  5635. watcher.run();
  5636. // in dev build, check and stop circular updates.
  5637. if ( true && has[id] != null) {
  5638. circular[id] = (circular[id] || 0) + 1;
  5639. if (circular[id] > MAX_UPDATE_COUNT) {
  5640. warn(
  5641. 'You may have an infinite update loop ' + (
  5642. watcher.user
  5643. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5644. : "in a component render function."
  5645. ),
  5646. watcher.vm
  5647. );
  5648. break
  5649. }
  5650. }
  5651. }
  5652. // keep copies of post queues before resetting state
  5653. var activatedQueue = activatedChildren.slice();
  5654. var updatedQueue = queue.slice();
  5655. resetSchedulerState();
  5656. // call component updated and activated hooks
  5657. callActivatedHooks(activatedQueue);
  5658. callUpdatedHooks(updatedQueue);
  5659. // devtool hook
  5660. /* istanbul ignore if */
  5661. if (devtools && config.devtools) {
  5662. devtools.emit('flush');
  5663. }
  5664. }
  5665. function callUpdatedHooks (queue) {
  5666. var i = queue.length;
  5667. while (i--) {
  5668. var watcher = queue[i];
  5669. var vm = watcher.vm;
  5670. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5671. callHook(vm, 'updated');
  5672. }
  5673. }
  5674. }
  5675. /**
  5676. * Queue a kept-alive component that was activated during patch.
  5677. * The queue will be processed after the entire tree has been patched.
  5678. */
  5679. function queueActivatedComponent (vm) {
  5680. // setting _inactive to false here so that a render function can
  5681. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5682. vm._inactive = false;
  5683. activatedChildren.push(vm);
  5684. }
  5685. function callActivatedHooks (queue) {
  5686. for (var i = 0; i < queue.length; i++) {
  5687. queue[i]._inactive = true;
  5688. activateChildComponent(queue[i], true /* true */);
  5689. }
  5690. }
  5691. /**
  5692. * Push a watcher into the watcher queue.
  5693. * Jobs with duplicate IDs will be skipped unless it's
  5694. * pushed when the queue is being flushed.
  5695. */
  5696. function queueWatcher (watcher) {
  5697. var id = watcher.id;
  5698. if (has[id] == null) {
  5699. has[id] = true;
  5700. if (!flushing) {
  5701. queue.push(watcher);
  5702. } else {
  5703. // if already flushing, splice the watcher based on its id
  5704. // if already past its id, it will be run next immediately.
  5705. var i = queue.length - 1;
  5706. while (i > index && queue[i].id > watcher.id) {
  5707. i--;
  5708. }
  5709. queue.splice(i + 1, 0, watcher);
  5710. }
  5711. // queue the flush
  5712. if (!waiting) {
  5713. waiting = true;
  5714. if ( true && !config.async) {
  5715. flushSchedulerQueue();
  5716. return
  5717. }
  5718. nextTick(flushSchedulerQueue);
  5719. }
  5720. }
  5721. }
  5722. /* */
  5723. var uid$2 = 0;
  5724. /**
  5725. * A watcher parses an expression, collects dependencies,
  5726. * and fires callback when the expression value changes.
  5727. * This is used for both the $watch() api and directives.
  5728. */
  5729. var Watcher = function Watcher (
  5730. vm,
  5731. expOrFn,
  5732. cb,
  5733. options,
  5734. isRenderWatcher
  5735. ) {
  5736. this.vm = vm;
  5737. if (isRenderWatcher) {
  5738. vm._watcher = this;
  5739. }
  5740. vm._watchers.push(this);
  5741. // options
  5742. if (options) {
  5743. this.deep = !!options.deep;
  5744. this.user = !!options.user;
  5745. this.lazy = !!options.lazy;
  5746. this.sync = !!options.sync;
  5747. this.before = options.before;
  5748. } else {
  5749. this.deep = this.user = this.lazy = this.sync = false;
  5750. }
  5751. this.cb = cb;
  5752. this.id = ++uid$2; // uid for batching
  5753. this.active = true;
  5754. this.dirty = this.lazy; // for lazy watchers
  5755. this.deps = [];
  5756. this.newDeps = [];
  5757. this.depIds = new _Set();
  5758. this.newDepIds = new _Set();
  5759. this.expression = true
  5760. ? expOrFn.toString()
  5761. : undefined;
  5762. // parse expression for getter
  5763. if (typeof expOrFn === 'function') {
  5764. this.getter = expOrFn;
  5765. } else {
  5766. this.getter = parsePath(expOrFn);
  5767. if (!this.getter) {
  5768. this.getter = noop;
  5769. true && warn(
  5770. "Failed watching path: \"" + expOrFn + "\" " +
  5771. 'Watcher only accepts simple dot-delimited paths. ' +
  5772. 'For full control, use a function instead.',
  5773. vm
  5774. );
  5775. }
  5776. }
  5777. this.value = this.lazy
  5778. ? undefined
  5779. : this.get();
  5780. };
  5781. /**
  5782. * Evaluate the getter, and re-collect dependencies.
  5783. */
  5784. Watcher.prototype.get = function get () {
  5785. pushTarget(this);
  5786. var value;
  5787. var vm = this.vm;
  5788. try {
  5789. value = this.getter.call(vm, vm);
  5790. } catch (e) {
  5791. if (this.user) {
  5792. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5793. } else {
  5794. throw e
  5795. }
  5796. } finally {
  5797. // "touch" every property so they are all tracked as
  5798. // dependencies for deep watching
  5799. if (this.deep) {
  5800. traverse(value);
  5801. }
  5802. popTarget();
  5803. this.cleanupDeps();
  5804. }
  5805. return value
  5806. };
  5807. /**
  5808. * Add a dependency to this directive.
  5809. */
  5810. Watcher.prototype.addDep = function addDep (dep) {
  5811. var id = dep.id;
  5812. if (!this.newDepIds.has(id)) {
  5813. this.newDepIds.add(id);
  5814. this.newDeps.push(dep);
  5815. if (!this.depIds.has(id)) {
  5816. dep.addSub(this);
  5817. }
  5818. }
  5819. };
  5820. /**
  5821. * Clean up for dependency collection.
  5822. */
  5823. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5824. var i = this.deps.length;
  5825. while (i--) {
  5826. var dep = this.deps[i];
  5827. if (!this.newDepIds.has(dep.id)) {
  5828. dep.removeSub(this);
  5829. }
  5830. }
  5831. var tmp = this.depIds;
  5832. this.depIds = this.newDepIds;
  5833. this.newDepIds = tmp;
  5834. this.newDepIds.clear();
  5835. tmp = this.deps;
  5836. this.deps = this.newDeps;
  5837. this.newDeps = tmp;
  5838. this.newDeps.length = 0;
  5839. };
  5840. /**
  5841. * Subscriber interface.
  5842. * Will be called when a dependency changes.
  5843. */
  5844. Watcher.prototype.update = function update () {
  5845. /* istanbul ignore else */
  5846. if (this.lazy) {
  5847. this.dirty = true;
  5848. } else if (this.sync) {
  5849. this.run();
  5850. } else {
  5851. queueWatcher(this);
  5852. }
  5853. };
  5854. /**
  5855. * Scheduler job interface.
  5856. * Will be called by the scheduler.
  5857. */
  5858. Watcher.prototype.run = function run () {
  5859. if (this.active) {
  5860. var value = this.get();
  5861. if (
  5862. value !== this.value ||
  5863. // Deep watchers and watchers on Object/Arrays should fire even
  5864. // when the value is the same, because the value may
  5865. // have mutated.
  5866. isObject(value) ||
  5867. this.deep
  5868. ) {
  5869. // set new value
  5870. var oldValue = this.value;
  5871. this.value = value;
  5872. if (this.user) {
  5873. try {
  5874. this.cb.call(this.vm, value, oldValue);
  5875. } catch (e) {
  5876. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5877. }
  5878. } else {
  5879. this.cb.call(this.vm, value, oldValue);
  5880. }
  5881. }
  5882. }
  5883. };
  5884. /**
  5885. * Evaluate the value of the watcher.
  5886. * This only gets called for lazy watchers.
  5887. */
  5888. Watcher.prototype.evaluate = function evaluate () {
  5889. this.value = this.get();
  5890. this.dirty = false;
  5891. };
  5892. /**
  5893. * Depend on all deps collected by this watcher.
  5894. */
  5895. Watcher.prototype.depend = function depend () {
  5896. var i = this.deps.length;
  5897. while (i--) {
  5898. this.deps[i].depend();
  5899. }
  5900. };
  5901. /**
  5902. * Remove self from all dependencies' subscriber list.
  5903. */
  5904. Watcher.prototype.teardown = function teardown () {
  5905. if (this.active) {
  5906. // remove self from vm's watcher list
  5907. // this is a somewhat expensive operation so we skip it
  5908. // if the vm is being destroyed.
  5909. if (!this.vm._isBeingDestroyed) {
  5910. remove(this.vm._watchers, this);
  5911. }
  5912. var i = this.deps.length;
  5913. while (i--) {
  5914. this.deps[i].removeSub(this);
  5915. }
  5916. this.active = false;
  5917. }
  5918. };
  5919. /* */
  5920. var sharedPropertyDefinition = {
  5921. enumerable: true,
  5922. configurable: true,
  5923. get: noop,
  5924. set: noop
  5925. };
  5926. function proxy (target, sourceKey, key) {
  5927. sharedPropertyDefinition.get = function proxyGetter () {
  5928. return this[sourceKey][key]
  5929. };
  5930. sharedPropertyDefinition.set = function proxySetter (val) {
  5931. this[sourceKey][key] = val;
  5932. };
  5933. Object.defineProperty(target, key, sharedPropertyDefinition);
  5934. }
  5935. function initState (vm) {
  5936. vm._watchers = [];
  5937. var opts = vm.$options;
  5938. if (opts.props) { initProps(vm, opts.props); }
  5939. if (opts.methods) { initMethods(vm, opts.methods); }
  5940. if (opts.data) {
  5941. initData(vm);
  5942. } else {
  5943. observe(vm._data = {}, true /* asRootData */);
  5944. }
  5945. if (opts.computed) { initComputed(vm, opts.computed); }
  5946. if (opts.watch && opts.watch !== nativeWatch) {
  5947. initWatch(vm, opts.watch);
  5948. }
  5949. }
  5950. function initProps (vm, propsOptions) {
  5951. var propsData = vm.$options.propsData || {};
  5952. var props = vm._props = {};
  5953. // cache prop keys so that future props updates can iterate using Array
  5954. // instead of dynamic object key enumeration.
  5955. var keys = vm.$options._propKeys = [];
  5956. var isRoot = !vm.$parent;
  5957. // root instance props should be converted
  5958. if (!isRoot) {
  5959. toggleObserving(false);
  5960. }
  5961. var loop = function ( key ) {
  5962. keys.push(key);
  5963. var value = validateProp(key, propsOptions, propsData, vm);
  5964. /* istanbul ignore else */
  5965. if (true) {
  5966. var hyphenatedKey = hyphenate(key);
  5967. if (isReservedAttribute(hyphenatedKey) ||
  5968. config.isReservedAttr(hyphenatedKey)) {
  5969. warn(
  5970. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5971. vm
  5972. );
  5973. }
  5974. defineReactive$$1(props, key, value, function () {
  5975. if (!isRoot && !isUpdatingChildComponent) {
  5976. {
  5977. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  5978. return
  5979. }
  5980. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5981. if(
  5982. key === 'value' &&
  5983. Array.isArray(vm.$options.behaviors) &&
  5984. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5985. ){
  5986. return
  5987. }
  5988. if(vm._getFormData){
  5989. return
  5990. }
  5991. var $parent = vm.$parent;
  5992. while($parent){
  5993. if($parent.__next_tick_pending){
  5994. return
  5995. }
  5996. $parent = $parent.$parent;
  5997. }
  5998. }
  5999. warn(
  6000. "Avoid mutating a prop directly since the value will be " +
  6001. "overwritten whenever the parent component re-renders. " +
  6002. "Instead, use a data or computed property based on the prop's " +
  6003. "value. Prop being mutated: \"" + key + "\"",
  6004. vm
  6005. );
  6006. }
  6007. });
  6008. } else {}
  6009. // static props are already proxied on the component's prototype
  6010. // during Vue.extend(). We only need to proxy props defined at
  6011. // instantiation here.
  6012. if (!(key in vm)) {
  6013. proxy(vm, "_props", key);
  6014. }
  6015. };
  6016. for (var key in propsOptions) loop( key );
  6017. toggleObserving(true);
  6018. }
  6019. function initData (vm) {
  6020. var data = vm.$options.data;
  6021. data = vm._data = typeof data === 'function'
  6022. ? getData(data, vm)
  6023. : data || {};
  6024. if (!isPlainObject(data)) {
  6025. data = {};
  6026. true && warn(
  6027. 'data functions should return an object:\n' +
  6028. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6029. vm
  6030. );
  6031. }
  6032. // proxy data on instance
  6033. var keys = Object.keys(data);
  6034. var props = vm.$options.props;
  6035. var methods = vm.$options.methods;
  6036. var i = keys.length;
  6037. while (i--) {
  6038. var key = keys[i];
  6039. if (true) {
  6040. if (methods && hasOwn(methods, key)) {
  6041. warn(
  6042. ("Method \"" + key + "\" has already been defined as a data property."),
  6043. vm
  6044. );
  6045. }
  6046. }
  6047. if (props && hasOwn(props, key)) {
  6048. true && warn(
  6049. "The data property \"" + key + "\" is already declared as a prop. " +
  6050. "Use prop default value instead.",
  6051. vm
  6052. );
  6053. } else if (!isReserved(key)) {
  6054. proxy(vm, "_data", key);
  6055. }
  6056. }
  6057. // observe data
  6058. observe(data, true /* asRootData */);
  6059. }
  6060. function getData (data, vm) {
  6061. // #7573 disable dep collection when invoking data getters
  6062. pushTarget();
  6063. try {
  6064. return data.call(vm, vm)
  6065. } catch (e) {
  6066. handleError(e, vm, "data()");
  6067. return {}
  6068. } finally {
  6069. popTarget();
  6070. }
  6071. }
  6072. var computedWatcherOptions = { lazy: true };
  6073. function initComputed (vm, computed) {
  6074. // $flow-disable-line
  6075. var watchers = vm._computedWatchers = Object.create(null);
  6076. // computed properties are just getters during SSR
  6077. var isSSR = isServerRendering();
  6078. for (var key in computed) {
  6079. var userDef = computed[key];
  6080. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6081. if ( true && getter == null) {
  6082. warn(
  6083. ("Getter is missing for computed property \"" + key + "\"."),
  6084. vm
  6085. );
  6086. }
  6087. if (!isSSR) {
  6088. // create internal watcher for the computed property.
  6089. watchers[key] = new Watcher(
  6090. vm,
  6091. getter || noop,
  6092. noop,
  6093. computedWatcherOptions
  6094. );
  6095. }
  6096. // component-defined computed properties are already defined on the
  6097. // component prototype. We only need to define computed properties defined
  6098. // at instantiation here.
  6099. if (!(key in vm)) {
  6100. defineComputed(vm, key, userDef);
  6101. } else if (true) {
  6102. if (key in vm.$data) {
  6103. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6104. } else if (vm.$options.props && key in vm.$options.props) {
  6105. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6106. }
  6107. }
  6108. }
  6109. }
  6110. function defineComputed (
  6111. target,
  6112. key,
  6113. userDef
  6114. ) {
  6115. var shouldCache = !isServerRendering();
  6116. if (typeof userDef === 'function') {
  6117. sharedPropertyDefinition.get = shouldCache
  6118. ? createComputedGetter(key)
  6119. : createGetterInvoker(userDef);
  6120. sharedPropertyDefinition.set = noop;
  6121. } else {
  6122. sharedPropertyDefinition.get = userDef.get
  6123. ? shouldCache && userDef.cache !== false
  6124. ? createComputedGetter(key)
  6125. : createGetterInvoker(userDef.get)
  6126. : noop;
  6127. sharedPropertyDefinition.set = userDef.set || noop;
  6128. }
  6129. if ( true &&
  6130. sharedPropertyDefinition.set === noop) {
  6131. sharedPropertyDefinition.set = function () {
  6132. warn(
  6133. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6134. this
  6135. );
  6136. };
  6137. }
  6138. Object.defineProperty(target, key, sharedPropertyDefinition);
  6139. }
  6140. function createComputedGetter (key) {
  6141. return function computedGetter () {
  6142. var watcher = this._computedWatchers && this._computedWatchers[key];
  6143. if (watcher) {
  6144. if (watcher.dirty) {
  6145. watcher.evaluate();
  6146. }
  6147. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6148. watcher.depend();
  6149. }
  6150. return watcher.value
  6151. }
  6152. }
  6153. }
  6154. function createGetterInvoker(fn) {
  6155. return function computedGetter () {
  6156. return fn.call(this, this)
  6157. }
  6158. }
  6159. function initMethods (vm, methods) {
  6160. var props = vm.$options.props;
  6161. for (var key in methods) {
  6162. if (true) {
  6163. if (typeof methods[key] !== 'function') {
  6164. warn(
  6165. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6166. "Did you reference the function correctly?",
  6167. vm
  6168. );
  6169. }
  6170. if (props && hasOwn(props, key)) {
  6171. warn(
  6172. ("Method \"" + key + "\" has already been defined as a prop."),
  6173. vm
  6174. );
  6175. }
  6176. if ((key in vm) && isReserved(key)) {
  6177. warn(
  6178. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6179. "Avoid defining component methods that start with _ or $."
  6180. );
  6181. }
  6182. }
  6183. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6184. }
  6185. }
  6186. function initWatch (vm, watch) {
  6187. for (var key in watch) {
  6188. var handler = watch[key];
  6189. if (Array.isArray(handler)) {
  6190. for (var i = 0; i < handler.length; i++) {
  6191. createWatcher(vm, key, handler[i]);
  6192. }
  6193. } else {
  6194. createWatcher(vm, key, handler);
  6195. }
  6196. }
  6197. }
  6198. function createWatcher (
  6199. vm,
  6200. expOrFn,
  6201. handler,
  6202. options
  6203. ) {
  6204. if (isPlainObject(handler)) {
  6205. options = handler;
  6206. handler = handler.handler;
  6207. }
  6208. if (typeof handler === 'string') {
  6209. handler = vm[handler];
  6210. }
  6211. return vm.$watch(expOrFn, handler, options)
  6212. }
  6213. function stateMixin (Vue) {
  6214. // flow somehow has problems with directly declared definition object
  6215. // when using Object.defineProperty, so we have to procedurally build up
  6216. // the object here.
  6217. var dataDef = {};
  6218. dataDef.get = function () { return this._data };
  6219. var propsDef = {};
  6220. propsDef.get = function () { return this._props };
  6221. if (true) {
  6222. dataDef.set = function () {
  6223. warn(
  6224. 'Avoid replacing instance root $data. ' +
  6225. 'Use nested data properties instead.',
  6226. this
  6227. );
  6228. };
  6229. propsDef.set = function () {
  6230. warn("$props is readonly.", this);
  6231. };
  6232. }
  6233. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6234. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6235. Vue.prototype.$set = set;
  6236. Vue.prototype.$delete = del;
  6237. Vue.prototype.$watch = function (
  6238. expOrFn,
  6239. cb,
  6240. options
  6241. ) {
  6242. var vm = this;
  6243. if (isPlainObject(cb)) {
  6244. return createWatcher(vm, expOrFn, cb, options)
  6245. }
  6246. options = options || {};
  6247. options.user = true;
  6248. var watcher = new Watcher(vm, expOrFn, cb, options);
  6249. if (options.immediate) {
  6250. try {
  6251. cb.call(vm, watcher.value);
  6252. } catch (error) {
  6253. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6254. }
  6255. }
  6256. return function unwatchFn () {
  6257. watcher.teardown();
  6258. }
  6259. };
  6260. }
  6261. /* */
  6262. var uid$3 = 0;
  6263. function initMixin (Vue) {
  6264. Vue.prototype._init = function (options) {
  6265. var vm = this;
  6266. // a uid
  6267. vm._uid = uid$3++;
  6268. var startTag, endTag;
  6269. /* istanbul ignore if */
  6270. if ( true && config.performance && mark) {
  6271. startTag = "vue-perf-start:" + (vm._uid);
  6272. endTag = "vue-perf-end:" + (vm._uid);
  6273. mark(startTag);
  6274. }
  6275. // a flag to avoid this being observed
  6276. vm._isVue = true;
  6277. // merge options
  6278. if (options && options._isComponent) {
  6279. // optimize internal component instantiation
  6280. // since dynamic options merging is pretty slow, and none of the
  6281. // internal component options needs special treatment.
  6282. initInternalComponent(vm, options);
  6283. } else {
  6284. vm.$options = mergeOptions(
  6285. resolveConstructorOptions(vm.constructor),
  6286. options || {},
  6287. vm
  6288. );
  6289. }
  6290. /* istanbul ignore else */
  6291. if (true) {
  6292. initProxy(vm);
  6293. } else {}
  6294. // expose real self
  6295. vm._self = vm;
  6296. initLifecycle(vm);
  6297. initEvents(vm);
  6298. initRender(vm);
  6299. callHook(vm, 'beforeCreate');
  6300. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6301. initState(vm);
  6302. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6303. !vm._$fallback && callHook(vm, 'created');
  6304. /* istanbul ignore if */
  6305. if ( true && config.performance && mark) {
  6306. vm._name = formatComponentName(vm, false);
  6307. mark(endTag);
  6308. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6309. }
  6310. if (vm.$options.el) {
  6311. vm.$mount(vm.$options.el);
  6312. }
  6313. };
  6314. }
  6315. function initInternalComponent (vm, options) {
  6316. var opts = vm.$options = Object.create(vm.constructor.options);
  6317. // doing this because it's faster than dynamic enumeration.
  6318. var parentVnode = options._parentVnode;
  6319. opts.parent = options.parent;
  6320. opts._parentVnode = parentVnode;
  6321. var vnodeComponentOptions = parentVnode.componentOptions;
  6322. opts.propsData = vnodeComponentOptions.propsData;
  6323. opts._parentListeners = vnodeComponentOptions.listeners;
  6324. opts._renderChildren = vnodeComponentOptions.children;
  6325. opts._componentTag = vnodeComponentOptions.tag;
  6326. if (options.render) {
  6327. opts.render = options.render;
  6328. opts.staticRenderFns = options.staticRenderFns;
  6329. }
  6330. }
  6331. function resolveConstructorOptions (Ctor) {
  6332. var options = Ctor.options;
  6333. if (Ctor.super) {
  6334. var superOptions = resolveConstructorOptions(Ctor.super);
  6335. var cachedSuperOptions = Ctor.superOptions;
  6336. if (superOptions !== cachedSuperOptions) {
  6337. // super option changed,
  6338. // need to resolve new options.
  6339. Ctor.superOptions = superOptions;
  6340. // check if there are any late-modified/attached options (#4976)
  6341. var modifiedOptions = resolveModifiedOptions(Ctor);
  6342. // update base extend options
  6343. if (modifiedOptions) {
  6344. extend(Ctor.extendOptions, modifiedOptions);
  6345. }
  6346. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6347. if (options.name) {
  6348. options.components[options.name] = Ctor;
  6349. }
  6350. }
  6351. }
  6352. return options
  6353. }
  6354. function resolveModifiedOptions (Ctor) {
  6355. var modified;
  6356. var latest = Ctor.options;
  6357. var sealed = Ctor.sealedOptions;
  6358. for (var key in latest) {
  6359. if (latest[key] !== sealed[key]) {
  6360. if (!modified) { modified = {}; }
  6361. modified[key] = latest[key];
  6362. }
  6363. }
  6364. return modified
  6365. }
  6366. function Vue (options) {
  6367. if ( true &&
  6368. !(this instanceof Vue)
  6369. ) {
  6370. warn('Vue is a constructor and should be called with the `new` keyword');
  6371. }
  6372. this._init(options);
  6373. }
  6374. initMixin(Vue);
  6375. stateMixin(Vue);
  6376. eventsMixin(Vue);
  6377. lifecycleMixin(Vue);
  6378. renderMixin(Vue);
  6379. /* */
  6380. function initUse (Vue) {
  6381. Vue.use = function (plugin) {
  6382. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6383. if (installedPlugins.indexOf(plugin) > -1) {
  6384. return this
  6385. }
  6386. // additional parameters
  6387. var args = toArray(arguments, 1);
  6388. args.unshift(this);
  6389. if (typeof plugin.install === 'function') {
  6390. plugin.install.apply(plugin, args);
  6391. } else if (typeof plugin === 'function') {
  6392. plugin.apply(null, args);
  6393. }
  6394. installedPlugins.push(plugin);
  6395. return this
  6396. };
  6397. }
  6398. /* */
  6399. function initMixin$1 (Vue) {
  6400. Vue.mixin = function (mixin) {
  6401. this.options = mergeOptions(this.options, mixin);
  6402. return this
  6403. };
  6404. }
  6405. /* */
  6406. function initExtend (Vue) {
  6407. /**
  6408. * Each instance constructor, including Vue, has a unique
  6409. * cid. This enables us to create wrapped "child
  6410. * constructors" for prototypal inheritance and cache them.
  6411. */
  6412. Vue.cid = 0;
  6413. var cid = 1;
  6414. /**
  6415. * Class inheritance
  6416. */
  6417. Vue.extend = function (extendOptions) {
  6418. extendOptions = extendOptions || {};
  6419. var Super = this;
  6420. var SuperId = Super.cid;
  6421. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6422. if (cachedCtors[SuperId]) {
  6423. return cachedCtors[SuperId]
  6424. }
  6425. var name = extendOptions.name || Super.options.name;
  6426. if ( true && name) {
  6427. validateComponentName(name);
  6428. }
  6429. var Sub = function VueComponent (options) {
  6430. this._init(options);
  6431. };
  6432. Sub.prototype = Object.create(Super.prototype);
  6433. Sub.prototype.constructor = Sub;
  6434. Sub.cid = cid++;
  6435. Sub.options = mergeOptions(
  6436. Super.options,
  6437. extendOptions
  6438. );
  6439. Sub['super'] = Super;
  6440. // For props and computed properties, we define the proxy getters on
  6441. // the Vue instances at extension time, on the extended prototype. This
  6442. // avoids Object.defineProperty calls for each instance created.
  6443. if (Sub.options.props) {
  6444. initProps$1(Sub);
  6445. }
  6446. if (Sub.options.computed) {
  6447. initComputed$1(Sub);
  6448. }
  6449. // allow further extension/mixin/plugin usage
  6450. Sub.extend = Super.extend;
  6451. Sub.mixin = Super.mixin;
  6452. Sub.use = Super.use;
  6453. // create asset registers, so extended classes
  6454. // can have their private assets too.
  6455. ASSET_TYPES.forEach(function (type) {
  6456. Sub[type] = Super[type];
  6457. });
  6458. // enable recursive self-lookup
  6459. if (name) {
  6460. Sub.options.components[name] = Sub;
  6461. }
  6462. // keep a reference to the super options at extension time.
  6463. // later at instantiation we can check if Super's options have
  6464. // been updated.
  6465. Sub.superOptions = Super.options;
  6466. Sub.extendOptions = extendOptions;
  6467. Sub.sealedOptions = extend({}, Sub.options);
  6468. // cache constructor
  6469. cachedCtors[SuperId] = Sub;
  6470. return Sub
  6471. };
  6472. }
  6473. function initProps$1 (Comp) {
  6474. var props = Comp.options.props;
  6475. for (var key in props) {
  6476. proxy(Comp.prototype, "_props", key);
  6477. }
  6478. }
  6479. function initComputed$1 (Comp) {
  6480. var computed = Comp.options.computed;
  6481. for (var key in computed) {
  6482. defineComputed(Comp.prototype, key, computed[key]);
  6483. }
  6484. }
  6485. /* */
  6486. function initAssetRegisters (Vue) {
  6487. /**
  6488. * Create asset registration methods.
  6489. */
  6490. ASSET_TYPES.forEach(function (type) {
  6491. Vue[type] = function (
  6492. id,
  6493. definition
  6494. ) {
  6495. if (!definition) {
  6496. return this.options[type + 's'][id]
  6497. } else {
  6498. /* istanbul ignore if */
  6499. if ( true && type === 'component') {
  6500. validateComponentName(id);
  6501. }
  6502. if (type === 'component' && isPlainObject(definition)) {
  6503. definition.name = definition.name || id;
  6504. definition = this.options._base.extend(definition);
  6505. }
  6506. if (type === 'directive' && typeof definition === 'function') {
  6507. definition = { bind: definition, update: definition };
  6508. }
  6509. this.options[type + 's'][id] = definition;
  6510. return definition
  6511. }
  6512. };
  6513. });
  6514. }
  6515. /* */
  6516. function getComponentName (opts) {
  6517. return opts && (opts.Ctor.options.name || opts.tag)
  6518. }
  6519. function matches (pattern, name) {
  6520. if (Array.isArray(pattern)) {
  6521. return pattern.indexOf(name) > -1
  6522. } else if (typeof pattern === 'string') {
  6523. return pattern.split(',').indexOf(name) > -1
  6524. } else if (isRegExp(pattern)) {
  6525. return pattern.test(name)
  6526. }
  6527. /* istanbul ignore next */
  6528. return false
  6529. }
  6530. function pruneCache (keepAliveInstance, filter) {
  6531. var cache = keepAliveInstance.cache;
  6532. var keys = keepAliveInstance.keys;
  6533. var _vnode = keepAliveInstance._vnode;
  6534. for (var key in cache) {
  6535. var cachedNode = cache[key];
  6536. if (cachedNode) {
  6537. var name = getComponentName(cachedNode.componentOptions);
  6538. if (name && !filter(name)) {
  6539. pruneCacheEntry(cache, key, keys, _vnode);
  6540. }
  6541. }
  6542. }
  6543. }
  6544. function pruneCacheEntry (
  6545. cache,
  6546. key,
  6547. keys,
  6548. current
  6549. ) {
  6550. var cached$$1 = cache[key];
  6551. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6552. cached$$1.componentInstance.$destroy();
  6553. }
  6554. cache[key] = null;
  6555. remove(keys, key);
  6556. }
  6557. var patternTypes = [String, RegExp, Array];
  6558. var KeepAlive = {
  6559. name: 'keep-alive',
  6560. abstract: true,
  6561. props: {
  6562. include: patternTypes,
  6563. exclude: patternTypes,
  6564. max: [String, Number]
  6565. },
  6566. created: function created () {
  6567. this.cache = Object.create(null);
  6568. this.keys = [];
  6569. },
  6570. destroyed: function destroyed () {
  6571. for (var key in this.cache) {
  6572. pruneCacheEntry(this.cache, key, this.keys);
  6573. }
  6574. },
  6575. mounted: function mounted () {
  6576. var this$1 = this;
  6577. this.$watch('include', function (val) {
  6578. pruneCache(this$1, function (name) { return matches(val, name); });
  6579. });
  6580. this.$watch('exclude', function (val) {
  6581. pruneCache(this$1, function (name) { return !matches(val, name); });
  6582. });
  6583. },
  6584. render: function render () {
  6585. var slot = this.$slots.default;
  6586. var vnode = getFirstComponentChild(slot);
  6587. var componentOptions = vnode && vnode.componentOptions;
  6588. if (componentOptions) {
  6589. // check pattern
  6590. var name = getComponentName(componentOptions);
  6591. var ref = this;
  6592. var include = ref.include;
  6593. var exclude = ref.exclude;
  6594. if (
  6595. // not included
  6596. (include && (!name || !matches(include, name))) ||
  6597. // excluded
  6598. (exclude && name && matches(exclude, name))
  6599. ) {
  6600. return vnode
  6601. }
  6602. var ref$1 = this;
  6603. var cache = ref$1.cache;
  6604. var keys = ref$1.keys;
  6605. var key = vnode.key == null
  6606. // same constructor may get registered as different local components
  6607. // so cid alone is not enough (#3269)
  6608. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6609. : vnode.key;
  6610. if (cache[key]) {
  6611. vnode.componentInstance = cache[key].componentInstance;
  6612. // make current key freshest
  6613. remove(keys, key);
  6614. keys.push(key);
  6615. } else {
  6616. cache[key] = vnode;
  6617. keys.push(key);
  6618. // prune oldest entry
  6619. if (this.max && keys.length > parseInt(this.max)) {
  6620. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6621. }
  6622. }
  6623. vnode.data.keepAlive = true;
  6624. }
  6625. return vnode || (slot && slot[0])
  6626. }
  6627. };
  6628. var builtInComponents = {
  6629. KeepAlive: KeepAlive
  6630. };
  6631. /* */
  6632. function initGlobalAPI (Vue) {
  6633. // config
  6634. var configDef = {};
  6635. configDef.get = function () { return config; };
  6636. if (true) {
  6637. configDef.set = function () {
  6638. warn(
  6639. 'Do not replace the Vue.config object, set individual fields instead.'
  6640. );
  6641. };
  6642. }
  6643. Object.defineProperty(Vue, 'config', configDef);
  6644. // exposed util methods.
  6645. // NOTE: these are not considered part of the public API - avoid relying on
  6646. // them unless you are aware of the risk.
  6647. Vue.util = {
  6648. warn: warn,
  6649. extend: extend,
  6650. mergeOptions: mergeOptions,
  6651. defineReactive: defineReactive$$1
  6652. };
  6653. Vue.set = set;
  6654. Vue.delete = del;
  6655. Vue.nextTick = nextTick;
  6656. // 2.6 explicit observable API
  6657. Vue.observable = function (obj) {
  6658. observe(obj);
  6659. return obj
  6660. };
  6661. Vue.options = Object.create(null);
  6662. ASSET_TYPES.forEach(function (type) {
  6663. Vue.options[type + 's'] = Object.create(null);
  6664. });
  6665. // this is used to identify the "base" constructor to extend all plain-object
  6666. // components with in Weex's multi-instance scenarios.
  6667. Vue.options._base = Vue;
  6668. extend(Vue.options.components, builtInComponents);
  6669. initUse(Vue);
  6670. initMixin$1(Vue);
  6671. initExtend(Vue);
  6672. initAssetRegisters(Vue);
  6673. }
  6674. initGlobalAPI(Vue);
  6675. Object.defineProperty(Vue.prototype, '$isServer', {
  6676. get: isServerRendering
  6677. });
  6678. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6679. get: function get () {
  6680. /* istanbul ignore next */
  6681. return this.$vnode && this.$vnode.ssrContext
  6682. }
  6683. });
  6684. // expose FunctionalRenderContext for ssr runtime helper installation
  6685. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6686. value: FunctionalRenderContext
  6687. });
  6688. Vue.version = '2.6.11';
  6689. /**
  6690. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6691. */
  6692. var ARRAYTYPE = '[object Array]';
  6693. var OBJECTTYPE = '[object Object]';
  6694. // const FUNCTIONTYPE = '[object Function]'
  6695. function diff(current, pre) {
  6696. var result = {};
  6697. syncKeys(current, pre);
  6698. _diff(current, pre, '', result);
  6699. return result
  6700. }
  6701. function syncKeys(current, pre) {
  6702. if (current === pre) { return }
  6703. var rootCurrentType = type(current);
  6704. var rootPreType = type(pre);
  6705. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6706. if(Object.keys(current).length >= Object.keys(pre).length){
  6707. for (var key in pre) {
  6708. var currentValue = current[key];
  6709. if (currentValue === undefined) {
  6710. current[key] = null;
  6711. } else {
  6712. syncKeys(currentValue, pre[key]);
  6713. }
  6714. }
  6715. }
  6716. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6717. if (current.length >= pre.length) {
  6718. pre.forEach(function (item, index) {
  6719. syncKeys(current[index], item);
  6720. });
  6721. }
  6722. }
  6723. }
  6724. function _diff(current, pre, path, result) {
  6725. if (current === pre) { return }
  6726. var rootCurrentType = type(current);
  6727. var rootPreType = type(pre);
  6728. if (rootCurrentType == OBJECTTYPE) {
  6729. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6730. setResult(result, path, current);
  6731. } else {
  6732. var loop = function ( key ) {
  6733. var currentValue = current[key];
  6734. var preValue = pre[key];
  6735. var currentType = type(currentValue);
  6736. var preType = type(preValue);
  6737. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6738. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  6739. if (currentValue !== pre[key]) {
  6740. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6741. }
  6742. } else if (currentType == ARRAYTYPE) {
  6743. if (preType != ARRAYTYPE) {
  6744. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6745. } else {
  6746. if (currentValue.length < preValue.length) {
  6747. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6748. } else {
  6749. currentValue.forEach(function (item, index) {
  6750. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6751. });
  6752. }
  6753. }
  6754. } else if (currentType == OBJECTTYPE) {
  6755. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6756. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6757. } else {
  6758. for (var subKey in currentValue) {
  6759. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6760. }
  6761. }
  6762. }
  6763. };
  6764. for (var key in current) loop( key );
  6765. }
  6766. } else if (rootCurrentType == ARRAYTYPE) {
  6767. if (rootPreType != ARRAYTYPE) {
  6768. setResult(result, path, current);
  6769. } else {
  6770. if (current.length < pre.length) {
  6771. setResult(result, path, current);
  6772. } else {
  6773. current.forEach(function (item, index) {
  6774. _diff(item, pre[index], path + '[' + index + ']', result);
  6775. });
  6776. }
  6777. }
  6778. } else {
  6779. setResult(result, path, current);
  6780. }
  6781. }
  6782. function setResult(result, k, v) {
  6783. // if (type(v) != FUNCTIONTYPE) {
  6784. result[k] = v;
  6785. // }
  6786. }
  6787. function type(obj) {
  6788. return Object.prototype.toString.call(obj)
  6789. }
  6790. /* */
  6791. function flushCallbacks$1(vm) {
  6792. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6793. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6794. var mpInstance = vm.$scope;
  6795. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6796. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6797. }
  6798. var copies = vm.__next_tick_callbacks.slice(0);
  6799. vm.__next_tick_callbacks.length = 0;
  6800. for (var i = 0; i < copies.length; i++) {
  6801. copies[i]();
  6802. }
  6803. }
  6804. }
  6805. function hasRenderWatcher(vm) {
  6806. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6807. }
  6808. function nextTick$1(vm, cb) {
  6809. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6810. //2.nextTick 之前存在 render watcher
  6811. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6812. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6813. var mpInstance = vm.$scope;
  6814. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6815. ']:nextVueTick');
  6816. }
  6817. return nextTick(cb, vm)
  6818. }else{
  6819. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6820. var mpInstance$1 = vm.$scope;
  6821. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6822. ']:nextMPTick');
  6823. }
  6824. }
  6825. var _resolve;
  6826. if (!vm.__next_tick_callbacks) {
  6827. vm.__next_tick_callbacks = [];
  6828. }
  6829. vm.__next_tick_callbacks.push(function () {
  6830. if (cb) {
  6831. try {
  6832. cb.call(vm);
  6833. } catch (e) {
  6834. handleError(e, vm, 'nextTick');
  6835. }
  6836. } else if (_resolve) {
  6837. _resolve(vm);
  6838. }
  6839. });
  6840. // $flow-disable-line
  6841. if (!cb && typeof Promise !== 'undefined') {
  6842. return new Promise(function (resolve) {
  6843. _resolve = resolve;
  6844. })
  6845. }
  6846. }
  6847. /* */
  6848. function cloneWithData(vm) {
  6849. // 确保当前 vm 所有数据被同步
  6850. var ret = Object.create(null);
  6851. var dataKeys = [].concat(
  6852. Object.keys(vm._data || {}),
  6853. Object.keys(vm._computedWatchers || {}));
  6854. dataKeys.reduce(function(ret, key) {
  6855. ret[key] = vm[key];
  6856. return ret
  6857. }, ret);
  6858. // vue-composition-api
  6859. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6860. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6861. if (rawBindings) {
  6862. Object.keys(rawBindings).forEach(function (key) {
  6863. ret[key] = vm[key];
  6864. });
  6865. }
  6866. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6867. Object.assign(ret, vm.$mp.data || {});
  6868. if (
  6869. Array.isArray(vm.$options.behaviors) &&
  6870. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6871. ) { //form-field
  6872. ret['name'] = vm.name;
  6873. ret['value'] = vm.value;
  6874. }
  6875. return JSON.parse(JSON.stringify(ret))
  6876. }
  6877. var patch = function(oldVnode, vnode) {
  6878. var this$1 = this;
  6879. if (vnode === null) { //destroy
  6880. return
  6881. }
  6882. if (this.mpType === 'page' || this.mpType === 'component') {
  6883. var mpInstance = this.$scope;
  6884. var data = Object.create(null);
  6885. try {
  6886. data = cloneWithData(this);
  6887. } catch (err) {
  6888. console.error(err);
  6889. }
  6890. data.__webviewId__ = mpInstance.data.__webviewId__;
  6891. var mpData = Object.create(null);
  6892. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6893. mpData[key] = mpInstance.data[key];
  6894. });
  6895. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6896. if (Object.keys(diffData).length) {
  6897. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6898. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6899. ']差量更新',
  6900. JSON.stringify(diffData));
  6901. }
  6902. this.__next_tick_pending = true;
  6903. mpInstance.setData(diffData, function () {
  6904. this$1.__next_tick_pending = false;
  6905. flushCallbacks$1(this$1);
  6906. });
  6907. } else {
  6908. flushCallbacks$1(this);
  6909. }
  6910. }
  6911. };
  6912. /* */
  6913. function createEmptyRender() {
  6914. }
  6915. function mountComponent$1(
  6916. vm,
  6917. el,
  6918. hydrating
  6919. ) {
  6920. if (!vm.mpType) {//main.js 中的 new Vue
  6921. return vm
  6922. }
  6923. if (vm.mpType === 'app') {
  6924. vm.$options.render = createEmptyRender;
  6925. }
  6926. if (!vm.$options.render) {
  6927. vm.$options.render = createEmptyRender;
  6928. if (true) {
  6929. /* istanbul ignore if */
  6930. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6931. vm.$options.el || el) {
  6932. warn(
  6933. 'You are using the runtime-only build of Vue where the template ' +
  6934. 'compiler is not available. Either pre-compile the templates into ' +
  6935. 'render functions, or use the compiler-included build.',
  6936. vm
  6937. );
  6938. } else {
  6939. warn(
  6940. 'Failed to mount component: template or render function not defined.',
  6941. vm
  6942. );
  6943. }
  6944. }
  6945. }
  6946. !vm._$fallback && callHook(vm, 'beforeMount');
  6947. var updateComponent = function () {
  6948. vm._update(vm._render(), hydrating);
  6949. };
  6950. // we set this to vm._watcher inside the watcher's constructor
  6951. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6952. // component's mounted hook), which relies on vm._watcher being already defined
  6953. new Watcher(vm, updateComponent, noop, {
  6954. before: function before() {
  6955. if (vm._isMounted && !vm._isDestroyed) {
  6956. callHook(vm, 'beforeUpdate');
  6957. }
  6958. }
  6959. }, true /* isRenderWatcher */);
  6960. hydrating = false;
  6961. return vm
  6962. }
  6963. /* */
  6964. function renderClass (
  6965. staticClass,
  6966. dynamicClass
  6967. ) {
  6968. if (isDef(staticClass) || isDef(dynamicClass)) {
  6969. return concat(staticClass, stringifyClass(dynamicClass))
  6970. }
  6971. /* istanbul ignore next */
  6972. return ''
  6973. }
  6974. function concat (a, b) {
  6975. return a ? b ? (a + ' ' + b) : a : (b || '')
  6976. }
  6977. function stringifyClass (value) {
  6978. if (Array.isArray(value)) {
  6979. return stringifyArray(value)
  6980. }
  6981. if (isObject(value)) {
  6982. return stringifyObject(value)
  6983. }
  6984. if (typeof value === 'string') {
  6985. return value
  6986. }
  6987. /* istanbul ignore next */
  6988. return ''
  6989. }
  6990. function stringifyArray (value) {
  6991. var res = '';
  6992. var stringified;
  6993. for (var i = 0, l = value.length; i < l; i++) {
  6994. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6995. if (res) { res += ' '; }
  6996. res += stringified;
  6997. }
  6998. }
  6999. return res
  7000. }
  7001. function stringifyObject (value) {
  7002. var res = '';
  7003. for (var key in value) {
  7004. if (value[key]) {
  7005. if (res) { res += ' '; }
  7006. res += key;
  7007. }
  7008. }
  7009. return res
  7010. }
  7011. /* */
  7012. var parseStyleText = cached(function (cssText) {
  7013. var res = {};
  7014. var listDelimiter = /;(?![^(]*\))/g;
  7015. var propertyDelimiter = /:(.+)/;
  7016. cssText.split(listDelimiter).forEach(function (item) {
  7017. if (item) {
  7018. var tmp = item.split(propertyDelimiter);
  7019. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7020. }
  7021. });
  7022. return res
  7023. });
  7024. // normalize possible array / string values into Object
  7025. function normalizeStyleBinding (bindingStyle) {
  7026. if (Array.isArray(bindingStyle)) {
  7027. return toObject(bindingStyle)
  7028. }
  7029. if (typeof bindingStyle === 'string') {
  7030. return parseStyleText(bindingStyle)
  7031. }
  7032. return bindingStyle
  7033. }
  7034. /* */
  7035. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7036. function getTarget(obj, path) {
  7037. var parts = path.split('.');
  7038. var key = parts[0];
  7039. if (key.indexOf('__$n') === 0) { //number index
  7040. key = parseInt(key.replace('__$n', ''));
  7041. }
  7042. if (parts.length === 1) {
  7043. return obj[key]
  7044. }
  7045. return getTarget(obj[key], parts.slice(1).join('.'))
  7046. }
  7047. function internalMixin(Vue) {
  7048. Vue.config.errorHandler = function(err, vm, info) {
  7049. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7050. console.error(err);
  7051. /* eslint-disable no-undef */
  7052. var app = typeof getApp === 'function' && getApp();
  7053. if (app && app.onError) {
  7054. app.onError(err);
  7055. }
  7056. };
  7057. var oldEmit = Vue.prototype.$emit;
  7058. Vue.prototype.$emit = function(event) {
  7059. if (this.$scope && event) {
  7060. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent'])
  7061. .call(this.$scope, event, {
  7062. __args__: toArray(arguments, 1)
  7063. })
  7064. }
  7065. return oldEmit.apply(this, arguments)
  7066. };
  7067. Vue.prototype.$nextTick = function(fn) {
  7068. return nextTick$1(this, fn)
  7069. };
  7070. MP_METHODS.forEach(function (method) {
  7071. Vue.prototype[method] = function(args) {
  7072. if (this.$scope && this.$scope[method]) {
  7073. return this.$scope[method](args)
  7074. }
  7075. // mp-alipay
  7076. if (typeof my === 'undefined') {
  7077. return
  7078. }
  7079. if (method === 'createSelectorQuery') {
  7080. /* eslint-disable no-undef */
  7081. return my.createSelectorQuery(args)
  7082. } else if (method === 'createIntersectionObserver') {
  7083. /* eslint-disable no-undef */
  7084. return my.createIntersectionObserver(args)
  7085. }
  7086. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7087. };
  7088. });
  7089. Vue.prototype.__init_provide = initProvide;
  7090. Vue.prototype.__init_injections = initInjections;
  7091. Vue.prototype.__call_hook = function(hook, args) {
  7092. var vm = this;
  7093. // #7573 disable dep collection when invoking lifecycle hooks
  7094. pushTarget();
  7095. var handlers = vm.$options[hook];
  7096. var info = hook + " hook";
  7097. var ret;
  7098. if (handlers) {
  7099. for (var i = 0, j = handlers.length; i < j; i++) {
  7100. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7101. }
  7102. }
  7103. if (vm._hasHookEvent) {
  7104. vm.$emit('hook:' + hook, args);
  7105. }
  7106. popTarget();
  7107. return ret
  7108. };
  7109. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7110. if (Array.isArray(modifiers)) {
  7111. if (modifiers.indexOf('trim') !== -1) {
  7112. value = value.trim();
  7113. }
  7114. if (modifiers.indexOf('number') !== -1) {
  7115. value = this._n(value);
  7116. }
  7117. }
  7118. if (!target) {
  7119. target = this;
  7120. }
  7121. // 解决动态属性添加
  7122. Vue.set(target, key, value)
  7123. };
  7124. Vue.prototype.__set_sync = function(target, key, value) {
  7125. if (!target) {
  7126. target = this;
  7127. }
  7128. // 解决动态属性添加
  7129. Vue.set(target, key, value)
  7130. };
  7131. Vue.prototype.__get_orig = function(item) {
  7132. if (isPlainObject(item)) {
  7133. return item['$orig'] || item
  7134. }
  7135. return item
  7136. };
  7137. Vue.prototype.__get_value = function(dataPath, target) {
  7138. return getTarget(target || this, dataPath)
  7139. };
  7140. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7141. return renderClass(staticClass, dynamicClass)
  7142. };
  7143. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7144. if (!dynamicStyle && !staticStyle) {
  7145. return ''
  7146. }
  7147. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7148. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7149. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7150. };
  7151. Vue.prototype.__map = function(val, iteratee) {
  7152. //TODO 暂不考虑 string
  7153. var ret, i, l, keys, key;
  7154. if (Array.isArray(val)) {
  7155. ret = new Array(val.length);
  7156. for (i = 0, l = val.length; i < l; i++) {
  7157. ret[i] = iteratee(val[i], i);
  7158. }
  7159. return ret
  7160. } else if (isObject(val)) {
  7161. keys = Object.keys(val);
  7162. ret = Object.create(null);
  7163. for (i = 0, l = keys.length; i < l; i++) {
  7164. key = keys[i];
  7165. ret[key] = iteratee(val[key], key, i);
  7166. }
  7167. return ret
  7168. } else if (typeof val === 'number') {
  7169. ret = new Array(val);
  7170. for (i = 0, l = val; i < l; i++) {
  7171. // 第一个参数暂时仍和小程序一致
  7172. ret[i] = iteratee(i, i);
  7173. }
  7174. return ret
  7175. }
  7176. return []
  7177. };
  7178. }
  7179. /* */
  7180. var LIFECYCLE_HOOKS$1 = [
  7181. //App
  7182. 'onLaunch',
  7183. 'onShow',
  7184. 'onHide',
  7185. 'onUniNViewMessage',
  7186. 'onPageNotFound',
  7187. 'onThemeChange',
  7188. 'onError',
  7189. 'onUnhandledRejection',
  7190. //Page
  7191. 'onInit',
  7192. 'onLoad',
  7193. // 'onShow',
  7194. 'onReady',
  7195. // 'onHide',
  7196. 'onUnload',
  7197. 'onPullDownRefresh',
  7198. 'onReachBottom',
  7199. 'onTabItemTap',
  7200. 'onAddToFavorites',
  7201. 'onShareTimeline',
  7202. 'onShareAppMessage',
  7203. 'onResize',
  7204. 'onPageScroll',
  7205. 'onNavigationBarButtonTap',
  7206. 'onBackPress',
  7207. 'onNavigationBarSearchInputChanged',
  7208. 'onNavigationBarSearchInputConfirmed',
  7209. 'onNavigationBarSearchInputClicked',
  7210. //Component
  7211. // 'onReady', // 兼容旧版本,应该移除该事件
  7212. 'onPageShow',
  7213. 'onPageHide',
  7214. 'onPageResize'
  7215. ];
  7216. function lifecycleMixin$1(Vue) {
  7217. //fixed vue-class-component
  7218. var oldExtend = Vue.extend;
  7219. Vue.extend = function(extendOptions) {
  7220. extendOptions = extendOptions || {};
  7221. var methods = extendOptions.methods;
  7222. if (methods) {
  7223. Object.keys(methods).forEach(function (methodName) {
  7224. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7225. extendOptions[methodName] = methods[methodName];
  7226. delete methods[methodName];
  7227. }
  7228. });
  7229. }
  7230. return oldExtend.call(this, extendOptions)
  7231. };
  7232. var strategies = Vue.config.optionMergeStrategies;
  7233. var mergeHook = strategies.created;
  7234. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7235. strategies[hook] = mergeHook;
  7236. });
  7237. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7238. }
  7239. /* */
  7240. // install platform patch function
  7241. Vue.prototype.__patch__ = patch;
  7242. // public mount method
  7243. Vue.prototype.$mount = function(
  7244. el ,
  7245. hydrating
  7246. ) {
  7247. return mountComponent$1(this, el, hydrating)
  7248. };
  7249. lifecycleMixin$1(Vue);
  7250. internalMixin(Vue);
  7251. /* */
  7252. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7253. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  7254. /***/ }),
  7255. /* 4 */
  7256. /*!*************************************************************!*\
  7257. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  7258. \*************************************************************/
  7259. /*! no static exports found */
  7260. /***/ (function(module, exports, __webpack_require__) {
  7261. "use strict";
  7262. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  7263. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  7264. var defaultDelimiters = ['{', '}'];var
  7265. BaseFormatter = /*#__PURE__*/function () {
  7266. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  7267. this._caches = Object.create(null);
  7268. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  7269. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  7270. if (!values) {
  7271. return [message];
  7272. }
  7273. var tokens = this._caches[message];
  7274. if (!tokens) {
  7275. tokens = parse(message, delimiters);
  7276. this._caches[message] = tokens;
  7277. }
  7278. return compile(tokens, values);
  7279. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  7280. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  7281. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  7282. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  7283. var tokens = [];
  7284. var position = 0;
  7285. var text = '';
  7286. while (position < format.length) {
  7287. var char = format[position++];
  7288. if (char === startDelimiter) {
  7289. if (text) {
  7290. tokens.push({ type: 'text', value: text });
  7291. }
  7292. text = '';
  7293. var sub = '';
  7294. char = format[position++];
  7295. while (char !== undefined && char !== endDelimiter) {
  7296. sub += char;
  7297. char = format[position++];
  7298. }
  7299. var isClosed = char === endDelimiter;
  7300. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  7301. 'list' :
  7302. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  7303. 'named' :
  7304. 'unknown';
  7305. tokens.push({ value: sub, type: type });
  7306. }
  7307. // else if (char === '%') {
  7308. // // when found rails i18n syntax, skip text capture
  7309. // if (format[position] !== '{') {
  7310. // text += char
  7311. // }
  7312. // }
  7313. else {
  7314. text += char;
  7315. }
  7316. }
  7317. text && tokens.push({ type: 'text', value: text });
  7318. return tokens;
  7319. }
  7320. function compile(tokens, values) {
  7321. var compiled = [];
  7322. var index = 0;
  7323. var mode = isArray(values) ?
  7324. 'list' :
  7325. isObject(values) ?
  7326. 'named' :
  7327. 'unknown';
  7328. if (mode === 'unknown') {
  7329. return compiled;
  7330. }
  7331. while (index < tokens.length) {
  7332. var token = tokens[index];
  7333. switch (token.type) {
  7334. case 'text':
  7335. compiled.push(token.value);
  7336. break;
  7337. case 'list':
  7338. compiled.push(values[parseInt(token.value, 10)]);
  7339. break;
  7340. case 'named':
  7341. if (mode === 'named') {
  7342. compiled.push(values[token.value]);
  7343. } else
  7344. {
  7345. if (true) {
  7346. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  7347. }
  7348. }
  7349. break;
  7350. case 'unknown':
  7351. if (true) {
  7352. console.warn("Detect 'unknown' type of token!");
  7353. }
  7354. break;}
  7355. index++;
  7356. }
  7357. return compiled;
  7358. }
  7359. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  7360. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  7361. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  7362. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  7363. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  7364. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7365. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  7366. var defaultFormatter = new BaseFormatter();
  7367. function include(str, parts) {
  7368. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  7369. }
  7370. function startsWith(str, parts) {
  7371. return parts.find(function (part) {return str.indexOf(part) === 0;});
  7372. }
  7373. function normalizeLocale(locale, messages) {
  7374. if (!locale) {
  7375. return;
  7376. }
  7377. locale = locale.trim().replace(/_/g, '-');
  7378. if (messages && messages[locale]) {
  7379. return locale;
  7380. }
  7381. locale = locale.toLowerCase();
  7382. if (locale.indexOf('zh') === 0) {
  7383. if (locale.indexOf('-hans') > -1) {
  7384. return LOCALE_ZH_HANS;
  7385. }
  7386. if (locale.indexOf('-hant') > -1) {
  7387. return LOCALE_ZH_HANT;
  7388. }
  7389. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  7390. return LOCALE_ZH_HANT;
  7391. }
  7392. return LOCALE_ZH_HANS;
  7393. }
  7394. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  7395. if (lang) {
  7396. return lang;
  7397. }
  7398. }var
  7399. I18n = /*#__PURE__*/function () {
  7400. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  7401. this.locale = LOCALE_EN;
  7402. this.fallbackLocale = LOCALE_EN;
  7403. this.message = {};
  7404. this.messages = {};
  7405. this.watchers = [];
  7406. if (fallbackLocale) {
  7407. this.fallbackLocale = fallbackLocale;
  7408. }
  7409. this.formater = formater || defaultFormatter;
  7410. this.messages = messages || {};
  7411. this.setLocale(locale || LOCALE_EN);
  7412. if (watcher) {
  7413. this.watchLocale(watcher);
  7414. }
  7415. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  7416. locale) {var _this = this;
  7417. var oldLocale = this.locale;
  7418. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  7419. if (!this.messages[this.locale]) {
  7420. // 可能初始化时不存在
  7421. this.messages[this.locale] = {};
  7422. }
  7423. this.message = this.messages[this.locale];
  7424. // 仅发生变化时,通知
  7425. if (oldLocale !== this.locale) {
  7426. this.watchers.forEach(function (watcher) {
  7427. watcher(_this.locale, oldLocale);
  7428. });
  7429. }
  7430. } }, { key: "getLocale", value: function getLocale()
  7431. {
  7432. return this.locale;
  7433. } }, { key: "watchLocale", value: function watchLocale(
  7434. fn) {var _this2 = this;
  7435. var index = this.watchers.push(fn) - 1;
  7436. return function () {
  7437. _this2.watchers.splice(index, 1);
  7438. };
  7439. } }, { key: "add", value: function add(
  7440. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7441. var curMessages = this.messages[locale];
  7442. if (curMessages) {
  7443. if (override) {
  7444. Object.assign(curMessages, message);
  7445. } else
  7446. {
  7447. Object.keys(message).forEach(function (key) {
  7448. if (!hasOwn(curMessages, key)) {
  7449. curMessages[key] = message[key];
  7450. }
  7451. });
  7452. }
  7453. } else
  7454. {
  7455. this.messages[locale] = message;
  7456. }
  7457. } }, { key: "f", value: function f(
  7458. message, values, delimiters) {
  7459. return this.formater.interpolate(message, values, delimiters).join('');
  7460. } }, { key: "t", value: function t(
  7461. key, locale, values) {
  7462. var message = this.message;
  7463. if (typeof locale === 'string') {
  7464. locale = normalizeLocale(locale, this.messages);
  7465. locale && (message = this.messages[locale]);
  7466. } else
  7467. {
  7468. values = locale;
  7469. }
  7470. if (!hasOwn(message, key)) {
  7471. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  7472. return key;
  7473. }
  7474. return this.formater.interpolate(message[key], values).join('');
  7475. } }]);return I18n;}();exports.I18n = I18n;
  7476. function watchAppLocale(appVm, i18n) {
  7477. // 需要保证 watch 的触发在组件渲染之前
  7478. if (appVm.$watchLocale) {
  7479. // vue2
  7480. appVm.$watchLocale(function (newLocale) {
  7481. i18n.setLocale(newLocale);
  7482. });
  7483. } else
  7484. {
  7485. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  7486. i18n.setLocale(newLocale);
  7487. });
  7488. }
  7489. }
  7490. function getDefaultLocale() {
  7491. if (typeof uni !== 'undefined' && uni.getLocale) {
  7492. return uni.getLocale();
  7493. }
  7494. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  7495. if (typeof global !== 'undefined' && global.getLocale) {
  7496. return global.getLocale();
  7497. }
  7498. return LOCALE_EN;
  7499. }
  7500. 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;
  7501. // 兼容旧版本入参
  7502. if (typeof locale !== 'string') {var _ref4 =
  7503. [
  7504. messages,
  7505. locale];locale = _ref4[0];messages = _ref4[1];
  7506. }
  7507. if (typeof locale !== 'string') {
  7508. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  7509. locale = getDefaultLocale();
  7510. }
  7511. if (typeof fallbackLocale !== 'string') {
  7512. fallbackLocale =
  7513. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  7514. LOCALE_EN;
  7515. }
  7516. var i18n = new I18n({
  7517. locale: locale,
  7518. fallbackLocale: fallbackLocale,
  7519. messages: messages,
  7520. watcher: watcher });
  7521. var _t = function t(key, values) {
  7522. if (typeof getApp !== 'function') {
  7523. // app view
  7524. /* eslint-disable no-func-assign */
  7525. _t = function t(key, values) {
  7526. return i18n.t(key, values);
  7527. };
  7528. } else
  7529. {
  7530. var isWatchedAppLocale = false;
  7531. _t = function t(key, values) {
  7532. var appVm = getApp().$vm;
  7533. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  7534. // options: {
  7535. // type: Array,
  7536. // default () {
  7537. // return [{
  7538. // icon: 'shop',
  7539. // text: t("uni-goods-nav.options.shop"),
  7540. // }, {
  7541. // icon: 'cart',
  7542. // text: t("uni-goods-nav.options.cart")
  7543. // }]
  7544. // }
  7545. // },
  7546. if (appVm) {
  7547. // 触发响应式
  7548. appVm.$locale;
  7549. if (!isWatchedAppLocale) {
  7550. isWatchedAppLocale = true;
  7551. watchAppLocale(appVm, i18n);
  7552. }
  7553. }
  7554. return i18n.t(key, values);
  7555. };
  7556. }
  7557. return _t(key, values);
  7558. };
  7559. return {
  7560. i18n: i18n,
  7561. f: function f(message, values, delimiters) {
  7562. return i18n.f(message, values, delimiters);
  7563. },
  7564. t: function t(key, values) {
  7565. return _t(key, values);
  7566. },
  7567. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7568. return i18n.add(locale, message, override);
  7569. },
  7570. watch: function watch(fn) {
  7571. return i18n.watchLocale(fn);
  7572. },
  7573. getLocale: function getLocale() {
  7574. return i18n.getLocale();
  7575. },
  7576. setLocale: function setLocale(newLocale) {
  7577. return i18n.setLocale(newLocale);
  7578. } };
  7579. }
  7580. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  7581. var formater;
  7582. function hasI18nJson(jsonObj, delimiters) {
  7583. if (!formater) {
  7584. formater = new BaseFormatter();
  7585. }
  7586. return walkJsonObj(jsonObj, function (jsonObj, key) {
  7587. var value = jsonObj[key];
  7588. if (isString(value)) {
  7589. if (isI18nStr(value, delimiters)) {
  7590. return true;
  7591. }
  7592. } else
  7593. {
  7594. return hasI18nJson(value, delimiters);
  7595. }
  7596. });
  7597. }
  7598. function parseI18nJson(jsonObj, values, delimiters) {
  7599. if (!formater) {
  7600. formater = new BaseFormatter();
  7601. }
  7602. walkJsonObj(jsonObj, function (jsonObj, key) {
  7603. var value = jsonObj[key];
  7604. if (isString(value)) {
  7605. if (isI18nStr(value, delimiters)) {
  7606. jsonObj[key] = compileStr(value, values, delimiters);
  7607. }
  7608. } else
  7609. {
  7610. parseI18nJson(value, values, delimiters);
  7611. }
  7612. });
  7613. return jsonObj;
  7614. }
  7615. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  7616. if (!isI18nStr(jsonStr, delimiters)) {
  7617. return jsonStr;
  7618. }
  7619. if (!formater) {
  7620. formater = new BaseFormatter();
  7621. }
  7622. var localeValues = [];
  7623. Object.keys(locales).forEach(function (name) {
  7624. if (name !== locale) {
  7625. localeValues.push({
  7626. locale: name,
  7627. values: locales[name] });
  7628. }
  7629. });
  7630. localeValues.unshift({ locale: locale, values: locales[locale] });
  7631. try {
  7632. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  7633. }
  7634. catch (e) {}
  7635. return jsonStr;
  7636. }
  7637. function isI18nStr(value, delimiters) {
  7638. return value.indexOf(delimiters[0]) > -1;
  7639. }
  7640. function compileStr(value, values, delimiters) {
  7641. return formater.interpolate(value, values, delimiters).join('');
  7642. }
  7643. function compileValue(jsonObj, key, localeValues, delimiters) {
  7644. var value = jsonObj[key];
  7645. if (isString(value)) {
  7646. // 存在国际化
  7647. if (isI18nStr(value, delimiters)) {
  7648. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  7649. if (localeValues.length > 1) {
  7650. // 格式化国际化语言
  7651. var valueLocales = jsonObj[key + 'Locales'] = {};
  7652. localeValues.forEach(function (localValue) {
  7653. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  7654. });
  7655. }
  7656. }
  7657. } else
  7658. {
  7659. compileJsonObj(value, localeValues, delimiters);
  7660. }
  7661. }
  7662. function compileJsonObj(jsonObj, localeValues, delimiters) {
  7663. walkJsonObj(jsonObj, function (jsonObj, key) {
  7664. compileValue(jsonObj, key, localeValues, delimiters);
  7665. });
  7666. return jsonObj;
  7667. }
  7668. function walkJsonObj(jsonObj, walk) {
  7669. if (isArray(jsonObj)) {
  7670. for (var i = 0; i < jsonObj.length; i++) {
  7671. if (walk(jsonObj, i)) {
  7672. return true;
  7673. }
  7674. }
  7675. } else
  7676. if (isObject(jsonObj)) {
  7677. for (var key in jsonObj) {
  7678. if (walk(jsonObj, key)) {
  7679. return true;
  7680. }
  7681. }
  7682. }
  7683. return false;
  7684. }
  7685. function resolveLocale(locales) {
  7686. return function (locale) {
  7687. if (!locale) {
  7688. return locale;
  7689. }
  7690. locale = normalizeLocale(locale) || locale;
  7691. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  7692. };
  7693. }
  7694. function resolveLocaleChain(locale) {
  7695. var chain = [];
  7696. var tokens = locale.split('-');
  7697. while (tokens.length) {
  7698. chain.push(tokens.join('-'));
  7699. tokens.pop();
  7700. }
  7701. return chain;
  7702. }
  7703. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  7704. /***/ }),
  7705. /* 5 */
  7706. /*!*************************************************************************!*\
  7707. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/pages.json ***!
  7708. \*************************************************************************/
  7709. /*! no static exports found */
  7710. /***/ (function(module, exports) {
  7711. /***/ }),
  7712. /* 6 */,
  7713. /* 7 */,
  7714. /* 8 */,
  7715. /* 9 */,
  7716. /* 10 */,
  7717. /* 11 */
  7718. /*!**********************************************************************************************************!*\
  7719. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  7720. \**********************************************************************************************************/
  7721. /*! exports provided: default */
  7722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7723. "use strict";
  7724. __webpack_require__.r(__webpack_exports__);
  7725. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  7726. /* globals __VUE_SSR_CONTEXT__ */
  7727. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  7728. // This module is a runtime utility for cleaner component module output and will
  7729. // be included in the final webpack user bundle.
  7730. function normalizeComponent (
  7731. scriptExports,
  7732. render,
  7733. staticRenderFns,
  7734. functionalTemplate,
  7735. injectStyles,
  7736. scopeId,
  7737. moduleIdentifier, /* server only */
  7738. shadowMode, /* vue-cli only */
  7739. components, // fixed by xxxxxx auto components
  7740. renderjs // fixed by xxxxxx renderjs
  7741. ) {
  7742. // Vue.extend constructor export interop
  7743. var options = typeof scriptExports === 'function'
  7744. ? scriptExports.options
  7745. : scriptExports
  7746. // fixed by xxxxxx auto components
  7747. if (components) {
  7748. if (!options.components) {
  7749. options.components = {}
  7750. }
  7751. var hasOwn = Object.prototype.hasOwnProperty
  7752. for (var name in components) {
  7753. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  7754. options.components[name] = components[name]
  7755. }
  7756. }
  7757. }
  7758. // fixed by xxxxxx renderjs
  7759. if (renderjs) {
  7760. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  7761. this[renderjs.__module] = this
  7762. });
  7763. (options.mixins || (options.mixins = [])).push(renderjs)
  7764. }
  7765. // render functions
  7766. if (render) {
  7767. options.render = render
  7768. options.staticRenderFns = staticRenderFns
  7769. options._compiled = true
  7770. }
  7771. // functional template
  7772. if (functionalTemplate) {
  7773. options.functional = true
  7774. }
  7775. // scopedId
  7776. if (scopeId) {
  7777. options._scopeId = 'data-v-' + scopeId
  7778. }
  7779. var hook
  7780. if (moduleIdentifier) { // server build
  7781. hook = function (context) {
  7782. // 2.3 injection
  7783. context =
  7784. context || // cached call
  7785. (this.$vnode && this.$vnode.ssrContext) || // stateful
  7786. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  7787. // 2.2 with runInNewContext: true
  7788. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  7789. context = __VUE_SSR_CONTEXT__
  7790. }
  7791. // inject component styles
  7792. if (injectStyles) {
  7793. injectStyles.call(this, context)
  7794. }
  7795. // register component module identifier for async chunk inferrence
  7796. if (context && context._registeredComponents) {
  7797. context._registeredComponents.add(moduleIdentifier)
  7798. }
  7799. }
  7800. // used by ssr in case component is cached and beforeCreate
  7801. // never gets called
  7802. options._ssrRegister = hook
  7803. } else if (injectStyles) {
  7804. hook = shadowMode
  7805. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  7806. : injectStyles
  7807. }
  7808. if (hook) {
  7809. if (options.functional) {
  7810. // for template-only hot-reload because in that case the render fn doesn't
  7811. // go through the normalizer
  7812. options._injectStyles = hook
  7813. // register for functioal component in vue file
  7814. var originalRender = options.render
  7815. options.render = function renderWithStyleInjection (h, context) {
  7816. hook.call(context)
  7817. return originalRender(h, context)
  7818. }
  7819. } else {
  7820. // inject component registration as beforeCreate hook
  7821. var existing = options.beforeCreate
  7822. options.beforeCreate = existing
  7823. ? [].concat(existing, hook)
  7824. : [hook]
  7825. }
  7826. }
  7827. return {
  7828. exports: scriptExports,
  7829. options: options
  7830. }
  7831. }
  7832. /***/ }),
  7833. /* 12 */
  7834. /*!********************************************************************************!*\
  7835. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/index.js ***!
  7836. \********************************************************************************/
  7837. /*! no static exports found */
  7838. /***/ (function(module, exports, __webpack_require__) {
  7839. "use strict";
  7840. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  7841. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  7842. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  7843. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  7844. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  7845. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  7846. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  7847. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  7848. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  7849. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  7850. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  7851. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  7852. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  7853. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  7854. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  7855. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  7856. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  7857. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  7858. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  7859. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  7860. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  7861. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  7862. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  7863. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  7864. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  7865. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  7866. // 引入关于是否mixin集成小程序分享的配置
  7867. // import wxshare from './libs/mixin/mpShare.js'
  7868. // 全局挂载引入http相关请求拦截插件
  7869. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  7870. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  7871. // 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
  7872. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  7873. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  7874. // let vuexStore = {};
  7875. // try {
  7876. // vuexStore = require("@/store/$u.mixin.js");
  7877. // } catch (e) {
  7878. // //TODO handle the exception
  7879. // }
  7880. // post类型对象参数转为get类型url参数
  7881. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  7882. 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,
  7883. post: _request.default.post,
  7884. put: _request.default.put,
  7885. 'delete': _request.default.delete,
  7886. hexToRgb: _colorGradient.default.hexToRgb,
  7887. rgbToHex: _colorGradient.default.rgbToHex,
  7888. test: _test.default,
  7889. random: _random.default,
  7890. deepClone: _deepClone.default,
  7891. deepMerge: _deepMerge.default,
  7892. getParent: _getParent.default,
  7893. $parent: _$parent.default,
  7894. addUnit: _addUnit.default,
  7895. trim: _trim.default,
  7896. type: ['primary', 'success', 'error', 'warning', 'info'],
  7897. http: _request.default,
  7898. toast: _toast.default,
  7899. config: _config.default, // uView配置信息相关,比如版本号
  7900. zIndex: _zIndex.default,
  7901. debounce: _debounce.default,
  7902. throttle: _throttle.default };
  7903. // $u挂载到uni对象上
  7904. uni.$u = $u;
  7905. var install = function install(Vue) {
  7906. Vue.mixin(_mixin.default);
  7907. if (Vue.prototype.openShare) {
  7908. Vue.mixin(mpShare);
  7909. }
  7910. // Vue.mixin(vuexStore);
  7911. // 时间格式化,同时两个名称,date和timeFormat
  7912. Vue.filter('timeFormat', function (timestamp, format) {
  7913. return (0, _timeFormat.default)(timestamp, format);
  7914. });
  7915. Vue.filter('date', function (timestamp, format) {
  7916. return (0, _timeFormat.default)(timestamp, format);
  7917. });
  7918. // 将多久以前的方法,注入到全局过滤器
  7919. Vue.filter('timeFrom', function (timestamp, format) {
  7920. return (0, _timeFrom.default)(timestamp, format);
  7921. });
  7922. Vue.prototype.$u = $u;
  7923. };var _default =
  7924. {
  7925. install: install };exports.default = _default;
  7926. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7927. /***/ }),
  7928. /* 13 */
  7929. /*!*******************************************************************************************!*\
  7930. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/mixin/mixin.js ***!
  7931. \*******************************************************************************************/
  7932. /*! no static exports found */
  7933. /***/ (function(module, exports, __webpack_require__) {
  7934. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  7935. data: function data() {
  7936. return {};
  7937. },
  7938. onLoad: function onLoad() {
  7939. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  7940. this.$u.getRect = this.$uGetRect;
  7941. },
  7942. methods: {
  7943. // 查询节点信息
  7944. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  7945. // 解决办法为在组件根部再套一个没有任何作用的view元素
  7946. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  7947. return new Promise(function (resolve) {
  7948. uni.createSelectorQuery().
  7949. in(_this)[all ? 'selectAll' : 'select'](selector).
  7950. boundingClientRect(function (rect) {
  7951. if (all && Array.isArray(rect) && rect.length) {
  7952. resolve(rect);
  7953. }
  7954. if (!all && rect) {
  7955. resolve(rect);
  7956. }
  7957. }).
  7958. exec();
  7959. });
  7960. },
  7961. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  7962. // 避免在created中去定义parent变量
  7963. if (!this.parent) this.parent = false;
  7964. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  7965. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  7966. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  7967. this.parent = this.$u.$parent.call(this, parentName);
  7968. if (this.parent) {
  7969. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  7970. Object.keys(this.parentData).map(function (key) {
  7971. _this2.parentData[key] = _this2.parent[key];
  7972. });
  7973. }
  7974. },
  7975. // 阻止事件冒泡
  7976. preventEvent: function preventEvent(e) {
  7977. e && e.stopPropagation && e.stopPropagation();
  7978. } },
  7979. onReachBottom: function onReachBottom() {
  7980. uni.$emit('uOnReachBottom');
  7981. },
  7982. beforeDestroy: function beforeDestroy() {var _this3 = this;
  7983. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  7984. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  7985. if (this.parent && uni.$u.test.array(this.parent.children)) {
  7986. // 组件销毁时,移除父组件中的children数组中对应的实例
  7987. var childrenList = this.parent.children;
  7988. childrenList.map(function (child, index) {
  7989. // 如果相等,则移除
  7990. if (child === _this3) {
  7991. childrenList.splice(index, 1);
  7992. }
  7993. });
  7994. }
  7995. } };
  7996. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7997. /***/ }),
  7998. /* 14 */
  7999. /*!*********************************************************************************************!*\
  8000. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/request/index.js ***!
  8001. \*********************************************************************************************/
  8002. /*! no static exports found */
  8003. /***/ (function(module, exports, __webpack_require__) {
  8004. "use strict";
  8005. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  8006. 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
  8007. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  8008. // 设置全局默认配置
  8009. value: function setConfig(customConfig) {
  8010. // 深度合并对象,否则会造成对象深层属性丢失
  8011. this.config = (0, _deepMerge.default)(this.config, customConfig);
  8012. }
  8013. // 主要请求部分
  8014. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8015. // 检查请求拦截
  8016. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  8017. var tmpConfig = {};
  8018. var interceptorRequest = this.interceptor.request(options);
  8019. if (interceptorRequest === false) {
  8020. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  8021. return new Promise(function () {});
  8022. }
  8023. this.options = interceptorRequest;
  8024. }
  8025. options.dataType = options.dataType || this.config.dataType;
  8026. options.responseType = options.responseType || this.config.responseType;
  8027. options.url = options.url || '';
  8028. options.params = options.params || {};
  8029. options.header = Object.assign({}, this.config.header, options.header);
  8030. options.method = options.method || this.config.method;
  8031. return new Promise(function (resolve, reject) {
  8032. options.complete = function (response) {
  8033. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  8034. uni.hideLoading();
  8035. // 清除定时器,如果请求回来了,就无需loading
  8036. clearTimeout(_this.config.timer);
  8037. _this.config.timer = null;
  8038. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  8039. if (_this.config.originalData) {
  8040. // 判断是否存在拦截器
  8041. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  8042. var resInterceptors = _this.interceptor.response(response);
  8043. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  8044. if (resInterceptors !== false) {
  8045. resolve(resInterceptors);
  8046. } else {
  8047. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  8048. reject(response);
  8049. }
  8050. } else {
  8051. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  8052. resolve(response);
  8053. }
  8054. } else {
  8055. if (response.statusCode == 200) {
  8056. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  8057. var _resInterceptors = _this.interceptor.response(response.data);
  8058. if (_resInterceptors !== false) {
  8059. resolve(_resInterceptors);
  8060. } else {
  8061. reject(response.data);
  8062. }
  8063. } else {
  8064. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  8065. resolve(response.data);
  8066. }
  8067. } else {
  8068. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  8069. // if(response.errMsg) {
  8070. // uni.showModal({
  8071. // title: response.errMsg
  8072. // });
  8073. // }
  8074. reject(response);
  8075. }
  8076. }
  8077. };
  8078. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  8079. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  8080. options.url : '/' + options.url);
  8081. // 是否显示loading
  8082. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  8083. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  8084. if (_this.config.showLoading && !_this.config.timer) {
  8085. _this.config.timer = setTimeout(function () {
  8086. uni.showLoading({
  8087. title: _this.config.loadingText,
  8088. mask: _this.config.loadingMask });
  8089. _this.config.timer = null;
  8090. }, _this.config.loadingTime);
  8091. }
  8092. uni.request(options);
  8093. });
  8094. // .catch(res => {
  8095. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  8096. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  8097. // return new Promise(()=>{});
  8098. // })
  8099. } }]);
  8100. function Request() {var _this2 = this;_classCallCheck(this, Request);
  8101. this.config = {
  8102. baseUrl: '', // 请求的根域名
  8103. // 默认的请求头
  8104. header: {},
  8105. method: 'POST',
  8106. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  8107. dataType: 'json',
  8108. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  8109. responseType: 'text',
  8110. showLoading: true, // 是否显示请求中的loading
  8111. loadingText: '请求中...',
  8112. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  8113. timer: null, // 定时器
  8114. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  8115. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  8116. };
  8117. // 拦截器
  8118. this.interceptor = {
  8119. // 请求前的拦截
  8120. request: null,
  8121. // 请求后的拦截
  8122. response: null };
  8123. // get请求
  8124. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8125. return _this2.request({
  8126. method: 'GET',
  8127. url: url,
  8128. header: header,
  8129. data: data });
  8130. };
  8131. // post请求
  8132. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8133. return _this2.request({
  8134. url: url,
  8135. method: 'POST',
  8136. header: header,
  8137. data: data });
  8138. };
  8139. // put请求,不支持支付宝小程序(HX2.6.15)
  8140. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8141. return _this2.request({
  8142. url: url,
  8143. method: 'PUT',
  8144. header: header,
  8145. data: data });
  8146. };
  8147. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  8148. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8149. return _this2.request({
  8150. url: url,
  8151. method: 'DELETE',
  8152. header: header,
  8153. data: data });
  8154. };
  8155. }return Request;}();var _default =
  8156. new Request();exports.default = _default;
  8157. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8158. /***/ }),
  8159. /* 15 */
  8160. /*!**************************************************************************************************!*\
  8161. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/deepMerge.js ***!
  8162. \**************************************************************************************************/
  8163. /*! no static exports found */
  8164. /***/ (function(module, exports, __webpack_require__) {
  8165. "use strict";
  8166. 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 };}
  8167. // JS对象深度合并
  8168. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8169. target = (0, _deepClone.default)(target);
  8170. if (typeof target !== 'object' || typeof source !== 'object') return false;
  8171. for (var prop in source) {
  8172. if (!source.hasOwnProperty(prop)) continue;
  8173. if (prop in target) {
  8174. if (typeof target[prop] !== 'object') {
  8175. target[prop] = source[prop];
  8176. } else {
  8177. if (typeof source[prop] !== 'object') {
  8178. target[prop] = source[prop];
  8179. } else {
  8180. if (target[prop].concat && source[prop].concat) {
  8181. target[prop] = target[prop].concat(source[prop]);
  8182. } else {
  8183. target[prop] = deepMerge(target[prop], source[prop]);
  8184. }
  8185. }
  8186. }
  8187. } else {
  8188. target[prop] = source[prop];
  8189. }
  8190. }
  8191. return target;
  8192. }var _default =
  8193. deepMerge;exports.default = _default;
  8194. /***/ }),
  8195. /* 16 */
  8196. /*!**************************************************************************************************!*\
  8197. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/deepClone.js ***!
  8198. \**************************************************************************************************/
  8199. /*! no static exports found */
  8200. /***/ (function(module, exports, __webpack_require__) {
  8201. "use strict";
  8202. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  8203. function isArray(arr) {
  8204. return Object.prototype.toString.call(arr) === '[object Array]';
  8205. }
  8206. // 深度克隆
  8207. function deepClone(obj) {
  8208. // 对常见的“非”值,直接返回原来值
  8209. if ([null, undefined, NaN, false].includes(obj)) return obj;
  8210. if (typeof obj !== "object" && typeof obj !== 'function') {
  8211. //原始类型直接返回
  8212. return obj;
  8213. }
  8214. var o = isArray(obj) ? [] : {};
  8215. for (var i in obj) {
  8216. if (obj.hasOwnProperty(i)) {
  8217. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  8218. }
  8219. }
  8220. return o;
  8221. }var _default =
  8222. deepClone;exports.default = _default;
  8223. /***/ }),
  8224. /* 17 */
  8225. /*!*********************************************************************************************!*\
  8226. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/test.js ***!
  8227. \*********************************************************************************************/
  8228. /*! no static exports found */
  8229. /***/ (function(module, exports, __webpack_require__) {
  8230. "use strict";
  8231. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8232. * 验证电子邮箱格式
  8233. */
  8234. function email(value) {
  8235. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  8236. }
  8237. /**
  8238. * 验证手机格式
  8239. */
  8240. function mobile(value) {
  8241. return /^1[3-9]\d{9}$/.test(value);
  8242. }
  8243. /**
  8244. * 验证URL格式
  8245. */
  8246. function url(value) {
  8247. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  8248. }
  8249. /**
  8250. * 验证日期格式
  8251. */
  8252. function date(value) {
  8253. return !/Invalid|NaN/.test(new Date(value).toString());
  8254. }
  8255. /**
  8256. * 验证ISO类型的日期格式
  8257. */
  8258. function dateISO(value) {
  8259. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  8260. }
  8261. /**
  8262. * 验证十进制数字
  8263. */
  8264. function number(value) {
  8265. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  8266. }
  8267. /**
  8268. * 验证整数
  8269. */
  8270. function digits(value) {
  8271. return /^\d+$/.test(value);
  8272. }
  8273. /**
  8274. * 验证身份证号码
  8275. */
  8276. function idCard(value) {
  8277. 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(
  8278. value);
  8279. }
  8280. /**
  8281. * 是否车牌号
  8282. */
  8283. function carNo(value) {
  8284. // 新能源车牌
  8285. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  8286. // 旧车牌
  8287. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  8288. if (value.length === 7) {
  8289. return creg.test(value);
  8290. } else if (value.length === 8) {
  8291. return xreg.test(value);
  8292. } else {
  8293. return false;
  8294. }
  8295. }
  8296. /**
  8297. * 金额,只允许2位小数
  8298. */
  8299. function amount(value) {
  8300. //金额,只允许保留两位小数
  8301. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  8302. }
  8303. /**
  8304. * 中文
  8305. */
  8306. function chinese(value) {
  8307. var reg = /^[\u4e00-\u9fa5]+$/gi;
  8308. return reg.test(value);
  8309. }
  8310. /**
  8311. * 只能输入字母
  8312. */
  8313. function letter(value) {
  8314. return /^[a-zA-Z]*$/.test(value);
  8315. }
  8316. /**
  8317. * 只能是字母或者数字
  8318. */
  8319. function enOrNum(value) {
  8320. //英文或者数字
  8321. var reg = /^[0-9a-zA-Z]*$/g;
  8322. return reg.test(value);
  8323. }
  8324. /**
  8325. * 验证是否包含某个值
  8326. */
  8327. function contains(value, param) {
  8328. return value.indexOf(param) >= 0;
  8329. }
  8330. /**
  8331. * 验证一个值范围[min, max]
  8332. */
  8333. function range(value, param) {
  8334. return value >= param[0] && value <= param[1];
  8335. }
  8336. /**
  8337. * 验证一个长度范围[min, max]
  8338. */
  8339. function rangeLength(value, param) {
  8340. return value.length >= param[0] && value.length <= param[1];
  8341. }
  8342. /**
  8343. * 是否固定电话
  8344. */
  8345. function landline(value) {
  8346. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  8347. return reg.test(value);
  8348. }
  8349. /**
  8350. * 判断是否为空
  8351. */
  8352. function empty(value) {
  8353. switch (typeof value) {
  8354. case 'undefined':
  8355. return true;
  8356. case 'string':
  8357. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  8358. break;
  8359. case 'boolean':
  8360. if (!value) return true;
  8361. break;
  8362. case 'number':
  8363. if (0 === value || isNaN(value)) return true;
  8364. break;
  8365. case 'object':
  8366. if (null === value || value.length === 0) return true;
  8367. for (var i in value) {
  8368. return false;
  8369. }
  8370. return true;}
  8371. return false;
  8372. }
  8373. /**
  8374. * 是否json字符串
  8375. */
  8376. function jsonString(value) {
  8377. if (typeof value == 'string') {
  8378. try {
  8379. var obj = JSON.parse(value);
  8380. if (typeof obj == 'object' && obj) {
  8381. return true;
  8382. } else {
  8383. return false;
  8384. }
  8385. } catch (e) {
  8386. return false;
  8387. }
  8388. }
  8389. return false;
  8390. }
  8391. /**
  8392. * 是否数组
  8393. */
  8394. function array(value) {
  8395. if (typeof Array.isArray === "function") {
  8396. return Array.isArray(value);
  8397. } else {
  8398. return Object.prototype.toString.call(value) === "[object Array]";
  8399. }
  8400. }
  8401. /**
  8402. * 是否对象
  8403. */
  8404. function object(value) {
  8405. return Object.prototype.toString.call(value) === '[object Object]';
  8406. }
  8407. /**
  8408. * 是否短信验证码
  8409. */
  8410. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  8411. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  8412. }var _default =
  8413. {
  8414. email: email,
  8415. mobile: mobile,
  8416. url: url,
  8417. date: date,
  8418. dateISO: dateISO,
  8419. number: number,
  8420. digits: digits,
  8421. idCard: idCard,
  8422. carNo: carNo,
  8423. amount: amount,
  8424. chinese: chinese,
  8425. letter: letter,
  8426. enOrNum: enOrNum,
  8427. contains: contains,
  8428. range: range,
  8429. rangeLength: rangeLength,
  8430. empty: empty,
  8431. isEmpty: empty,
  8432. jsonString: jsonString,
  8433. landline: landline,
  8434. object: object,
  8435. array: array,
  8436. code: code };exports.default = _default;
  8437. /***/ }),
  8438. /* 18 */
  8439. /*!****************************************************************************************************!*\
  8440. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/queryParams.js ***!
  8441. \****************************************************************************************************/
  8442. /*! no static exports found */
  8443. /***/ (function(module, exports, __webpack_require__) {
  8444. "use strict";
  8445. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8446. * 对象转url参数
  8447. * @param {*} data,对象
  8448. * @param {*} isPrefix,是否自动加上"?"
  8449. */
  8450. 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';
  8451. var prefix = isPrefix ? '?' : '';
  8452. var _result = [];
  8453. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  8454. key) {
  8455. var value = data[key];
  8456. // 去掉为空的参数
  8457. if (['', undefined, null].indexOf(value) >= 0) {
  8458. return "continue";
  8459. }
  8460. // 如果值为数组,另行处理
  8461. if (value.constructor === Array) {
  8462. // e.g. {ids: [1, 2, 3]}
  8463. switch (arrayFormat) {
  8464. case 'indices':
  8465. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  8466. for (var i = 0; i < value.length; i++) {
  8467. _result.push(key + '[' + i + ']=' + value[i]);
  8468. }
  8469. break;
  8470. case 'brackets':
  8471. // 结果: ids[]=1&ids[]=2&ids[]=3
  8472. value.forEach(function (_value) {
  8473. _result.push(key + '[]=' + _value);
  8474. });
  8475. break;
  8476. case 'repeat':
  8477. // 结果: ids=1&ids=2&ids=3
  8478. value.forEach(function (_value) {
  8479. _result.push(key + '=' + _value);
  8480. });
  8481. break;
  8482. case 'comma':
  8483. // 结果: ids=1,2,3
  8484. var commaStr = "";
  8485. value.forEach(function (_value) {
  8486. commaStr += (commaStr ? "," : "") + _value;
  8487. });
  8488. _result.push(key + '=' + commaStr);
  8489. break;
  8490. default:
  8491. value.forEach(function (_value) {
  8492. _result.push(key + '[]=' + _value);
  8493. });}
  8494. } else {
  8495. _result.push(key + '=' + value);
  8496. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  8497. }
  8498. return _result.length ? prefix + _result.join('&') : '';
  8499. }var _default =
  8500. queryParams;exports.default = _default;
  8501. /***/ }),
  8502. /* 19 */
  8503. /*!**********************************************************************************************!*\
  8504. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/route.js ***!
  8505. \**********************************************************************************************/
  8506. /*! no static exports found */
  8507. /***/ (function(module, exports, __webpack_require__) {
  8508. "use strict";
  8509. /* 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;} /**
  8510. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  8511. * 并且带有路由拦截功能
  8512. */var
  8513. Router = /*#__PURE__*/function () {
  8514. function Router() {_classCallCheck(this, Router);
  8515. // 原始属性定义
  8516. this.config = {
  8517. type: 'navigateTo',
  8518. url: '',
  8519. delta: 1, // navigateBack页面后退时,回退的层数
  8520. params: {}, // 传递的参数
  8521. animationType: 'pop-in', // 窗口动画,只在APP有效
  8522. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  8523. intercept: false // 是否需要拦截
  8524. };
  8525. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  8526. // 这里在构造函数中进行this绑定
  8527. this.route = this.route.bind(this);
  8528. }
  8529. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  8530. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  8531. return url[0] === '/' ? url : "/".concat(url);
  8532. }
  8533. // 整合路由参数
  8534. }, { key: "mixinParam", value: function mixinParam(url, params) {
  8535. url = url && this.addRootPath(url);
  8536. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  8537. // 如果有url中有get参数,转换后无需带上"?"
  8538. var query = '';
  8539. if (/.*\/.*\?.*=.*/.test(url)) {
  8540. // object对象转为get类型的参数
  8541. query = uni.$u.queryParams(params, false);
  8542. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  8543. return url += "&" + query;
  8544. } else {
  8545. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  8546. query = uni.$u.queryParams(params);
  8547. return url += query;
  8548. }
  8549. }
  8550. // 对外的方法名称
  8551. }, { 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] : {};
  8552. // 合并用户的配置和内部的默认配置
  8553. mergeConfig = {};
  8554. if (typeof options === 'string') {
  8555. // 如果options为字符串,则为route(url, params)的形式
  8556. mergeConfig.url = this.mixinParam(options, params);
  8557. mergeConfig.type = 'navigateTo';
  8558. } else {
  8559. mergeConfig = uni.$u.deepClone(options, this.config);
  8560. // 否则正常使用mergeConfig中的url和params进行拼接
  8561. mergeConfig.url = this.mixinParam(options.url, options.params);
  8562. }
  8563. if (params.intercept) {
  8564. this.config.intercept = params.intercept;
  8565. }
  8566. // params参数也带给拦截器
  8567. mergeConfig.params = params;
  8568. // 合并内外部参数
  8569. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  8570. // 判断用户是否定义了拦截器
  8571. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  8572. new Promise(function (resolve, reject) {
  8573. uni.$u.routeIntercept(mergeConfig, resolve);
  8574. }));case 10:isNext = _context.sent;
  8575. // 如果isNext为true,则执行路由跳转
  8576. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  8577. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  8578. // 执行路由跳转
  8579. }, { key: "openPage", value: function openPage(config) {
  8580. // 解构参数
  8581. var
  8582. url =
  8583. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  8584. if (config.type == 'navigateTo' || config.type == 'to') {
  8585. uni.navigateTo({
  8586. url: url,
  8587. animationType: animationType,
  8588. animationDuration: animationDuration });
  8589. }
  8590. if (config.type == 'redirectTo' || config.type == 'redirect') {
  8591. uni.redirectTo({
  8592. url: url });
  8593. }
  8594. if (config.type == 'switchTab' || config.type == 'tab') {
  8595. uni.switchTab({
  8596. url: url });
  8597. }
  8598. if (config.type == 'reLaunch' || config.type == 'launch') {
  8599. uni.reLaunch({
  8600. url: url });
  8601. }
  8602. if (config.type == 'navigateBack' || config.type == 'back') {
  8603. uni.navigateBack({
  8604. delta: delta });
  8605. }
  8606. } }]);return Router;}();var _default =
  8607. new Router().route;exports.default = _default;
  8608. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8609. /***/ }),
  8610. /* 20 */
  8611. /*!**********************************************************!*\
  8612. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  8613. \**********************************************************/
  8614. /*! no static exports found */
  8615. /***/ (function(module, exports, __webpack_require__) {
  8616. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  8617. /***/ }),
  8618. /* 21 */
  8619. /*!************************************************************!*\
  8620. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  8621. \************************************************************/
  8622. /*! no static exports found */
  8623. /***/ (function(module, exports, __webpack_require__) {
  8624. /**
  8625. * Copyright (c) 2014-present, Facebook, Inc.
  8626. *
  8627. * This source code is licensed under the MIT license found in the
  8628. * LICENSE file in the root directory of this source tree.
  8629. */
  8630. // This method of obtaining a reference to the global object needs to be
  8631. // kept identical to the way it is obtained in runtime.js
  8632. var g = (function() {
  8633. return this || (typeof self === "object" && self);
  8634. })() || Function("return this")();
  8635. // Use `getOwnPropertyNames` because not all browsers support calling
  8636. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  8637. var hadRuntime = g.regeneratorRuntime &&
  8638. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  8639. // Save the old regeneratorRuntime in case it needs to be restored later.
  8640. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  8641. // Force reevalutation of runtime.js.
  8642. g.regeneratorRuntime = undefined;
  8643. module.exports = __webpack_require__(/*! ./runtime */ 22);
  8644. if (hadRuntime) {
  8645. // Restore the original runtime.
  8646. g.regeneratorRuntime = oldRuntime;
  8647. } else {
  8648. // Remove the global property added by runtime.js.
  8649. try {
  8650. delete g.regeneratorRuntime;
  8651. } catch(e) {
  8652. g.regeneratorRuntime = undefined;
  8653. }
  8654. }
  8655. /***/ }),
  8656. /* 22 */
  8657. /*!*****************************************************!*\
  8658. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  8659. \*****************************************************/
  8660. /*! no static exports found */
  8661. /***/ (function(module, exports) {
  8662. /**
  8663. * Copyright (c) 2014-present, Facebook, Inc.
  8664. *
  8665. * This source code is licensed under the MIT license found in the
  8666. * LICENSE file in the root directory of this source tree.
  8667. */
  8668. !(function(global) {
  8669. "use strict";
  8670. var Op = Object.prototype;
  8671. var hasOwn = Op.hasOwnProperty;
  8672. var undefined; // More compressible than void 0.
  8673. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  8674. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  8675. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  8676. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8677. var inModule = typeof module === "object";
  8678. var runtime = global.regeneratorRuntime;
  8679. if (runtime) {
  8680. if (inModule) {
  8681. // If regeneratorRuntime is defined globally and we're in a module,
  8682. // make the exports object identical to regeneratorRuntime.
  8683. module.exports = runtime;
  8684. }
  8685. // Don't bother evaluating the rest of this file if the runtime was
  8686. // already defined globally.
  8687. return;
  8688. }
  8689. // Define the runtime globally (as expected by generated code) as either
  8690. // module.exports (if we're in a module) or a new, empty object.
  8691. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  8692. function wrap(innerFn, outerFn, self, tryLocsList) {
  8693. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  8694. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  8695. var generator = Object.create(protoGenerator.prototype);
  8696. var context = new Context(tryLocsList || []);
  8697. // The ._invoke method unifies the implementations of the .next,
  8698. // .throw, and .return methods.
  8699. generator._invoke = makeInvokeMethod(innerFn, self, context);
  8700. return generator;
  8701. }
  8702. runtime.wrap = wrap;
  8703. // Try/catch helper to minimize deoptimizations. Returns a completion
  8704. // record like context.tryEntries[i].completion. This interface could
  8705. // have been (and was previously) designed to take a closure to be
  8706. // invoked without arguments, but in all the cases we care about we
  8707. // already have an existing method we want to call, so there's no need
  8708. // to create a new function object. We can even get away with assuming
  8709. // the method takes exactly one argument, since that happens to be true
  8710. // in every case, so we don't have to touch the arguments object. The
  8711. // only additional allocation required is the completion record, which
  8712. // has a stable shape and so hopefully should be cheap to allocate.
  8713. function tryCatch(fn, obj, arg) {
  8714. try {
  8715. return { type: "normal", arg: fn.call(obj, arg) };
  8716. } catch (err) {
  8717. return { type: "throw", arg: err };
  8718. }
  8719. }
  8720. var GenStateSuspendedStart = "suspendedStart";
  8721. var GenStateSuspendedYield = "suspendedYield";
  8722. var GenStateExecuting = "executing";
  8723. var GenStateCompleted = "completed";
  8724. // Returning this object from the innerFn has the same effect as
  8725. // breaking out of the dispatch switch statement.
  8726. var ContinueSentinel = {};
  8727. // Dummy constructor functions that we use as the .constructor and
  8728. // .constructor.prototype properties for functions that return Generator
  8729. // objects. For full spec compliance, you may wish to configure your
  8730. // minifier not to mangle the names of these two functions.
  8731. function Generator() {}
  8732. function GeneratorFunction() {}
  8733. function GeneratorFunctionPrototype() {}
  8734. // This is a polyfill for %IteratorPrototype% for environments that
  8735. // don't natively support it.
  8736. var IteratorPrototype = {};
  8737. IteratorPrototype[iteratorSymbol] = function () {
  8738. return this;
  8739. };
  8740. var getProto = Object.getPrototypeOf;
  8741. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8742. if (NativeIteratorPrototype &&
  8743. NativeIteratorPrototype !== Op &&
  8744. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  8745. // This environment has a native %IteratorPrototype%; use it instead
  8746. // of the polyfill.
  8747. IteratorPrototype = NativeIteratorPrototype;
  8748. }
  8749. var Gp = GeneratorFunctionPrototype.prototype =
  8750. Generator.prototype = Object.create(IteratorPrototype);
  8751. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  8752. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  8753. GeneratorFunctionPrototype[toStringTagSymbol] =
  8754. GeneratorFunction.displayName = "GeneratorFunction";
  8755. // Helper for defining the .next, .throw, and .return methods of the
  8756. // Iterator interface in terms of a single ._invoke method.
  8757. function defineIteratorMethods(prototype) {
  8758. ["next", "throw", "return"].forEach(function(method) {
  8759. prototype[method] = function(arg) {
  8760. return this._invoke(method, arg);
  8761. };
  8762. });
  8763. }
  8764. runtime.isGeneratorFunction = function(genFun) {
  8765. var ctor = typeof genFun === "function" && genFun.constructor;
  8766. return ctor
  8767. ? ctor === GeneratorFunction ||
  8768. // For the native GeneratorFunction constructor, the best we can
  8769. // do is to check its .name property.
  8770. (ctor.displayName || ctor.name) === "GeneratorFunction"
  8771. : false;
  8772. };
  8773. runtime.mark = function(genFun) {
  8774. if (Object.setPrototypeOf) {
  8775. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  8776. } else {
  8777. genFun.__proto__ = GeneratorFunctionPrototype;
  8778. if (!(toStringTagSymbol in genFun)) {
  8779. genFun[toStringTagSymbol] = "GeneratorFunction";
  8780. }
  8781. }
  8782. genFun.prototype = Object.create(Gp);
  8783. return genFun;
  8784. };
  8785. // Within the body of any async function, `await x` is transformed to
  8786. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  8787. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  8788. // meant to be awaited.
  8789. runtime.awrap = function(arg) {
  8790. return { __await: arg };
  8791. };
  8792. function AsyncIterator(generator) {
  8793. function invoke(method, arg, resolve, reject) {
  8794. var record = tryCatch(generator[method], generator, arg);
  8795. if (record.type === "throw") {
  8796. reject(record.arg);
  8797. } else {
  8798. var result = record.arg;
  8799. var value = result.value;
  8800. if (value &&
  8801. typeof value === "object" &&
  8802. hasOwn.call(value, "__await")) {
  8803. return Promise.resolve(value.__await).then(function(value) {
  8804. invoke("next", value, resolve, reject);
  8805. }, function(err) {
  8806. invoke("throw", err, resolve, reject);
  8807. });
  8808. }
  8809. return Promise.resolve(value).then(function(unwrapped) {
  8810. // When a yielded Promise is resolved, its final value becomes
  8811. // the .value of the Promise<{value,done}> result for the
  8812. // current iteration.
  8813. result.value = unwrapped;
  8814. resolve(result);
  8815. }, function(error) {
  8816. // If a rejected Promise was yielded, throw the rejection back
  8817. // into the async generator function so it can be handled there.
  8818. return invoke("throw", error, resolve, reject);
  8819. });
  8820. }
  8821. }
  8822. var previousPromise;
  8823. function enqueue(method, arg) {
  8824. function callInvokeWithMethodAndArg() {
  8825. return new Promise(function(resolve, reject) {
  8826. invoke(method, arg, resolve, reject);
  8827. });
  8828. }
  8829. return previousPromise =
  8830. // If enqueue has been called before, then we want to wait until
  8831. // all previous Promises have been resolved before calling invoke,
  8832. // so that results are always delivered in the correct order. If
  8833. // enqueue has not been called before, then it is important to
  8834. // call invoke immediately, without waiting on a callback to fire,
  8835. // so that the async generator function has the opportunity to do
  8836. // any necessary setup in a predictable way. This predictability
  8837. // is why the Promise constructor synchronously invokes its
  8838. // executor callback, and why async functions synchronously
  8839. // execute code before the first await. Since we implement simple
  8840. // async functions in terms of async generators, it is especially
  8841. // important to get this right, even though it requires care.
  8842. previousPromise ? previousPromise.then(
  8843. callInvokeWithMethodAndArg,
  8844. // Avoid propagating failures to Promises returned by later
  8845. // invocations of the iterator.
  8846. callInvokeWithMethodAndArg
  8847. ) : callInvokeWithMethodAndArg();
  8848. }
  8849. // Define the unified helper method that is used to implement .next,
  8850. // .throw, and .return (see defineIteratorMethods).
  8851. this._invoke = enqueue;
  8852. }
  8853. defineIteratorMethods(AsyncIterator.prototype);
  8854. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  8855. return this;
  8856. };
  8857. runtime.AsyncIterator = AsyncIterator;
  8858. // Note that simple async functions are implemented on top of
  8859. // AsyncIterator objects; they just return a Promise for the value of
  8860. // the final result produced by the iterator.
  8861. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  8862. var iter = new AsyncIterator(
  8863. wrap(innerFn, outerFn, self, tryLocsList)
  8864. );
  8865. return runtime.isGeneratorFunction(outerFn)
  8866. ? iter // If outerFn is a generator, return the full iterator.
  8867. : iter.next().then(function(result) {
  8868. return result.done ? result.value : iter.next();
  8869. });
  8870. };
  8871. function makeInvokeMethod(innerFn, self, context) {
  8872. var state = GenStateSuspendedStart;
  8873. return function invoke(method, arg) {
  8874. if (state === GenStateExecuting) {
  8875. throw new Error("Generator is already running");
  8876. }
  8877. if (state === GenStateCompleted) {
  8878. if (method === "throw") {
  8879. throw arg;
  8880. }
  8881. // Be forgiving, per 25.3.3.3.3 of the spec:
  8882. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  8883. return doneResult();
  8884. }
  8885. context.method = method;
  8886. context.arg = arg;
  8887. while (true) {
  8888. var delegate = context.delegate;
  8889. if (delegate) {
  8890. var delegateResult = maybeInvokeDelegate(delegate, context);
  8891. if (delegateResult) {
  8892. if (delegateResult === ContinueSentinel) continue;
  8893. return delegateResult;
  8894. }
  8895. }
  8896. if (context.method === "next") {
  8897. // Setting context._sent for legacy support of Babel's
  8898. // function.sent implementation.
  8899. context.sent = context._sent = context.arg;
  8900. } else if (context.method === "throw") {
  8901. if (state === GenStateSuspendedStart) {
  8902. state = GenStateCompleted;
  8903. throw context.arg;
  8904. }
  8905. context.dispatchException(context.arg);
  8906. } else if (context.method === "return") {
  8907. context.abrupt("return", context.arg);
  8908. }
  8909. state = GenStateExecuting;
  8910. var record = tryCatch(innerFn, self, context);
  8911. if (record.type === "normal") {
  8912. // If an exception is thrown from innerFn, we leave state ===
  8913. // GenStateExecuting and loop back for another invocation.
  8914. state = context.done
  8915. ? GenStateCompleted
  8916. : GenStateSuspendedYield;
  8917. if (record.arg === ContinueSentinel) {
  8918. continue;
  8919. }
  8920. return {
  8921. value: record.arg,
  8922. done: context.done
  8923. };
  8924. } else if (record.type === "throw") {
  8925. state = GenStateCompleted;
  8926. // Dispatch the exception by looping back around to the
  8927. // context.dispatchException(context.arg) call above.
  8928. context.method = "throw";
  8929. context.arg = record.arg;
  8930. }
  8931. }
  8932. };
  8933. }
  8934. // Call delegate.iterator[context.method](context.arg) and handle the
  8935. // result, either by returning a { value, done } result from the
  8936. // delegate iterator, or by modifying context.method and context.arg,
  8937. // setting context.delegate to null, and returning the ContinueSentinel.
  8938. function maybeInvokeDelegate(delegate, context) {
  8939. var method = delegate.iterator[context.method];
  8940. if (method === undefined) {
  8941. // A .throw or .return when the delegate iterator has no .throw
  8942. // method always terminates the yield* loop.
  8943. context.delegate = null;
  8944. if (context.method === "throw") {
  8945. if (delegate.iterator.return) {
  8946. // If the delegate iterator has a return method, give it a
  8947. // chance to clean up.
  8948. context.method = "return";
  8949. context.arg = undefined;
  8950. maybeInvokeDelegate(delegate, context);
  8951. if (context.method === "throw") {
  8952. // If maybeInvokeDelegate(context) changed context.method from
  8953. // "return" to "throw", let that override the TypeError below.
  8954. return ContinueSentinel;
  8955. }
  8956. }
  8957. context.method = "throw";
  8958. context.arg = new TypeError(
  8959. "The iterator does not provide a 'throw' method");
  8960. }
  8961. return ContinueSentinel;
  8962. }
  8963. var record = tryCatch(method, delegate.iterator, context.arg);
  8964. if (record.type === "throw") {
  8965. context.method = "throw";
  8966. context.arg = record.arg;
  8967. context.delegate = null;
  8968. return ContinueSentinel;
  8969. }
  8970. var info = record.arg;
  8971. if (! info) {
  8972. context.method = "throw";
  8973. context.arg = new TypeError("iterator result is not an object");
  8974. context.delegate = null;
  8975. return ContinueSentinel;
  8976. }
  8977. if (info.done) {
  8978. // Assign the result of the finished delegate to the temporary
  8979. // variable specified by delegate.resultName (see delegateYield).
  8980. context[delegate.resultName] = info.value;
  8981. // Resume execution at the desired location (see delegateYield).
  8982. context.next = delegate.nextLoc;
  8983. // If context.method was "throw" but the delegate handled the
  8984. // exception, let the outer generator proceed normally. If
  8985. // context.method was "next", forget context.arg since it has been
  8986. // "consumed" by the delegate iterator. If context.method was
  8987. // "return", allow the original .return call to continue in the
  8988. // outer generator.
  8989. if (context.method !== "return") {
  8990. context.method = "next";
  8991. context.arg = undefined;
  8992. }
  8993. } else {
  8994. // Re-yield the result returned by the delegate method.
  8995. return info;
  8996. }
  8997. // The delegate iterator is finished, so forget it and continue with
  8998. // the outer generator.
  8999. context.delegate = null;
  9000. return ContinueSentinel;
  9001. }
  9002. // Define Generator.prototype.{next,throw,return} in terms of the
  9003. // unified ._invoke helper method.
  9004. defineIteratorMethods(Gp);
  9005. Gp[toStringTagSymbol] = "Generator";
  9006. // A Generator should always return itself as the iterator object when the
  9007. // @@iterator function is called on it. Some browsers' implementations of the
  9008. // iterator prototype chain incorrectly implement this, causing the Generator
  9009. // object to not be returned from this call. This ensures that doesn't happen.
  9010. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9011. Gp[iteratorSymbol] = function() {
  9012. return this;
  9013. };
  9014. Gp.toString = function() {
  9015. return "[object Generator]";
  9016. };
  9017. function pushTryEntry(locs) {
  9018. var entry = { tryLoc: locs[0] };
  9019. if (1 in locs) {
  9020. entry.catchLoc = locs[1];
  9021. }
  9022. if (2 in locs) {
  9023. entry.finallyLoc = locs[2];
  9024. entry.afterLoc = locs[3];
  9025. }
  9026. this.tryEntries.push(entry);
  9027. }
  9028. function resetTryEntry(entry) {
  9029. var record = entry.completion || {};
  9030. record.type = "normal";
  9031. delete record.arg;
  9032. entry.completion = record;
  9033. }
  9034. function Context(tryLocsList) {
  9035. // The root entry object (effectively a try statement without a catch
  9036. // or a finally block) gives us a place to store values thrown from
  9037. // locations where there is no enclosing try statement.
  9038. this.tryEntries = [{ tryLoc: "root" }];
  9039. tryLocsList.forEach(pushTryEntry, this);
  9040. this.reset(true);
  9041. }
  9042. runtime.keys = function(object) {
  9043. var keys = [];
  9044. for (var key in object) {
  9045. keys.push(key);
  9046. }
  9047. keys.reverse();
  9048. // Rather than returning an object with a next method, we keep
  9049. // things simple and return the next function itself.
  9050. return function next() {
  9051. while (keys.length) {
  9052. var key = keys.pop();
  9053. if (key in object) {
  9054. next.value = key;
  9055. next.done = false;
  9056. return next;
  9057. }
  9058. }
  9059. // To avoid creating an additional object, we just hang the .value
  9060. // and .done properties off the next function object itself. This
  9061. // also ensures that the minifier will not anonymize the function.
  9062. next.done = true;
  9063. return next;
  9064. };
  9065. };
  9066. function values(iterable) {
  9067. if (iterable) {
  9068. var iteratorMethod = iterable[iteratorSymbol];
  9069. if (iteratorMethod) {
  9070. return iteratorMethod.call(iterable);
  9071. }
  9072. if (typeof iterable.next === "function") {
  9073. return iterable;
  9074. }
  9075. if (!isNaN(iterable.length)) {
  9076. var i = -1, next = function next() {
  9077. while (++i < iterable.length) {
  9078. if (hasOwn.call(iterable, i)) {
  9079. next.value = iterable[i];
  9080. next.done = false;
  9081. return next;
  9082. }
  9083. }
  9084. next.value = undefined;
  9085. next.done = true;
  9086. return next;
  9087. };
  9088. return next.next = next;
  9089. }
  9090. }
  9091. // Return an iterator with no values.
  9092. return { next: doneResult };
  9093. }
  9094. runtime.values = values;
  9095. function doneResult() {
  9096. return { value: undefined, done: true };
  9097. }
  9098. Context.prototype = {
  9099. constructor: Context,
  9100. reset: function(skipTempReset) {
  9101. this.prev = 0;
  9102. this.next = 0;
  9103. // Resetting context._sent for legacy support of Babel's
  9104. // function.sent implementation.
  9105. this.sent = this._sent = undefined;
  9106. this.done = false;
  9107. this.delegate = null;
  9108. this.method = "next";
  9109. this.arg = undefined;
  9110. this.tryEntries.forEach(resetTryEntry);
  9111. if (!skipTempReset) {
  9112. for (var name in this) {
  9113. // Not sure about the optimal order of these conditions:
  9114. if (name.charAt(0) === "t" &&
  9115. hasOwn.call(this, name) &&
  9116. !isNaN(+name.slice(1))) {
  9117. this[name] = undefined;
  9118. }
  9119. }
  9120. }
  9121. },
  9122. stop: function() {
  9123. this.done = true;
  9124. var rootEntry = this.tryEntries[0];
  9125. var rootRecord = rootEntry.completion;
  9126. if (rootRecord.type === "throw") {
  9127. throw rootRecord.arg;
  9128. }
  9129. return this.rval;
  9130. },
  9131. dispatchException: function(exception) {
  9132. if (this.done) {
  9133. throw exception;
  9134. }
  9135. var context = this;
  9136. function handle(loc, caught) {
  9137. record.type = "throw";
  9138. record.arg = exception;
  9139. context.next = loc;
  9140. if (caught) {
  9141. // If the dispatched exception was caught by a catch block,
  9142. // then let that catch block handle the exception normally.
  9143. context.method = "next";
  9144. context.arg = undefined;
  9145. }
  9146. return !! caught;
  9147. }
  9148. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9149. var entry = this.tryEntries[i];
  9150. var record = entry.completion;
  9151. if (entry.tryLoc === "root") {
  9152. // Exception thrown outside of any try block that could handle
  9153. // it, so set the completion value of the entire function to
  9154. // throw the exception.
  9155. return handle("end");
  9156. }
  9157. if (entry.tryLoc <= this.prev) {
  9158. var hasCatch = hasOwn.call(entry, "catchLoc");
  9159. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9160. if (hasCatch && hasFinally) {
  9161. if (this.prev < entry.catchLoc) {
  9162. return handle(entry.catchLoc, true);
  9163. } else if (this.prev < entry.finallyLoc) {
  9164. return handle(entry.finallyLoc);
  9165. }
  9166. } else if (hasCatch) {
  9167. if (this.prev < entry.catchLoc) {
  9168. return handle(entry.catchLoc, true);
  9169. }
  9170. } else if (hasFinally) {
  9171. if (this.prev < entry.finallyLoc) {
  9172. return handle(entry.finallyLoc);
  9173. }
  9174. } else {
  9175. throw new Error("try statement without catch or finally");
  9176. }
  9177. }
  9178. }
  9179. },
  9180. abrupt: function(type, arg) {
  9181. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9182. var entry = this.tryEntries[i];
  9183. if (entry.tryLoc <= this.prev &&
  9184. hasOwn.call(entry, "finallyLoc") &&
  9185. this.prev < entry.finallyLoc) {
  9186. var finallyEntry = entry;
  9187. break;
  9188. }
  9189. }
  9190. if (finallyEntry &&
  9191. (type === "break" ||
  9192. type === "continue") &&
  9193. finallyEntry.tryLoc <= arg &&
  9194. arg <= finallyEntry.finallyLoc) {
  9195. // Ignore the finally entry if control is not jumping to a
  9196. // location outside the try/catch block.
  9197. finallyEntry = null;
  9198. }
  9199. var record = finallyEntry ? finallyEntry.completion : {};
  9200. record.type = type;
  9201. record.arg = arg;
  9202. if (finallyEntry) {
  9203. this.method = "next";
  9204. this.next = finallyEntry.finallyLoc;
  9205. return ContinueSentinel;
  9206. }
  9207. return this.complete(record);
  9208. },
  9209. complete: function(record, afterLoc) {
  9210. if (record.type === "throw") {
  9211. throw record.arg;
  9212. }
  9213. if (record.type === "break" ||
  9214. record.type === "continue") {
  9215. this.next = record.arg;
  9216. } else if (record.type === "return") {
  9217. this.rval = this.arg = record.arg;
  9218. this.method = "return";
  9219. this.next = "end";
  9220. } else if (record.type === "normal" && afterLoc) {
  9221. this.next = afterLoc;
  9222. }
  9223. return ContinueSentinel;
  9224. },
  9225. finish: function(finallyLoc) {
  9226. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9227. var entry = this.tryEntries[i];
  9228. if (entry.finallyLoc === finallyLoc) {
  9229. this.complete(entry.completion, entry.afterLoc);
  9230. resetTryEntry(entry);
  9231. return ContinueSentinel;
  9232. }
  9233. }
  9234. },
  9235. "catch": function(tryLoc) {
  9236. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9237. var entry = this.tryEntries[i];
  9238. if (entry.tryLoc === tryLoc) {
  9239. var record = entry.completion;
  9240. if (record.type === "throw") {
  9241. var thrown = record.arg;
  9242. resetTryEntry(entry);
  9243. }
  9244. return thrown;
  9245. }
  9246. }
  9247. // The context.catch method must only be called with a location
  9248. // argument that corresponds to a known catch block.
  9249. throw new Error("illegal catch attempt");
  9250. },
  9251. delegateYield: function(iterable, resultName, nextLoc) {
  9252. this.delegate = {
  9253. iterator: values(iterable),
  9254. resultName: resultName,
  9255. nextLoc: nextLoc
  9256. };
  9257. if (this.method === "next") {
  9258. // Deliberately forget the last sent value so that we don't
  9259. // accidentally pass it on to the delegate.
  9260. this.arg = undefined;
  9261. }
  9262. return ContinueSentinel;
  9263. }
  9264. };
  9265. })(
  9266. // In sloppy mode, unbound `this` refers to the global object, fallback to
  9267. // Function constructor if we're in global strict mode. That is sadly a form
  9268. // of indirect eval which violates Content Security Policy.
  9269. (function() {
  9270. return this || (typeof self === "object" && self);
  9271. })() || Function("return this")()
  9272. );
  9273. /***/ }),
  9274. /* 23 */
  9275. /*!***************************************************************************************************!*\
  9276. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/timeFormat.js ***!
  9277. \***************************************************************************************************/
  9278. /*! no static exports found */
  9279. /***/ (function(module, exports, __webpack_require__) {
  9280. "use strict";
  9281. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  9282. // 所以这里做一个兼容polyfill的兼容处理
  9283. if (!String.prototype.padStart) {
  9284. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  9285. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  9286. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  9287. 'fillString must be String');
  9288. var str = this;
  9289. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  9290. if (str.length >= maxLength) return String(str);
  9291. var fillLength = maxLength - str.length,
  9292. times = Math.ceil(fillLength / fillString.length);
  9293. while (times >>= 1) {
  9294. fillString += fillString;
  9295. if (times === 1) {
  9296. fillString += fillString;
  9297. }
  9298. }
  9299. return fillString.slice(0, fillLength) + str;
  9300. };
  9301. }
  9302. // 其他更多是格式化有如下:
  9303. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  9304. 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';
  9305. // 如果为null,则格式化当前时间
  9306. if (!dateTime) dateTime = Number(new Date());
  9307. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9308. if (dateTime.toString().length == 10) dateTime *= 1000;
  9309. var date = new Date(dateTime);
  9310. var ret;
  9311. var opt = {
  9312. "y+": date.getFullYear().toString(), // 年
  9313. "m+": (date.getMonth() + 1).toString(), // 月
  9314. "d+": date.getDate().toString(), // 日
  9315. "h+": date.getHours().toString(), // 时
  9316. "M+": date.getMinutes().toString(), // 分
  9317. "s+": date.getSeconds().toString() // 秒
  9318. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  9319. };
  9320. for (var k in opt) {
  9321. ret = new RegExp("(" + k + ")").exec(fmt);
  9322. if (ret) {
  9323. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  9324. };
  9325. };
  9326. return fmt;
  9327. }var _default =
  9328. timeFormat;exports.default = _default;
  9329. /***/ }),
  9330. /* 24 */
  9331. /*!*************************************************************************************************!*\
  9332. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/timeFrom.js ***!
  9333. \*************************************************************************************************/
  9334. /*! no static exports found */
  9335. /***/ (function(module, exports, __webpack_require__) {
  9336. "use strict";
  9337. 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 };}
  9338. /**
  9339. * 时间戳转为多久之前
  9340. * @param String timestamp 时间戳
  9341. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  9342. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  9343. */
  9344. 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';
  9345. // 如果为null,则格式化当前时间
  9346. if (!dateTime) dateTime = Number(new Date());
  9347. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9348. if (dateTime.toString().length == 10) dateTime *= 1000;
  9349. var timestamp = +new Date(Number(dateTime));
  9350. var timer = (Number(new Date()) - timestamp) / 1000;
  9351. // 如果小于5分钟,则返回"刚刚",其他以此类推
  9352. var tips = '';
  9353. switch (true) {
  9354. case timer < 300:
  9355. tips = '刚刚';
  9356. break;
  9357. case timer >= 300 && timer < 3600:
  9358. tips = parseInt(timer / 60) + '分钟前';
  9359. break;
  9360. case timer >= 3600 && timer < 86400:
  9361. tips = parseInt(timer / 3600) + '小时前';
  9362. break;
  9363. case timer >= 86400 && timer < 2592000:
  9364. tips = parseInt(timer / 86400) + '天前';
  9365. break;
  9366. default:
  9367. // 如果format为false,则无论什么时间戳,都显示xx之前
  9368. if (format === false) {
  9369. if (timer >= 2592000 && timer < 365 * 86400) {
  9370. tips = parseInt(timer / (86400 * 30)) + '个月前';
  9371. } else {
  9372. tips = parseInt(timer / (86400 * 365)) + '年前';
  9373. }
  9374. } else {
  9375. tips = (0, _timeFormat.default)(timestamp, format);
  9376. }}
  9377. return tips;
  9378. }var _default =
  9379. timeFrom;exports.default = _default;
  9380. /***/ }),
  9381. /* 25 */
  9382. /*!******************************************************************************************************!*\
  9383. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/colorGradient.js ***!
  9384. \******************************************************************************************************/
  9385. /*! no static exports found */
  9386. /***/ (function(module, exports, __webpack_require__) {
  9387. "use strict";
  9388. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9389. * 求两个颜色之间的渐变值
  9390. * @param {string} startColor 开始的颜色
  9391. * @param {string} endColor 结束的颜色
  9392. * @param {number} step 颜色等分的份额
  9393. * */
  9394. 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;
  9395. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  9396. var startR = startRGB[0];
  9397. var startG = startRGB[1];
  9398. var startB = startRGB[2];
  9399. var endRGB = hexToRgb(endColor, false);
  9400. var endR = endRGB[0];
  9401. var endG = endRGB[1];
  9402. var endB = endRGB[2];
  9403. var sR = (endR - startR) / step; //总差值
  9404. var sG = (endG - startG) / step;
  9405. var sB = (endB - startB) / step;
  9406. var colorArr = [];
  9407. for (var i = 0; i < step; i++) {
  9408. //计算每一步的hex值
  9409. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  9410. i + startB) + ')');
  9411. colorArr.push(hex);
  9412. }
  9413. return colorArr;
  9414. }
  9415. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  9416. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9417. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9418. sColor = sColor.toLowerCase();
  9419. if (sColor && reg.test(sColor)) {
  9420. if (sColor.length === 4) {
  9421. var sColorNew = "#";
  9422. for (var i = 1; i < 4; i += 1) {
  9423. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9424. }
  9425. sColor = sColorNew;
  9426. }
  9427. //处理六位的颜色值
  9428. var sColorChange = [];
  9429. for (var _i = 1; _i < 7; _i += 2) {
  9430. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  9431. }
  9432. if (!str) {
  9433. return sColorChange;
  9434. } else {
  9435. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  9436. }
  9437. } else if (/^(rgb|RGB)/.test(sColor)) {
  9438. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9439. return arr.map(function (val) {return Number(val);});
  9440. } else {
  9441. return sColor;
  9442. }
  9443. };
  9444. // 将rgb表示方式转换为hex表示方式
  9445. function rgbToHex(rgb) {
  9446. var _this = rgb;
  9447. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9448. if (/^(rgb|RGB)/.test(_this)) {
  9449. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9450. var strHex = "#";
  9451. for (var i = 0; i < aColor.length; i++) {
  9452. var hex = Number(aColor[i]).toString(16);
  9453. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  9454. if (hex === "0") {
  9455. hex += hex;
  9456. }
  9457. strHex += hex;
  9458. }
  9459. if (strHex.length !== 7) {
  9460. strHex = _this;
  9461. }
  9462. return strHex;
  9463. } else if (reg.test(_this)) {
  9464. var aNum = _this.replace(/#/, "").split("");
  9465. if (aNum.length === 6) {
  9466. return _this;
  9467. } else if (aNum.length === 3) {
  9468. var numHex = "#";
  9469. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  9470. numHex += aNum[_i2] + aNum[_i2];
  9471. }
  9472. return numHex;
  9473. }
  9474. } else {
  9475. return _this;
  9476. }
  9477. }
  9478. /**
  9479. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  9480. * sHex为传入的十六进制的色值
  9481. * alpha为rgba的透明度
  9482. */
  9483. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  9484. color = rgbToHex(color);
  9485. // 十六进制颜色值的正则表达式
  9486. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9487. /* 16进制颜色转为RGB格式 */
  9488. var sColor = color.toLowerCase();
  9489. if (sColor && reg.test(sColor)) {
  9490. if (sColor.length === 4) {
  9491. var sColorNew = '#';
  9492. for (var i = 1; i < 4; i += 1) {
  9493. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9494. }
  9495. sColor = sColorNew;
  9496. }
  9497. // 处理六位的颜色值
  9498. var sColorChange = [];
  9499. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  9500. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  9501. }
  9502. // return sColorChange.join(',')
  9503. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  9504. } else
  9505. {
  9506. return sColor;
  9507. }
  9508. }var _default =
  9509. {
  9510. colorGradient: colorGradient,
  9511. hexToRgb: hexToRgb,
  9512. rgbToHex: rgbToHex,
  9513. colorToRgba: colorToRgba };exports.default = _default;
  9514. /***/ }),
  9515. /* 26 */
  9516. /*!*********************************************************************************************!*\
  9517. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/guid.js ***!
  9518. \*********************************************************************************************/
  9519. /*! no static exports found */
  9520. /***/ (function(module, exports, __webpack_require__) {
  9521. "use strict";
  9522. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9523. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  9524. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  9525. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  9526. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  9527. * v-for的时候,推荐使用后端返回的id而不是循环的index
  9528. * @param {Number} len uuid的长度
  9529. * @param {Boolean} firstU 将返回的首字母置为"u"
  9530. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  9531. */
  9532. 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;
  9533. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  9534. var uuid = [];
  9535. radix = radix || chars.length;
  9536. if (len) {
  9537. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  9538. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  9539. } else {
  9540. var r;
  9541. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  9542. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  9543. uuid[14] = '4';
  9544. for (var _i = 0; _i < 36; _i++) {
  9545. if (!uuid[_i]) {
  9546. r = 0 | Math.random() * 16;
  9547. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  9548. }
  9549. }
  9550. }
  9551. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  9552. if (firstU) {
  9553. uuid.shift();
  9554. return 'u' + uuid.join('');
  9555. } else {
  9556. return uuid.join('');
  9557. }
  9558. }var _default =
  9559. guid;exports.default = _default;
  9560. /***/ }),
  9561. /* 27 */
  9562. /*!**********************************************************************************************!*\
  9563. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/color.js ***!
  9564. \**********************************************************************************************/
  9565. /*! no static exports found */
  9566. /***/ (function(module, exports, __webpack_require__) {
  9567. "use strict";
  9568. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  9569. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  9570. var color = {
  9571. primary: "#2979ff",
  9572. primaryDark: "#2b85e4",
  9573. primaryDisabled: "#a0cfff",
  9574. primaryLight: "#ecf5ff",
  9575. bgColor: "#f3f4f6",
  9576. info: "#909399",
  9577. infoDark: "#82848a",
  9578. infoDisabled: "#c8c9cc",
  9579. infoLight: "#f4f4f5",
  9580. warning: "#ff9900",
  9581. warningDark: "#f29100",
  9582. warningDisabled: "#fcbd71",
  9583. warningLight: "#fdf6ec",
  9584. error: "#fa3534",
  9585. errorDark: "#dd6161",
  9586. errorDisabled: "#fab6b6",
  9587. errorLight: "#fef0f0",
  9588. success: "#19be6b",
  9589. successDark: "#18b566",
  9590. successDisabled: "#71d5a1",
  9591. successLight: "#dbf1e1",
  9592. mainColor: "#303133",
  9593. contentColor: "#606266",
  9594. tipsColor: "#909399",
  9595. lightColor: "#c0c4cc",
  9596. borderColor: "#e4e7ed" };var _default =
  9597. color;exports.default = _default;
  9598. /***/ }),
  9599. /* 28 */
  9600. /*!**************************************************************************************************!*\
  9601. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/type2icon.js ***!
  9602. \**************************************************************************************************/
  9603. /*! no static exports found */
  9604. /***/ (function(module, exports, __webpack_require__) {
  9605. "use strict";
  9606. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9607. * 根据主题type值,获取对应的图标
  9608. * @param String type 主题名称,primary|info|error|warning|success
  9609. * @param String fill 是否使用fill填充实体的图标
  9610. */
  9611. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9612. // 如果非预置值,默认为success
  9613. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  9614. var iconName = '';
  9615. // 目前(2019-12-12),info和primary使用同一个图标
  9616. switch (type) {
  9617. case 'primary':
  9618. iconName = 'info-circle';
  9619. break;
  9620. case 'info':
  9621. iconName = 'info-circle';
  9622. break;
  9623. case 'error':
  9624. iconName = 'close-circle';
  9625. break;
  9626. case 'warning':
  9627. iconName = 'error-circle';
  9628. break;
  9629. case 'success':
  9630. iconName = 'checkmark-circle';
  9631. break;
  9632. default:
  9633. iconName = 'checkmark-circle';}
  9634. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  9635. if (fill) iconName += '-fill';
  9636. return iconName;
  9637. }var _default =
  9638. type2icon;exports.default = _default;
  9639. /***/ }),
  9640. /* 29 */
  9641. /*!****************************************************************************************************!*\
  9642. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/randomArray.js ***!
  9643. \****************************************************************************************************/
  9644. /*! no static exports found */
  9645. /***/ (function(module, exports, __webpack_require__) {
  9646. "use strict";
  9647. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  9648. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9649. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  9650. return array.sort(function () {return Math.random() - 0.5;});
  9651. }var _default =
  9652. randomArray;exports.default = _default;
  9653. /***/ }),
  9654. /* 30 */
  9655. /*!************************************************************************************************!*\
  9656. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/addUnit.js ***!
  9657. \************************************************************************************************/
  9658. /*! no static exports found */
  9659. /***/ (function(module, exports, __webpack_require__) {
  9660. "use strict";
  9661. 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 };}
  9662. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  9663. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  9664. value = String(value);
  9665. // 用uView内置验证规则中的number判断是否为数值
  9666. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  9667. }
  9668. /***/ }),
  9669. /* 31 */
  9670. /*!***********************************************************************************************!*\
  9671. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/random.js ***!
  9672. \***********************************************************************************************/
  9673. /*! no static exports found */
  9674. /***/ (function(module, exports, __webpack_require__) {
  9675. "use strict";
  9676. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  9677. if (min >= 0 && max > 0 && max >= min) {
  9678. var gab = max - min + 1;
  9679. return Math.floor(Math.random() * gab + min);
  9680. } else {
  9681. return 0;
  9682. }
  9683. }var _default =
  9684. random;exports.default = _default;
  9685. /***/ }),
  9686. /* 32 */
  9687. /*!*********************************************************************************************!*\
  9688. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/trim.js ***!
  9689. \*********************************************************************************************/
  9690. /*! no static exports found */
  9691. /***/ (function(module, exports, __webpack_require__) {
  9692. "use strict";
  9693. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  9694. if (pos == 'both') {
  9695. return str.replace(/^\s+|\s+$/g, "");
  9696. } else if (pos == "left") {
  9697. return str.replace(/^\s*/, '');
  9698. } else if (pos == 'right') {
  9699. return str.replace(/(\s*$)/g, "");
  9700. } else if (pos == 'all') {
  9701. return str.replace(/\s+/g, "");
  9702. } else {
  9703. return str;
  9704. }
  9705. }var _default =
  9706. trim;exports.default = _default;
  9707. /***/ }),
  9708. /* 33 */
  9709. /*!**********************************************************************************************!*\
  9710. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/toast.js ***!
  9711. \**********************************************************************************************/
  9712. /*! no static exports found */
  9713. /***/ (function(module, exports, __webpack_require__) {
  9714. "use strict";
  9715. /* 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;
  9716. uni.showToast({
  9717. title: title,
  9718. icon: 'none',
  9719. duration: duration });
  9720. }var _default =
  9721. toast;exports.default = _default;
  9722. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9723. /***/ }),
  9724. /* 34 */
  9725. /*!**************************************************************************************************!*\
  9726. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/getParent.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 = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9732. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9733. function getParent(name, keys) {
  9734. var parent = this.$parent;
  9735. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9736. while (parent) {
  9737. // 父组件
  9738. if (parent.$options.name !== name) {
  9739. // 如果组件的name不相等,继续上一级寻找
  9740. parent = parent.$parent;
  9741. } else {var _ret = function () {
  9742. var data = {};
  9743. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  9744. if (Array.isArray(keys)) {
  9745. keys.map(function (val) {
  9746. data[val] = parent[val] ? parent[val] : '';
  9747. });
  9748. } else {
  9749. // 历遍传过来的对象参数
  9750. for (var i in keys) {
  9751. // 如果子组件有此值则用,无此值则用父组件的值
  9752. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  9753. if (Array.isArray(keys[i])) {
  9754. if (keys[i].length) {
  9755. data[i] = keys[i];
  9756. } else {
  9757. data[i] = parent[i];
  9758. }
  9759. } else if (keys[i].constructor === Object) {
  9760. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  9761. if (Object.keys(keys[i]).length) {
  9762. data[i] = keys[i];
  9763. } else {
  9764. data[i] = parent[i];
  9765. }
  9766. } else {
  9767. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  9768. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  9769. }
  9770. }
  9771. }
  9772. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  9773. }
  9774. }
  9775. return {};
  9776. }
  9777. /***/ }),
  9778. /* 35 */
  9779. /*!************************************************************************************************!*\
  9780. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/$parent.js ***!
  9781. \************************************************************************************************/
  9782. /*! no static exports found */
  9783. /***/ (function(module, exports, __webpack_require__) {
  9784. "use strict";
  9785. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9786. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9787. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  9788. // 值(默认为undefined),就是查找最顶层的$parent
  9789. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  9790. var parent = this.$parent;
  9791. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9792. while (parent) {
  9793. // 父组件
  9794. if (parent.$options && parent.$options.name !== name) {
  9795. // 如果组件的name不相等,继续上一级寻找
  9796. parent = parent.$parent;
  9797. } else {
  9798. return parent;
  9799. }
  9800. }
  9801. return false;
  9802. }
  9803. /***/ }),
  9804. /* 36 */
  9805. /*!********************************************************************************************!*\
  9806. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/sys.js ***!
  9807. \********************************************************************************************/
  9808. /*! no static exports found */
  9809. /***/ (function(module, exports, __webpack_require__) {
  9810. "use strict";
  9811. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  9812. return uni.getSystemInfoSync().platform;
  9813. };
  9814. function sys() {
  9815. return uni.getSystemInfoSync();
  9816. }
  9817. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9818. /***/ }),
  9819. /* 37 */
  9820. /*!*************************************************************************************************!*\
  9821. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/debounce.js ***!
  9822. \*************************************************************************************************/
  9823. /*! no static exports found */
  9824. /***/ (function(module, exports, __webpack_require__) {
  9825. "use strict";
  9826. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  9827. /**
  9828. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  9829. *
  9830. * @param {Function} func 要执行的回调函数
  9831. * @param {Number} wait 延时的时间
  9832. * @param {Boolean} immediate 是否立即执行
  9833. * @return null
  9834. */
  9835. 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;
  9836. // 清除定时器
  9837. if (timeout !== null) clearTimeout(timeout);
  9838. // 立即执行,此类情况一般用不到
  9839. if (immediate) {
  9840. var callNow = !timeout;
  9841. timeout = setTimeout(function () {
  9842. timeout = null;
  9843. }, wait);
  9844. if (callNow) typeof func === 'function' && func();
  9845. } else {
  9846. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  9847. timeout = setTimeout(function () {
  9848. typeof func === 'function' && func();
  9849. }, wait);
  9850. }
  9851. }var _default =
  9852. debounce;exports.default = _default;
  9853. /***/ }),
  9854. /* 38 */
  9855. /*!*************************************************************************************************!*\
  9856. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/throttle.js ***!
  9857. \*************************************************************************************************/
  9858. /*! no static exports found */
  9859. /***/ (function(module, exports, __webpack_require__) {
  9860. "use strict";
  9861. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  9862. /**
  9863. * 节流原理:在一定时间内,只能触发一次
  9864. *
  9865. * @param {Function} func 要执行的回调函数
  9866. * @param {Number} wait 延时的时间
  9867. * @param {Boolean} immediate 是否立即执行
  9868. * @return null
  9869. */
  9870. 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;
  9871. if (immediate) {
  9872. if (!flag) {
  9873. flag = true;
  9874. // 如果是立即执行,则在wait毫秒内开始时执行
  9875. typeof func === 'function' && func();
  9876. timer = setTimeout(function () {
  9877. flag = false;
  9878. }, wait);
  9879. }
  9880. } else {
  9881. if (!flag) {
  9882. flag = true;
  9883. // 如果是非立即执行,则在wait毫秒内的结束处执行
  9884. timer = setTimeout(function () {
  9885. flag = false;
  9886. typeof func === 'function' && func();
  9887. }, wait);
  9888. }
  9889. }
  9890. };var _default =
  9891. throttle;exports.default = _default;
  9892. /***/ }),
  9893. /* 39 */
  9894. /*!*********************************************************************************************!*\
  9895. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/config/config.js ***!
  9896. \*********************************************************************************************/
  9897. /*! no static exports found */
  9898. /***/ (function(module, exports, __webpack_require__) {
  9899. "use strict";
  9900. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-03-17
  9901. var version = '1.8.4';var _default =
  9902. {
  9903. v: version,
  9904. version: version,
  9905. // 主题名称
  9906. type: [
  9907. 'primary',
  9908. 'success',
  9909. 'info',
  9910. 'error',
  9911. 'warning'] };exports.default = _default;
  9912. /***/ }),
  9913. /* 40 */
  9914. /*!*********************************************************************************************!*\
  9915. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/config/zIndex.js ***!
  9916. \*********************************************************************************************/
  9917. /*! no static exports found */
  9918. /***/ (function(module, exports, __webpack_require__) {
  9919. "use strict";
  9920. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  9921. /**
  9922. * actionsheet: 999
  9923. * modal: 999
  9924. * navigate: 998
  9925. * tabbar: 998
  9926. * toast: 999
  9927. */var _default =
  9928. {
  9929. toast: 10090,
  9930. noNetwork: 10080,
  9931. // popup包含popup,actionsheet,keyboard,picker的值
  9932. popup: 10075,
  9933. mask: 10070,
  9934. navbar: 980,
  9935. topTips: 975,
  9936. sticky: 970,
  9937. indexListSticky: 965 };exports.default = _default;
  9938. /***/ }),
  9939. /* 41 */,
  9940. /* 42 */,
  9941. /* 43 */,
  9942. /* 44 */,
  9943. /* 45 */,
  9944. /* 46 */,
  9945. /* 47 */
  9946. /*!*************************************************************************!*\
  9947. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/api/api.js ***!
  9948. \*************************************************************************/
  9949. /*! no static exports found */
  9950. /***/ (function(module, exports, __webpack_require__) {
  9951. "use strict";
  9952. 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);});};}
  9953. /**
  9954. * 大转盘小程序
  9955. * wx021e792baf529aff 好运赢书券
  9956. * wxe1b04d1d8f6df382 书币礼包送不停(转盘抽奖)
  9957. * wx4e8c3f946c06c519 书币礼包领不停(转盘抽奖)
  9958. */
  9959. var config = {
  9960. appid: 'wx021e792baf529aff',
  9961. version: '1.1.4' };exports.config = config;function
  9962. getHome(_x) {return _getHome.apply(this, arguments);}
  9963. // 获取公众号将此
  9964. 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);}
  9965. // 获取openId
  9966. 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);}
  9967. // 获取轮播消息
  9968. 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);}
  9969. // 获取中奖记录列表
  9970. 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);}
  9971. // 书币充值失败重新领取
  9972. 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);}
  9973. // 抽奖
  9974. 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);}
  9975. // 获取公众号文章
  9976. 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);}
  9977. // 头两次领取
  9978. 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);}
  9979. // 获取版本
  9980. 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",
  9981. (0, _request.request)({ url: "/applet/version", data: data }));case 1:case "end":return _context10.stop();}}}, _callee10);}));return _getVersion.apply(this, arguments);}
  9982. /***/ }),
  9983. /* 48 */
  9984. /*!*******************************************************************************!*\
  9985. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/utils/request.js ***!
  9986. \*******************************************************************************/
  9987. /*! no static exports found */
  9988. /***/ (function(module, exports, __webpack_require__) {
  9989. "use strict";
  9990. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.request = request; // let apiUrl = 'https://test.api.zanxiangnet.com/miniapp'
  9991. var apiUrl = 'https://api.zanxiangnet.com/miniapp';
  9992. var isopen = false; // 控制loading
  9993. var openLoading = function openLoading() {
  9994. if (!isopen) {
  9995. isopen = true;
  9996. uni.showLoading({
  9997. title: '加载中' });
  9998. }
  9999. };
  10000. var hiddenLoading = function hiddenLoading() {
  10001. isopen = false;
  10002. uni.hideLoading();
  10003. };
  10004. function request(props) {var
  10005. url =
  10006. 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;
  10007. var _loading = false;
  10008. var reqTimer = null;
  10009. if (isLoading) {
  10010. reqTimer = setTimeout(function () {
  10011. openLoading();
  10012. _loading = true;
  10013. }, 500);
  10014. }
  10015. return new Promise(function (resolve, reject) {
  10016. uni.request({
  10017. url: "".concat(apiUrl).concat(url),
  10018. data: data,
  10019. method: method || 'GET',
  10020. success: function success(res) {
  10021. console.log("请求返回数据---》", res);
  10022. reqTimer && clearTimeout(reqTimer);
  10023. if (_loading) {
  10024. hiddenLoading();
  10025. }
  10026. if (res.data.code === 500) {
  10027. uni.showToast({
  10028. title: res.data.msg || "".concat(apiUrl).concat(url, "\u8BF7\u6C42\u9519\u8BEF"),
  10029. icon: 'none',
  10030. duration: 2000 });
  10031. return;
  10032. }
  10033. resolve(res.data);
  10034. },
  10035. fail: function fail(err) {
  10036. reqTimer && clearTimeout(reqTimer);
  10037. if (_loading) {
  10038. hiddenLoading();
  10039. }
  10040. reject("".concat(url, "\u63A5\u53E3\u8C03\u7528\u5931\u8D25").concat(err));
  10041. } });
  10042. });
  10043. }
  10044. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10045. /***/ }),
  10046. /* 49 */
  10047. /*!***************************************************************************************************************!*\
  10048. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uni_modules/almost-lottery/utils/almost-utils.js ***!
  10049. \***************************************************************************************************************/
  10050. /*! no static exports found */
  10051. /***/ (function(module, exports, __webpack_require__) {
  10052. "use strict";
  10053. /* 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; /**
  10054. * 存储 localStorage 数据
  10055. * @param {String} name - 缓存数据的标识
  10056. * @param {any} content - 缓存的数据内容
  10057. */
  10058. var setStore = function setStore(name, content) {
  10059. if (!name) return;
  10060. if (typeof content !== 'string') {
  10061. content = JSON.stringify(content);
  10062. }
  10063. uni.setStorageSync(name, content);
  10064. };
  10065. /**
  10066. * 获取 localStorage 数据
  10067. * @param {String} name - 缓存数据的标识
  10068. */exports.setStore = setStore;
  10069. var getStore = function getStore(name) {
  10070. if (!name) return;
  10071. return uni.getStorageSync(name);
  10072. };
  10073. /**
  10074. * 清除 localStorage 数据
  10075. * @param {String} name - 缓存数据的标识
  10076. */exports.getStore = getStore;
  10077. var clearStore = function clearStore(name) {
  10078. if (name) {
  10079. uni.removeStorageSync(name);
  10080. } else {
  10081. console.log('清理本地全部缓存');
  10082. uni.clearStorageSync();
  10083. }
  10084. };
  10085. /**
  10086. * 计算文本的长度
  10087. * @param {String} text - 文本内容
  10088. */exports.clearStore = clearStore;
  10089. var clacTextLen = function clacTextLen(text) {
  10090. if (!text) return { byteLen: 0, realLen: 0 };
  10091. text += '';
  10092. var clacLen = 0;
  10093. for (var i = 0; i < text.length; i++) {
  10094. if (text.charCodeAt(i) < 0 || text.charCodeAt(i) > 255) {
  10095. clacLen += 2;
  10096. } else {
  10097. clacLen += 1;
  10098. }
  10099. }
  10100. // console.log(`当前文本 ${text} 的长度为 ${clacLen / 2}`)
  10101. return {
  10102. byteLen: clacLen,
  10103. realLen: clacLen / 2 };
  10104. };
  10105. /**
  10106. * 下载文件,并返回临时路径
  10107. * @return {String} 临时路径
  10108. * @param {String} fileUrl - 网络地址
  10109. */exports.clacTextLen = clacTextLen;
  10110. var downloadFile = function downloadFile(fileUrl) {
  10111. return new Promise(function (resolve) {
  10112. uni.downloadFile({
  10113. url: fileUrl,
  10114. success: function success(res) {
  10115. if (res.statusCode === 200) {
  10116. resolve({
  10117. ok: true,
  10118. data: res.errMsg,
  10119. tempFilePath: res.tempFilePath });
  10120. } else {
  10121. resolve({
  10122. ok: false,
  10123. data: res.errMsg,
  10124. msg: '图片下载失败' });
  10125. }
  10126. },
  10127. fail: function fail(err) {
  10128. resolve({
  10129. ok: false,
  10130. data: err.errMsg,
  10131. msg: '图片下载失败' });
  10132. } });
  10133. });
  10134. };
  10135. /**
  10136. * 清理应用已缓存的文件
  10137. */exports.downloadFile = downloadFile;
  10138. var clearCacheFile = function clearCacheFile() {
  10139. uni.getSavedFileList({
  10140. success: function success(res) {
  10141. var fileList = res.fileList;
  10142. if (fileList.length) {
  10143. for (var i = 0; i < fileList.length; i++) {
  10144. uni.removeSavedFile({
  10145. filePath: fileList[i].filePath,
  10146. complete: function complete() {
  10147. console.log('清除缓存已完成');
  10148. } });
  10149. }
  10150. }
  10151. },
  10152. fail: function fail(err) {
  10153. console.log('getSavedFileList Fail');
  10154. } });
  10155. };
  10156. // 图像转换工具,可用于图像和base64的转换
  10157. // https://ext.dcloud.net.cn/plugin?id=123
  10158. exports.clearCacheFile = clearCacheFile;var getLocalFilePath = function getLocalFilePath(path) {
  10159. if (
  10160. path.indexOf('_www') === 0 ||
  10161. path.indexOf('_doc') === 0 ||
  10162. path.indexOf('_documents') === 0 ||
  10163. path.indexOf('_downloads') === 0)
  10164. return path;
  10165. if (path.indexOf('/storage/emulated/0/') === 0) return path;
  10166. if (path.indexOf('/storage/sdcard0/') === 0) return path;
  10167. if (path.indexOf('/var/mobile/') === 0) return path;
  10168. if (path.indexOf('file://') === 0) return path;
  10169. if (path.indexOf('/') === 0) {
  10170. // ios 无法获取本地路径
  10171. var localFilePath = plus.os.name === 'iOS' ? path : plus.io.convertLocalFileSystemURL(path);
  10172. if (localFilePath !== path) {
  10173. return localFilePath;
  10174. } else {
  10175. path = path.substring(1);
  10176. }
  10177. }
  10178. return '_www/' + path;
  10179. };
  10180. var pathToBase64 = function pathToBase64(path) {
  10181. return new Promise(function (resolve, reject) {
  10182. if (typeof window === 'object' && 'document' in window) {
  10183. if (typeof FileReader === 'function') {
  10184. var xhr = new XMLHttpRequest();
  10185. xhr.open('GET', path, true);
  10186. xhr.responseType = 'blob';
  10187. xhr.onload = function () {
  10188. if (this.status === 200) {
  10189. var fileReader = new FileReader();
  10190. fileReader.onload = function (e) {
  10191. resolve(e.target.result);
  10192. };
  10193. fileReader.onerror = reject;
  10194. fileReader.readAsDataURL(this.response);
  10195. }
  10196. };
  10197. xhr.onerror = reject;
  10198. xhr.send();
  10199. return;
  10200. }
  10201. var canvas = document.createElement('canvas');
  10202. var c2x = canvas.getContext('2d');
  10203. var img = new Image();
  10204. img.onload = function () {
  10205. canvas.width = img.width;
  10206. canvas.height = img.height;
  10207. c2x.drawImage(img, 0, 0);
  10208. resolve(canvas.toDataURL());
  10209. canvas.height = canvas.width = 0;
  10210. };
  10211. img.onerror = reject;
  10212. img.src = path;
  10213. return;
  10214. }
  10215. if (typeof plus === 'object') {
  10216. var tempPath = getLocalFilePath(path);
  10217. plus.io.resolveLocalFileSystemURL(tempPath, function (entry) {
  10218. entry.file(function (file) {
  10219. var fileReader = new plus.io.FileReader();
  10220. fileReader.onload = function (data) {
  10221. resolve(data.target.result);
  10222. };
  10223. fileReader.onerror = function (error) {
  10224. console.log(error);
  10225. reject(error);
  10226. };
  10227. fileReader.readAsDataURL(file);
  10228. }, function (error) {
  10229. reject(error);
  10230. });
  10231. }, function (error) {
  10232. reject(error);
  10233. });
  10234. return;
  10235. }
  10236. if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
  10237. wx.getFileSystemManager().readFile({
  10238. filePath: path,
  10239. encoding: 'base64',
  10240. success: function success(res) {
  10241. resolve('data:image/png;base64,' + res.data);
  10242. },
  10243. fail: function fail(error) {
  10244. reject(error);
  10245. } });
  10246. return;
  10247. }
  10248. reject(new Error('not support'));
  10249. });
  10250. };exports.pathToBase64 = pathToBase64;
  10251. var base64ToPath = function base64ToPath(base64) {
  10252. return new Promise(function (resolve, reject) {
  10253. if (typeof window === 'object' && 'document' in window) {
  10254. base64 = base64.split(',');
  10255. var type = base64[0].match(/:(.*?);/)[1];
  10256. var str = atob(base64[1]);
  10257. var n = str.length;
  10258. var array = new Uint8Array(n);
  10259. while (n--) {
  10260. array[n] = str.charCodeAt(n);
  10261. }
  10262. return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
  10263. type: type })));
  10264. }
  10265. var extName = base64.match(/data\:\S+\/(\S+);/);
  10266. if (extName) {
  10267. extName = extName[1];
  10268. } else {
  10269. reject(new Error('base64 error'));
  10270. }
  10271. var fileName = Date.now() + '.' + extName;
  10272. if (typeof plus === 'object') {
  10273. var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now());
  10274. bitmap.loadBase64Data(base64, function () {
  10275. var filePath = '_doc/uniapp_temp/' + fileName;
  10276. bitmap.save(filePath, {}, function () {
  10277. bitmap.clear();
  10278. resolve(filePath);
  10279. }, function (error) {
  10280. bitmap.clear();
  10281. reject(error);
  10282. });
  10283. }, function (error) {
  10284. bitmap.clear();
  10285. reject(error);
  10286. });
  10287. return;
  10288. }
  10289. if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
  10290. var filePath = wx.env.USER_DATA_PATH + '/' + fileName;
  10291. wx.getFileSystemManager().writeFile({
  10292. filePath: filePath,
  10293. data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
  10294. encoding: 'base64',
  10295. success: function success() {
  10296. resolve(filePath);
  10297. },
  10298. fail: function fail(error) {
  10299. reject(error);
  10300. } });
  10301. return;
  10302. }
  10303. reject(new Error('not support'));
  10304. });
  10305. };exports.base64ToPath = base64ToPath;
  10306. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10307. /***/ }),
  10308. /* 50 */
  10309. /*!*********************************************************************************!*\
  10310. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/utils/ad_config.js ***!
  10311. \*********************************************************************************/
  10312. /*! no static exports found */
  10313. /***/ (function(module, exports, __webpack_require__) {
  10314. "use strict";
  10315. Object.defineProperty(exports, "__esModule", { value: true });exports.videoAd = exports.singleLatticeAd = exports.insertScreenAd = exports.urgeVideoAd = exports.bannerAd = void 0;var bannerAd = 'adunit-ad6b8eee5ffc4bba'; // banner 广告
  10316. exports.bannerAd = bannerAd;var urgeVideoAd = 'adunit-5ccff810acfd0c38'; // 激励视频广告
  10317. exports.urgeVideoAd = urgeVideoAd;var insertScreenAd = 'adunit-10723ce2718cb2c0'; // 插屏广告
  10318. exports.insertScreenAd = insertScreenAd;var singleLatticeAd = 'adunit-0ba7116ef6341a6a'; // 单格子广告
  10319. exports.singleLatticeAd = singleLatticeAd;var videoAd = 'adunit-9f3ce24d199e991e'; // 领取记录视频广告
  10320. exports.videoAd = videoAd;
  10321. /***/ }),
  10322. /* 51 */,
  10323. /* 52 */,
  10324. /* 53 */,
  10325. /* 54 */,
  10326. /* 55 */,
  10327. /* 56 */,
  10328. /* 57 */,
  10329. /* 58 */,
  10330. /* 59 */,
  10331. /* 60 */,
  10332. /* 61 */,
  10333. /* 62 */,
  10334. /* 63 */,
  10335. /* 64 */,
  10336. /* 65 */,
  10337. /* 66 */,
  10338. /* 67 */,
  10339. /* 68 */,
  10340. /* 69 */,
  10341. /* 70 */,
  10342. /* 71 */,
  10343. /* 72 */,
  10344. /* 73 */,
  10345. /* 74 */,
  10346. /* 75 */,
  10347. /* 76 */,
  10348. /* 77 */,
  10349. /* 78 */,
  10350. /* 79 */
  10351. /*!******************************************************************************!*\
  10352. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/static/bczp.png ***!
  10353. \******************************************************************************/
  10354. /*! no static exports found */
  10355. /***/ (function(module, exports) {
  10356. module.exports = "/static/bczp.png";
  10357. /***/ })
  10358. ]]);
  10359. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map