vendor.js 360 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 100:
  53. /*!******************************!*\
  54. !*** D:/2022/9/sx/api/wx.js ***!
  55. \******************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. "use strict";
  59. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  60. Object.defineProperty(exports, "__esModule", {
  61. value: true
  62. });
  63. exports.wechatMpAuth = wechatMpAuth;
  64. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 47));
  65. // 微信code地址
  66. function wechatMpAuth(data) {
  67. return (0, _request.default)({
  68. url: '/api/wechat/mp_auth',
  69. method: 'post',
  70. data: data
  71. });
  72. }
  73. /***/ }),
  74. /***/ 11:
  75. /*!***************************************************************!*\
  76. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  77. \***************************************************************/
  78. /*! no static exports found */
  79. /***/ (function(module, exports, __webpack_require__) {
  80. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  81. function _defineProperty(obj, key, value) {
  82. key = toPropertyKey(key);
  83. if (key in obj) {
  84. Object.defineProperty(obj, key, {
  85. value: value,
  86. enumerable: true,
  87. configurable: true,
  88. writable: true
  89. });
  90. } else {
  91. obj[key] = value;
  92. }
  93. return obj;
  94. }
  95. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  96. /***/ }),
  97. /***/ 117:
  98. /*!*******************************!*\
  99. !*** D:/2022/9/sx/api/set.js ***!
  100. \*******************************/
  101. /*! no static exports found */
  102. /***/ (function(module, exports, __webpack_require__) {
  103. "use strict";
  104. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  105. Object.defineProperty(exports, "__esModule", {
  106. value: true
  107. });
  108. exports.binding = binding;
  109. exports.logout = logout;
  110. exports.registerReset = registerReset;
  111. exports.userEdit = userEdit;
  112. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 47));
  113. // 修改用户信息
  114. function userEdit(data) {
  115. return (0, _request.default)({
  116. url: '/api/user/edit',
  117. method: 'post',
  118. data: data
  119. });
  120. }
  121. //退出登录
  122. function logout(data) {
  123. return (0, _request.default)({
  124. url: '/api/logout',
  125. method: 'get',
  126. data: data
  127. });
  128. }
  129. //修改密码
  130. function registerReset(data) {
  131. return (0, _request.default)({
  132. url: '/api/register/reset',
  133. method: 'post',
  134. data: data
  135. });
  136. }
  137. //绑定手机
  138. function binding(data) {
  139. return (0, _request.default)({
  140. url: '/api/binding',
  141. method: 'post',
  142. data: data
  143. });
  144. }
  145. /***/ }),
  146. /***/ 12:
  147. /*!**************************************************************!*\
  148. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  149. \**************************************************************/
  150. /*! no static exports found */
  151. /***/ (function(module, exports, __webpack_require__) {
  152. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  153. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  154. function _toPropertyKey(arg) {
  155. var key = toPrimitive(arg, "string");
  156. return _typeof(key) === "symbol" ? key : String(key);
  157. }
  158. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  159. /***/ }),
  160. /***/ 13:
  161. /*!*******************************************************!*\
  162. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  163. \*******************************************************/
  164. /*! no static exports found */
  165. /***/ (function(module, exports) {
  166. function _typeof(obj) {
  167. "@babel/helpers - typeof";
  168. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  169. return typeof obj;
  170. } : function (obj) {
  171. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  172. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  173. }
  174. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  175. /***/ }),
  176. /***/ 14:
  177. /*!************************************************************!*\
  178. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  179. \************************************************************/
  180. /*! no static exports found */
  181. /***/ (function(module, exports, __webpack_require__) {
  182. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  183. function _toPrimitive(input, hint) {
  184. if (_typeof(input) !== "object" || input === null) return input;
  185. var prim = input[Symbol.toPrimitive];
  186. if (prim !== undefined) {
  187. var res = prim.call(input, hint || "default");
  188. if (_typeof(res) !== "object") return res;
  189. throw new TypeError("@@toPrimitive must return a primitive value.");
  190. }
  191. return (hint === "string" ? String : Number)(input);
  192. }
  193. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  194. /***/ }),
  195. /***/ 142:
  196. /*!*********************************!*\
  197. !*** D:/2022/9/sx/api/order.js ***!
  198. \*********************************/
  199. /*! no static exports found */
  200. /***/ (function(module, exports, __webpack_require__) {
  201. "use strict";
  202. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  203. Object.defineProperty(exports, "__esModule", {
  204. value: true
  205. });
  206. exports.computedOrderkey = computedOrderkey;
  207. exports.confirm = confirm;
  208. exports.couponsOrder = couponsOrder;
  209. exports.createOrderkey = createOrderkey;
  210. exports.express_query = express_query;
  211. exports.getCouponsList = getCouponsList;
  212. exports.orderCancel = orderCancel;
  213. exports.orderDel = orderDel;
  214. exports.orderDetail = orderDetail;
  215. exports.orderList = orderList;
  216. exports.orderPay = orderPay;
  217. exports.orderTake = orderTake;
  218. exports.order_comment = order_comment;
  219. exports.product = product;
  220. exports.refund = refund;
  221. exports.refundReason = refundReason;
  222. exports.upload = upload;
  223. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 47));
  224. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  225. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  226. // 订单确认
  227. function confirm(data) {
  228. return (0, _request.default)({
  229. url: '/api/order/confirm',
  230. method: 'post',
  231. data: data
  232. });
  233. }
  234. //获取可使用优惠券
  235. function couponsOrder(data, price) {
  236. return (0, _request.default)({
  237. url: '/api/coupons/order/' + price,
  238. method: 'get',
  239. data: data
  240. });
  241. }
  242. //获取优惠券列表
  243. function getCouponsList(data, types) {
  244. //优惠券状态 0全部 1未使用 2已使用
  245. return (0, _request.default)({
  246. url: '/api/coupons/user/' + types,
  247. method: 'get',
  248. data: data
  249. });
  250. }
  251. //提交评论
  252. function order_comment(data) {
  253. return (0, _request.default)({
  254. url: '/api/order/comment',
  255. method: 'post',
  256. data: data
  257. });
  258. }
  259. //订单产品信息
  260. function product(data) {
  261. return (0, _request.default)({
  262. url: '/api/order/product',
  263. method: 'post',
  264. data: data
  265. });
  266. }
  267. // 快递查询
  268. function express_query(data) {
  269. return (0, _request.default)({
  270. url: '/api/order/express_query',
  271. method: 'get',
  272. data: data
  273. });
  274. }
  275. //上传图片
  276. function upload(data) {
  277. return (0, _request.upFilse)({
  278. url: '/api/upload/image',
  279. method: 'post',
  280. data: data
  281. });
  282. }
  283. // 订单列表
  284. function orderList(data) {
  285. return (0, _request.default)({
  286. url: '/api/order/list',
  287. method: 'get',
  288. data: data
  289. });
  290. }
  291. // 订单详细
  292. function orderDetail(data, orderid) {
  293. return (0, _request.default)({
  294. url: '/api/order/detail/' + orderid,
  295. method: 'get',
  296. data: data
  297. });
  298. }
  299. // 取消订单
  300. function orderCancel(data) {
  301. return (0, _request.default)({
  302. url: '/api/order/cancel',
  303. method: 'post',
  304. data: data
  305. });
  306. }
  307. // 删除订单
  308. function orderDel(data) {
  309. return (0, _request.default)({
  310. url: '/api/order/del',
  311. method: 'get',
  312. data: data
  313. });
  314. }
  315. // 申请退款
  316. function refund(data) {
  317. return (0, _request.default)({
  318. url: '/api/order/refund/verify',
  319. method: 'post',
  320. data: data
  321. });
  322. }
  323. // 退款理由列表
  324. function refundReason(data) {
  325. return (0, _request.default)({
  326. url: '/api/order/refund/reason',
  327. method: 'get',
  328. data: data
  329. });
  330. }
  331. // 确认收货
  332. function orderTake(data) {
  333. return (0, _request.default)({
  334. url: '/api/order/take',
  335. method: 'post',
  336. data: data
  337. });
  338. }
  339. // 订单支付
  340. function orderPay(data) {
  341. return (0, _request.default)({
  342. url: '/api/order/pay',
  343. method: 'post',
  344. data: data
  345. });
  346. }
  347. // 创建订单
  348. function createOrderkey(data, key) {
  349. return (0, _request.default)({
  350. url: '/api/order/create/' + key,
  351. method: 'post',
  352. data: data
  353. });
  354. }
  355. // 统计订单金额
  356. function computedOrderkey(data) {
  357. return (0, _request.default)({
  358. url: '/api/order/computed/' + data.orderkey,
  359. method: 'post',
  360. data: data
  361. });
  362. }
  363. /***/ }),
  364. /***/ 15:
  365. /*!**********************************************************!*\
  366. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  367. \**********************************************************/
  368. /*! no static exports found */
  369. /***/ (function(module, exports, __webpack_require__) {
  370. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  371. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  372. function _construct(Parent, args, Class) {
  373. if (isNativeReflectConstruct()) {
  374. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  375. } else {
  376. module.exports = _construct = function _construct(Parent, args, Class) {
  377. var a = [null];
  378. a.push.apply(a, args);
  379. var Constructor = Function.bind.apply(Parent, a);
  380. var instance = new Constructor();
  381. if (Class) setPrototypeOf(instance, Class.prototype);
  382. return instance;
  383. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  384. }
  385. return _construct.apply(null, arguments);
  386. }
  387. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  388. /***/ }),
  389. /***/ 16:
  390. /*!***************************************************************!*\
  391. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  392. \***************************************************************/
  393. /*! no static exports found */
  394. /***/ (function(module, exports) {
  395. function _setPrototypeOf(o, p) {
  396. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  397. o.__proto__ = p;
  398. return o;
  399. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  400. return _setPrototypeOf(o, p);
  401. }
  402. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  403. /***/ }),
  404. /***/ 17:
  405. /*!*************************************************************************!*\
  406. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  407. \*************************************************************************/
  408. /*! no static exports found */
  409. /***/ (function(module, exports) {
  410. function _isNativeReflectConstruct() {
  411. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  412. if (Reflect.construct.sham) return false;
  413. if (typeof Proxy === "function") return true;
  414. try {
  415. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  416. return true;
  417. } catch (e) {
  418. return false;
  419. }
  420. }
  421. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  422. /***/ }),
  423. /***/ 175:
  424. /*!**************************************!*\
  425. !*** D:/2022/9/sx/utils/rocessor.js ***!
  426. \**************************************/
  427. /*! no static exports found */
  428. /***/ (function(module, exports, __webpack_require__) {
  429. "use strict";
  430. /* WEBPACK VAR INJECTION */(function(wx) {
  431. Object.defineProperty(exports, "__esModule", {
  432. value: true
  433. });
  434. exports.getMoneyStyle = getMoneyStyle;
  435. exports.getTime = getTime;
  436. exports.isCardNo = isCardNo;
  437. exports.openMap = openMap;
  438. exports.timeComputed = timeComputed;
  439. //身份证验证
  440. function isCardNo(card) {
  441. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  442. var reg = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
  443. if (reg.test(card) === false) {
  444. console.log(card);
  445. return false;
  446. }
  447. return true;
  448. }
  449. // 金额显示变化
  450. function getMoneyStyle() {
  451. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  452. if (typeof value == 'string') {
  453. value = (+value).toFixed(2);
  454. }
  455. if (typeof value == 'number') {
  456. value = value.toFixed(2);
  457. }
  458. // 将字符串转为数组
  459. var n = value.split("");
  460. // 反转数组并复制循环处理
  461. var arr = n.reverse().map(function (e, ind, ar) {
  462. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  463. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  464. return e + ',';
  465. } else {
  466. return e;
  467. }
  468. });
  469. // 反转数组回复原来排序并合并回字符串
  470. arr = arr.reverse().join('');
  471. return arr;
  472. }
  473. // 倒计时计算
  474. // 计算倒计时时间
  475. function timeComputed(time) {
  476. // 获取当前时间
  477. var actTime = new Date().getTime();
  478. // 获取到期时间
  479. var stopTime = time - actTime;
  480. // 判断是否小于0
  481. if (stopTime < 0) {
  482. stopTime = stopTime * -1;
  483. }
  484. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余天数
  485. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  486. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  487. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  488. return {
  489. hours: hours,
  490. //倒计时小时数
  491. minutes: minutes,
  492. //倒计时分钟数
  493. seconds: seconds,
  494. //倒计时秒数
  495. day: day //倒计时天数
  496. };
  497. }
  498. // 调用打开地图方法
  499. function openMap(e) {
  500. var that = this;
  501. return new Promise(function (resolve, reject) {
  502. wx.getSetting({
  503. success: function success(res) {
  504. //这里判断是否有地位权限
  505. if (!res.authSetting['scope.userLocation']) {
  506. wx.showModal({
  507. title: '提示',
  508. content: '请求获取位置权限',
  509. success: function success(res) {
  510. if (res.confirm == false) {
  511. // 授权失败
  512. reject();
  513. return false;
  514. }
  515. wx.openSetting({
  516. success: function success(res) {
  517. //如果再次拒绝则返回页面并提示
  518. if (!res.authSetting['scope.userLocation']) {
  519. wx.showToast({
  520. title: '此功能需获取位置信息,请重新设置',
  521. duration: 3000,
  522. icon: 'none'
  523. });
  524. } else {
  525. //允许授权,调用地图
  526. resolve();
  527. }
  528. }
  529. });
  530. }
  531. });
  532. } else {
  533. //如果有定位权限,调用地图
  534. resolve();
  535. }
  536. }
  537. });
  538. });
  539. }
  540. //时间戳转换成时间
  541. function getTime(time) {
  542. var num = 13 - (time + '').length;
  543. var l = 1; //倍数
  544. for (var i = 0; i < num; i++) {
  545. l += '0';
  546. }
  547. // 重新解析为数字
  548. l = parseInt(l);
  549. var date = new Date(parseInt(time) * l);
  550. var year = date.getFullYear();
  551. var mon = date.getMonth() + 1;
  552. var day = date.getDate();
  553. var hours = date.getHours();
  554. var minu = date.getMinutes();
  555. var sec = date.getSeconds();
  556. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  557. }
  558. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  559. /***/ }),
  560. /***/ 18:
  561. /*!******************************************************************!*\
  562. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  563. \******************************************************************/
  564. /*! no static exports found */
  565. /***/ (function(module, exports, __webpack_require__) {
  566. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  567. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  568. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  569. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  570. function _toConsumableArray(arr) {
  571. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  572. }
  573. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  574. /***/ }),
  575. /***/ 184:
  576. /*!**********************************!*\
  577. !*** D:/2022/9/sx/api/wallet.js ***!
  578. \**********************************/
  579. /*! no static exports found */
  580. /***/ (function(module, exports, __webpack_require__) {
  581. "use strict";
  582. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  583. Object.defineProperty(exports, "__esModule", {
  584. value: true
  585. });
  586. exports.aliInfo = aliInfo;
  587. exports.balance = balance;
  588. exports.bankInfo = bankInfo;
  589. exports.extractBank = extractBank;
  590. exports.extractCash = extractCash;
  591. exports.rechargeRoutine = rechargeRoutine;
  592. exports.setAliInfo = setAliInfo;
  593. exports.setBankInfo = setBankInfo;
  594. exports.spreadCommission = spreadCommission;
  595. exports.userBalance = userBalance;
  596. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 47));
  597. // 获取用户消费记录
  598. function spreadCommission(data, state) {
  599. return (0, _request.default)({
  600. url: '/api/spread/commission/' + state,
  601. method: 'get',
  602. data: data
  603. });
  604. }
  605. // 获取账户余额
  606. function userBalance(data) {
  607. return (0, _request.default)({
  608. url: '/api/user/balance',
  609. method: 'get',
  610. data: data
  611. });
  612. }
  613. // 提现
  614. function extractCash(data) {
  615. return (0, _request.default)({
  616. url: '/api/extract/cash',
  617. method: 'post',
  618. data: data
  619. });
  620. }
  621. // 提现信息
  622. function extractBank(data) {
  623. return (0, _request.default)({
  624. url: '/api/extract/bank',
  625. method: 'get',
  626. data: data
  627. });
  628. }
  629. // 小程序充值
  630. function rechargeRoutine(data) {
  631. return (0, _request.default)({
  632. url: '/api/recharge/routine',
  633. method: 'post',
  634. data: data
  635. });
  636. }
  637. // 获取提现支付宝账号
  638. function aliInfo(data) {
  639. return (0, _request.default)({
  640. url: '/api/ali/info',
  641. method: 'get',
  642. data: data
  643. });
  644. }
  645. //获取默认银行卡账号
  646. function bankInfo(data) {
  647. return (0, _request.default)({
  648. url: '/api/bank/info',
  649. method: 'get',
  650. data: data
  651. });
  652. }
  653. // 保存提现支付宝账号
  654. function setAliInfo(data) {
  655. return (0, _request.default)({
  656. url: '/api/ali/edit',
  657. method: 'post',
  658. data: data
  659. });
  660. }
  661. //保存默认银行卡账号
  662. function setBankInfo(data) {
  663. return (0, _request.default)({
  664. url: '/api/bank/edit',
  665. method: 'post',
  666. data: data
  667. });
  668. }
  669. // 账户余额
  670. function balance(data) {
  671. return (0, _request.default)({
  672. url: '/api/user/balance',
  673. method: 'get',
  674. data: data
  675. });
  676. }
  677. /***/ }),
  678. /***/ 19:
  679. /*!******************************************************************!*\
  680. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  681. \******************************************************************/
  682. /*! no static exports found */
  683. /***/ (function(module, exports, __webpack_require__) {
  684. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  685. function _arrayWithoutHoles(arr) {
  686. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  687. }
  688. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  689. /***/ }),
  690. /***/ 2:
  691. /*!************************************************************!*\
  692. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  693. \************************************************************/
  694. /*! no static exports found */
  695. /***/ (function(module, exports, __webpack_require__) {
  696. "use strict";
  697. /* WEBPACK VAR INJECTION */(function(wx, global) {
  698. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  699. Object.defineProperty(exports, "__esModule", {
  700. value: true
  701. });
  702. exports.createApp = createApp;
  703. exports.createComponent = createComponent;
  704. exports.createPage = createPage;
  705. exports.createPlugin = createPlugin;
  706. exports.createSubpackageApp = createSubpackageApp;
  707. exports.default = void 0;
  708. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  709. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  710. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  711. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  712. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  713. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  714. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  715. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  716. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  717. var realAtob;
  718. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  719. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  720. if (typeof atob !== 'function') {
  721. realAtob = function realAtob(str) {
  722. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  723. if (!b64re.test(str)) {
  724. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  725. }
  726. // Adding the padding if missing, for semplicity
  727. str += '=='.slice(2 - (str.length & 3));
  728. var bitmap;
  729. var result = '';
  730. var r1;
  731. var r2;
  732. var i = 0;
  733. for (; i < str.length;) {
  734. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  735. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  736. }
  737. return result;
  738. };
  739. } else {
  740. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  741. realAtob = atob;
  742. }
  743. function b64DecodeUnicode(str) {
  744. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  745. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  746. }).join(''));
  747. }
  748. function getCurrentUserInfo() {
  749. var token = wx.getStorageSync('uni_id_token') || '';
  750. var tokenArr = token.split('.');
  751. if (!token || tokenArr.length !== 3) {
  752. return {
  753. uid: null,
  754. role: [],
  755. permission: [],
  756. tokenExpired: 0
  757. };
  758. }
  759. var userInfo;
  760. try {
  761. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  762. } catch (error) {
  763. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  764. }
  765. userInfo.tokenExpired = userInfo.exp * 1000;
  766. delete userInfo.exp;
  767. delete userInfo.iat;
  768. return userInfo;
  769. }
  770. function uniIdMixin(Vue) {
  771. Vue.prototype.uniIDHasRole = function (roleId) {
  772. var _getCurrentUserInfo = getCurrentUserInfo(),
  773. role = _getCurrentUserInfo.role;
  774. return role.indexOf(roleId) > -1;
  775. };
  776. Vue.prototype.uniIDHasPermission = function (permissionId) {
  777. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  778. permission = _getCurrentUserInfo2.permission;
  779. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  780. };
  781. Vue.prototype.uniIDTokenValid = function () {
  782. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  783. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  784. return tokenExpired > Date.now();
  785. };
  786. }
  787. var _toString = Object.prototype.toString;
  788. var hasOwnProperty = Object.prototype.hasOwnProperty;
  789. function isFn(fn) {
  790. return typeof fn === 'function';
  791. }
  792. function isStr(str) {
  793. return typeof str === 'string';
  794. }
  795. function isObject(obj) {
  796. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  797. }
  798. function isPlainObject(obj) {
  799. return _toString.call(obj) === '[object Object]';
  800. }
  801. function hasOwn(obj, key) {
  802. return hasOwnProperty.call(obj, key);
  803. }
  804. function noop() {}
  805. /**
  806. * Create a cached version of a pure function.
  807. */
  808. function cached(fn) {
  809. var cache = Object.create(null);
  810. return function cachedFn(str) {
  811. var hit = cache[str];
  812. return hit || (cache[str] = fn(str));
  813. };
  814. }
  815. /**
  816. * Camelize a hyphen-delimited string.
  817. */
  818. var camelizeRE = /-(\w)/g;
  819. var camelize = cached(function (str) {
  820. return str.replace(camelizeRE, function (_, c) {
  821. return c ? c.toUpperCase() : '';
  822. });
  823. });
  824. function sortObject(obj) {
  825. var sortObj = {};
  826. if (isPlainObject(obj)) {
  827. Object.keys(obj).sort().forEach(function (key) {
  828. sortObj[key] = obj[key];
  829. });
  830. }
  831. return !Object.keys(sortObj) ? obj : sortObj;
  832. }
  833. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  834. var globalInterceptors = {};
  835. var scopedInterceptors = {};
  836. function mergeHook(parentVal, childVal) {
  837. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  838. return res ? dedupeHooks(res) : res;
  839. }
  840. function dedupeHooks(hooks) {
  841. var res = [];
  842. for (var i = 0; i < hooks.length; i++) {
  843. if (res.indexOf(hooks[i]) === -1) {
  844. res.push(hooks[i]);
  845. }
  846. }
  847. return res;
  848. }
  849. function removeHook(hooks, hook) {
  850. var index = hooks.indexOf(hook);
  851. if (index !== -1) {
  852. hooks.splice(index, 1);
  853. }
  854. }
  855. function mergeInterceptorHook(interceptor, option) {
  856. Object.keys(option).forEach(function (hook) {
  857. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  858. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  859. }
  860. });
  861. }
  862. function removeInterceptorHook(interceptor, option) {
  863. if (!interceptor || !option) {
  864. return;
  865. }
  866. Object.keys(option).forEach(function (hook) {
  867. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  868. removeHook(interceptor[hook], option[hook]);
  869. }
  870. });
  871. }
  872. function addInterceptor(method, option) {
  873. if (typeof method === 'string' && isPlainObject(option)) {
  874. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  875. } else if (isPlainObject(method)) {
  876. mergeInterceptorHook(globalInterceptors, method);
  877. }
  878. }
  879. function removeInterceptor(method, option) {
  880. if (typeof method === 'string') {
  881. if (isPlainObject(option)) {
  882. removeInterceptorHook(scopedInterceptors[method], option);
  883. } else {
  884. delete scopedInterceptors[method];
  885. }
  886. } else if (isPlainObject(method)) {
  887. removeInterceptorHook(globalInterceptors, method);
  888. }
  889. }
  890. function wrapperHook(hook) {
  891. return function (data) {
  892. return hook(data) || data;
  893. };
  894. }
  895. function isPromise(obj) {
  896. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  897. }
  898. function queue(hooks, data) {
  899. var promise = false;
  900. for (var i = 0; i < hooks.length; i++) {
  901. var hook = hooks[i];
  902. if (promise) {
  903. promise = Promise.resolve(wrapperHook(hook));
  904. } else {
  905. var res = hook(data);
  906. if (isPromise(res)) {
  907. promise = Promise.resolve(res);
  908. }
  909. if (res === false) {
  910. return {
  911. then: function then() {}
  912. };
  913. }
  914. }
  915. }
  916. return promise || {
  917. then: function then(callback) {
  918. return callback(data);
  919. }
  920. };
  921. }
  922. function wrapperOptions(interceptor) {
  923. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  924. ['success', 'fail', 'complete'].forEach(function (name) {
  925. if (Array.isArray(interceptor[name])) {
  926. var oldCallback = options[name];
  927. options[name] = function callbackInterceptor(res) {
  928. queue(interceptor[name], res).then(function (res) {
  929. /* eslint-disable no-mixed-operators */
  930. return isFn(oldCallback) && oldCallback(res) || res;
  931. });
  932. };
  933. }
  934. });
  935. return options;
  936. }
  937. function wrapperReturnValue(method, returnValue) {
  938. var returnValueHooks = [];
  939. if (Array.isArray(globalInterceptors.returnValue)) {
  940. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  941. }
  942. var interceptor = scopedInterceptors[method];
  943. if (interceptor && Array.isArray(interceptor.returnValue)) {
  944. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  945. }
  946. returnValueHooks.forEach(function (hook) {
  947. returnValue = hook(returnValue) || returnValue;
  948. });
  949. return returnValue;
  950. }
  951. function getApiInterceptorHooks(method) {
  952. var interceptor = Object.create(null);
  953. Object.keys(globalInterceptors).forEach(function (hook) {
  954. if (hook !== 'returnValue') {
  955. interceptor[hook] = globalInterceptors[hook].slice();
  956. }
  957. });
  958. var scopedInterceptor = scopedInterceptors[method];
  959. if (scopedInterceptor) {
  960. Object.keys(scopedInterceptor).forEach(function (hook) {
  961. if (hook !== 'returnValue') {
  962. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  963. }
  964. });
  965. }
  966. return interceptor;
  967. }
  968. function invokeApi(method, api, options) {
  969. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  970. params[_key - 3] = arguments[_key];
  971. }
  972. var interceptor = getApiInterceptorHooks(method);
  973. if (interceptor && Object.keys(interceptor).length) {
  974. if (Array.isArray(interceptor.invoke)) {
  975. var res = queue(interceptor.invoke, options);
  976. return res.then(function (options) {
  977. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  978. });
  979. } else {
  980. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  981. }
  982. }
  983. return api.apply(void 0, [options].concat(params));
  984. }
  985. var promiseInterceptor = {
  986. returnValue: function returnValue(res) {
  987. if (!isPromise(res)) {
  988. return res;
  989. }
  990. return new Promise(function (resolve, reject) {
  991. res.then(function (res) {
  992. if (res[0]) {
  993. reject(res[0]);
  994. } else {
  995. resolve(res[1]);
  996. }
  997. });
  998. });
  999. }
  1000. };
  1001. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  1002. var CONTEXT_API_RE = /^create|Manager$/;
  1003. // Context例外情况
  1004. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1005. // 同步例外情况
  1006. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1007. var CALLBACK_API_RE = /^on|^off/;
  1008. function isContextApi(name) {
  1009. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1010. }
  1011. function isSyncApi(name) {
  1012. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1013. }
  1014. function isCallbackApi(name) {
  1015. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1016. }
  1017. function handlePromise(promise) {
  1018. return promise.then(function (data) {
  1019. return [null, data];
  1020. }).catch(function (err) {
  1021. return [err];
  1022. });
  1023. }
  1024. function shouldPromise(name) {
  1025. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1026. return false;
  1027. }
  1028. return true;
  1029. }
  1030. /* eslint-disable no-extend-native */
  1031. if (!Promise.prototype.finally) {
  1032. Promise.prototype.finally = function (callback) {
  1033. var promise = this.constructor;
  1034. return this.then(function (value) {
  1035. return promise.resolve(callback()).then(function () {
  1036. return value;
  1037. });
  1038. }, function (reason) {
  1039. return promise.resolve(callback()).then(function () {
  1040. throw reason;
  1041. });
  1042. });
  1043. };
  1044. }
  1045. function promisify(name, api) {
  1046. if (!shouldPromise(name) || !isFn(api)) {
  1047. return api;
  1048. }
  1049. return function promiseApi() {
  1050. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1051. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1052. params[_key2 - 1] = arguments[_key2];
  1053. }
  1054. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1055. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1056. }
  1057. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1058. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1059. success: resolve,
  1060. fail: reject
  1061. })].concat(params));
  1062. })));
  1063. };
  1064. }
  1065. var EPS = 1e-4;
  1066. var BASE_DEVICE_WIDTH = 750;
  1067. var isIOS = false;
  1068. var deviceWidth = 0;
  1069. var deviceDPR = 0;
  1070. function checkDeviceWidth() {
  1071. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1072. platform = _wx$getSystemInfoSync.platform,
  1073. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1074. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1075. deviceWidth = windowWidth;
  1076. deviceDPR = pixelRatio;
  1077. isIOS = platform === 'ios';
  1078. }
  1079. function upx2px(number, newDeviceWidth) {
  1080. if (deviceWidth === 0) {
  1081. checkDeviceWidth();
  1082. }
  1083. number = Number(number);
  1084. if (number === 0) {
  1085. return 0;
  1086. }
  1087. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1088. if (result < 0) {
  1089. result = -result;
  1090. }
  1091. result = Math.floor(result + EPS);
  1092. if (result === 0) {
  1093. if (deviceDPR === 1 || !isIOS) {
  1094. result = 1;
  1095. } else {
  1096. result = 0.5;
  1097. }
  1098. }
  1099. return number < 0 ? -result : result;
  1100. }
  1101. var LOCALE_ZH_HANS = 'zh-Hans';
  1102. var LOCALE_ZH_HANT = 'zh-Hant';
  1103. var LOCALE_EN = 'en';
  1104. var LOCALE_FR = 'fr';
  1105. var LOCALE_ES = 'es';
  1106. var messages = {};
  1107. var locale;
  1108. {
  1109. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1110. }
  1111. function initI18nMessages() {
  1112. if (!isEnableLocale()) {
  1113. return;
  1114. }
  1115. var localeKeys = Object.keys(__uniConfig.locales);
  1116. if (localeKeys.length) {
  1117. localeKeys.forEach(function (locale) {
  1118. var curMessages = messages[locale];
  1119. var userMessages = __uniConfig.locales[locale];
  1120. if (curMessages) {
  1121. Object.assign(curMessages, userMessages);
  1122. } else {
  1123. messages[locale] = userMessages;
  1124. }
  1125. });
  1126. }
  1127. }
  1128. initI18nMessages();
  1129. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1130. var t = i18n.t;
  1131. var i18nMixin = i18n.mixin = {
  1132. beforeCreate: function beforeCreate() {
  1133. var _this = this;
  1134. var unwatch = i18n.i18n.watchLocale(function () {
  1135. _this.$forceUpdate();
  1136. });
  1137. this.$once('hook:beforeDestroy', function () {
  1138. unwatch();
  1139. });
  1140. },
  1141. methods: {
  1142. $$t: function $$t(key, values) {
  1143. return t(key, values);
  1144. }
  1145. }
  1146. };
  1147. var setLocale = i18n.setLocale;
  1148. var getLocale = i18n.getLocale;
  1149. function initAppLocale(Vue, appVm, locale) {
  1150. var state = Vue.observable({
  1151. locale: locale || i18n.getLocale()
  1152. });
  1153. var localeWatchers = [];
  1154. appVm.$watchLocale = function (fn) {
  1155. localeWatchers.push(fn);
  1156. };
  1157. Object.defineProperty(appVm, '$locale', {
  1158. get: function get() {
  1159. return state.locale;
  1160. },
  1161. set: function set(v) {
  1162. state.locale = v;
  1163. localeWatchers.forEach(function (watch) {
  1164. return watch(v);
  1165. });
  1166. }
  1167. });
  1168. }
  1169. function isEnableLocale() {
  1170. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1171. }
  1172. function include(str, parts) {
  1173. return !!parts.find(function (part) {
  1174. return str.indexOf(part) !== -1;
  1175. });
  1176. }
  1177. function startsWith(str, parts) {
  1178. return parts.find(function (part) {
  1179. return str.indexOf(part) === 0;
  1180. });
  1181. }
  1182. function normalizeLocale(locale, messages) {
  1183. if (!locale) {
  1184. return;
  1185. }
  1186. locale = locale.trim().replace(/_/g, '-');
  1187. if (messages && messages[locale]) {
  1188. return locale;
  1189. }
  1190. locale = locale.toLowerCase();
  1191. if (locale === 'chinese') {
  1192. // 支付宝
  1193. return LOCALE_ZH_HANS;
  1194. }
  1195. if (locale.indexOf('zh') === 0) {
  1196. if (locale.indexOf('-hans') > -1) {
  1197. return LOCALE_ZH_HANS;
  1198. }
  1199. if (locale.indexOf('-hant') > -1) {
  1200. return LOCALE_ZH_HANT;
  1201. }
  1202. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1203. return LOCALE_ZH_HANT;
  1204. }
  1205. return LOCALE_ZH_HANS;
  1206. }
  1207. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1208. if (lang) {
  1209. return lang;
  1210. }
  1211. }
  1212. // export function initI18n() {
  1213. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1214. // if (localeKeys.length) {
  1215. // localeKeys.forEach((locale) =>
  1216. // i18n.add(locale, __uniConfig.locales[locale])
  1217. // )
  1218. // }
  1219. // }
  1220. function getLocale$1() {
  1221. // 优先使用 $locale
  1222. if (isFn(getApp)) {
  1223. var app = getApp({
  1224. allowDefault: true
  1225. });
  1226. if (app && app.$vm) {
  1227. return app.$vm.$locale;
  1228. }
  1229. }
  1230. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1231. }
  1232. function setLocale$1(locale) {
  1233. var app = isFn(getApp) ? getApp() : false;
  1234. if (!app) {
  1235. return false;
  1236. }
  1237. var oldLocale = app.$vm.$locale;
  1238. if (oldLocale !== locale) {
  1239. app.$vm.$locale = locale;
  1240. onLocaleChangeCallbacks.forEach(function (fn) {
  1241. return fn({
  1242. locale: locale
  1243. });
  1244. });
  1245. return true;
  1246. }
  1247. return false;
  1248. }
  1249. var onLocaleChangeCallbacks = [];
  1250. function onLocaleChange(fn) {
  1251. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1252. onLocaleChangeCallbacks.push(fn);
  1253. }
  1254. }
  1255. if (typeof global !== 'undefined') {
  1256. global.getLocale = getLocale$1;
  1257. }
  1258. var interceptors = {
  1259. promiseInterceptor: promiseInterceptor
  1260. };
  1261. var baseApi = /*#__PURE__*/Object.freeze({
  1262. __proto__: null,
  1263. upx2px: upx2px,
  1264. getLocale: getLocale$1,
  1265. setLocale: setLocale$1,
  1266. onLocaleChange: onLocaleChange,
  1267. addInterceptor: addInterceptor,
  1268. removeInterceptor: removeInterceptor,
  1269. interceptors: interceptors
  1270. });
  1271. function findExistsPageIndex(url) {
  1272. var pages = getCurrentPages();
  1273. var len = pages.length;
  1274. while (len--) {
  1275. var page = pages[len];
  1276. if (page.$page && page.$page.fullPath === url) {
  1277. return len;
  1278. }
  1279. }
  1280. return -1;
  1281. }
  1282. var redirectTo = {
  1283. name: function name(fromArgs) {
  1284. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1285. return 'navigateBack';
  1286. }
  1287. return 'redirectTo';
  1288. },
  1289. args: function args(fromArgs) {
  1290. if (fromArgs.exists === 'back' && fromArgs.url) {
  1291. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1292. if (existsPageIndex !== -1) {
  1293. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1294. if (delta > 0) {
  1295. fromArgs.delta = delta;
  1296. }
  1297. }
  1298. }
  1299. }
  1300. };
  1301. var previewImage = {
  1302. args: function args(fromArgs) {
  1303. var currentIndex = parseInt(fromArgs.current);
  1304. if (isNaN(currentIndex)) {
  1305. return;
  1306. }
  1307. var urls = fromArgs.urls;
  1308. if (!Array.isArray(urls)) {
  1309. return;
  1310. }
  1311. var len = urls.length;
  1312. if (!len) {
  1313. return;
  1314. }
  1315. if (currentIndex < 0) {
  1316. currentIndex = 0;
  1317. } else if (currentIndex >= len) {
  1318. currentIndex = len - 1;
  1319. }
  1320. if (currentIndex > 0) {
  1321. fromArgs.current = urls[currentIndex];
  1322. fromArgs.urls = urls.filter(function (item, index) {
  1323. return index < currentIndex ? item !== urls[currentIndex] : true;
  1324. });
  1325. } else {
  1326. fromArgs.current = urls[0];
  1327. }
  1328. return {
  1329. indicator: false,
  1330. loop: false
  1331. };
  1332. }
  1333. };
  1334. var UUID_KEY = '__DC_STAT_UUID';
  1335. var deviceId;
  1336. function useDeviceId(result) {
  1337. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1338. if (!deviceId) {
  1339. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1340. wx.setStorage({
  1341. key: UUID_KEY,
  1342. data: deviceId
  1343. });
  1344. }
  1345. result.deviceId = deviceId;
  1346. }
  1347. function addSafeAreaInsets(result) {
  1348. if (result.safeArea) {
  1349. var safeArea = result.safeArea;
  1350. result.safeAreaInsets = {
  1351. top: safeArea.top,
  1352. left: safeArea.left,
  1353. right: result.windowWidth - safeArea.right,
  1354. bottom: result.screenHeight - safeArea.bottom
  1355. };
  1356. }
  1357. }
  1358. function populateParameters(result) {
  1359. var _result$brand = result.brand,
  1360. brand = _result$brand === void 0 ? '' : _result$brand,
  1361. _result$model = result.model,
  1362. model = _result$model === void 0 ? '' : _result$model,
  1363. _result$system = result.system,
  1364. system = _result$system === void 0 ? '' : _result$system,
  1365. _result$language = result.language,
  1366. language = _result$language === void 0 ? '' : _result$language,
  1367. theme = result.theme,
  1368. version = result.version,
  1369. platform = result.platform,
  1370. fontSizeSetting = result.fontSizeSetting,
  1371. SDKVersion = result.SDKVersion,
  1372. pixelRatio = result.pixelRatio,
  1373. deviceOrientation = result.deviceOrientation;
  1374. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1375. var extraParam = {};
  1376. // osName osVersion
  1377. var osName = '';
  1378. var osVersion = '';
  1379. {
  1380. osName = system.split(' ')[0] || '';
  1381. osVersion = system.split(' ')[1] || '';
  1382. }
  1383. var hostVersion = version;
  1384. // deviceType
  1385. var deviceType = getGetDeviceType(result, model);
  1386. // deviceModel
  1387. var deviceBrand = getDeviceBrand(brand);
  1388. // hostName
  1389. var _hostName = getHostName(result);
  1390. // deviceOrientation
  1391. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1392. // devicePixelRatio
  1393. var _devicePixelRatio = pixelRatio;
  1394. // SDKVersion
  1395. var _SDKVersion = SDKVersion;
  1396. // hostLanguage
  1397. var hostLanguage = language.replace(/_/g, '-');
  1398. // wx.getAccountInfoSync
  1399. var parameters = {
  1400. appId: "__UNI__F0EBD91",
  1401. appName: "水箱计算",
  1402. appVersion: "1.0.0",
  1403. appVersionCode: "100",
  1404. appLanguage: getAppLanguage(hostLanguage),
  1405. uniCompileVersion: "3.7.9",
  1406. uniRuntimeVersion: "3.7.9",
  1407. uniPlatform: undefined || "mp-weixin",
  1408. deviceBrand: deviceBrand,
  1409. deviceModel: model,
  1410. deviceType: deviceType,
  1411. devicePixelRatio: _devicePixelRatio,
  1412. deviceOrientation: _deviceOrientation,
  1413. osName: osName.toLocaleLowerCase(),
  1414. osVersion: osVersion,
  1415. hostTheme: theme,
  1416. hostVersion: hostVersion,
  1417. hostLanguage: hostLanguage,
  1418. hostName: _hostName,
  1419. hostSDKVersion: _SDKVersion,
  1420. hostFontSizeSetting: fontSizeSetting,
  1421. windowTop: 0,
  1422. windowBottom: 0,
  1423. // TODO
  1424. osLanguage: undefined,
  1425. osTheme: undefined,
  1426. ua: undefined,
  1427. hostPackageName: undefined,
  1428. browserName: undefined,
  1429. browserVersion: undefined
  1430. };
  1431. Object.assign(result, parameters, extraParam);
  1432. }
  1433. function getGetDeviceType(result, model) {
  1434. var deviceType = result.deviceType || 'phone';
  1435. {
  1436. var deviceTypeMaps = {
  1437. ipad: 'pad',
  1438. windows: 'pc',
  1439. mac: 'pc'
  1440. };
  1441. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1442. var _model = model.toLocaleLowerCase();
  1443. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1444. var _m = deviceTypeMapsKeys[index];
  1445. if (_model.indexOf(_m) !== -1) {
  1446. deviceType = deviceTypeMaps[_m];
  1447. break;
  1448. }
  1449. }
  1450. }
  1451. return deviceType;
  1452. }
  1453. function getDeviceBrand(brand) {
  1454. var deviceBrand = brand;
  1455. if (deviceBrand) {
  1456. deviceBrand = brand.toLocaleLowerCase();
  1457. }
  1458. return deviceBrand;
  1459. }
  1460. function getAppLanguage(defaultLanguage) {
  1461. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1462. }
  1463. function getHostName(result) {
  1464. var _platform = 'WeChat';
  1465. var _hostName = result.hostName || _platform; // mp-jd
  1466. {
  1467. if (result.environment) {
  1468. _hostName = result.environment;
  1469. } else if (result.host && result.host.env) {
  1470. _hostName = result.host.env;
  1471. }
  1472. }
  1473. return _hostName;
  1474. }
  1475. var getSystemInfo = {
  1476. returnValue: function returnValue(result) {
  1477. useDeviceId(result);
  1478. addSafeAreaInsets(result);
  1479. populateParameters(result);
  1480. }
  1481. };
  1482. var showActionSheet = {
  1483. args: function args(fromArgs) {
  1484. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1485. fromArgs.alertText = fromArgs.title;
  1486. }
  1487. }
  1488. };
  1489. var getAppBaseInfo = {
  1490. returnValue: function returnValue(result) {
  1491. var _result = result,
  1492. version = _result.version,
  1493. language = _result.language,
  1494. SDKVersion = _result.SDKVersion,
  1495. theme = _result.theme;
  1496. var _hostName = getHostName(result);
  1497. var hostLanguage = language.replace('_', '-');
  1498. result = sortObject(Object.assign(result, {
  1499. appId: "__UNI__F0EBD91",
  1500. appName: "水箱计算",
  1501. appVersion: "1.0.0",
  1502. appVersionCode: "100",
  1503. appLanguage: getAppLanguage(hostLanguage),
  1504. hostVersion: version,
  1505. hostLanguage: hostLanguage,
  1506. hostName: _hostName,
  1507. hostSDKVersion: SDKVersion,
  1508. hostTheme: theme
  1509. }));
  1510. }
  1511. };
  1512. var getDeviceInfo = {
  1513. returnValue: function returnValue(result) {
  1514. var _result2 = result,
  1515. brand = _result2.brand,
  1516. model = _result2.model;
  1517. var deviceType = getGetDeviceType(result, model);
  1518. var deviceBrand = getDeviceBrand(brand);
  1519. useDeviceId(result);
  1520. result = sortObject(Object.assign(result, {
  1521. deviceType: deviceType,
  1522. deviceBrand: deviceBrand,
  1523. deviceModel: model
  1524. }));
  1525. }
  1526. };
  1527. var getWindowInfo = {
  1528. returnValue: function returnValue(result) {
  1529. addSafeAreaInsets(result);
  1530. result = sortObject(Object.assign(result, {
  1531. windowTop: 0,
  1532. windowBottom: 0
  1533. }));
  1534. }
  1535. };
  1536. var getAppAuthorizeSetting = {
  1537. returnValue: function returnValue(result) {
  1538. var locationReducedAccuracy = result.locationReducedAccuracy;
  1539. result.locationAccuracy = 'unsupported';
  1540. if (locationReducedAccuracy === true) {
  1541. result.locationAccuracy = 'reduced';
  1542. } else if (locationReducedAccuracy === false) {
  1543. result.locationAccuracy = 'full';
  1544. }
  1545. }
  1546. };
  1547. // import navigateTo from 'uni-helpers/navigate-to'
  1548. var compressImage = {
  1549. args: function args(fromArgs) {
  1550. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  1551. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  1552. fromArgs.compressHeight = fromArgs.compressedHeight;
  1553. }
  1554. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  1555. fromArgs.compressWidth = fromArgs.compressedWidth;
  1556. }
  1557. }
  1558. };
  1559. var protocols = {
  1560. redirectTo: redirectTo,
  1561. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1562. previewImage: previewImage,
  1563. getSystemInfo: getSystemInfo,
  1564. getSystemInfoSync: getSystemInfo,
  1565. showActionSheet: showActionSheet,
  1566. getAppBaseInfo: getAppBaseInfo,
  1567. getDeviceInfo: getDeviceInfo,
  1568. getWindowInfo: getWindowInfo,
  1569. getAppAuthorizeSetting: getAppAuthorizeSetting,
  1570. compressImage: compressImage
  1571. };
  1572. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1573. var canIUses = [];
  1574. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1575. function processCallback(methodName, method, returnValue) {
  1576. return function (res) {
  1577. return method(processReturnValue(methodName, res, returnValue));
  1578. };
  1579. }
  1580. function processArgs(methodName, fromArgs) {
  1581. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1582. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1583. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1584. if (isPlainObject(fromArgs)) {
  1585. // 一般 api 的参数解析
  1586. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1587. if (isFn(argsOption)) {
  1588. argsOption = argsOption(fromArgs, toArgs) || {};
  1589. }
  1590. for (var key in fromArgs) {
  1591. if (hasOwn(argsOption, key)) {
  1592. var keyOption = argsOption[key];
  1593. if (isFn(keyOption)) {
  1594. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1595. }
  1596. if (!keyOption) {
  1597. // 不支持的参数
  1598. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1599. } else if (isStr(keyOption)) {
  1600. // 重写参数 key
  1601. toArgs[keyOption] = fromArgs[key];
  1602. } else if (isPlainObject(keyOption)) {
  1603. // {name:newName,value:value}可重新指定参数 key:value
  1604. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1605. }
  1606. } else if (CALLBACKS.indexOf(key) !== -1) {
  1607. if (isFn(fromArgs[key])) {
  1608. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1609. }
  1610. } else {
  1611. if (!keepFromArgs) {
  1612. toArgs[key] = fromArgs[key];
  1613. }
  1614. }
  1615. }
  1616. return toArgs;
  1617. } else if (isFn(fromArgs)) {
  1618. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1619. }
  1620. return fromArgs;
  1621. }
  1622. function processReturnValue(methodName, res, returnValue) {
  1623. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1624. if (isFn(protocols.returnValue)) {
  1625. // 处理通用 returnValue
  1626. res = protocols.returnValue(methodName, res);
  1627. }
  1628. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1629. }
  1630. function wrapper(methodName, method) {
  1631. if (hasOwn(protocols, methodName)) {
  1632. var protocol = protocols[methodName];
  1633. if (!protocol) {
  1634. // 暂不支持的 api
  1635. return function () {
  1636. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1637. };
  1638. }
  1639. return function (arg1, arg2) {
  1640. // 目前 api 最多两个参数
  1641. var options = protocol;
  1642. if (isFn(protocol)) {
  1643. options = protocol(arg1);
  1644. }
  1645. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1646. var args = [arg1];
  1647. if (typeof arg2 !== 'undefined') {
  1648. args.push(arg2);
  1649. }
  1650. if (isFn(options.name)) {
  1651. methodName = options.name(arg1);
  1652. } else if (isStr(options.name)) {
  1653. methodName = options.name;
  1654. }
  1655. var returnValue = wx[methodName].apply(wx, args);
  1656. if (isSyncApi(methodName)) {
  1657. // 同步 api
  1658. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1659. }
  1660. return returnValue;
  1661. };
  1662. }
  1663. return method;
  1664. }
  1665. var todoApis = Object.create(null);
  1666. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1667. function createTodoApi(name) {
  1668. return function todoApi(_ref) {
  1669. var fail = _ref.fail,
  1670. complete = _ref.complete;
  1671. var res = {
  1672. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1673. };
  1674. isFn(fail) && fail(res);
  1675. isFn(complete) && complete(res);
  1676. };
  1677. }
  1678. TODOS.forEach(function (name) {
  1679. todoApis[name] = createTodoApi(name);
  1680. });
  1681. var providers = {
  1682. oauth: ['weixin'],
  1683. share: ['weixin'],
  1684. payment: ['wxpay'],
  1685. push: ['weixin']
  1686. };
  1687. function getProvider(_ref2) {
  1688. var service = _ref2.service,
  1689. success = _ref2.success,
  1690. fail = _ref2.fail,
  1691. complete = _ref2.complete;
  1692. var res = false;
  1693. if (providers[service]) {
  1694. res = {
  1695. errMsg: 'getProvider:ok',
  1696. service: service,
  1697. provider: providers[service]
  1698. };
  1699. isFn(success) && success(res);
  1700. } else {
  1701. res = {
  1702. errMsg: 'getProvider:fail service not found'
  1703. };
  1704. isFn(fail) && fail(res);
  1705. }
  1706. isFn(complete) && complete(res);
  1707. }
  1708. var extraApi = /*#__PURE__*/Object.freeze({
  1709. __proto__: null,
  1710. getProvider: getProvider
  1711. });
  1712. var getEmitter = function () {
  1713. var Emitter;
  1714. return function getUniEmitter() {
  1715. if (!Emitter) {
  1716. Emitter = new _vue.default();
  1717. }
  1718. return Emitter;
  1719. };
  1720. }();
  1721. function apply(ctx, method, args) {
  1722. return ctx[method].apply(ctx, args);
  1723. }
  1724. function $on() {
  1725. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1726. }
  1727. function $off() {
  1728. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1729. }
  1730. function $once() {
  1731. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1732. }
  1733. function $emit() {
  1734. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1735. }
  1736. var eventApi = /*#__PURE__*/Object.freeze({
  1737. __proto__: null,
  1738. $on: $on,
  1739. $off: $off,
  1740. $once: $once,
  1741. $emit: $emit
  1742. });
  1743. /**
  1744. * 框架内 try-catch
  1745. */
  1746. /**
  1747. * 开发者 try-catch
  1748. */
  1749. function tryCatch(fn) {
  1750. return function () {
  1751. try {
  1752. return fn.apply(fn, arguments);
  1753. } catch (e) {
  1754. // TODO
  1755. console.error(e);
  1756. }
  1757. };
  1758. }
  1759. function getApiCallbacks(params) {
  1760. var apiCallbacks = {};
  1761. for (var name in params) {
  1762. var param = params[name];
  1763. if (isFn(param)) {
  1764. apiCallbacks[name] = tryCatch(param);
  1765. delete params[name];
  1766. }
  1767. }
  1768. return apiCallbacks;
  1769. }
  1770. var cid;
  1771. var cidErrMsg;
  1772. var enabled;
  1773. function normalizePushMessage(message) {
  1774. try {
  1775. return JSON.parse(message);
  1776. } catch (e) {}
  1777. return message;
  1778. }
  1779. function invokePushCallback(args) {
  1780. if (args.type === 'enabled') {
  1781. enabled = true;
  1782. } else if (args.type === 'clientId') {
  1783. cid = args.cid;
  1784. cidErrMsg = args.errMsg;
  1785. invokeGetPushCidCallbacks(cid, args.errMsg);
  1786. } else if (args.type === 'pushMsg') {
  1787. var message = {
  1788. type: 'receive',
  1789. data: normalizePushMessage(args.message)
  1790. };
  1791. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1792. var callback = onPushMessageCallbacks[i];
  1793. callback(message);
  1794. // 该消息已被阻止
  1795. if (message.stopped) {
  1796. break;
  1797. }
  1798. }
  1799. } else if (args.type === 'click') {
  1800. onPushMessageCallbacks.forEach(function (callback) {
  1801. callback({
  1802. type: 'click',
  1803. data: normalizePushMessage(args.message)
  1804. });
  1805. });
  1806. }
  1807. }
  1808. var getPushCidCallbacks = [];
  1809. function invokeGetPushCidCallbacks(cid, errMsg) {
  1810. getPushCidCallbacks.forEach(function (callback) {
  1811. callback(cid, errMsg);
  1812. });
  1813. getPushCidCallbacks.length = 0;
  1814. }
  1815. function getPushClientId(args) {
  1816. if (!isPlainObject(args)) {
  1817. args = {};
  1818. }
  1819. var _getApiCallbacks = getApiCallbacks(args),
  1820. success = _getApiCallbacks.success,
  1821. fail = _getApiCallbacks.fail,
  1822. complete = _getApiCallbacks.complete;
  1823. var hasSuccess = isFn(success);
  1824. var hasFail = isFn(fail);
  1825. var hasComplete = isFn(complete);
  1826. Promise.resolve().then(function () {
  1827. if (typeof enabled === 'undefined') {
  1828. enabled = false;
  1829. cid = '';
  1830. cidErrMsg = 'uniPush is not enabled';
  1831. }
  1832. getPushCidCallbacks.push(function (cid, errMsg) {
  1833. var res;
  1834. if (cid) {
  1835. res = {
  1836. errMsg: 'getPushClientId:ok',
  1837. cid: cid
  1838. };
  1839. hasSuccess && success(res);
  1840. } else {
  1841. res = {
  1842. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1843. };
  1844. hasFail && fail(res);
  1845. }
  1846. hasComplete && complete(res);
  1847. });
  1848. if (typeof cid !== 'undefined') {
  1849. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1850. }
  1851. });
  1852. }
  1853. var onPushMessageCallbacks = [];
  1854. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1855. var onPushMessage = function onPushMessage(fn) {
  1856. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1857. onPushMessageCallbacks.push(fn);
  1858. }
  1859. };
  1860. var offPushMessage = function offPushMessage(fn) {
  1861. if (!fn) {
  1862. onPushMessageCallbacks.length = 0;
  1863. } else {
  1864. var index = onPushMessageCallbacks.indexOf(fn);
  1865. if (index > -1) {
  1866. onPushMessageCallbacks.splice(index, 1);
  1867. }
  1868. }
  1869. };
  1870. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1871. if (!baseInfo) {
  1872. baseInfo = wx.getSystemInfoSync();
  1873. }
  1874. var host = baseInfo ? baseInfo.host : null;
  1875. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1876. var api = /*#__PURE__*/Object.freeze({
  1877. __proto__: null,
  1878. shareVideoMessage: shareVideoMessage,
  1879. getPushClientId: getPushClientId,
  1880. onPushMessage: onPushMessage,
  1881. offPushMessage: offPushMessage,
  1882. invokePushCallback: invokePushCallback
  1883. });
  1884. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1885. function findVmByVueId(vm, vuePid) {
  1886. var $children = vm.$children;
  1887. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1888. for (var i = $children.length - 1; i >= 0; i--) {
  1889. var childVm = $children[i];
  1890. if (childVm.$scope._$vueId === vuePid) {
  1891. return childVm;
  1892. }
  1893. }
  1894. // 反向递归查找
  1895. var parentVm;
  1896. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1897. parentVm = findVmByVueId($children[_i], vuePid);
  1898. if (parentVm) {
  1899. return parentVm;
  1900. }
  1901. }
  1902. }
  1903. function initBehavior(options) {
  1904. return Behavior(options);
  1905. }
  1906. function isPage() {
  1907. return !!this.route;
  1908. }
  1909. function initRelation(detail) {
  1910. this.triggerEvent('__l', detail);
  1911. }
  1912. function selectAllComponents(mpInstance, selector, $refs) {
  1913. var components = mpInstance.selectAllComponents(selector) || [];
  1914. components.forEach(function (component) {
  1915. var ref = component.dataset.ref;
  1916. $refs[ref] = component.$vm || toSkip(component);
  1917. {
  1918. if (component.dataset.vueGeneric === 'scoped') {
  1919. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1920. selectAllComponents(scopedComponent, selector, $refs);
  1921. });
  1922. }
  1923. }
  1924. });
  1925. }
  1926. function syncRefs(refs, newRefs) {
  1927. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1928. var newKeys = Object.keys(newRefs);
  1929. newKeys.forEach(function (key) {
  1930. var oldValue = refs[key];
  1931. var newValue = newRefs[key];
  1932. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1933. return oldValue.includes(value);
  1934. })) {
  1935. return;
  1936. }
  1937. refs[key] = newValue;
  1938. oldKeys.delete(key);
  1939. });
  1940. oldKeys.forEach(function (key) {
  1941. delete refs[key];
  1942. });
  1943. return refs;
  1944. }
  1945. function initRefs(vm) {
  1946. var mpInstance = vm.$scope;
  1947. var refs = {};
  1948. Object.defineProperty(vm, '$refs', {
  1949. get: function get() {
  1950. var $refs = {};
  1951. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1952. // TODO 暂不考虑 for 中的 scoped
  1953. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1954. forComponents.forEach(function (component) {
  1955. var ref = component.dataset.ref;
  1956. if (!$refs[ref]) {
  1957. $refs[ref] = [];
  1958. }
  1959. $refs[ref].push(component.$vm || toSkip(component));
  1960. });
  1961. return syncRefs(refs, $refs);
  1962. }
  1963. });
  1964. }
  1965. function handleLink(event) {
  1966. var _ref3 = event.detail || event.value,
  1967. vuePid = _ref3.vuePid,
  1968. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1969. var parentVm;
  1970. if (vuePid) {
  1971. parentVm = findVmByVueId(this.$vm, vuePid);
  1972. }
  1973. if (!parentVm) {
  1974. parentVm = this.$vm;
  1975. }
  1976. vueOptions.parent = parentVm;
  1977. }
  1978. function markMPComponent(component) {
  1979. // 在 Vue 中标记为小程序组件
  1980. var IS_MP = '__v_isMPComponent';
  1981. Object.defineProperty(component, IS_MP, {
  1982. configurable: true,
  1983. enumerable: false,
  1984. value: true
  1985. });
  1986. return component;
  1987. }
  1988. function toSkip(obj) {
  1989. var OB = '__ob__';
  1990. var SKIP = '__v_skip';
  1991. if (isObject(obj) && Object.isExtensible(obj)) {
  1992. // 避免被 @vue/composition-api 观测
  1993. Object.defineProperty(obj, OB, {
  1994. configurable: true,
  1995. enumerable: false,
  1996. value: (0, _defineProperty2.default)({}, SKIP, true)
  1997. });
  1998. }
  1999. return obj;
  2000. }
  2001. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2002. function initWorkletMethods(mpMethods, vueMethods) {
  2003. if (vueMethods) {
  2004. Object.keys(vueMethods).forEach(function (name) {
  2005. var matches = name.match(WORKLET_RE);
  2006. if (matches) {
  2007. var workletName = matches[1];
  2008. mpMethods[name] = vueMethods[name];
  2009. mpMethods[workletName] = vueMethods[workletName];
  2010. }
  2011. });
  2012. }
  2013. }
  2014. var MPPage = Page;
  2015. var MPComponent = Component;
  2016. var customizeRE = /:/g;
  2017. var customize = cached(function (str) {
  2018. return camelize(str.replace(customizeRE, '-'));
  2019. });
  2020. function initTriggerEvent(mpInstance) {
  2021. var oldTriggerEvent = mpInstance.triggerEvent;
  2022. var newTriggerEvent = function newTriggerEvent(event) {
  2023. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2024. args[_key3 - 1] = arguments[_key3];
  2025. }
  2026. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2027. if (this.$vm || this.dataset && this.dataset.comType) {
  2028. event = customize(event);
  2029. } else {
  2030. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2031. var newEvent = customize(event);
  2032. if (newEvent !== event) {
  2033. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2034. }
  2035. }
  2036. return oldTriggerEvent.apply(this, [event].concat(args));
  2037. };
  2038. try {
  2039. // 京东小程序 triggerEvent 为只读
  2040. mpInstance.triggerEvent = newTriggerEvent;
  2041. } catch (error) {
  2042. mpInstance._triggerEvent = newTriggerEvent;
  2043. }
  2044. }
  2045. function initHook(name, options, isComponent) {
  2046. var oldHook = options[name];
  2047. options[name] = function () {
  2048. markMPComponent(this);
  2049. initTriggerEvent(this);
  2050. if (oldHook) {
  2051. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2052. args[_key4] = arguments[_key4];
  2053. }
  2054. return oldHook.apply(this, args);
  2055. }
  2056. };
  2057. }
  2058. if (!MPPage.__$wrappered) {
  2059. MPPage.__$wrappered = true;
  2060. Page = function Page() {
  2061. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2062. initHook('onLoad', options);
  2063. return MPPage(options);
  2064. };
  2065. Page.after = MPPage.after;
  2066. Component = function Component() {
  2067. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2068. initHook('created', options);
  2069. return MPComponent(options);
  2070. };
  2071. }
  2072. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2073. function initMocks(vm, mocks) {
  2074. var mpInstance = vm.$mp[vm.mpType];
  2075. mocks.forEach(function (mock) {
  2076. if (hasOwn(mpInstance, mock)) {
  2077. vm[mock] = mpInstance[mock];
  2078. }
  2079. });
  2080. }
  2081. function hasHook(hook, vueOptions) {
  2082. if (!vueOptions) {
  2083. return true;
  2084. }
  2085. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2086. return true;
  2087. }
  2088. vueOptions = vueOptions.default || vueOptions;
  2089. if (isFn(vueOptions)) {
  2090. if (isFn(vueOptions.extendOptions[hook])) {
  2091. return true;
  2092. }
  2093. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2094. return true;
  2095. }
  2096. return false;
  2097. }
  2098. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2099. return true;
  2100. }
  2101. var mixins = vueOptions.mixins;
  2102. if (Array.isArray(mixins)) {
  2103. return !!mixins.find(function (mixin) {
  2104. return hasHook(hook, mixin);
  2105. });
  2106. }
  2107. }
  2108. function initHooks(mpOptions, hooks, vueOptions) {
  2109. hooks.forEach(function (hook) {
  2110. if (hasHook(hook, vueOptions)) {
  2111. mpOptions[hook] = function (args) {
  2112. return this.$vm && this.$vm.__call_hook(hook, args);
  2113. };
  2114. }
  2115. });
  2116. }
  2117. function initUnknownHooks(mpOptions, vueOptions) {
  2118. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2119. findHooks(vueOptions).forEach(function (hook) {
  2120. return initHook$1(mpOptions, hook, excludes);
  2121. });
  2122. }
  2123. function findHooks(vueOptions) {
  2124. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2125. if (vueOptions) {
  2126. Object.keys(vueOptions).forEach(function (name) {
  2127. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2128. hooks.push(name);
  2129. }
  2130. });
  2131. }
  2132. return hooks;
  2133. }
  2134. function initHook$1(mpOptions, hook, excludes) {
  2135. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2136. mpOptions[hook] = function (args) {
  2137. return this.$vm && this.$vm.__call_hook(hook, args);
  2138. };
  2139. }
  2140. }
  2141. function initVueComponent(Vue, vueOptions) {
  2142. vueOptions = vueOptions.default || vueOptions;
  2143. var VueComponent;
  2144. if (isFn(vueOptions)) {
  2145. VueComponent = vueOptions;
  2146. } else {
  2147. VueComponent = Vue.extend(vueOptions);
  2148. }
  2149. vueOptions = VueComponent.options;
  2150. return [VueComponent, vueOptions];
  2151. }
  2152. function initSlots(vm, vueSlots) {
  2153. if (Array.isArray(vueSlots) && vueSlots.length) {
  2154. var $slots = Object.create(null);
  2155. vueSlots.forEach(function (slotName) {
  2156. $slots[slotName] = true;
  2157. });
  2158. vm.$scopedSlots = vm.$slots = $slots;
  2159. }
  2160. }
  2161. function initVueIds(vueIds, mpInstance) {
  2162. vueIds = (vueIds || '').split(',');
  2163. var len = vueIds.length;
  2164. if (len === 1) {
  2165. mpInstance._$vueId = vueIds[0];
  2166. } else if (len === 2) {
  2167. mpInstance._$vueId = vueIds[0];
  2168. mpInstance._$vuePid = vueIds[1];
  2169. }
  2170. }
  2171. function initData(vueOptions, context) {
  2172. var data = vueOptions.data || {};
  2173. var methods = vueOptions.methods || {};
  2174. if (typeof data === 'function') {
  2175. try {
  2176. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2177. } catch (e) {
  2178. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"水箱计算","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2179. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2180. }
  2181. }
  2182. } else {
  2183. try {
  2184. // 对 data 格式化
  2185. data = JSON.parse(JSON.stringify(data));
  2186. } catch (e) {}
  2187. }
  2188. if (!isPlainObject(data)) {
  2189. data = {};
  2190. }
  2191. Object.keys(methods).forEach(function (methodName) {
  2192. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2193. data[methodName] = methods[methodName];
  2194. }
  2195. });
  2196. return data;
  2197. }
  2198. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2199. function createObserver(name) {
  2200. return function observer(newVal, oldVal) {
  2201. if (this.$vm) {
  2202. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2203. }
  2204. };
  2205. }
  2206. function initBehaviors(vueOptions, initBehavior) {
  2207. var vueBehaviors = vueOptions.behaviors;
  2208. var vueExtends = vueOptions.extends;
  2209. var vueMixins = vueOptions.mixins;
  2210. var vueProps = vueOptions.props;
  2211. if (!vueProps) {
  2212. vueOptions.props = vueProps = [];
  2213. }
  2214. var behaviors = [];
  2215. if (Array.isArray(vueBehaviors)) {
  2216. vueBehaviors.forEach(function (behavior) {
  2217. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2218. if (behavior === 'uni://form-field') {
  2219. if (Array.isArray(vueProps)) {
  2220. vueProps.push('name');
  2221. vueProps.push('value');
  2222. } else {
  2223. vueProps.name = {
  2224. type: String,
  2225. default: ''
  2226. };
  2227. vueProps.value = {
  2228. type: [String, Number, Boolean, Array, Object, Date],
  2229. default: ''
  2230. };
  2231. }
  2232. }
  2233. });
  2234. }
  2235. if (isPlainObject(vueExtends) && vueExtends.props) {
  2236. behaviors.push(initBehavior({
  2237. properties: initProperties(vueExtends.props, true)
  2238. }));
  2239. }
  2240. if (Array.isArray(vueMixins)) {
  2241. vueMixins.forEach(function (vueMixin) {
  2242. if (isPlainObject(vueMixin) && vueMixin.props) {
  2243. behaviors.push(initBehavior({
  2244. properties: initProperties(vueMixin.props, true)
  2245. }));
  2246. }
  2247. });
  2248. }
  2249. return behaviors;
  2250. }
  2251. function parsePropType(key, type, defaultValue, file) {
  2252. // [String]=>String
  2253. if (Array.isArray(type) && type.length === 1) {
  2254. return type[0];
  2255. }
  2256. return type;
  2257. }
  2258. function initProperties(props) {
  2259. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2260. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2261. var options = arguments.length > 3 ? arguments[3] : undefined;
  2262. var properties = {};
  2263. if (!isBehavior) {
  2264. properties.vueId = {
  2265. type: String,
  2266. value: ''
  2267. };
  2268. {
  2269. if (options.virtualHost) {
  2270. properties.virtualHostStyle = {
  2271. type: null,
  2272. value: ''
  2273. };
  2274. properties.virtualHostClass = {
  2275. type: null,
  2276. value: ''
  2277. };
  2278. }
  2279. }
  2280. // scopedSlotsCompiler auto
  2281. properties.scopedSlotsCompiler = {
  2282. type: String,
  2283. value: ''
  2284. };
  2285. properties.vueSlots = {
  2286. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2287. type: null,
  2288. value: [],
  2289. observer: function observer(newVal, oldVal) {
  2290. var $slots = Object.create(null);
  2291. newVal.forEach(function (slotName) {
  2292. $slots[slotName] = true;
  2293. });
  2294. this.setData({
  2295. $slots: $slots
  2296. });
  2297. }
  2298. };
  2299. }
  2300. if (Array.isArray(props)) {
  2301. // ['title']
  2302. props.forEach(function (key) {
  2303. properties[key] = {
  2304. type: null,
  2305. observer: createObserver(key)
  2306. };
  2307. });
  2308. } else if (isPlainObject(props)) {
  2309. // {title:{type:String,default:''},content:String}
  2310. Object.keys(props).forEach(function (key) {
  2311. var opts = props[key];
  2312. if (isPlainObject(opts)) {
  2313. // title:{type:String,default:''}
  2314. var value = opts.default;
  2315. if (isFn(value)) {
  2316. value = value();
  2317. }
  2318. opts.type = parsePropType(key, opts.type);
  2319. properties[key] = {
  2320. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2321. value: value,
  2322. observer: createObserver(key)
  2323. };
  2324. } else {
  2325. // content:String
  2326. var type = parsePropType(key, opts);
  2327. properties[key] = {
  2328. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2329. observer: createObserver(key)
  2330. };
  2331. }
  2332. });
  2333. }
  2334. return properties;
  2335. }
  2336. function wrapper$1(event) {
  2337. // TODO 又得兼容 mpvue 的 mp 对象
  2338. try {
  2339. event.mp = JSON.parse(JSON.stringify(event));
  2340. } catch (e) {}
  2341. event.stopPropagation = noop;
  2342. event.preventDefault = noop;
  2343. event.target = event.target || {};
  2344. if (!hasOwn(event, 'detail')) {
  2345. event.detail = {};
  2346. }
  2347. if (hasOwn(event, 'markerId')) {
  2348. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2349. event.detail.markerId = event.markerId;
  2350. }
  2351. if (isPlainObject(event.detail)) {
  2352. event.target = Object.assign({}, event.target, event.detail);
  2353. }
  2354. return event;
  2355. }
  2356. function getExtraValue(vm, dataPathsArray) {
  2357. var context = vm;
  2358. dataPathsArray.forEach(function (dataPathArray) {
  2359. var dataPath = dataPathArray[0];
  2360. var value = dataPathArray[2];
  2361. if (dataPath || typeof value !== 'undefined') {
  2362. // ['','',index,'disable']
  2363. var propPath = dataPathArray[1];
  2364. var valuePath = dataPathArray[3];
  2365. var vFor;
  2366. if (Number.isInteger(dataPath)) {
  2367. vFor = dataPath;
  2368. } else if (!dataPath) {
  2369. vFor = context;
  2370. } else if (typeof dataPath === 'string' && dataPath) {
  2371. if (dataPath.indexOf('#s#') === 0) {
  2372. vFor = dataPath.substr(3);
  2373. } else {
  2374. vFor = vm.__get_value(dataPath, context);
  2375. }
  2376. }
  2377. if (Number.isInteger(vFor)) {
  2378. context = value;
  2379. } else if (!propPath) {
  2380. context = vFor[value];
  2381. } else {
  2382. if (Array.isArray(vFor)) {
  2383. context = vFor.find(function (vForItem) {
  2384. return vm.__get_value(propPath, vForItem) === value;
  2385. });
  2386. } else if (isPlainObject(vFor)) {
  2387. context = Object.keys(vFor).find(function (vForKey) {
  2388. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2389. });
  2390. } else {
  2391. console.error('v-for 暂不支持循环数据:', vFor);
  2392. }
  2393. }
  2394. if (valuePath) {
  2395. context = vm.__get_value(valuePath, context);
  2396. }
  2397. }
  2398. });
  2399. return context;
  2400. }
  2401. function processEventExtra(vm, extra, event, __args__) {
  2402. var extraObj = {};
  2403. if (Array.isArray(extra) && extra.length) {
  2404. /**
  2405. *[
  2406. * ['data.items', 'data.id', item.data.id],
  2407. * ['metas', 'id', meta.id]
  2408. *],
  2409. *[
  2410. * ['data.items', 'data.id', item.data.id],
  2411. * ['metas', 'id', meta.id]
  2412. *],
  2413. *'test'
  2414. */
  2415. extra.forEach(function (dataPath, index) {
  2416. if (typeof dataPath === 'string') {
  2417. if (!dataPath) {
  2418. // model,prop.sync
  2419. extraObj['$' + index] = vm;
  2420. } else {
  2421. if (dataPath === '$event') {
  2422. // $event
  2423. extraObj['$' + index] = event;
  2424. } else if (dataPath === 'arguments') {
  2425. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2426. } else if (dataPath.indexOf('$event.') === 0) {
  2427. // $event.target.value
  2428. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2429. } else {
  2430. extraObj['$' + index] = vm.__get_value(dataPath);
  2431. }
  2432. }
  2433. } else {
  2434. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2435. }
  2436. });
  2437. }
  2438. return extraObj;
  2439. }
  2440. function getObjByArray(arr) {
  2441. var obj = {};
  2442. for (var i = 1; i < arr.length; i++) {
  2443. var element = arr[i];
  2444. obj[element[0]] = element[1];
  2445. }
  2446. return obj;
  2447. }
  2448. function processEventArgs(vm, event) {
  2449. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2450. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2451. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2452. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2453. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2454. // fixed 用户直接触发 mpInstance.triggerEvent
  2455. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2456. if (isCustom) {
  2457. // 自定义事件
  2458. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2459. if (!args.length) {
  2460. // 无参数,直接传入 event 或 detail 数组
  2461. if (isCustomMPEvent) {
  2462. return [event];
  2463. }
  2464. return __args__;
  2465. }
  2466. }
  2467. var extraObj = processEventExtra(vm, extra, event, __args__);
  2468. var ret = [];
  2469. args.forEach(function (arg) {
  2470. if (arg === '$event') {
  2471. if (methodName === '__set_model' && !isCustom) {
  2472. // input v-model value
  2473. ret.push(event.target.value);
  2474. } else {
  2475. if (isCustom && !isCustomMPEvent) {
  2476. ret.push(__args__[0]);
  2477. } else {
  2478. // wxcomponent 组件或内置组件
  2479. ret.push(event);
  2480. }
  2481. }
  2482. } else {
  2483. if (Array.isArray(arg) && arg[0] === 'o') {
  2484. ret.push(getObjByArray(arg));
  2485. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2486. ret.push(extraObj[arg]);
  2487. } else {
  2488. ret.push(arg);
  2489. }
  2490. }
  2491. });
  2492. return ret;
  2493. }
  2494. var ONCE = '~';
  2495. var CUSTOM = '^';
  2496. function isMatchEventType(eventType, optType) {
  2497. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2498. }
  2499. function getContextVm(vm) {
  2500. var $parent = vm.$parent;
  2501. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2502. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2503. $parent = $parent.$parent;
  2504. }
  2505. return $parent && $parent.$parent;
  2506. }
  2507. function handleEvent(event) {
  2508. var _this2 = this;
  2509. event = wrapper$1(event);
  2510. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2511. var dataset = (event.currentTarget || event.target).dataset;
  2512. if (!dataset) {
  2513. return console.warn('事件信息不存在');
  2514. }
  2515. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2516. if (!eventOpts) {
  2517. return console.warn('事件信息不存在');
  2518. }
  2519. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2520. var eventType = event.type;
  2521. var ret = [];
  2522. eventOpts.forEach(function (eventOpt) {
  2523. var type = eventOpt[0];
  2524. var eventsArray = eventOpt[1];
  2525. var isCustom = type.charAt(0) === CUSTOM;
  2526. type = isCustom ? type.slice(1) : type;
  2527. var isOnce = type.charAt(0) === ONCE;
  2528. type = isOnce ? type.slice(1) : type;
  2529. if (eventsArray && isMatchEventType(eventType, type)) {
  2530. eventsArray.forEach(function (eventArray) {
  2531. var methodName = eventArray[0];
  2532. if (methodName) {
  2533. var handlerCtx = _this2.$vm;
  2534. if (handlerCtx.$options.generic) {
  2535. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2536. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2537. }
  2538. if (methodName === '$emit') {
  2539. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2540. return;
  2541. }
  2542. var handler = handlerCtx[methodName];
  2543. if (!isFn(handler)) {
  2544. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2545. var path = _this2.route || _this2.is;
  2546. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2547. }
  2548. if (isOnce) {
  2549. if (handler.once) {
  2550. return;
  2551. }
  2552. handler.once = true;
  2553. }
  2554. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2555. params = Array.isArray(params) ? params : [];
  2556. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2557. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2558. // eslint-disable-next-line no-sparse-arrays
  2559. params = params.concat([,,,,,,,,,, event]);
  2560. }
  2561. ret.push(handler.apply(handlerCtx, params));
  2562. }
  2563. });
  2564. }
  2565. });
  2566. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2567. return ret[0];
  2568. }
  2569. }
  2570. var eventChannels = {};
  2571. var eventChannelStack = [];
  2572. function getEventChannel(id) {
  2573. if (id) {
  2574. var eventChannel = eventChannels[id];
  2575. delete eventChannels[id];
  2576. return eventChannel;
  2577. }
  2578. return eventChannelStack.shift();
  2579. }
  2580. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2581. function initEventChannel() {
  2582. _vue.default.prototype.getOpenerEventChannel = function () {
  2583. // 微信小程序使用自身getOpenerEventChannel
  2584. {
  2585. return this.$scope.getOpenerEventChannel();
  2586. }
  2587. };
  2588. var callHook = _vue.default.prototype.__call_hook;
  2589. _vue.default.prototype.__call_hook = function (hook, args) {
  2590. if (hook === 'onLoad' && args && args.__id__) {
  2591. this.__eventChannel__ = getEventChannel(args.__id__);
  2592. delete args.__id__;
  2593. }
  2594. return callHook.call(this, hook, args);
  2595. };
  2596. }
  2597. function initScopedSlotsParams() {
  2598. var center = {};
  2599. var parents = {};
  2600. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  2601. var has = center[vueId];
  2602. if (!has) {
  2603. parents[vueId] = this;
  2604. this.$on('hook:destroyed', function () {
  2605. delete parents[vueId];
  2606. });
  2607. }
  2608. return has;
  2609. };
  2610. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  2611. var data = center[vueId];
  2612. if (data) {
  2613. var object = data[name] || {};
  2614. return key ? object[key] : object;
  2615. } else {
  2616. parents[vueId] = this;
  2617. this.$on('hook:destroyed', function () {
  2618. delete parents[vueId];
  2619. });
  2620. }
  2621. };
  2622. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  2623. var vueIds = this.$options.propsData.vueId;
  2624. if (vueIds) {
  2625. var vueId = vueIds.split(',')[0];
  2626. var object = center[vueId] = center[vueId] || {};
  2627. object[name] = value;
  2628. if (parents[vueId]) {
  2629. parents[vueId].$forceUpdate();
  2630. }
  2631. }
  2632. };
  2633. _vue.default.mixin({
  2634. destroyed: function destroyed() {
  2635. var propsData = this.$options.propsData;
  2636. var vueId = propsData && propsData.vueId;
  2637. if (vueId) {
  2638. delete center[vueId];
  2639. delete parents[vueId];
  2640. }
  2641. }
  2642. });
  2643. }
  2644. function parseBaseApp(vm, _ref4) {
  2645. var mocks = _ref4.mocks,
  2646. initRefs = _ref4.initRefs;
  2647. initEventChannel();
  2648. {
  2649. initScopedSlotsParams();
  2650. }
  2651. if (vm.$options.store) {
  2652. _vue.default.prototype.$store = vm.$options.store;
  2653. }
  2654. uniIdMixin(_vue.default);
  2655. _vue.default.prototype.mpHost = "mp-weixin";
  2656. _vue.default.mixin({
  2657. beforeCreate: function beforeCreate() {
  2658. if (!this.$options.mpType) {
  2659. return;
  2660. }
  2661. this.mpType = this.$options.mpType;
  2662. this.$mp = (0, _defineProperty2.default)({
  2663. data: {}
  2664. }, this.mpType, this.$options.mpInstance);
  2665. this.$scope = this.$options.mpInstance;
  2666. delete this.$options.mpType;
  2667. delete this.$options.mpInstance;
  2668. if (this.mpType === 'page' && typeof getApp === 'function') {
  2669. // hack vue-i18n
  2670. var app = getApp();
  2671. if (app.$vm && app.$vm.$i18n) {
  2672. this._i18n = app.$vm.$i18n;
  2673. }
  2674. }
  2675. if (this.mpType !== 'app') {
  2676. initRefs(this);
  2677. initMocks(this, mocks);
  2678. }
  2679. }
  2680. });
  2681. var appOptions = {
  2682. onLaunch: function onLaunch(args) {
  2683. if (this.$vm) {
  2684. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2685. return;
  2686. }
  2687. {
  2688. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2689. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2690. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2691. }
  2692. }
  2693. this.$vm = vm;
  2694. this.$vm.$mp = {
  2695. app: this
  2696. };
  2697. this.$vm.$scope = this;
  2698. // vm 上也挂载 globalData
  2699. this.$vm.globalData = this.globalData;
  2700. this.$vm._isMounted = true;
  2701. this.$vm.__call_hook('mounted', args);
  2702. this.$vm.__call_hook('onLaunch', args);
  2703. }
  2704. };
  2705. // 兼容旧版本 globalData
  2706. appOptions.globalData = vm.$options.globalData || {};
  2707. // 将 methods 中的方法挂在 getApp() 中
  2708. var methods = vm.$options.methods;
  2709. if (methods) {
  2710. Object.keys(methods).forEach(function (name) {
  2711. appOptions[name] = methods[name];
  2712. });
  2713. }
  2714. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2715. initHooks(appOptions, hooks);
  2716. initUnknownHooks(appOptions, vm.$options);
  2717. return appOptions;
  2718. }
  2719. function parseApp(vm) {
  2720. return parseBaseApp(vm, {
  2721. mocks: mocks,
  2722. initRefs: initRefs
  2723. });
  2724. }
  2725. function createApp(vm) {
  2726. App(parseApp(vm));
  2727. return vm;
  2728. }
  2729. var encodeReserveRE = /[!'()*]/g;
  2730. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2731. return '%' + c.charCodeAt(0).toString(16);
  2732. };
  2733. var commaRE = /%2C/g;
  2734. // fixed encodeURIComponent which is more conformant to RFC3986:
  2735. // - escapes [!'()*]
  2736. // - preserve commas
  2737. var encode = function encode(str) {
  2738. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2739. };
  2740. function stringifyQuery(obj) {
  2741. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2742. var res = obj ? Object.keys(obj).map(function (key) {
  2743. var val = obj[key];
  2744. if (val === undefined) {
  2745. return '';
  2746. }
  2747. if (val === null) {
  2748. return encodeStr(key);
  2749. }
  2750. if (Array.isArray(val)) {
  2751. var result = [];
  2752. val.forEach(function (val2) {
  2753. if (val2 === undefined) {
  2754. return;
  2755. }
  2756. if (val2 === null) {
  2757. result.push(encodeStr(key));
  2758. } else {
  2759. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2760. }
  2761. });
  2762. return result.join('&');
  2763. }
  2764. return encodeStr(key) + '=' + encodeStr(val);
  2765. }).filter(function (x) {
  2766. return x.length > 0;
  2767. }).join('&') : null;
  2768. return res ? "?".concat(res) : '';
  2769. }
  2770. function parseBaseComponent(vueComponentOptions) {
  2771. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2772. isPage = _ref5.isPage,
  2773. initRelation = _ref5.initRelation;
  2774. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2775. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2776. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2777. VueComponent = _initVueComponent2[0],
  2778. vueOptions = _initVueComponent2[1];
  2779. var options = _objectSpread({
  2780. multipleSlots: true,
  2781. addGlobalClass: true
  2782. }, vueOptions.options || {});
  2783. {
  2784. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2785. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2786. Object.assign(options, vueOptions['mp-weixin'].options);
  2787. }
  2788. }
  2789. var componentOptions = {
  2790. options: options,
  2791. data: initData(vueOptions, _vue.default.prototype),
  2792. behaviors: initBehaviors(vueOptions, initBehavior),
  2793. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2794. lifetimes: {
  2795. attached: function attached() {
  2796. var properties = this.properties;
  2797. var options = {
  2798. mpType: isPage.call(this) ? 'page' : 'component',
  2799. mpInstance: this,
  2800. propsData: properties
  2801. };
  2802. initVueIds(properties.vueId, this);
  2803. // 处理父子关系
  2804. initRelation.call(this, {
  2805. vuePid: this._$vuePid,
  2806. vueOptions: options
  2807. });
  2808. // 初始化 vue 实例
  2809. this.$vm = new VueComponent(options);
  2810. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2811. initSlots(this.$vm, properties.vueSlots);
  2812. // 触发首次 setData
  2813. this.$vm.$mount();
  2814. },
  2815. ready: function ready() {
  2816. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2817. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2818. if (this.$vm) {
  2819. this.$vm._isMounted = true;
  2820. this.$vm.__call_hook('mounted');
  2821. this.$vm.__call_hook('onReady');
  2822. }
  2823. },
  2824. detached: function detached() {
  2825. this.$vm && this.$vm.$destroy();
  2826. }
  2827. },
  2828. pageLifetimes: {
  2829. show: function show(args) {
  2830. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2831. },
  2832. hide: function hide() {
  2833. this.$vm && this.$vm.__call_hook('onPageHide');
  2834. },
  2835. resize: function resize(size) {
  2836. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2837. }
  2838. },
  2839. methods: {
  2840. __l: handleLink,
  2841. __e: handleEvent
  2842. }
  2843. };
  2844. // externalClasses
  2845. if (vueOptions.externalClasses) {
  2846. componentOptions.externalClasses = vueOptions.externalClasses;
  2847. }
  2848. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2849. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2850. componentOptions.methods[callMethod] = function (args) {
  2851. return this.$vm[callMethod](args);
  2852. };
  2853. });
  2854. }
  2855. if (needVueOptions) {
  2856. return [componentOptions, vueOptions, VueComponent];
  2857. }
  2858. if (isPage) {
  2859. return componentOptions;
  2860. }
  2861. return [componentOptions, VueComponent];
  2862. }
  2863. function parseComponent(vueComponentOptions, needVueOptions) {
  2864. return parseBaseComponent(vueComponentOptions, {
  2865. isPage: isPage,
  2866. initRelation: initRelation
  2867. }, needVueOptions);
  2868. }
  2869. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2870. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2871. function parseBasePage(vuePageOptions) {
  2872. var _parseComponent = parseComponent(vuePageOptions, true),
  2873. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2874. pageOptions = _parseComponent2[0],
  2875. vueOptions = _parseComponent2[1];
  2876. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2877. pageOptions.methods.onLoad = function (query) {
  2878. this.options = query;
  2879. var copyQuery = Object.assign({}, query);
  2880. delete copyQuery.__id__;
  2881. this.$page = {
  2882. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2883. };
  2884. this.$vm.$mp.query = query; // 兼容 mpvue
  2885. this.$vm.__call_hook('onLoad', query);
  2886. };
  2887. {
  2888. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2889. }
  2890. {
  2891. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  2892. }
  2893. return pageOptions;
  2894. }
  2895. function parsePage(vuePageOptions) {
  2896. return parseBasePage(vuePageOptions);
  2897. }
  2898. function createPage(vuePageOptions) {
  2899. {
  2900. return Component(parsePage(vuePageOptions));
  2901. }
  2902. }
  2903. function createComponent(vueOptions) {
  2904. {
  2905. return Component(parseComponent(vueOptions));
  2906. }
  2907. }
  2908. function createSubpackageApp(vm) {
  2909. var appOptions = parseApp(vm);
  2910. var app = getApp({
  2911. allowDefault: true
  2912. });
  2913. vm.$scope = app;
  2914. var globalData = app.globalData;
  2915. if (globalData) {
  2916. Object.keys(appOptions.globalData).forEach(function (name) {
  2917. if (!hasOwn(globalData, name)) {
  2918. globalData[name] = appOptions.globalData[name];
  2919. }
  2920. });
  2921. }
  2922. Object.keys(appOptions).forEach(function (name) {
  2923. if (!hasOwn(app, name)) {
  2924. app[name] = appOptions[name];
  2925. }
  2926. });
  2927. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2928. wx.onAppShow(function () {
  2929. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2930. args[_key5] = arguments[_key5];
  2931. }
  2932. vm.__call_hook('onShow', args);
  2933. });
  2934. }
  2935. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2936. wx.onAppHide(function () {
  2937. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2938. args[_key6] = arguments[_key6];
  2939. }
  2940. vm.__call_hook('onHide', args);
  2941. });
  2942. }
  2943. if (isFn(appOptions.onLaunch)) {
  2944. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2945. vm.__call_hook('onLaunch', args);
  2946. }
  2947. return vm;
  2948. }
  2949. function createPlugin(vm) {
  2950. var appOptions = parseApp(vm);
  2951. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2952. wx.onAppShow(function () {
  2953. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2954. args[_key7] = arguments[_key7];
  2955. }
  2956. vm.__call_hook('onShow', args);
  2957. });
  2958. }
  2959. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2960. wx.onAppHide(function () {
  2961. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2962. args[_key8] = arguments[_key8];
  2963. }
  2964. vm.__call_hook('onHide', args);
  2965. });
  2966. }
  2967. if (isFn(appOptions.onLaunch)) {
  2968. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2969. vm.__call_hook('onLaunch', args);
  2970. }
  2971. return vm;
  2972. }
  2973. todos.forEach(function (todoApi) {
  2974. protocols[todoApi] = false;
  2975. });
  2976. canIUses.forEach(function (canIUseApi) {
  2977. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2978. if (!wx.canIUse(apiName)) {
  2979. protocols[canIUseApi] = false;
  2980. }
  2981. });
  2982. var uni = {};
  2983. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2984. uni = new Proxy({}, {
  2985. get: function get(target, name) {
  2986. if (hasOwn(target, name)) {
  2987. return target[name];
  2988. }
  2989. if (baseApi[name]) {
  2990. return baseApi[name];
  2991. }
  2992. if (api[name]) {
  2993. return promisify(name, api[name]);
  2994. }
  2995. {
  2996. if (extraApi[name]) {
  2997. return promisify(name, extraApi[name]);
  2998. }
  2999. if (todoApis[name]) {
  3000. return promisify(name, todoApis[name]);
  3001. }
  3002. }
  3003. if (eventApi[name]) {
  3004. return eventApi[name];
  3005. }
  3006. return promisify(name, wrapper(name, wx[name]));
  3007. },
  3008. set: function set(target, name, value) {
  3009. target[name] = value;
  3010. return true;
  3011. }
  3012. });
  3013. } else {
  3014. Object.keys(baseApi).forEach(function (name) {
  3015. uni[name] = baseApi[name];
  3016. });
  3017. {
  3018. Object.keys(todoApis).forEach(function (name) {
  3019. uni[name] = promisify(name, todoApis[name]);
  3020. });
  3021. Object.keys(extraApi).forEach(function (name) {
  3022. uni[name] = promisify(name, todoApis[name]);
  3023. });
  3024. }
  3025. Object.keys(eventApi).forEach(function (name) {
  3026. uni[name] = eventApi[name];
  3027. });
  3028. Object.keys(api).forEach(function (name) {
  3029. uni[name] = promisify(name, api[name]);
  3030. });
  3031. Object.keys(wx).forEach(function (name) {
  3032. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3033. uni[name] = promisify(name, wrapper(name, wx[name]));
  3034. }
  3035. });
  3036. }
  3037. wx.createApp = createApp;
  3038. wx.createPage = createPage;
  3039. wx.createComponent = createComponent;
  3040. wx.createSubpackageApp = createSubpackageApp;
  3041. wx.createPlugin = createPlugin;
  3042. var uni$1 = uni;
  3043. var _default = uni$1;
  3044. exports.default = _default;
  3045. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3046. /***/ }),
  3047. /***/ 20:
  3048. /*!****************************************************************!*\
  3049. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3050. \****************************************************************/
  3051. /*! no static exports found */
  3052. /***/ (function(module, exports) {
  3053. function _iterableToArray(iter) {
  3054. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3055. }
  3056. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3057. /***/ }),
  3058. /***/ 21:
  3059. /*!******************************************************************!*\
  3060. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3061. \******************************************************************/
  3062. /*! no static exports found */
  3063. /***/ (function(module, exports) {
  3064. function _nonIterableSpread() {
  3065. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3066. }
  3067. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3068. /***/ }),
  3069. /***/ 22:
  3070. /*!*************************************************************!*\
  3071. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3072. \*************************************************************/
  3073. /*! no static exports found */
  3074. /***/ (function(module, exports, __webpack_require__) {
  3075. "use strict";
  3076. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3077. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3078. Object.defineProperty(exports, "__esModule", {
  3079. value: true
  3080. });
  3081. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3082. exports.compileI18nJsonStr = compileI18nJsonStr;
  3083. exports.hasI18nJson = hasI18nJson;
  3084. exports.initVueI18n = initVueI18n;
  3085. exports.isI18nStr = isI18nStr;
  3086. exports.isString = void 0;
  3087. exports.normalizeLocale = normalizeLocale;
  3088. exports.parseI18nJson = parseI18nJson;
  3089. exports.resolveLocale = resolveLocale;
  3090. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3091. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3092. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3093. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3094. var isArray = Array.isArray;
  3095. var isObject = function isObject(val) {
  3096. return val !== null && (0, _typeof2.default)(val) === 'object';
  3097. };
  3098. var defaultDelimiters = ['{', '}'];
  3099. var BaseFormatter = /*#__PURE__*/function () {
  3100. function BaseFormatter() {
  3101. (0, _classCallCheck2.default)(this, BaseFormatter);
  3102. this._caches = Object.create(null);
  3103. }
  3104. (0, _createClass2.default)(BaseFormatter, [{
  3105. key: "interpolate",
  3106. value: function interpolate(message, values) {
  3107. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3108. if (!values) {
  3109. return [message];
  3110. }
  3111. var tokens = this._caches[message];
  3112. if (!tokens) {
  3113. tokens = parse(message, delimiters);
  3114. this._caches[message] = tokens;
  3115. }
  3116. return compile(tokens, values);
  3117. }
  3118. }]);
  3119. return BaseFormatter;
  3120. }();
  3121. exports.Formatter = BaseFormatter;
  3122. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3123. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3124. function parse(format, _ref) {
  3125. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3126. startDelimiter = _ref2[0],
  3127. endDelimiter = _ref2[1];
  3128. var tokens = [];
  3129. var position = 0;
  3130. var text = '';
  3131. while (position < format.length) {
  3132. var char = format[position++];
  3133. if (char === startDelimiter) {
  3134. if (text) {
  3135. tokens.push({
  3136. type: 'text',
  3137. value: text
  3138. });
  3139. }
  3140. text = '';
  3141. var sub = '';
  3142. char = format[position++];
  3143. while (char !== undefined && char !== endDelimiter) {
  3144. sub += char;
  3145. char = format[position++];
  3146. }
  3147. var isClosed = char === endDelimiter;
  3148. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3149. tokens.push({
  3150. value: sub,
  3151. type: type
  3152. });
  3153. }
  3154. // else if (char === '%') {
  3155. // // when found rails i18n syntax, skip text capture
  3156. // if (format[position] !== '{') {
  3157. // text += char
  3158. // }
  3159. // }
  3160. else {
  3161. text += char;
  3162. }
  3163. }
  3164. text && tokens.push({
  3165. type: 'text',
  3166. value: text
  3167. });
  3168. return tokens;
  3169. }
  3170. function compile(tokens, values) {
  3171. var compiled = [];
  3172. var index = 0;
  3173. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3174. if (mode === 'unknown') {
  3175. return compiled;
  3176. }
  3177. while (index < tokens.length) {
  3178. var token = tokens[index];
  3179. switch (token.type) {
  3180. case 'text':
  3181. compiled.push(token.value);
  3182. break;
  3183. case 'list':
  3184. compiled.push(values[parseInt(token.value, 10)]);
  3185. break;
  3186. case 'named':
  3187. if (mode === 'named') {
  3188. compiled.push(values[token.value]);
  3189. } else {
  3190. if (true) {
  3191. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3192. }
  3193. }
  3194. break;
  3195. case 'unknown':
  3196. if (true) {
  3197. console.warn("Detect 'unknown' type of token!");
  3198. }
  3199. break;
  3200. }
  3201. index++;
  3202. }
  3203. return compiled;
  3204. }
  3205. var LOCALE_ZH_HANS = 'zh-Hans';
  3206. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3207. var LOCALE_ZH_HANT = 'zh-Hant';
  3208. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3209. var LOCALE_EN = 'en';
  3210. exports.LOCALE_EN = LOCALE_EN;
  3211. var LOCALE_FR = 'fr';
  3212. exports.LOCALE_FR = LOCALE_FR;
  3213. var LOCALE_ES = 'es';
  3214. exports.LOCALE_ES = LOCALE_ES;
  3215. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3216. var hasOwn = function hasOwn(val, key) {
  3217. return hasOwnProperty.call(val, key);
  3218. };
  3219. var defaultFormatter = new BaseFormatter();
  3220. function include(str, parts) {
  3221. return !!parts.find(function (part) {
  3222. return str.indexOf(part) !== -1;
  3223. });
  3224. }
  3225. function startsWith(str, parts) {
  3226. return parts.find(function (part) {
  3227. return str.indexOf(part) === 0;
  3228. });
  3229. }
  3230. function normalizeLocale(locale, messages) {
  3231. if (!locale) {
  3232. return;
  3233. }
  3234. locale = locale.trim().replace(/_/g, '-');
  3235. if (messages && messages[locale]) {
  3236. return locale;
  3237. }
  3238. locale = locale.toLowerCase();
  3239. if (locale.indexOf('zh') === 0) {
  3240. if (locale.indexOf('-hans') > -1) {
  3241. return LOCALE_ZH_HANS;
  3242. }
  3243. if (locale.indexOf('-hant') > -1) {
  3244. return LOCALE_ZH_HANT;
  3245. }
  3246. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3247. return LOCALE_ZH_HANT;
  3248. }
  3249. return LOCALE_ZH_HANS;
  3250. }
  3251. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3252. if (lang) {
  3253. return lang;
  3254. }
  3255. }
  3256. var I18n = /*#__PURE__*/function () {
  3257. function I18n(_ref3) {
  3258. var locale = _ref3.locale,
  3259. fallbackLocale = _ref3.fallbackLocale,
  3260. messages = _ref3.messages,
  3261. watcher = _ref3.watcher,
  3262. formater = _ref3.formater;
  3263. (0, _classCallCheck2.default)(this, I18n);
  3264. this.locale = LOCALE_EN;
  3265. this.fallbackLocale = LOCALE_EN;
  3266. this.message = {};
  3267. this.messages = {};
  3268. this.watchers = [];
  3269. if (fallbackLocale) {
  3270. this.fallbackLocale = fallbackLocale;
  3271. }
  3272. this.formater = formater || defaultFormatter;
  3273. this.messages = messages || {};
  3274. this.setLocale(locale || LOCALE_EN);
  3275. if (watcher) {
  3276. this.watchLocale(watcher);
  3277. }
  3278. }
  3279. (0, _createClass2.default)(I18n, [{
  3280. key: "setLocale",
  3281. value: function setLocale(locale) {
  3282. var _this = this;
  3283. var oldLocale = this.locale;
  3284. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3285. if (!this.messages[this.locale]) {
  3286. // 可能初始化时不存在
  3287. this.messages[this.locale] = {};
  3288. }
  3289. this.message = this.messages[this.locale];
  3290. // 仅发生变化时,通知
  3291. if (oldLocale !== this.locale) {
  3292. this.watchers.forEach(function (watcher) {
  3293. watcher(_this.locale, oldLocale);
  3294. });
  3295. }
  3296. }
  3297. }, {
  3298. key: "getLocale",
  3299. value: function getLocale() {
  3300. return this.locale;
  3301. }
  3302. }, {
  3303. key: "watchLocale",
  3304. value: function watchLocale(fn) {
  3305. var _this2 = this;
  3306. var index = this.watchers.push(fn) - 1;
  3307. return function () {
  3308. _this2.watchers.splice(index, 1);
  3309. };
  3310. }
  3311. }, {
  3312. key: "add",
  3313. value: function add(locale, message) {
  3314. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3315. var curMessages = this.messages[locale];
  3316. if (curMessages) {
  3317. if (override) {
  3318. Object.assign(curMessages, message);
  3319. } else {
  3320. Object.keys(message).forEach(function (key) {
  3321. if (!hasOwn(curMessages, key)) {
  3322. curMessages[key] = message[key];
  3323. }
  3324. });
  3325. }
  3326. } else {
  3327. this.messages[locale] = message;
  3328. }
  3329. }
  3330. }, {
  3331. key: "f",
  3332. value: function f(message, values, delimiters) {
  3333. return this.formater.interpolate(message, values, delimiters).join('');
  3334. }
  3335. }, {
  3336. key: "t",
  3337. value: function t(key, locale, values) {
  3338. var message = this.message;
  3339. if (typeof locale === 'string') {
  3340. locale = normalizeLocale(locale, this.messages);
  3341. locale && (message = this.messages[locale]);
  3342. } else {
  3343. values = locale;
  3344. }
  3345. if (!hasOwn(message, key)) {
  3346. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3347. return key;
  3348. }
  3349. return this.formater.interpolate(message[key], values).join('');
  3350. }
  3351. }]);
  3352. return I18n;
  3353. }();
  3354. exports.I18n = I18n;
  3355. function watchAppLocale(appVm, i18n) {
  3356. // 需要保证 watch 的触发在组件渲染之前
  3357. if (appVm.$watchLocale) {
  3358. // vue2
  3359. appVm.$watchLocale(function (newLocale) {
  3360. i18n.setLocale(newLocale);
  3361. });
  3362. } else {
  3363. appVm.$watch(function () {
  3364. return appVm.$locale;
  3365. }, function (newLocale) {
  3366. i18n.setLocale(newLocale);
  3367. });
  3368. }
  3369. }
  3370. function getDefaultLocale() {
  3371. if (typeof uni !== 'undefined' && uni.getLocale) {
  3372. return uni.getLocale();
  3373. }
  3374. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3375. if (typeof global !== 'undefined' && global.getLocale) {
  3376. return global.getLocale();
  3377. }
  3378. return LOCALE_EN;
  3379. }
  3380. function initVueI18n(locale) {
  3381. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3382. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3383. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3384. // 兼容旧版本入参
  3385. if (typeof locale !== 'string') {
  3386. var _ref4 = [messages, locale];
  3387. locale = _ref4[0];
  3388. messages = _ref4[1];
  3389. }
  3390. if (typeof locale !== 'string') {
  3391. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3392. locale = getDefaultLocale();
  3393. }
  3394. if (typeof fallbackLocale !== 'string') {
  3395. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3396. }
  3397. var i18n = new I18n({
  3398. locale: locale,
  3399. fallbackLocale: fallbackLocale,
  3400. messages: messages,
  3401. watcher: watcher
  3402. });
  3403. var _t = function t(key, values) {
  3404. if (typeof getApp !== 'function') {
  3405. // app view
  3406. /* eslint-disable no-func-assign */
  3407. _t = function t(key, values) {
  3408. return i18n.t(key, values);
  3409. };
  3410. } else {
  3411. var isWatchedAppLocale = false;
  3412. _t = function t(key, values) {
  3413. var appVm = getApp().$vm;
  3414. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3415. // options: {
  3416. // type: Array,
  3417. // default () {
  3418. // return [{
  3419. // icon: 'shop',
  3420. // text: t("uni-goods-nav.options.shop"),
  3421. // }, {
  3422. // icon: 'cart',
  3423. // text: t("uni-goods-nav.options.cart")
  3424. // }]
  3425. // }
  3426. // },
  3427. if (appVm) {
  3428. // 触发响应式
  3429. appVm.$locale;
  3430. if (!isWatchedAppLocale) {
  3431. isWatchedAppLocale = true;
  3432. watchAppLocale(appVm, i18n);
  3433. }
  3434. }
  3435. return i18n.t(key, values);
  3436. };
  3437. }
  3438. return _t(key, values);
  3439. };
  3440. return {
  3441. i18n: i18n,
  3442. f: function f(message, values, delimiters) {
  3443. return i18n.f(message, values, delimiters);
  3444. },
  3445. t: function t(key, values) {
  3446. return _t(key, values);
  3447. },
  3448. add: function add(locale, message) {
  3449. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3450. return i18n.add(locale, message, override);
  3451. },
  3452. watch: function watch(fn) {
  3453. return i18n.watchLocale(fn);
  3454. },
  3455. getLocale: function getLocale() {
  3456. return i18n.getLocale();
  3457. },
  3458. setLocale: function setLocale(newLocale) {
  3459. return i18n.setLocale(newLocale);
  3460. }
  3461. };
  3462. }
  3463. var isString = function isString(val) {
  3464. return typeof val === 'string';
  3465. };
  3466. exports.isString = isString;
  3467. var formater;
  3468. function hasI18nJson(jsonObj, delimiters) {
  3469. if (!formater) {
  3470. formater = new BaseFormatter();
  3471. }
  3472. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3473. var value = jsonObj[key];
  3474. if (isString(value)) {
  3475. if (isI18nStr(value, delimiters)) {
  3476. return true;
  3477. }
  3478. } else {
  3479. return hasI18nJson(value, delimiters);
  3480. }
  3481. });
  3482. }
  3483. function parseI18nJson(jsonObj, values, delimiters) {
  3484. if (!formater) {
  3485. formater = new BaseFormatter();
  3486. }
  3487. walkJsonObj(jsonObj, function (jsonObj, key) {
  3488. var value = jsonObj[key];
  3489. if (isString(value)) {
  3490. if (isI18nStr(value, delimiters)) {
  3491. jsonObj[key] = compileStr(value, values, delimiters);
  3492. }
  3493. } else {
  3494. parseI18nJson(value, values, delimiters);
  3495. }
  3496. });
  3497. return jsonObj;
  3498. }
  3499. function compileI18nJsonStr(jsonStr, _ref5) {
  3500. var locale = _ref5.locale,
  3501. locales = _ref5.locales,
  3502. delimiters = _ref5.delimiters;
  3503. if (!isI18nStr(jsonStr, delimiters)) {
  3504. return jsonStr;
  3505. }
  3506. if (!formater) {
  3507. formater = new BaseFormatter();
  3508. }
  3509. var localeValues = [];
  3510. Object.keys(locales).forEach(function (name) {
  3511. if (name !== locale) {
  3512. localeValues.push({
  3513. locale: name,
  3514. values: locales[name]
  3515. });
  3516. }
  3517. });
  3518. localeValues.unshift({
  3519. locale: locale,
  3520. values: locales[locale]
  3521. });
  3522. try {
  3523. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3524. } catch (e) {}
  3525. return jsonStr;
  3526. }
  3527. function isI18nStr(value, delimiters) {
  3528. return value.indexOf(delimiters[0]) > -1;
  3529. }
  3530. function compileStr(value, values, delimiters) {
  3531. return formater.interpolate(value, values, delimiters).join('');
  3532. }
  3533. function compileValue(jsonObj, key, localeValues, delimiters) {
  3534. var value = jsonObj[key];
  3535. if (isString(value)) {
  3536. // 存在国际化
  3537. if (isI18nStr(value, delimiters)) {
  3538. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3539. if (localeValues.length > 1) {
  3540. // 格式化国际化语言
  3541. var valueLocales = jsonObj[key + 'Locales'] = {};
  3542. localeValues.forEach(function (localValue) {
  3543. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3544. });
  3545. }
  3546. }
  3547. } else {
  3548. compileJsonObj(value, localeValues, delimiters);
  3549. }
  3550. }
  3551. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3552. walkJsonObj(jsonObj, function (jsonObj, key) {
  3553. compileValue(jsonObj, key, localeValues, delimiters);
  3554. });
  3555. return jsonObj;
  3556. }
  3557. function walkJsonObj(jsonObj, walk) {
  3558. if (isArray(jsonObj)) {
  3559. for (var i = 0; i < jsonObj.length; i++) {
  3560. if (walk(jsonObj, i)) {
  3561. return true;
  3562. }
  3563. }
  3564. } else if (isObject(jsonObj)) {
  3565. for (var key in jsonObj) {
  3566. if (walk(jsonObj, key)) {
  3567. return true;
  3568. }
  3569. }
  3570. }
  3571. return false;
  3572. }
  3573. function resolveLocale(locales) {
  3574. return function (locale) {
  3575. if (!locale) {
  3576. return locale;
  3577. }
  3578. locale = normalizeLocale(locale) || locale;
  3579. return resolveLocaleChain(locale).find(function (locale) {
  3580. return locales.indexOf(locale) > -1;
  3581. });
  3582. };
  3583. }
  3584. function resolveLocaleChain(locale) {
  3585. var chain = [];
  3586. var tokens = locale.split('-');
  3587. while (tokens.length) {
  3588. chain.push(tokens.join('-'));
  3589. tokens.pop();
  3590. }
  3591. return chain;
  3592. }
  3593. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3594. /***/ }),
  3595. /***/ 23:
  3596. /*!***************************************************************!*\
  3597. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3598. \***************************************************************/
  3599. /*! no static exports found */
  3600. /***/ (function(module, exports) {
  3601. function _classCallCheck(instance, Constructor) {
  3602. if (!(instance instanceof Constructor)) {
  3603. throw new TypeError("Cannot call a class as a function");
  3604. }
  3605. }
  3606. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3607. /***/ }),
  3608. /***/ 24:
  3609. /*!************************************************************!*\
  3610. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3611. \************************************************************/
  3612. /*! no static exports found */
  3613. /***/ (function(module, exports, __webpack_require__) {
  3614. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3615. function _defineProperties(target, props) {
  3616. for (var i = 0; i < props.length; i++) {
  3617. var descriptor = props[i];
  3618. descriptor.enumerable = descriptor.enumerable || false;
  3619. descriptor.configurable = true;
  3620. if ("value" in descriptor) descriptor.writable = true;
  3621. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3622. }
  3623. }
  3624. function _createClass(Constructor, protoProps, staticProps) {
  3625. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3626. if (staticProps) _defineProperties(Constructor, staticProps);
  3627. Object.defineProperty(Constructor, "prototype", {
  3628. writable: false
  3629. });
  3630. return Constructor;
  3631. }
  3632. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3633. /***/ }),
  3634. /***/ 25:
  3635. /*!******************************************************************************************!*\
  3636. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3637. \******************************************************************************************/
  3638. /*! exports provided: default */
  3639. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3640. "use strict";
  3641. __webpack_require__.r(__webpack_exports__);
  3642. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3643. * Vue.js v2.6.11
  3644. * (c) 2014-2022 Evan You
  3645. * Released under the MIT License.
  3646. */
  3647. /* */
  3648. var emptyObject = Object.freeze({});
  3649. // These helpers produce better VM code in JS engines due to their
  3650. // explicitness and function inlining.
  3651. function isUndef (v) {
  3652. return v === undefined || v === null
  3653. }
  3654. function isDef (v) {
  3655. return v !== undefined && v !== null
  3656. }
  3657. function isTrue (v) {
  3658. return v === true
  3659. }
  3660. function isFalse (v) {
  3661. return v === false
  3662. }
  3663. /**
  3664. * Check if value is primitive.
  3665. */
  3666. function isPrimitive (value) {
  3667. return (
  3668. typeof value === 'string' ||
  3669. typeof value === 'number' ||
  3670. // $flow-disable-line
  3671. typeof value === 'symbol' ||
  3672. typeof value === 'boolean'
  3673. )
  3674. }
  3675. /**
  3676. * Quick object check - this is primarily used to tell
  3677. * Objects from primitive values when we know the value
  3678. * is a JSON-compliant type.
  3679. */
  3680. function isObject (obj) {
  3681. return obj !== null && typeof obj === 'object'
  3682. }
  3683. /**
  3684. * Get the raw type string of a value, e.g., [object Object].
  3685. */
  3686. var _toString = Object.prototype.toString;
  3687. function toRawType (value) {
  3688. return _toString.call(value).slice(8, -1)
  3689. }
  3690. /**
  3691. * Strict object type check. Only returns true
  3692. * for plain JavaScript objects.
  3693. */
  3694. function isPlainObject (obj) {
  3695. return _toString.call(obj) === '[object Object]'
  3696. }
  3697. function isRegExp (v) {
  3698. return _toString.call(v) === '[object RegExp]'
  3699. }
  3700. /**
  3701. * Check if val is a valid array index.
  3702. */
  3703. function isValidArrayIndex (val) {
  3704. var n = parseFloat(String(val));
  3705. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3706. }
  3707. function isPromise (val) {
  3708. return (
  3709. isDef(val) &&
  3710. typeof val.then === 'function' &&
  3711. typeof val.catch === 'function'
  3712. )
  3713. }
  3714. /**
  3715. * Convert a value to a string that is actually rendered.
  3716. */
  3717. function toString (val) {
  3718. return val == null
  3719. ? ''
  3720. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3721. ? JSON.stringify(val, null, 2)
  3722. : String(val)
  3723. }
  3724. /**
  3725. * Convert an input value to a number for persistence.
  3726. * If the conversion fails, return original string.
  3727. */
  3728. function toNumber (val) {
  3729. var n = parseFloat(val);
  3730. return isNaN(n) ? val : n
  3731. }
  3732. /**
  3733. * Make a map and return a function for checking if a key
  3734. * is in that map.
  3735. */
  3736. function makeMap (
  3737. str,
  3738. expectsLowerCase
  3739. ) {
  3740. var map = Object.create(null);
  3741. var list = str.split(',');
  3742. for (var i = 0; i < list.length; i++) {
  3743. map[list[i]] = true;
  3744. }
  3745. return expectsLowerCase
  3746. ? function (val) { return map[val.toLowerCase()]; }
  3747. : function (val) { return map[val]; }
  3748. }
  3749. /**
  3750. * Check if a tag is a built-in tag.
  3751. */
  3752. var isBuiltInTag = makeMap('slot,component', true);
  3753. /**
  3754. * Check if an attribute is a reserved attribute.
  3755. */
  3756. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3757. /**
  3758. * Remove an item from an array.
  3759. */
  3760. function remove (arr, item) {
  3761. if (arr.length) {
  3762. var index = arr.indexOf(item);
  3763. if (index > -1) {
  3764. return arr.splice(index, 1)
  3765. }
  3766. }
  3767. }
  3768. /**
  3769. * Check whether an object has the property.
  3770. */
  3771. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3772. function hasOwn (obj, key) {
  3773. return hasOwnProperty.call(obj, key)
  3774. }
  3775. /**
  3776. * Create a cached version of a pure function.
  3777. */
  3778. function cached (fn) {
  3779. var cache = Object.create(null);
  3780. return (function cachedFn (str) {
  3781. var hit = cache[str];
  3782. return hit || (cache[str] = fn(str))
  3783. })
  3784. }
  3785. /**
  3786. * Camelize a hyphen-delimited string.
  3787. */
  3788. var camelizeRE = /-(\w)/g;
  3789. var camelize = cached(function (str) {
  3790. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3791. });
  3792. /**
  3793. * Capitalize a string.
  3794. */
  3795. var capitalize = cached(function (str) {
  3796. return str.charAt(0).toUpperCase() + str.slice(1)
  3797. });
  3798. /**
  3799. * Hyphenate a camelCase string.
  3800. */
  3801. var hyphenateRE = /\B([A-Z])/g;
  3802. var hyphenate = cached(function (str) {
  3803. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3804. });
  3805. /**
  3806. * Simple bind polyfill for environments that do not support it,
  3807. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3808. * since native bind is now performant enough in most browsers.
  3809. * But removing it would mean breaking code that was able to run in
  3810. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3811. */
  3812. /* istanbul ignore next */
  3813. function polyfillBind (fn, ctx) {
  3814. function boundFn (a) {
  3815. var l = arguments.length;
  3816. return l
  3817. ? l > 1
  3818. ? fn.apply(ctx, arguments)
  3819. : fn.call(ctx, a)
  3820. : fn.call(ctx)
  3821. }
  3822. boundFn._length = fn.length;
  3823. return boundFn
  3824. }
  3825. function nativeBind (fn, ctx) {
  3826. return fn.bind(ctx)
  3827. }
  3828. var bind = Function.prototype.bind
  3829. ? nativeBind
  3830. : polyfillBind;
  3831. /**
  3832. * Convert an Array-like object to a real Array.
  3833. */
  3834. function toArray (list, start) {
  3835. start = start || 0;
  3836. var i = list.length - start;
  3837. var ret = new Array(i);
  3838. while (i--) {
  3839. ret[i] = list[i + start];
  3840. }
  3841. return ret
  3842. }
  3843. /**
  3844. * Mix properties into target object.
  3845. */
  3846. function extend (to, _from) {
  3847. for (var key in _from) {
  3848. to[key] = _from[key];
  3849. }
  3850. return to
  3851. }
  3852. /**
  3853. * Merge an Array of Objects into a single Object.
  3854. */
  3855. function toObject (arr) {
  3856. var res = {};
  3857. for (var i = 0; i < arr.length; i++) {
  3858. if (arr[i]) {
  3859. extend(res, arr[i]);
  3860. }
  3861. }
  3862. return res
  3863. }
  3864. /* eslint-disable no-unused-vars */
  3865. /**
  3866. * Perform no operation.
  3867. * Stubbing args to make Flow happy without leaving useless transpiled code
  3868. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3869. */
  3870. function noop (a, b, c) {}
  3871. /**
  3872. * Always return false.
  3873. */
  3874. var no = function (a, b, c) { return false; };
  3875. /* eslint-enable no-unused-vars */
  3876. /**
  3877. * Return the same value.
  3878. */
  3879. var identity = function (_) { return _; };
  3880. /**
  3881. * Check if two values are loosely equal - that is,
  3882. * if they are plain objects, do they have the same shape?
  3883. */
  3884. function looseEqual (a, b) {
  3885. if (a === b) { return true }
  3886. var isObjectA = isObject(a);
  3887. var isObjectB = isObject(b);
  3888. if (isObjectA && isObjectB) {
  3889. try {
  3890. var isArrayA = Array.isArray(a);
  3891. var isArrayB = Array.isArray(b);
  3892. if (isArrayA && isArrayB) {
  3893. return a.length === b.length && a.every(function (e, i) {
  3894. return looseEqual(e, b[i])
  3895. })
  3896. } else if (a instanceof Date && b instanceof Date) {
  3897. return a.getTime() === b.getTime()
  3898. } else if (!isArrayA && !isArrayB) {
  3899. var keysA = Object.keys(a);
  3900. var keysB = Object.keys(b);
  3901. return keysA.length === keysB.length && keysA.every(function (key) {
  3902. return looseEqual(a[key], b[key])
  3903. })
  3904. } else {
  3905. /* istanbul ignore next */
  3906. return false
  3907. }
  3908. } catch (e) {
  3909. /* istanbul ignore next */
  3910. return false
  3911. }
  3912. } else if (!isObjectA && !isObjectB) {
  3913. return String(a) === String(b)
  3914. } else {
  3915. return false
  3916. }
  3917. }
  3918. /**
  3919. * Return the first index at which a loosely equal value can be
  3920. * found in the array (if value is a plain object, the array must
  3921. * contain an object of the same shape), or -1 if it is not present.
  3922. */
  3923. function looseIndexOf (arr, val) {
  3924. for (var i = 0; i < arr.length; i++) {
  3925. if (looseEqual(arr[i], val)) { return i }
  3926. }
  3927. return -1
  3928. }
  3929. /**
  3930. * Ensure a function is called only once.
  3931. */
  3932. function once (fn) {
  3933. var called = false;
  3934. return function () {
  3935. if (!called) {
  3936. called = true;
  3937. fn.apply(this, arguments);
  3938. }
  3939. }
  3940. }
  3941. var ASSET_TYPES = [
  3942. 'component',
  3943. 'directive',
  3944. 'filter'
  3945. ];
  3946. var LIFECYCLE_HOOKS = [
  3947. 'beforeCreate',
  3948. 'created',
  3949. 'beforeMount',
  3950. 'mounted',
  3951. 'beforeUpdate',
  3952. 'updated',
  3953. 'beforeDestroy',
  3954. 'destroyed',
  3955. 'activated',
  3956. 'deactivated',
  3957. 'errorCaptured',
  3958. 'serverPrefetch'
  3959. ];
  3960. /* */
  3961. var config = ({
  3962. /**
  3963. * Option merge strategies (used in core/util/options)
  3964. */
  3965. // $flow-disable-line
  3966. optionMergeStrategies: Object.create(null),
  3967. /**
  3968. * Whether to suppress warnings.
  3969. */
  3970. silent: false,
  3971. /**
  3972. * Show production mode tip message on boot?
  3973. */
  3974. productionTip: "development" !== 'production',
  3975. /**
  3976. * Whether to enable devtools
  3977. */
  3978. devtools: "development" !== 'production',
  3979. /**
  3980. * Whether to record perf
  3981. */
  3982. performance: false,
  3983. /**
  3984. * Error handler for watcher errors
  3985. */
  3986. errorHandler: null,
  3987. /**
  3988. * Warn handler for watcher warns
  3989. */
  3990. warnHandler: null,
  3991. /**
  3992. * Ignore certain custom elements
  3993. */
  3994. ignoredElements: [],
  3995. /**
  3996. * Custom user key aliases for v-on
  3997. */
  3998. // $flow-disable-line
  3999. keyCodes: Object.create(null),
  4000. /**
  4001. * Check if a tag is reserved so that it cannot be registered as a
  4002. * component. This is platform-dependent and may be overwritten.
  4003. */
  4004. isReservedTag: no,
  4005. /**
  4006. * Check if an attribute is reserved so that it cannot be used as a component
  4007. * prop. This is platform-dependent and may be overwritten.
  4008. */
  4009. isReservedAttr: no,
  4010. /**
  4011. * Check if a tag is an unknown element.
  4012. * Platform-dependent.
  4013. */
  4014. isUnknownElement: no,
  4015. /**
  4016. * Get the namespace of an element
  4017. */
  4018. getTagNamespace: noop,
  4019. /**
  4020. * Parse the real tag name for the specific platform.
  4021. */
  4022. parsePlatformTagName: identity,
  4023. /**
  4024. * Check if an attribute must be bound using property, e.g. value
  4025. * Platform-dependent.
  4026. */
  4027. mustUseProp: no,
  4028. /**
  4029. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4030. * This will significantly reduce performance if set to false.
  4031. */
  4032. async: true,
  4033. /**
  4034. * Exposed for legacy reasons
  4035. */
  4036. _lifecycleHooks: LIFECYCLE_HOOKS
  4037. });
  4038. /* */
  4039. /**
  4040. * unicode letters used for parsing html tags, component names and property paths.
  4041. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4042. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4043. */
  4044. 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/;
  4045. /**
  4046. * Check if a string starts with $ or _
  4047. */
  4048. function isReserved (str) {
  4049. var c = (str + '').charCodeAt(0);
  4050. return c === 0x24 || c === 0x5F
  4051. }
  4052. /**
  4053. * Define a property.
  4054. */
  4055. function def (obj, key, val, enumerable) {
  4056. Object.defineProperty(obj, key, {
  4057. value: val,
  4058. enumerable: !!enumerable,
  4059. writable: true,
  4060. configurable: true
  4061. });
  4062. }
  4063. /**
  4064. * Parse simple path.
  4065. */
  4066. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4067. function parsePath (path) {
  4068. if (bailRE.test(path)) {
  4069. return
  4070. }
  4071. var segments = path.split('.');
  4072. return function (obj) {
  4073. for (var i = 0; i < segments.length; i++) {
  4074. if (!obj) { return }
  4075. obj = obj[segments[i]];
  4076. }
  4077. return obj
  4078. }
  4079. }
  4080. /* */
  4081. // can we use __proto__?
  4082. var hasProto = '__proto__' in {};
  4083. // Browser environment sniffing
  4084. var inBrowser = typeof window !== 'undefined';
  4085. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4086. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4087. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4088. var isIE = UA && /msie|trident/.test(UA);
  4089. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4090. var isEdge = UA && UA.indexOf('edge/') > 0;
  4091. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4092. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4093. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4094. var isPhantomJS = UA && /phantomjs/.test(UA);
  4095. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4096. // Firefox has a "watch" function on Object.prototype...
  4097. var nativeWatch = ({}).watch;
  4098. if (inBrowser) {
  4099. try {
  4100. var opts = {};
  4101. Object.defineProperty(opts, 'passive', ({
  4102. get: function get () {
  4103. }
  4104. })); // https://github.com/facebook/flow/issues/285
  4105. window.addEventListener('test-passive', null, opts);
  4106. } catch (e) {}
  4107. }
  4108. // this needs to be lazy-evaled because vue may be required before
  4109. // vue-server-renderer can set VUE_ENV
  4110. var _isServer;
  4111. var isServerRendering = function () {
  4112. if (_isServer === undefined) {
  4113. /* istanbul ignore if */
  4114. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4115. // detect presence of vue-server-renderer and avoid
  4116. // Webpack shimming the process
  4117. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4118. } else {
  4119. _isServer = false;
  4120. }
  4121. }
  4122. return _isServer
  4123. };
  4124. // detect devtools
  4125. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4126. /* istanbul ignore next */
  4127. function isNative (Ctor) {
  4128. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4129. }
  4130. var hasSymbol =
  4131. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4132. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4133. var _Set;
  4134. /* istanbul ignore if */ // $flow-disable-line
  4135. if (typeof Set !== 'undefined' && isNative(Set)) {
  4136. // use native Set when available.
  4137. _Set = Set;
  4138. } else {
  4139. // a non-standard Set polyfill that only works with primitive keys.
  4140. _Set = /*@__PURE__*/(function () {
  4141. function Set () {
  4142. this.set = Object.create(null);
  4143. }
  4144. Set.prototype.has = function has (key) {
  4145. return this.set[key] === true
  4146. };
  4147. Set.prototype.add = function add (key) {
  4148. this.set[key] = true;
  4149. };
  4150. Set.prototype.clear = function clear () {
  4151. this.set = Object.create(null);
  4152. };
  4153. return Set;
  4154. }());
  4155. }
  4156. /* */
  4157. var warn = noop;
  4158. var tip = noop;
  4159. var generateComponentTrace = (noop); // work around flow check
  4160. var formatComponentName = (noop);
  4161. if (true) {
  4162. var hasConsole = typeof console !== 'undefined';
  4163. var classifyRE = /(?:^|[-_])(\w)/g;
  4164. var classify = function (str) { return str
  4165. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4166. .replace(/[-_]/g, ''); };
  4167. warn = function (msg, vm) {
  4168. var trace = vm ? generateComponentTrace(vm) : '';
  4169. if (config.warnHandler) {
  4170. config.warnHandler.call(null, msg, vm, trace);
  4171. } else if (hasConsole && (!config.silent)) {
  4172. console.error(("[Vue warn]: " + msg + trace));
  4173. }
  4174. };
  4175. tip = function (msg, vm) {
  4176. if (hasConsole && (!config.silent)) {
  4177. console.warn("[Vue tip]: " + msg + (
  4178. vm ? generateComponentTrace(vm) : ''
  4179. ));
  4180. }
  4181. };
  4182. formatComponentName = function (vm, includeFile) {
  4183. if (vm.$root === vm) {
  4184. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4185. return ('') + vm.$options.__file
  4186. }
  4187. return '<Root>'
  4188. }
  4189. var options = typeof vm === 'function' && vm.cid != null
  4190. ? vm.options
  4191. : vm._isVue
  4192. ? vm.$options || vm.constructor.options
  4193. : vm;
  4194. var name = options.name || options._componentTag;
  4195. var file = options.__file;
  4196. if (!name && file) {
  4197. var match = file.match(/([^/\\]+)\.vue$/);
  4198. name = match && match[1];
  4199. }
  4200. return (
  4201. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4202. (file && includeFile !== false ? (" at " + file) : '')
  4203. )
  4204. };
  4205. var repeat = function (str, n) {
  4206. var res = '';
  4207. while (n) {
  4208. if (n % 2 === 1) { res += str; }
  4209. if (n > 1) { str += str; }
  4210. n >>= 1;
  4211. }
  4212. return res
  4213. };
  4214. generateComponentTrace = function (vm) {
  4215. if (vm._isVue && vm.$parent) {
  4216. var tree = [];
  4217. var currentRecursiveSequence = 0;
  4218. while (vm && vm.$options.name !== 'PageBody') {
  4219. if (tree.length > 0) {
  4220. var last = tree[tree.length - 1];
  4221. if (last.constructor === vm.constructor) {
  4222. currentRecursiveSequence++;
  4223. vm = vm.$parent;
  4224. continue
  4225. } else if (currentRecursiveSequence > 0) {
  4226. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4227. currentRecursiveSequence = 0;
  4228. }
  4229. }
  4230. !vm.$options.isReserved && tree.push(vm);
  4231. vm = vm.$parent;
  4232. }
  4233. return '\n\nfound in\n\n' + tree
  4234. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4235. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4236. : formatComponentName(vm))); })
  4237. .join('\n')
  4238. } else {
  4239. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4240. }
  4241. };
  4242. }
  4243. /* */
  4244. var uid = 0;
  4245. /**
  4246. * A dep is an observable that can have multiple
  4247. * directives subscribing to it.
  4248. */
  4249. var Dep = function Dep () {
  4250. this.id = uid++;
  4251. this.subs = [];
  4252. };
  4253. Dep.prototype.addSub = function addSub (sub) {
  4254. this.subs.push(sub);
  4255. };
  4256. Dep.prototype.removeSub = function removeSub (sub) {
  4257. remove(this.subs, sub);
  4258. };
  4259. Dep.prototype.depend = function depend () {
  4260. if (Dep.SharedObject.target) {
  4261. Dep.SharedObject.target.addDep(this);
  4262. }
  4263. };
  4264. Dep.prototype.notify = function notify () {
  4265. // stabilize the subscriber list first
  4266. var subs = this.subs.slice();
  4267. if ( true && !config.async) {
  4268. // subs aren't sorted in scheduler if not running async
  4269. // we need to sort them now to make sure they fire in correct
  4270. // order
  4271. subs.sort(function (a, b) { return a.id - b.id; });
  4272. }
  4273. for (var i = 0, l = subs.length; i < l; i++) {
  4274. subs[i].update();
  4275. }
  4276. };
  4277. // The current target watcher being evaluated.
  4278. // This is globally unique because only one watcher
  4279. // can be evaluated at a time.
  4280. // fixed by xxxxxx (nvue shared vuex)
  4281. /* eslint-disable no-undef */
  4282. Dep.SharedObject = {};
  4283. Dep.SharedObject.target = null;
  4284. Dep.SharedObject.targetStack = [];
  4285. function pushTarget (target) {
  4286. Dep.SharedObject.targetStack.push(target);
  4287. Dep.SharedObject.target = target;
  4288. Dep.target = target;
  4289. }
  4290. function popTarget () {
  4291. Dep.SharedObject.targetStack.pop();
  4292. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4293. Dep.target = Dep.SharedObject.target;
  4294. }
  4295. /* */
  4296. var VNode = function VNode (
  4297. tag,
  4298. data,
  4299. children,
  4300. text,
  4301. elm,
  4302. context,
  4303. componentOptions,
  4304. asyncFactory
  4305. ) {
  4306. this.tag = tag;
  4307. this.data = data;
  4308. this.children = children;
  4309. this.text = text;
  4310. this.elm = elm;
  4311. this.ns = undefined;
  4312. this.context = context;
  4313. this.fnContext = undefined;
  4314. this.fnOptions = undefined;
  4315. this.fnScopeId = undefined;
  4316. this.key = data && data.key;
  4317. this.componentOptions = componentOptions;
  4318. this.componentInstance = undefined;
  4319. this.parent = undefined;
  4320. this.raw = false;
  4321. this.isStatic = false;
  4322. this.isRootInsert = true;
  4323. this.isComment = false;
  4324. this.isCloned = false;
  4325. this.isOnce = false;
  4326. this.asyncFactory = asyncFactory;
  4327. this.asyncMeta = undefined;
  4328. this.isAsyncPlaceholder = false;
  4329. };
  4330. var prototypeAccessors = { child: { configurable: true } };
  4331. // DEPRECATED: alias for componentInstance for backwards compat.
  4332. /* istanbul ignore next */
  4333. prototypeAccessors.child.get = function () {
  4334. return this.componentInstance
  4335. };
  4336. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4337. var createEmptyVNode = function (text) {
  4338. if ( text === void 0 ) text = '';
  4339. var node = new VNode();
  4340. node.text = text;
  4341. node.isComment = true;
  4342. return node
  4343. };
  4344. function createTextVNode (val) {
  4345. return new VNode(undefined, undefined, undefined, String(val))
  4346. }
  4347. // optimized shallow clone
  4348. // used for static nodes and slot nodes because they may be reused across
  4349. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4350. // on their elm reference.
  4351. function cloneVNode (vnode) {
  4352. var cloned = new VNode(
  4353. vnode.tag,
  4354. vnode.data,
  4355. // #7975
  4356. // clone children array to avoid mutating original in case of cloning
  4357. // a child.
  4358. vnode.children && vnode.children.slice(),
  4359. vnode.text,
  4360. vnode.elm,
  4361. vnode.context,
  4362. vnode.componentOptions,
  4363. vnode.asyncFactory
  4364. );
  4365. cloned.ns = vnode.ns;
  4366. cloned.isStatic = vnode.isStatic;
  4367. cloned.key = vnode.key;
  4368. cloned.isComment = vnode.isComment;
  4369. cloned.fnContext = vnode.fnContext;
  4370. cloned.fnOptions = vnode.fnOptions;
  4371. cloned.fnScopeId = vnode.fnScopeId;
  4372. cloned.asyncMeta = vnode.asyncMeta;
  4373. cloned.isCloned = true;
  4374. return cloned
  4375. }
  4376. /*
  4377. * not type checking this file because flow doesn't play well with
  4378. * dynamically accessing methods on Array prototype
  4379. */
  4380. var arrayProto = Array.prototype;
  4381. var arrayMethods = Object.create(arrayProto);
  4382. var methodsToPatch = [
  4383. 'push',
  4384. 'pop',
  4385. 'shift',
  4386. 'unshift',
  4387. 'splice',
  4388. 'sort',
  4389. 'reverse'
  4390. ];
  4391. /**
  4392. * Intercept mutating methods and emit events
  4393. */
  4394. methodsToPatch.forEach(function (method) {
  4395. // cache original method
  4396. var original = arrayProto[method];
  4397. def(arrayMethods, method, function mutator () {
  4398. var args = [], len = arguments.length;
  4399. while ( len-- ) args[ len ] = arguments[ len ];
  4400. var result = original.apply(this, args);
  4401. var ob = this.__ob__;
  4402. var inserted;
  4403. switch (method) {
  4404. case 'push':
  4405. case 'unshift':
  4406. inserted = args;
  4407. break
  4408. case 'splice':
  4409. inserted = args.slice(2);
  4410. break
  4411. }
  4412. if (inserted) { ob.observeArray(inserted); }
  4413. // notify change
  4414. ob.dep.notify();
  4415. return result
  4416. });
  4417. });
  4418. /* */
  4419. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4420. /**
  4421. * In some cases we may want to disable observation inside a component's
  4422. * update computation.
  4423. */
  4424. var shouldObserve = true;
  4425. function toggleObserving (value) {
  4426. shouldObserve = value;
  4427. }
  4428. /**
  4429. * Observer class that is attached to each observed
  4430. * object. Once attached, the observer converts the target
  4431. * object's property keys into getter/setters that
  4432. * collect dependencies and dispatch updates.
  4433. */
  4434. var Observer = function Observer (value) {
  4435. this.value = value;
  4436. this.dep = new Dep();
  4437. this.vmCount = 0;
  4438. def(value, '__ob__', this);
  4439. if (Array.isArray(value)) {
  4440. if (hasProto) {
  4441. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4442. if(value.push !== value.__proto__.push){
  4443. copyAugment(value, arrayMethods, arrayKeys);
  4444. } else {
  4445. protoAugment(value, arrayMethods);
  4446. }
  4447. }
  4448. } else {
  4449. copyAugment(value, arrayMethods, arrayKeys);
  4450. }
  4451. this.observeArray(value);
  4452. } else {
  4453. this.walk(value);
  4454. }
  4455. };
  4456. /**
  4457. * Walk through all properties and convert them into
  4458. * getter/setters. This method should only be called when
  4459. * value type is Object.
  4460. */
  4461. Observer.prototype.walk = function walk (obj) {
  4462. var keys = Object.keys(obj);
  4463. for (var i = 0; i < keys.length; i++) {
  4464. defineReactive$$1(obj, keys[i]);
  4465. }
  4466. };
  4467. /**
  4468. * Observe a list of Array items.
  4469. */
  4470. Observer.prototype.observeArray = function observeArray (items) {
  4471. for (var i = 0, l = items.length; i < l; i++) {
  4472. observe(items[i]);
  4473. }
  4474. };
  4475. // helpers
  4476. /**
  4477. * Augment a target Object or Array by intercepting
  4478. * the prototype chain using __proto__
  4479. */
  4480. function protoAugment (target, src) {
  4481. /* eslint-disable no-proto */
  4482. target.__proto__ = src;
  4483. /* eslint-enable no-proto */
  4484. }
  4485. /**
  4486. * Augment a target Object or Array by defining
  4487. * hidden properties.
  4488. */
  4489. /* istanbul ignore next */
  4490. function copyAugment (target, src, keys) {
  4491. for (var i = 0, l = keys.length; i < l; i++) {
  4492. var key = keys[i];
  4493. def(target, key, src[key]);
  4494. }
  4495. }
  4496. /**
  4497. * Attempt to create an observer instance for a value,
  4498. * returns the new observer if successfully observed,
  4499. * or the existing observer if the value already has one.
  4500. */
  4501. function observe (value, asRootData) {
  4502. if (!isObject(value) || value instanceof VNode) {
  4503. return
  4504. }
  4505. var ob;
  4506. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4507. ob = value.__ob__;
  4508. } else if (
  4509. shouldObserve &&
  4510. !isServerRendering() &&
  4511. (Array.isArray(value) || isPlainObject(value)) &&
  4512. Object.isExtensible(value) &&
  4513. !value._isVue &&
  4514. !value.__v_isMPComponent
  4515. ) {
  4516. ob = new Observer(value);
  4517. }
  4518. if (asRootData && ob) {
  4519. ob.vmCount++;
  4520. }
  4521. return ob
  4522. }
  4523. /**
  4524. * Define a reactive property on an Object.
  4525. */
  4526. function defineReactive$$1 (
  4527. obj,
  4528. key,
  4529. val,
  4530. customSetter,
  4531. shallow
  4532. ) {
  4533. var dep = new Dep();
  4534. var property = Object.getOwnPropertyDescriptor(obj, key);
  4535. if (property && property.configurable === false) {
  4536. return
  4537. }
  4538. // cater for pre-defined getter/setters
  4539. var getter = property && property.get;
  4540. var setter = property && property.set;
  4541. if ((!getter || setter) && arguments.length === 2) {
  4542. val = obj[key];
  4543. }
  4544. var childOb = !shallow && observe(val);
  4545. Object.defineProperty(obj, key, {
  4546. enumerable: true,
  4547. configurable: true,
  4548. get: function reactiveGetter () {
  4549. var value = getter ? getter.call(obj) : val;
  4550. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4551. dep.depend();
  4552. if (childOb) {
  4553. childOb.dep.depend();
  4554. if (Array.isArray(value)) {
  4555. dependArray(value);
  4556. }
  4557. }
  4558. }
  4559. return value
  4560. },
  4561. set: function reactiveSetter (newVal) {
  4562. var value = getter ? getter.call(obj) : val;
  4563. /* eslint-disable no-self-compare */
  4564. if (newVal === value || (newVal !== newVal && value !== value)) {
  4565. return
  4566. }
  4567. /* eslint-enable no-self-compare */
  4568. if ( true && customSetter) {
  4569. customSetter();
  4570. }
  4571. // #7981: for accessor properties without setter
  4572. if (getter && !setter) { return }
  4573. if (setter) {
  4574. setter.call(obj, newVal);
  4575. } else {
  4576. val = newVal;
  4577. }
  4578. childOb = !shallow && observe(newVal);
  4579. dep.notify();
  4580. }
  4581. });
  4582. }
  4583. /**
  4584. * Set a property on an object. Adds the new property and
  4585. * triggers change notification if the property doesn't
  4586. * already exist.
  4587. */
  4588. function set (target, key, val) {
  4589. if ( true &&
  4590. (isUndef(target) || isPrimitive(target))
  4591. ) {
  4592. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4593. }
  4594. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4595. target.length = Math.max(target.length, key);
  4596. target.splice(key, 1, val);
  4597. return val
  4598. }
  4599. if (key in target && !(key in Object.prototype)) {
  4600. target[key] = val;
  4601. return val
  4602. }
  4603. var ob = (target).__ob__;
  4604. if (target._isVue || (ob && ob.vmCount)) {
  4605. true && warn(
  4606. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4607. 'at runtime - declare it upfront in the data option.'
  4608. );
  4609. return val
  4610. }
  4611. if (!ob) {
  4612. target[key] = val;
  4613. return val
  4614. }
  4615. defineReactive$$1(ob.value, key, val);
  4616. ob.dep.notify();
  4617. return val
  4618. }
  4619. /**
  4620. * Delete a property and trigger change if necessary.
  4621. */
  4622. function del (target, key) {
  4623. if ( true &&
  4624. (isUndef(target) || isPrimitive(target))
  4625. ) {
  4626. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4627. }
  4628. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4629. target.splice(key, 1);
  4630. return
  4631. }
  4632. var ob = (target).__ob__;
  4633. if (target._isVue || (ob && ob.vmCount)) {
  4634. true && warn(
  4635. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4636. '- just set it to null.'
  4637. );
  4638. return
  4639. }
  4640. if (!hasOwn(target, key)) {
  4641. return
  4642. }
  4643. delete target[key];
  4644. if (!ob) {
  4645. return
  4646. }
  4647. ob.dep.notify();
  4648. }
  4649. /**
  4650. * Collect dependencies on array elements when the array is touched, since
  4651. * we cannot intercept array element access like property getters.
  4652. */
  4653. function dependArray (value) {
  4654. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4655. e = value[i];
  4656. e && e.__ob__ && e.__ob__.dep.depend();
  4657. if (Array.isArray(e)) {
  4658. dependArray(e);
  4659. }
  4660. }
  4661. }
  4662. /* */
  4663. /**
  4664. * Option overwriting strategies are functions that handle
  4665. * how to merge a parent option value and a child option
  4666. * value into the final value.
  4667. */
  4668. var strats = config.optionMergeStrategies;
  4669. /**
  4670. * Options with restrictions
  4671. */
  4672. if (true) {
  4673. strats.el = strats.propsData = function (parent, child, vm, key) {
  4674. if (!vm) {
  4675. warn(
  4676. "option \"" + key + "\" can only be used during instance " +
  4677. 'creation with the `new` keyword.'
  4678. );
  4679. }
  4680. return defaultStrat(parent, child)
  4681. };
  4682. }
  4683. /**
  4684. * Helper that recursively merges two data objects together.
  4685. */
  4686. function mergeData (to, from) {
  4687. if (!from) { return to }
  4688. var key, toVal, fromVal;
  4689. var keys = hasSymbol
  4690. ? Reflect.ownKeys(from)
  4691. : Object.keys(from);
  4692. for (var i = 0; i < keys.length; i++) {
  4693. key = keys[i];
  4694. // in case the object is already observed...
  4695. if (key === '__ob__') { continue }
  4696. toVal = to[key];
  4697. fromVal = from[key];
  4698. if (!hasOwn(to, key)) {
  4699. set(to, key, fromVal);
  4700. } else if (
  4701. toVal !== fromVal &&
  4702. isPlainObject(toVal) &&
  4703. isPlainObject(fromVal)
  4704. ) {
  4705. mergeData(toVal, fromVal);
  4706. }
  4707. }
  4708. return to
  4709. }
  4710. /**
  4711. * Data
  4712. */
  4713. function mergeDataOrFn (
  4714. parentVal,
  4715. childVal,
  4716. vm
  4717. ) {
  4718. if (!vm) {
  4719. // in a Vue.extend merge, both should be functions
  4720. if (!childVal) {
  4721. return parentVal
  4722. }
  4723. if (!parentVal) {
  4724. return childVal
  4725. }
  4726. // when parentVal & childVal are both present,
  4727. // we need to return a function that returns the
  4728. // merged result of both functions... no need to
  4729. // check if parentVal is a function here because
  4730. // it has to be a function to pass previous merges.
  4731. return function mergedDataFn () {
  4732. return mergeData(
  4733. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4734. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4735. )
  4736. }
  4737. } else {
  4738. return function mergedInstanceDataFn () {
  4739. // instance merge
  4740. var instanceData = typeof childVal === 'function'
  4741. ? childVal.call(vm, vm)
  4742. : childVal;
  4743. var defaultData = typeof parentVal === 'function'
  4744. ? parentVal.call(vm, vm)
  4745. : parentVal;
  4746. if (instanceData) {
  4747. return mergeData(instanceData, defaultData)
  4748. } else {
  4749. return defaultData
  4750. }
  4751. }
  4752. }
  4753. }
  4754. strats.data = function (
  4755. parentVal,
  4756. childVal,
  4757. vm
  4758. ) {
  4759. if (!vm) {
  4760. if (childVal && typeof childVal !== 'function') {
  4761. true && warn(
  4762. 'The "data" option should be a function ' +
  4763. 'that returns a per-instance value in component ' +
  4764. 'definitions.',
  4765. vm
  4766. );
  4767. return parentVal
  4768. }
  4769. return mergeDataOrFn(parentVal, childVal)
  4770. }
  4771. return mergeDataOrFn(parentVal, childVal, vm)
  4772. };
  4773. /**
  4774. * Hooks and props are merged as arrays.
  4775. */
  4776. function mergeHook (
  4777. parentVal,
  4778. childVal
  4779. ) {
  4780. var res = childVal
  4781. ? parentVal
  4782. ? parentVal.concat(childVal)
  4783. : Array.isArray(childVal)
  4784. ? childVal
  4785. : [childVal]
  4786. : parentVal;
  4787. return res
  4788. ? dedupeHooks(res)
  4789. : res
  4790. }
  4791. function dedupeHooks (hooks) {
  4792. var res = [];
  4793. for (var i = 0; i < hooks.length; i++) {
  4794. if (res.indexOf(hooks[i]) === -1) {
  4795. res.push(hooks[i]);
  4796. }
  4797. }
  4798. return res
  4799. }
  4800. LIFECYCLE_HOOKS.forEach(function (hook) {
  4801. strats[hook] = mergeHook;
  4802. });
  4803. /**
  4804. * Assets
  4805. *
  4806. * When a vm is present (instance creation), we need to do
  4807. * a three-way merge between constructor options, instance
  4808. * options and parent options.
  4809. */
  4810. function mergeAssets (
  4811. parentVal,
  4812. childVal,
  4813. vm,
  4814. key
  4815. ) {
  4816. var res = Object.create(parentVal || null);
  4817. if (childVal) {
  4818. true && assertObjectType(key, childVal, vm);
  4819. return extend(res, childVal)
  4820. } else {
  4821. return res
  4822. }
  4823. }
  4824. ASSET_TYPES.forEach(function (type) {
  4825. strats[type + 's'] = mergeAssets;
  4826. });
  4827. /**
  4828. * Watchers.
  4829. *
  4830. * Watchers hashes should not overwrite one
  4831. * another, so we merge them as arrays.
  4832. */
  4833. strats.watch = function (
  4834. parentVal,
  4835. childVal,
  4836. vm,
  4837. key
  4838. ) {
  4839. // work around Firefox's Object.prototype.watch...
  4840. if (parentVal === nativeWatch) { parentVal = undefined; }
  4841. if (childVal === nativeWatch) { childVal = undefined; }
  4842. /* istanbul ignore if */
  4843. if (!childVal) { return Object.create(parentVal || null) }
  4844. if (true) {
  4845. assertObjectType(key, childVal, vm);
  4846. }
  4847. if (!parentVal) { return childVal }
  4848. var ret = {};
  4849. extend(ret, parentVal);
  4850. for (var key$1 in childVal) {
  4851. var parent = ret[key$1];
  4852. var child = childVal[key$1];
  4853. if (parent && !Array.isArray(parent)) {
  4854. parent = [parent];
  4855. }
  4856. ret[key$1] = parent
  4857. ? parent.concat(child)
  4858. : Array.isArray(child) ? child : [child];
  4859. }
  4860. return ret
  4861. };
  4862. /**
  4863. * Other object hashes.
  4864. */
  4865. strats.props =
  4866. strats.methods =
  4867. strats.inject =
  4868. strats.computed = function (
  4869. parentVal,
  4870. childVal,
  4871. vm,
  4872. key
  4873. ) {
  4874. if (childVal && "development" !== 'production') {
  4875. assertObjectType(key, childVal, vm);
  4876. }
  4877. if (!parentVal) { return childVal }
  4878. var ret = Object.create(null);
  4879. extend(ret, parentVal);
  4880. if (childVal) { extend(ret, childVal); }
  4881. return ret
  4882. };
  4883. strats.provide = mergeDataOrFn;
  4884. /**
  4885. * Default strategy.
  4886. */
  4887. var defaultStrat = function (parentVal, childVal) {
  4888. return childVal === undefined
  4889. ? parentVal
  4890. : childVal
  4891. };
  4892. /**
  4893. * Validate component names
  4894. */
  4895. function checkComponents (options) {
  4896. for (var key in options.components) {
  4897. validateComponentName(key);
  4898. }
  4899. }
  4900. function validateComponentName (name) {
  4901. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4902. warn(
  4903. 'Invalid component name: "' + name + '". Component names ' +
  4904. 'should conform to valid custom element name in html5 specification.'
  4905. );
  4906. }
  4907. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4908. warn(
  4909. 'Do not use built-in or reserved HTML elements as component ' +
  4910. 'id: ' + name
  4911. );
  4912. }
  4913. }
  4914. /**
  4915. * Ensure all props option syntax are normalized into the
  4916. * Object-based format.
  4917. */
  4918. function normalizeProps (options, vm) {
  4919. var props = options.props;
  4920. if (!props) { return }
  4921. var res = {};
  4922. var i, val, name;
  4923. if (Array.isArray(props)) {
  4924. i = props.length;
  4925. while (i--) {
  4926. val = props[i];
  4927. if (typeof val === 'string') {
  4928. name = camelize(val);
  4929. res[name] = { type: null };
  4930. } else if (true) {
  4931. warn('props must be strings when using array syntax.');
  4932. }
  4933. }
  4934. } else if (isPlainObject(props)) {
  4935. for (var key in props) {
  4936. val = props[key];
  4937. name = camelize(key);
  4938. res[name] = isPlainObject(val)
  4939. ? val
  4940. : { type: val };
  4941. }
  4942. } else if (true) {
  4943. warn(
  4944. "Invalid value for option \"props\": expected an Array or an Object, " +
  4945. "but got " + (toRawType(props)) + ".",
  4946. vm
  4947. );
  4948. }
  4949. options.props = res;
  4950. }
  4951. /**
  4952. * Normalize all injections into Object-based format
  4953. */
  4954. function normalizeInject (options, vm) {
  4955. var inject = options.inject;
  4956. if (!inject) { return }
  4957. var normalized = options.inject = {};
  4958. if (Array.isArray(inject)) {
  4959. for (var i = 0; i < inject.length; i++) {
  4960. normalized[inject[i]] = { from: inject[i] };
  4961. }
  4962. } else if (isPlainObject(inject)) {
  4963. for (var key in inject) {
  4964. var val = inject[key];
  4965. normalized[key] = isPlainObject(val)
  4966. ? extend({ from: key }, val)
  4967. : { from: val };
  4968. }
  4969. } else if (true) {
  4970. warn(
  4971. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4972. "but got " + (toRawType(inject)) + ".",
  4973. vm
  4974. );
  4975. }
  4976. }
  4977. /**
  4978. * Normalize raw function directives into object format.
  4979. */
  4980. function normalizeDirectives (options) {
  4981. var dirs = options.directives;
  4982. if (dirs) {
  4983. for (var key in dirs) {
  4984. var def$$1 = dirs[key];
  4985. if (typeof def$$1 === 'function') {
  4986. dirs[key] = { bind: def$$1, update: def$$1 };
  4987. }
  4988. }
  4989. }
  4990. }
  4991. function assertObjectType (name, value, vm) {
  4992. if (!isPlainObject(value)) {
  4993. warn(
  4994. "Invalid value for option \"" + name + "\": expected an Object, " +
  4995. "but got " + (toRawType(value)) + ".",
  4996. vm
  4997. );
  4998. }
  4999. }
  5000. /**
  5001. * Merge two option objects into a new one.
  5002. * Core utility used in both instantiation and inheritance.
  5003. */
  5004. function mergeOptions (
  5005. parent,
  5006. child,
  5007. vm
  5008. ) {
  5009. if (true) {
  5010. checkComponents(child);
  5011. }
  5012. if (typeof child === 'function') {
  5013. child = child.options;
  5014. }
  5015. normalizeProps(child, vm);
  5016. normalizeInject(child, vm);
  5017. normalizeDirectives(child);
  5018. // Apply extends and mixins on the child options,
  5019. // but only if it is a raw options object that isn't
  5020. // the result of another mergeOptions call.
  5021. // Only merged options has the _base property.
  5022. if (!child._base) {
  5023. if (child.extends) {
  5024. parent = mergeOptions(parent, child.extends, vm);
  5025. }
  5026. if (child.mixins) {
  5027. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5028. parent = mergeOptions(parent, child.mixins[i], vm);
  5029. }
  5030. }
  5031. }
  5032. var options = {};
  5033. var key;
  5034. for (key in parent) {
  5035. mergeField(key);
  5036. }
  5037. for (key in child) {
  5038. if (!hasOwn(parent, key)) {
  5039. mergeField(key);
  5040. }
  5041. }
  5042. function mergeField (key) {
  5043. var strat = strats[key] || defaultStrat;
  5044. options[key] = strat(parent[key], child[key], vm, key);
  5045. }
  5046. return options
  5047. }
  5048. /**
  5049. * Resolve an asset.
  5050. * This function is used because child instances need access
  5051. * to assets defined in its ancestor chain.
  5052. */
  5053. function resolveAsset (
  5054. options,
  5055. type,
  5056. id,
  5057. warnMissing
  5058. ) {
  5059. /* istanbul ignore if */
  5060. if (typeof id !== 'string') {
  5061. return
  5062. }
  5063. var assets = options[type];
  5064. // check local registration variations first
  5065. if (hasOwn(assets, id)) { return assets[id] }
  5066. var camelizedId = camelize(id);
  5067. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5068. var PascalCaseId = capitalize(camelizedId);
  5069. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5070. // fallback to prototype chain
  5071. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5072. if ( true && warnMissing && !res) {
  5073. warn(
  5074. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5075. options
  5076. );
  5077. }
  5078. return res
  5079. }
  5080. /* */
  5081. function validateProp (
  5082. key,
  5083. propOptions,
  5084. propsData,
  5085. vm
  5086. ) {
  5087. var prop = propOptions[key];
  5088. var absent = !hasOwn(propsData, key);
  5089. var value = propsData[key];
  5090. // boolean casting
  5091. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5092. if (booleanIndex > -1) {
  5093. if (absent && !hasOwn(prop, 'default')) {
  5094. value = false;
  5095. } else if (value === '' || value === hyphenate(key)) {
  5096. // only cast empty string / same name to boolean if
  5097. // boolean has higher priority
  5098. var stringIndex = getTypeIndex(String, prop.type);
  5099. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5100. value = true;
  5101. }
  5102. }
  5103. }
  5104. // check default value
  5105. if (value === undefined) {
  5106. value = getPropDefaultValue(vm, prop, key);
  5107. // since the default value is a fresh copy,
  5108. // make sure to observe it.
  5109. var prevShouldObserve = shouldObserve;
  5110. toggleObserving(true);
  5111. observe(value);
  5112. toggleObserving(prevShouldObserve);
  5113. }
  5114. if (
  5115. true
  5116. ) {
  5117. assertProp(prop, key, value, vm, absent);
  5118. }
  5119. return value
  5120. }
  5121. /**
  5122. * Get the default value of a prop.
  5123. */
  5124. function getPropDefaultValue (vm, prop, key) {
  5125. // no default, return undefined
  5126. if (!hasOwn(prop, 'default')) {
  5127. return undefined
  5128. }
  5129. var def = prop.default;
  5130. // warn against non-factory defaults for Object & Array
  5131. if ( true && isObject(def)) {
  5132. warn(
  5133. 'Invalid default value for prop "' + key + '": ' +
  5134. 'Props with type Object/Array must use a factory function ' +
  5135. 'to return the default value.',
  5136. vm
  5137. );
  5138. }
  5139. // the raw prop value was also undefined from previous render,
  5140. // return previous default value to avoid unnecessary watcher trigger
  5141. if (vm && vm.$options.propsData &&
  5142. vm.$options.propsData[key] === undefined &&
  5143. vm._props[key] !== undefined
  5144. ) {
  5145. return vm._props[key]
  5146. }
  5147. // call factory function for non-Function types
  5148. // a value is Function if its prototype is function even across different execution context
  5149. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5150. ? def.call(vm)
  5151. : def
  5152. }
  5153. /**
  5154. * Assert whether a prop is valid.
  5155. */
  5156. function assertProp (
  5157. prop,
  5158. name,
  5159. value,
  5160. vm,
  5161. absent
  5162. ) {
  5163. if (prop.required && absent) {
  5164. warn(
  5165. 'Missing required prop: "' + name + '"',
  5166. vm
  5167. );
  5168. return
  5169. }
  5170. if (value == null && !prop.required) {
  5171. return
  5172. }
  5173. var type = prop.type;
  5174. var valid = !type || type === true;
  5175. var expectedTypes = [];
  5176. if (type) {
  5177. if (!Array.isArray(type)) {
  5178. type = [type];
  5179. }
  5180. for (var i = 0; i < type.length && !valid; i++) {
  5181. var assertedType = assertType(value, type[i]);
  5182. expectedTypes.push(assertedType.expectedType || '');
  5183. valid = assertedType.valid;
  5184. }
  5185. }
  5186. if (!valid) {
  5187. warn(
  5188. getInvalidTypeMessage(name, value, expectedTypes),
  5189. vm
  5190. );
  5191. return
  5192. }
  5193. var validator = prop.validator;
  5194. if (validator) {
  5195. if (!validator(value)) {
  5196. warn(
  5197. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5198. vm
  5199. );
  5200. }
  5201. }
  5202. }
  5203. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5204. function assertType (value, type) {
  5205. var valid;
  5206. var expectedType = getType(type);
  5207. if (simpleCheckRE.test(expectedType)) {
  5208. var t = typeof value;
  5209. valid = t === expectedType.toLowerCase();
  5210. // for primitive wrapper objects
  5211. if (!valid && t === 'object') {
  5212. valid = value instanceof type;
  5213. }
  5214. } else if (expectedType === 'Object') {
  5215. valid = isPlainObject(value);
  5216. } else if (expectedType === 'Array') {
  5217. valid = Array.isArray(value);
  5218. } else {
  5219. valid = value instanceof type;
  5220. }
  5221. return {
  5222. valid: valid,
  5223. expectedType: expectedType
  5224. }
  5225. }
  5226. /**
  5227. * Use function string name to check built-in types,
  5228. * because a simple equality check will fail when running
  5229. * across different vms / iframes.
  5230. */
  5231. function getType (fn) {
  5232. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5233. return match ? match[1] : ''
  5234. }
  5235. function isSameType (a, b) {
  5236. return getType(a) === getType(b)
  5237. }
  5238. function getTypeIndex (type, expectedTypes) {
  5239. if (!Array.isArray(expectedTypes)) {
  5240. return isSameType(expectedTypes, type) ? 0 : -1
  5241. }
  5242. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5243. if (isSameType(expectedTypes[i], type)) {
  5244. return i
  5245. }
  5246. }
  5247. return -1
  5248. }
  5249. function getInvalidTypeMessage (name, value, expectedTypes) {
  5250. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5251. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5252. var expectedType = expectedTypes[0];
  5253. var receivedType = toRawType(value);
  5254. var expectedValue = styleValue(value, expectedType);
  5255. var receivedValue = styleValue(value, receivedType);
  5256. // check if we need to specify expected value
  5257. if (expectedTypes.length === 1 &&
  5258. isExplicable(expectedType) &&
  5259. !isBoolean(expectedType, receivedType)) {
  5260. message += " with value " + expectedValue;
  5261. }
  5262. message += ", got " + receivedType + " ";
  5263. // check if we need to specify received value
  5264. if (isExplicable(receivedType)) {
  5265. message += "with value " + receivedValue + ".";
  5266. }
  5267. return message
  5268. }
  5269. function styleValue (value, type) {
  5270. if (type === 'String') {
  5271. return ("\"" + value + "\"")
  5272. } else if (type === 'Number') {
  5273. return ("" + (Number(value)))
  5274. } else {
  5275. return ("" + value)
  5276. }
  5277. }
  5278. function isExplicable (value) {
  5279. var explicitTypes = ['string', 'number', 'boolean'];
  5280. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5281. }
  5282. function isBoolean () {
  5283. var args = [], len = arguments.length;
  5284. while ( len-- ) args[ len ] = arguments[ len ];
  5285. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5286. }
  5287. /* */
  5288. function handleError (err, vm, info) {
  5289. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5290. // See: https://github.com/vuejs/vuex/issues/1505
  5291. pushTarget();
  5292. try {
  5293. if (vm) {
  5294. var cur = vm;
  5295. while ((cur = cur.$parent)) {
  5296. var hooks = cur.$options.errorCaptured;
  5297. if (hooks) {
  5298. for (var i = 0; i < hooks.length; i++) {
  5299. try {
  5300. var capture = hooks[i].call(cur, err, vm, info) === false;
  5301. if (capture) { return }
  5302. } catch (e) {
  5303. globalHandleError(e, cur, 'errorCaptured hook');
  5304. }
  5305. }
  5306. }
  5307. }
  5308. }
  5309. globalHandleError(err, vm, info);
  5310. } finally {
  5311. popTarget();
  5312. }
  5313. }
  5314. function invokeWithErrorHandling (
  5315. handler,
  5316. context,
  5317. args,
  5318. vm,
  5319. info
  5320. ) {
  5321. var res;
  5322. try {
  5323. res = args ? handler.apply(context, args) : handler.call(context);
  5324. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5325. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5326. // issue #9511
  5327. // avoid catch triggering multiple times when nested calls
  5328. res._handled = true;
  5329. }
  5330. } catch (e) {
  5331. handleError(e, vm, info);
  5332. }
  5333. return res
  5334. }
  5335. function globalHandleError (err, vm, info) {
  5336. if (config.errorHandler) {
  5337. try {
  5338. return config.errorHandler.call(null, err, vm, info)
  5339. } catch (e) {
  5340. // if the user intentionally throws the original error in the handler,
  5341. // do not log it twice
  5342. if (e !== err) {
  5343. logError(e, null, 'config.errorHandler');
  5344. }
  5345. }
  5346. }
  5347. logError(err, vm, info);
  5348. }
  5349. function logError (err, vm, info) {
  5350. if (true) {
  5351. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5352. }
  5353. /* istanbul ignore else */
  5354. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5355. console.error(err);
  5356. } else {
  5357. throw err
  5358. }
  5359. }
  5360. /* */
  5361. var callbacks = [];
  5362. var pending = false;
  5363. function flushCallbacks () {
  5364. pending = false;
  5365. var copies = callbacks.slice(0);
  5366. callbacks.length = 0;
  5367. for (var i = 0; i < copies.length; i++) {
  5368. copies[i]();
  5369. }
  5370. }
  5371. // Here we have async deferring wrappers using microtasks.
  5372. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5373. // However, it has subtle problems when state is changed right before repaint
  5374. // (e.g. #6813, out-in transitions).
  5375. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5376. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5377. // So we now use microtasks everywhere, again.
  5378. // A major drawback of this tradeoff is that there are some scenarios
  5379. // where microtasks have too high a priority and fire in between supposedly
  5380. // sequential events (e.g. #4521, #6690, which have workarounds)
  5381. // or even between bubbling of the same event (#6566).
  5382. var timerFunc;
  5383. // The nextTick behavior leverages the microtask queue, which can be accessed
  5384. // via either native Promise.then or MutationObserver.
  5385. // MutationObserver has wider support, however it is seriously bugged in
  5386. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5387. // completely stops working after triggering a few times... so, if native
  5388. // Promise is available, we will use it:
  5389. /* istanbul ignore next, $flow-disable-line */
  5390. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5391. var p = Promise.resolve();
  5392. timerFunc = function () {
  5393. p.then(flushCallbacks);
  5394. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5395. // it can get stuck in a weird state where callbacks are pushed into the
  5396. // microtask queue but the queue isn't being flushed, until the browser
  5397. // needs to do some other work, e.g. handle a timer. Therefore we can
  5398. // "force" the microtask queue to be flushed by adding an empty timer.
  5399. if (isIOS) { setTimeout(noop); }
  5400. };
  5401. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5402. isNative(MutationObserver) ||
  5403. // PhantomJS and iOS 7.x
  5404. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5405. )) {
  5406. // Use MutationObserver where native Promise is not available,
  5407. // e.g. PhantomJS, iOS7, Android 4.4
  5408. // (#6466 MutationObserver is unreliable in IE11)
  5409. var counter = 1;
  5410. var observer = new MutationObserver(flushCallbacks);
  5411. var textNode = document.createTextNode(String(counter));
  5412. observer.observe(textNode, {
  5413. characterData: true
  5414. });
  5415. timerFunc = function () {
  5416. counter = (counter + 1) % 2;
  5417. textNode.data = String(counter);
  5418. };
  5419. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5420. // Fallback to setImmediate.
  5421. // Technically it leverages the (macro) task queue,
  5422. // but it is still a better choice than setTimeout.
  5423. timerFunc = function () {
  5424. setImmediate(flushCallbacks);
  5425. };
  5426. } else {
  5427. // Fallback to setTimeout.
  5428. timerFunc = function () {
  5429. setTimeout(flushCallbacks, 0);
  5430. };
  5431. }
  5432. function nextTick (cb, ctx) {
  5433. var _resolve;
  5434. callbacks.push(function () {
  5435. if (cb) {
  5436. try {
  5437. cb.call(ctx);
  5438. } catch (e) {
  5439. handleError(e, ctx, 'nextTick');
  5440. }
  5441. } else if (_resolve) {
  5442. _resolve(ctx);
  5443. }
  5444. });
  5445. if (!pending) {
  5446. pending = true;
  5447. timerFunc();
  5448. }
  5449. // $flow-disable-line
  5450. if (!cb && typeof Promise !== 'undefined') {
  5451. return new Promise(function (resolve) {
  5452. _resolve = resolve;
  5453. })
  5454. }
  5455. }
  5456. /* */
  5457. /* not type checking this file because flow doesn't play well with Proxy */
  5458. var initProxy;
  5459. if (true) {
  5460. var allowedGlobals = makeMap(
  5461. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5462. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5463. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5464. 'require' // for Webpack/Browserify
  5465. );
  5466. var warnNonPresent = function (target, key) {
  5467. warn(
  5468. "Property or method \"" + key + "\" is not defined on the instance but " +
  5469. 'referenced during render. Make sure that this property is reactive, ' +
  5470. 'either in the data option, or for class-based components, by ' +
  5471. 'initializing the property. ' +
  5472. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5473. target
  5474. );
  5475. };
  5476. var warnReservedPrefix = function (target, key) {
  5477. warn(
  5478. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5479. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5480. 'prevent conflicts with Vue internals. ' +
  5481. 'See: https://vuejs.org/v2/api/#data',
  5482. target
  5483. );
  5484. };
  5485. var hasProxy =
  5486. typeof Proxy !== 'undefined' && isNative(Proxy);
  5487. if (hasProxy) {
  5488. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5489. config.keyCodes = new Proxy(config.keyCodes, {
  5490. set: function set (target, key, value) {
  5491. if (isBuiltInModifier(key)) {
  5492. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5493. return false
  5494. } else {
  5495. target[key] = value;
  5496. return true
  5497. }
  5498. }
  5499. });
  5500. }
  5501. var hasHandler = {
  5502. has: function has (target, key) {
  5503. var has = key in target;
  5504. var isAllowed = allowedGlobals(key) ||
  5505. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5506. if (!has && !isAllowed) {
  5507. if (key in target.$data) { warnReservedPrefix(target, key); }
  5508. else { warnNonPresent(target, key); }
  5509. }
  5510. return has || !isAllowed
  5511. }
  5512. };
  5513. var getHandler = {
  5514. get: function get (target, key) {
  5515. if (typeof key === 'string' && !(key in target)) {
  5516. if (key in target.$data) { warnReservedPrefix(target, key); }
  5517. else { warnNonPresent(target, key); }
  5518. }
  5519. return target[key]
  5520. }
  5521. };
  5522. initProxy = function initProxy (vm) {
  5523. if (hasProxy) {
  5524. // determine which proxy handler to use
  5525. var options = vm.$options;
  5526. var handlers = options.render && options.render._withStripped
  5527. ? getHandler
  5528. : hasHandler;
  5529. vm._renderProxy = new Proxy(vm, handlers);
  5530. } else {
  5531. vm._renderProxy = vm;
  5532. }
  5533. };
  5534. }
  5535. /* */
  5536. var seenObjects = new _Set();
  5537. /**
  5538. * Recursively traverse an object to evoke all converted
  5539. * getters, so that every nested property inside the object
  5540. * is collected as a "deep" dependency.
  5541. */
  5542. function traverse (val) {
  5543. _traverse(val, seenObjects);
  5544. seenObjects.clear();
  5545. }
  5546. function _traverse (val, seen) {
  5547. var i, keys;
  5548. var isA = Array.isArray(val);
  5549. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5550. return
  5551. }
  5552. if (val.__ob__) {
  5553. var depId = val.__ob__.dep.id;
  5554. if (seen.has(depId)) {
  5555. return
  5556. }
  5557. seen.add(depId);
  5558. }
  5559. if (isA) {
  5560. i = val.length;
  5561. while (i--) { _traverse(val[i], seen); }
  5562. } else {
  5563. keys = Object.keys(val);
  5564. i = keys.length;
  5565. while (i--) { _traverse(val[keys[i]], seen); }
  5566. }
  5567. }
  5568. var mark;
  5569. var measure;
  5570. if (true) {
  5571. var perf = inBrowser && window.performance;
  5572. /* istanbul ignore if */
  5573. if (
  5574. perf &&
  5575. perf.mark &&
  5576. perf.measure &&
  5577. perf.clearMarks &&
  5578. perf.clearMeasures
  5579. ) {
  5580. mark = function (tag) { return perf.mark(tag); };
  5581. measure = function (name, startTag, endTag) {
  5582. perf.measure(name, startTag, endTag);
  5583. perf.clearMarks(startTag);
  5584. perf.clearMarks(endTag);
  5585. // perf.clearMeasures(name)
  5586. };
  5587. }
  5588. }
  5589. /* */
  5590. var normalizeEvent = cached(function (name) {
  5591. var passive = name.charAt(0) === '&';
  5592. name = passive ? name.slice(1) : name;
  5593. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5594. name = once$$1 ? name.slice(1) : name;
  5595. var capture = name.charAt(0) === '!';
  5596. name = capture ? name.slice(1) : name;
  5597. return {
  5598. name: name,
  5599. once: once$$1,
  5600. capture: capture,
  5601. passive: passive
  5602. }
  5603. });
  5604. function createFnInvoker (fns, vm) {
  5605. function invoker () {
  5606. var arguments$1 = arguments;
  5607. var fns = invoker.fns;
  5608. if (Array.isArray(fns)) {
  5609. var cloned = fns.slice();
  5610. for (var i = 0; i < cloned.length; i++) {
  5611. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5612. }
  5613. } else {
  5614. // return handler return value for single handlers
  5615. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5616. }
  5617. }
  5618. invoker.fns = fns;
  5619. return invoker
  5620. }
  5621. function updateListeners (
  5622. on,
  5623. oldOn,
  5624. add,
  5625. remove$$1,
  5626. createOnceHandler,
  5627. vm
  5628. ) {
  5629. var name, def$$1, cur, old, event;
  5630. for (name in on) {
  5631. def$$1 = cur = on[name];
  5632. old = oldOn[name];
  5633. event = normalizeEvent(name);
  5634. if (isUndef(cur)) {
  5635. true && warn(
  5636. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5637. vm
  5638. );
  5639. } else if (isUndef(old)) {
  5640. if (isUndef(cur.fns)) {
  5641. cur = on[name] = createFnInvoker(cur, vm);
  5642. }
  5643. if (isTrue(event.once)) {
  5644. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5645. }
  5646. add(event.name, cur, event.capture, event.passive, event.params);
  5647. } else if (cur !== old) {
  5648. old.fns = cur;
  5649. on[name] = old;
  5650. }
  5651. }
  5652. for (name in oldOn) {
  5653. if (isUndef(on[name])) {
  5654. event = normalizeEvent(name);
  5655. remove$$1(event.name, oldOn[name], event.capture);
  5656. }
  5657. }
  5658. }
  5659. /* */
  5660. /* */
  5661. // fixed by xxxxxx (mp properties)
  5662. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5663. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5664. if (isUndef(propOptions)) {
  5665. return res
  5666. }
  5667. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5668. var attrs = data.attrs;
  5669. var props = data.props;
  5670. if (isDef(attrs) || isDef(props)) {
  5671. for (var key in propOptions) {
  5672. var altKey = hyphenate(key);
  5673. var result = checkProp(res, props, key, altKey, true) ||
  5674. checkProp(res, attrs, key, altKey, false);
  5675. // externalClass
  5676. if (
  5677. result &&
  5678. res[key] &&
  5679. externalClasses.indexOf(altKey) !== -1 &&
  5680. context[camelize(res[key])]
  5681. ) {
  5682. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5683. res[key] = context[camelize(res[key])];
  5684. }
  5685. }
  5686. }
  5687. return res
  5688. }
  5689. function extractPropsFromVNodeData (
  5690. data,
  5691. Ctor,
  5692. tag,
  5693. context// fixed by xxxxxx
  5694. ) {
  5695. // we are only extracting raw values here.
  5696. // validation and default values are handled in the child
  5697. // component itself.
  5698. var propOptions = Ctor.options.props;
  5699. if (isUndef(propOptions)) {
  5700. // fixed by xxxxxx
  5701. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5702. }
  5703. var res = {};
  5704. var attrs = data.attrs;
  5705. var props = data.props;
  5706. if (isDef(attrs) || isDef(props)) {
  5707. for (var key in propOptions) {
  5708. var altKey = hyphenate(key);
  5709. if (true) {
  5710. var keyInLowerCase = key.toLowerCase();
  5711. if (
  5712. key !== keyInLowerCase &&
  5713. attrs && hasOwn(attrs, keyInLowerCase)
  5714. ) {
  5715. tip(
  5716. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5717. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5718. " \"" + key + "\". " +
  5719. "Note that HTML attributes are case-insensitive and camelCased " +
  5720. "props need to use their kebab-case equivalents when using in-DOM " +
  5721. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5722. );
  5723. }
  5724. }
  5725. checkProp(res, props, key, altKey, true) ||
  5726. checkProp(res, attrs, key, altKey, false);
  5727. }
  5728. }
  5729. // fixed by xxxxxx
  5730. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5731. }
  5732. function checkProp (
  5733. res,
  5734. hash,
  5735. key,
  5736. altKey,
  5737. preserve
  5738. ) {
  5739. if (isDef(hash)) {
  5740. if (hasOwn(hash, key)) {
  5741. res[key] = hash[key];
  5742. if (!preserve) {
  5743. delete hash[key];
  5744. }
  5745. return true
  5746. } else if (hasOwn(hash, altKey)) {
  5747. res[key] = hash[altKey];
  5748. if (!preserve) {
  5749. delete hash[altKey];
  5750. }
  5751. return true
  5752. }
  5753. }
  5754. return false
  5755. }
  5756. /* */
  5757. // The template compiler attempts to minimize the need for normalization by
  5758. // statically analyzing the template at compile time.
  5759. //
  5760. // For plain HTML markup, normalization can be completely skipped because the
  5761. // generated render function is guaranteed to return Array<VNode>. There are
  5762. // two cases where extra normalization is needed:
  5763. // 1. When the children contains components - because a functional component
  5764. // may return an Array instead of a single root. In this case, just a simple
  5765. // normalization is needed - if any child is an Array, we flatten the whole
  5766. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5767. // because functional components already normalize their own children.
  5768. function simpleNormalizeChildren (children) {
  5769. for (var i = 0; i < children.length; i++) {
  5770. if (Array.isArray(children[i])) {
  5771. return Array.prototype.concat.apply([], children)
  5772. }
  5773. }
  5774. return children
  5775. }
  5776. // 2. When the children contains constructs that always generated nested Arrays,
  5777. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5778. // with hand-written render functions / JSX. In such cases a full normalization
  5779. // is needed to cater to all possible types of children values.
  5780. function normalizeChildren (children) {
  5781. return isPrimitive(children)
  5782. ? [createTextVNode(children)]
  5783. : Array.isArray(children)
  5784. ? normalizeArrayChildren(children)
  5785. : undefined
  5786. }
  5787. function isTextNode (node) {
  5788. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5789. }
  5790. function normalizeArrayChildren (children, nestedIndex) {
  5791. var res = [];
  5792. var i, c, lastIndex, last;
  5793. for (i = 0; i < children.length; i++) {
  5794. c = children[i];
  5795. if (isUndef(c) || typeof c === 'boolean') { continue }
  5796. lastIndex = res.length - 1;
  5797. last = res[lastIndex];
  5798. // nested
  5799. if (Array.isArray(c)) {
  5800. if (c.length > 0) {
  5801. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5802. // merge adjacent text nodes
  5803. if (isTextNode(c[0]) && isTextNode(last)) {
  5804. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5805. c.shift();
  5806. }
  5807. res.push.apply(res, c);
  5808. }
  5809. } else if (isPrimitive(c)) {
  5810. if (isTextNode(last)) {
  5811. // merge adjacent text nodes
  5812. // this is necessary for SSR hydration because text nodes are
  5813. // essentially merged when rendered to HTML strings
  5814. res[lastIndex] = createTextVNode(last.text + c);
  5815. } else if (c !== '') {
  5816. // convert primitive to vnode
  5817. res.push(createTextVNode(c));
  5818. }
  5819. } else {
  5820. if (isTextNode(c) && isTextNode(last)) {
  5821. // merge adjacent text nodes
  5822. res[lastIndex] = createTextVNode(last.text + c.text);
  5823. } else {
  5824. // default key for nested array children (likely generated by v-for)
  5825. if (isTrue(children._isVList) &&
  5826. isDef(c.tag) &&
  5827. isUndef(c.key) &&
  5828. isDef(nestedIndex)) {
  5829. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5830. }
  5831. res.push(c);
  5832. }
  5833. }
  5834. }
  5835. return res
  5836. }
  5837. /* */
  5838. function initProvide (vm) {
  5839. var provide = vm.$options.provide;
  5840. if (provide) {
  5841. vm._provided = typeof provide === 'function'
  5842. ? provide.call(vm)
  5843. : provide;
  5844. }
  5845. }
  5846. function initInjections (vm) {
  5847. var result = resolveInject(vm.$options.inject, vm);
  5848. if (result) {
  5849. toggleObserving(false);
  5850. Object.keys(result).forEach(function (key) {
  5851. /* istanbul ignore else */
  5852. if (true) {
  5853. defineReactive$$1(vm, key, result[key], function () {
  5854. warn(
  5855. "Avoid mutating an injected value directly since the changes will be " +
  5856. "overwritten whenever the provided component re-renders. " +
  5857. "injection being mutated: \"" + key + "\"",
  5858. vm
  5859. );
  5860. });
  5861. } else {}
  5862. });
  5863. toggleObserving(true);
  5864. }
  5865. }
  5866. function resolveInject (inject, vm) {
  5867. if (inject) {
  5868. // inject is :any because flow is not smart enough to figure out cached
  5869. var result = Object.create(null);
  5870. var keys = hasSymbol
  5871. ? Reflect.ownKeys(inject)
  5872. : Object.keys(inject);
  5873. for (var i = 0; i < keys.length; i++) {
  5874. var key = keys[i];
  5875. // #6574 in case the inject object is observed...
  5876. if (key === '__ob__') { continue }
  5877. var provideKey = inject[key].from;
  5878. var source = vm;
  5879. while (source) {
  5880. if (source._provided && hasOwn(source._provided, provideKey)) {
  5881. result[key] = source._provided[provideKey];
  5882. break
  5883. }
  5884. source = source.$parent;
  5885. }
  5886. if (!source) {
  5887. if ('default' in inject[key]) {
  5888. var provideDefault = inject[key].default;
  5889. result[key] = typeof provideDefault === 'function'
  5890. ? provideDefault.call(vm)
  5891. : provideDefault;
  5892. } else if (true) {
  5893. warn(("Injection \"" + key + "\" not found"), vm);
  5894. }
  5895. }
  5896. }
  5897. return result
  5898. }
  5899. }
  5900. /* */
  5901. /**
  5902. * Runtime helper for resolving raw children VNodes into a slot object.
  5903. */
  5904. function resolveSlots (
  5905. children,
  5906. context
  5907. ) {
  5908. if (!children || !children.length) {
  5909. return {}
  5910. }
  5911. var slots = {};
  5912. for (var i = 0, l = children.length; i < l; i++) {
  5913. var child = children[i];
  5914. var data = child.data;
  5915. // remove slot attribute if the node is resolved as a Vue slot node
  5916. if (data && data.attrs && data.attrs.slot) {
  5917. delete data.attrs.slot;
  5918. }
  5919. // named slots should only be respected if the vnode was rendered in the
  5920. // same context.
  5921. if ((child.context === context || child.fnContext === context) &&
  5922. data && data.slot != null
  5923. ) {
  5924. var name = data.slot;
  5925. var slot = (slots[name] || (slots[name] = []));
  5926. if (child.tag === 'template') {
  5927. slot.push.apply(slot, child.children || []);
  5928. } else {
  5929. slot.push(child);
  5930. }
  5931. } else {
  5932. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5933. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5934. (slots['page'] || (slots['page'] = [])).push(child);
  5935. }else{
  5936. (slots.default || (slots.default = [])).push(child);
  5937. }
  5938. }
  5939. }
  5940. // ignore slots that contains only whitespace
  5941. for (var name$1 in slots) {
  5942. if (slots[name$1].every(isWhitespace)) {
  5943. delete slots[name$1];
  5944. }
  5945. }
  5946. return slots
  5947. }
  5948. function isWhitespace (node) {
  5949. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5950. }
  5951. /* */
  5952. function normalizeScopedSlots (
  5953. slots,
  5954. normalSlots,
  5955. prevSlots
  5956. ) {
  5957. var res;
  5958. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5959. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5960. var key = slots && slots.$key;
  5961. if (!slots) {
  5962. res = {};
  5963. } else if (slots._normalized) {
  5964. // fast path 1: child component re-render only, parent did not change
  5965. return slots._normalized
  5966. } else if (
  5967. isStable &&
  5968. prevSlots &&
  5969. prevSlots !== emptyObject &&
  5970. key === prevSlots.$key &&
  5971. !hasNormalSlots &&
  5972. !prevSlots.$hasNormal
  5973. ) {
  5974. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5975. // only need to normalize once
  5976. return prevSlots
  5977. } else {
  5978. res = {};
  5979. for (var key$1 in slots) {
  5980. if (slots[key$1] && key$1[0] !== '$') {
  5981. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5982. }
  5983. }
  5984. }
  5985. // expose normal slots on scopedSlots
  5986. for (var key$2 in normalSlots) {
  5987. if (!(key$2 in res)) {
  5988. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5989. }
  5990. }
  5991. // avoriaz seems to mock a non-extensible $scopedSlots object
  5992. // and when that is passed down this would cause an error
  5993. if (slots && Object.isExtensible(slots)) {
  5994. (slots)._normalized = res;
  5995. }
  5996. def(res, '$stable', isStable);
  5997. def(res, '$key', key);
  5998. def(res, '$hasNormal', hasNormalSlots);
  5999. return res
  6000. }
  6001. function normalizeScopedSlot(normalSlots, key, fn) {
  6002. var normalized = function () {
  6003. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6004. res = res && typeof res === 'object' && !Array.isArray(res)
  6005. ? [res] // single vnode
  6006. : normalizeChildren(res);
  6007. return res && (
  6008. res.length === 0 ||
  6009. (res.length === 1 && res[0].isComment) // #9658
  6010. ) ? undefined
  6011. : res
  6012. };
  6013. // this is a slot using the new v-slot syntax without scope. although it is
  6014. // compiled as a scoped slot, render fn users would expect it to be present
  6015. // on this.$slots because the usage is semantically a normal slot.
  6016. if (fn.proxy) {
  6017. Object.defineProperty(normalSlots, key, {
  6018. get: normalized,
  6019. enumerable: true,
  6020. configurable: true
  6021. });
  6022. }
  6023. return normalized
  6024. }
  6025. function proxyNormalSlot(slots, key) {
  6026. return function () { return slots[key]; }
  6027. }
  6028. /* */
  6029. /**
  6030. * Runtime helper for rendering v-for lists.
  6031. */
  6032. function renderList (
  6033. val,
  6034. render
  6035. ) {
  6036. var ret, i, l, keys, key;
  6037. if (Array.isArray(val) || typeof val === 'string') {
  6038. ret = new Array(val.length);
  6039. for (i = 0, l = val.length; i < l; i++) {
  6040. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6041. }
  6042. } else if (typeof val === 'number') {
  6043. ret = new Array(val);
  6044. for (i = 0; i < val; i++) {
  6045. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6046. }
  6047. } else if (isObject(val)) {
  6048. if (hasSymbol && val[Symbol.iterator]) {
  6049. ret = [];
  6050. var iterator = val[Symbol.iterator]();
  6051. var result = iterator.next();
  6052. while (!result.done) {
  6053. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6054. result = iterator.next();
  6055. }
  6056. } else {
  6057. keys = Object.keys(val);
  6058. ret = new Array(keys.length);
  6059. for (i = 0, l = keys.length; i < l; i++) {
  6060. key = keys[i];
  6061. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6062. }
  6063. }
  6064. }
  6065. if (!isDef(ret)) {
  6066. ret = [];
  6067. }
  6068. (ret)._isVList = true;
  6069. return ret
  6070. }
  6071. /* */
  6072. /**
  6073. * Runtime helper for rendering <slot>
  6074. */
  6075. function renderSlot (
  6076. name,
  6077. fallback,
  6078. props,
  6079. bindObject
  6080. ) {
  6081. var scopedSlotFn = this.$scopedSlots[name];
  6082. var nodes;
  6083. if (scopedSlotFn) { // scoped slot
  6084. props = props || {};
  6085. if (bindObject) {
  6086. if ( true && !isObject(bindObject)) {
  6087. warn(
  6088. 'slot v-bind without argument expects an Object',
  6089. this
  6090. );
  6091. }
  6092. props = extend(extend({}, bindObject), props);
  6093. }
  6094. // fixed by xxxxxx app-plus scopedSlot
  6095. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6096. } else {
  6097. nodes = this.$slots[name] || fallback;
  6098. }
  6099. var target = props && props.slot;
  6100. if (target) {
  6101. return this.$createElement('template', { slot: target }, nodes)
  6102. } else {
  6103. return nodes
  6104. }
  6105. }
  6106. /* */
  6107. /**
  6108. * Runtime helper for resolving filters
  6109. */
  6110. function resolveFilter (id) {
  6111. return resolveAsset(this.$options, 'filters', id, true) || identity
  6112. }
  6113. /* */
  6114. function isKeyNotMatch (expect, actual) {
  6115. if (Array.isArray(expect)) {
  6116. return expect.indexOf(actual) === -1
  6117. } else {
  6118. return expect !== actual
  6119. }
  6120. }
  6121. /**
  6122. * Runtime helper for checking keyCodes from config.
  6123. * exposed as Vue.prototype._k
  6124. * passing in eventKeyName as last argument separately for backwards compat
  6125. */
  6126. function checkKeyCodes (
  6127. eventKeyCode,
  6128. key,
  6129. builtInKeyCode,
  6130. eventKeyName,
  6131. builtInKeyName
  6132. ) {
  6133. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6134. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6135. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6136. } else if (mappedKeyCode) {
  6137. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6138. } else if (eventKeyName) {
  6139. return hyphenate(eventKeyName) !== key
  6140. }
  6141. }
  6142. /* */
  6143. /**
  6144. * Runtime helper for merging v-bind="object" into a VNode's data.
  6145. */
  6146. function bindObjectProps (
  6147. data,
  6148. tag,
  6149. value,
  6150. asProp,
  6151. isSync
  6152. ) {
  6153. if (value) {
  6154. if (!isObject(value)) {
  6155. true && warn(
  6156. 'v-bind without argument expects an Object or Array value',
  6157. this
  6158. );
  6159. } else {
  6160. if (Array.isArray(value)) {
  6161. value = toObject(value);
  6162. }
  6163. var hash;
  6164. var loop = function ( key ) {
  6165. if (
  6166. key === 'class' ||
  6167. key === 'style' ||
  6168. isReservedAttribute(key)
  6169. ) {
  6170. hash = data;
  6171. } else {
  6172. var type = data.attrs && data.attrs.type;
  6173. hash = asProp || config.mustUseProp(tag, type, key)
  6174. ? data.domProps || (data.domProps = {})
  6175. : data.attrs || (data.attrs = {});
  6176. }
  6177. var camelizedKey = camelize(key);
  6178. var hyphenatedKey = hyphenate(key);
  6179. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6180. hash[key] = value[key];
  6181. if (isSync) {
  6182. var on = data.on || (data.on = {});
  6183. on[("update:" + key)] = function ($event) {
  6184. value[key] = $event;
  6185. };
  6186. }
  6187. }
  6188. };
  6189. for (var key in value) loop( key );
  6190. }
  6191. }
  6192. return data
  6193. }
  6194. /* */
  6195. /**
  6196. * Runtime helper for rendering static trees.
  6197. */
  6198. function renderStatic (
  6199. index,
  6200. isInFor
  6201. ) {
  6202. var cached = this._staticTrees || (this._staticTrees = []);
  6203. var tree = cached[index];
  6204. // if has already-rendered static tree and not inside v-for,
  6205. // we can reuse the same tree.
  6206. if (tree && !isInFor) {
  6207. return tree
  6208. }
  6209. // otherwise, render a fresh tree.
  6210. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6211. this._renderProxy,
  6212. null,
  6213. this // for render fns generated for functional component templates
  6214. );
  6215. markStatic(tree, ("__static__" + index), false);
  6216. return tree
  6217. }
  6218. /**
  6219. * Runtime helper for v-once.
  6220. * Effectively it means marking the node as static with a unique key.
  6221. */
  6222. function markOnce (
  6223. tree,
  6224. index,
  6225. key
  6226. ) {
  6227. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6228. return tree
  6229. }
  6230. function markStatic (
  6231. tree,
  6232. key,
  6233. isOnce
  6234. ) {
  6235. if (Array.isArray(tree)) {
  6236. for (var i = 0; i < tree.length; i++) {
  6237. if (tree[i] && typeof tree[i] !== 'string') {
  6238. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6239. }
  6240. }
  6241. } else {
  6242. markStaticNode(tree, key, isOnce);
  6243. }
  6244. }
  6245. function markStaticNode (node, key, isOnce) {
  6246. node.isStatic = true;
  6247. node.key = key;
  6248. node.isOnce = isOnce;
  6249. }
  6250. /* */
  6251. function bindObjectListeners (data, value) {
  6252. if (value) {
  6253. if (!isPlainObject(value)) {
  6254. true && warn(
  6255. 'v-on without argument expects an Object value',
  6256. this
  6257. );
  6258. } else {
  6259. var on = data.on = data.on ? extend({}, data.on) : {};
  6260. for (var key in value) {
  6261. var existing = on[key];
  6262. var ours = value[key];
  6263. on[key] = existing ? [].concat(existing, ours) : ours;
  6264. }
  6265. }
  6266. }
  6267. return data
  6268. }
  6269. /* */
  6270. function resolveScopedSlots (
  6271. fns, // see flow/vnode
  6272. res,
  6273. // the following are added in 2.6
  6274. hasDynamicKeys,
  6275. contentHashKey
  6276. ) {
  6277. res = res || { $stable: !hasDynamicKeys };
  6278. for (var i = 0; i < fns.length; i++) {
  6279. var slot = fns[i];
  6280. if (Array.isArray(slot)) {
  6281. resolveScopedSlots(slot, res, hasDynamicKeys);
  6282. } else if (slot) {
  6283. // marker for reverse proxying v-slot without scope on this.$slots
  6284. if (slot.proxy) {
  6285. slot.fn.proxy = true;
  6286. }
  6287. res[slot.key] = slot.fn;
  6288. }
  6289. }
  6290. if (contentHashKey) {
  6291. (res).$key = contentHashKey;
  6292. }
  6293. return res
  6294. }
  6295. /* */
  6296. function bindDynamicKeys (baseObj, values) {
  6297. for (var i = 0; i < values.length; i += 2) {
  6298. var key = values[i];
  6299. if (typeof key === 'string' && key) {
  6300. baseObj[values[i]] = values[i + 1];
  6301. } else if ( true && key !== '' && key !== null) {
  6302. // null is a special value for explicitly removing a binding
  6303. warn(
  6304. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6305. this
  6306. );
  6307. }
  6308. }
  6309. return baseObj
  6310. }
  6311. // helper to dynamically append modifier runtime markers to event names.
  6312. // ensure only append when value is already string, otherwise it will be cast
  6313. // to string and cause the type check to miss.
  6314. function prependModifier (value, symbol) {
  6315. return typeof value === 'string' ? symbol + value : value
  6316. }
  6317. /* */
  6318. function installRenderHelpers (target) {
  6319. target._o = markOnce;
  6320. target._n = toNumber;
  6321. target._s = toString;
  6322. target._l = renderList;
  6323. target._t = renderSlot;
  6324. target._q = looseEqual;
  6325. target._i = looseIndexOf;
  6326. target._m = renderStatic;
  6327. target._f = resolveFilter;
  6328. target._k = checkKeyCodes;
  6329. target._b = bindObjectProps;
  6330. target._v = createTextVNode;
  6331. target._e = createEmptyVNode;
  6332. target._u = resolveScopedSlots;
  6333. target._g = bindObjectListeners;
  6334. target._d = bindDynamicKeys;
  6335. target._p = prependModifier;
  6336. }
  6337. /* */
  6338. function FunctionalRenderContext (
  6339. data,
  6340. props,
  6341. children,
  6342. parent,
  6343. Ctor
  6344. ) {
  6345. var this$1 = this;
  6346. var options = Ctor.options;
  6347. // ensure the createElement function in functional components
  6348. // gets a unique context - this is necessary for correct named slot check
  6349. var contextVm;
  6350. if (hasOwn(parent, '_uid')) {
  6351. contextVm = Object.create(parent);
  6352. // $flow-disable-line
  6353. contextVm._original = parent;
  6354. } else {
  6355. // the context vm passed in is a functional context as well.
  6356. // in this case we want to make sure we are able to get a hold to the
  6357. // real context instance.
  6358. contextVm = parent;
  6359. // $flow-disable-line
  6360. parent = parent._original;
  6361. }
  6362. var isCompiled = isTrue(options._compiled);
  6363. var needNormalization = !isCompiled;
  6364. this.data = data;
  6365. this.props = props;
  6366. this.children = children;
  6367. this.parent = parent;
  6368. this.listeners = data.on || emptyObject;
  6369. this.injections = resolveInject(options.inject, parent);
  6370. this.slots = function () {
  6371. if (!this$1.$slots) {
  6372. normalizeScopedSlots(
  6373. data.scopedSlots,
  6374. this$1.$slots = resolveSlots(children, parent)
  6375. );
  6376. }
  6377. return this$1.$slots
  6378. };
  6379. Object.defineProperty(this, 'scopedSlots', ({
  6380. enumerable: true,
  6381. get: function get () {
  6382. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6383. }
  6384. }));
  6385. // support for compiled functional template
  6386. if (isCompiled) {
  6387. // exposing $options for renderStatic()
  6388. this.$options = options;
  6389. // pre-resolve slots for renderSlot()
  6390. this.$slots = this.slots();
  6391. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6392. }
  6393. if (options._scopeId) {
  6394. this._c = function (a, b, c, d) {
  6395. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6396. if (vnode && !Array.isArray(vnode)) {
  6397. vnode.fnScopeId = options._scopeId;
  6398. vnode.fnContext = parent;
  6399. }
  6400. return vnode
  6401. };
  6402. } else {
  6403. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6404. }
  6405. }
  6406. installRenderHelpers(FunctionalRenderContext.prototype);
  6407. function createFunctionalComponent (
  6408. Ctor,
  6409. propsData,
  6410. data,
  6411. contextVm,
  6412. children
  6413. ) {
  6414. var options = Ctor.options;
  6415. var props = {};
  6416. var propOptions = options.props;
  6417. if (isDef(propOptions)) {
  6418. for (var key in propOptions) {
  6419. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6420. }
  6421. } else {
  6422. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6423. if (isDef(data.props)) { mergeProps(props, data.props); }
  6424. }
  6425. var renderContext = new FunctionalRenderContext(
  6426. data,
  6427. props,
  6428. children,
  6429. contextVm,
  6430. Ctor
  6431. );
  6432. var vnode = options.render.call(null, renderContext._c, renderContext);
  6433. if (vnode instanceof VNode) {
  6434. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6435. } else if (Array.isArray(vnode)) {
  6436. var vnodes = normalizeChildren(vnode) || [];
  6437. var res = new Array(vnodes.length);
  6438. for (var i = 0; i < vnodes.length; i++) {
  6439. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6440. }
  6441. return res
  6442. }
  6443. }
  6444. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6445. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6446. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6447. // that should not be matched to match.
  6448. var clone = cloneVNode(vnode);
  6449. clone.fnContext = contextVm;
  6450. clone.fnOptions = options;
  6451. if (true) {
  6452. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6453. }
  6454. if (data.slot) {
  6455. (clone.data || (clone.data = {})).slot = data.slot;
  6456. }
  6457. return clone
  6458. }
  6459. function mergeProps (to, from) {
  6460. for (var key in from) {
  6461. to[camelize(key)] = from[key];
  6462. }
  6463. }
  6464. /* */
  6465. /* */
  6466. /* */
  6467. /* */
  6468. // inline hooks to be invoked on component VNodes during patch
  6469. var componentVNodeHooks = {
  6470. init: function init (vnode, hydrating) {
  6471. if (
  6472. vnode.componentInstance &&
  6473. !vnode.componentInstance._isDestroyed &&
  6474. vnode.data.keepAlive
  6475. ) {
  6476. // kept-alive components, treat as a patch
  6477. var mountedNode = vnode; // work around flow
  6478. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6479. } else {
  6480. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6481. vnode,
  6482. activeInstance
  6483. );
  6484. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6485. }
  6486. },
  6487. prepatch: function prepatch (oldVnode, vnode) {
  6488. var options = vnode.componentOptions;
  6489. var child = vnode.componentInstance = oldVnode.componentInstance;
  6490. updateChildComponent(
  6491. child,
  6492. options.propsData, // updated props
  6493. options.listeners, // updated listeners
  6494. vnode, // new parent vnode
  6495. options.children // new children
  6496. );
  6497. },
  6498. insert: function insert (vnode) {
  6499. var context = vnode.context;
  6500. var componentInstance = vnode.componentInstance;
  6501. if (!componentInstance._isMounted) {
  6502. callHook(componentInstance, 'onServiceCreated');
  6503. callHook(componentInstance, 'onServiceAttached');
  6504. componentInstance._isMounted = true;
  6505. callHook(componentInstance, 'mounted');
  6506. }
  6507. if (vnode.data.keepAlive) {
  6508. if (context._isMounted) {
  6509. // vue-router#1212
  6510. // During updates, a kept-alive component's child components may
  6511. // change, so directly walking the tree here may call activated hooks
  6512. // on incorrect children. Instead we push them into a queue which will
  6513. // be processed after the whole patch process ended.
  6514. queueActivatedComponent(componentInstance);
  6515. } else {
  6516. activateChildComponent(componentInstance, true /* direct */);
  6517. }
  6518. }
  6519. },
  6520. destroy: function destroy (vnode) {
  6521. var componentInstance = vnode.componentInstance;
  6522. if (!componentInstance._isDestroyed) {
  6523. if (!vnode.data.keepAlive) {
  6524. componentInstance.$destroy();
  6525. } else {
  6526. deactivateChildComponent(componentInstance, true /* direct */);
  6527. }
  6528. }
  6529. }
  6530. };
  6531. var hooksToMerge = Object.keys(componentVNodeHooks);
  6532. function createComponent (
  6533. Ctor,
  6534. data,
  6535. context,
  6536. children,
  6537. tag
  6538. ) {
  6539. if (isUndef(Ctor)) {
  6540. return
  6541. }
  6542. var baseCtor = context.$options._base;
  6543. // plain options object: turn it into a constructor
  6544. if (isObject(Ctor)) {
  6545. Ctor = baseCtor.extend(Ctor);
  6546. }
  6547. // if at this stage it's not a constructor or an async component factory,
  6548. // reject.
  6549. if (typeof Ctor !== 'function') {
  6550. if (true) {
  6551. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6552. }
  6553. return
  6554. }
  6555. // async component
  6556. var asyncFactory;
  6557. if (isUndef(Ctor.cid)) {
  6558. asyncFactory = Ctor;
  6559. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6560. if (Ctor === undefined) {
  6561. // return a placeholder node for async component, which is rendered
  6562. // as a comment node but preserves all the raw information for the node.
  6563. // the information will be used for async server-rendering and hydration.
  6564. return createAsyncPlaceholder(
  6565. asyncFactory,
  6566. data,
  6567. context,
  6568. children,
  6569. tag
  6570. )
  6571. }
  6572. }
  6573. data = data || {};
  6574. // resolve constructor options in case global mixins are applied after
  6575. // component constructor creation
  6576. resolveConstructorOptions(Ctor);
  6577. // transform component v-model data into props & events
  6578. if (isDef(data.model)) {
  6579. transformModel(Ctor.options, data);
  6580. }
  6581. // extract props
  6582. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6583. // functional component
  6584. if (isTrue(Ctor.options.functional)) {
  6585. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6586. }
  6587. // extract listeners, since these needs to be treated as
  6588. // child component listeners instead of DOM listeners
  6589. var listeners = data.on;
  6590. // replace with listeners with .native modifier
  6591. // so it gets processed during parent component patch.
  6592. data.on = data.nativeOn;
  6593. if (isTrue(Ctor.options.abstract)) {
  6594. // abstract components do not keep anything
  6595. // other than props & listeners & slot
  6596. // work around flow
  6597. var slot = data.slot;
  6598. data = {};
  6599. if (slot) {
  6600. data.slot = slot;
  6601. }
  6602. }
  6603. // install component management hooks onto the placeholder node
  6604. installComponentHooks(data);
  6605. // return a placeholder vnode
  6606. var name = Ctor.options.name || tag;
  6607. var vnode = new VNode(
  6608. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6609. data, undefined, undefined, undefined, context,
  6610. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6611. asyncFactory
  6612. );
  6613. return vnode
  6614. }
  6615. function createComponentInstanceForVnode (
  6616. vnode, // we know it's MountedComponentVNode but flow doesn't
  6617. parent // activeInstance in lifecycle state
  6618. ) {
  6619. var options = {
  6620. _isComponent: true,
  6621. _parentVnode: vnode,
  6622. parent: parent
  6623. };
  6624. // check inline-template render functions
  6625. var inlineTemplate = vnode.data.inlineTemplate;
  6626. if (isDef(inlineTemplate)) {
  6627. options.render = inlineTemplate.render;
  6628. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6629. }
  6630. return new vnode.componentOptions.Ctor(options)
  6631. }
  6632. function installComponentHooks (data) {
  6633. var hooks = data.hook || (data.hook = {});
  6634. for (var i = 0; i < hooksToMerge.length; i++) {
  6635. var key = hooksToMerge[i];
  6636. var existing = hooks[key];
  6637. var toMerge = componentVNodeHooks[key];
  6638. if (existing !== toMerge && !(existing && existing._merged)) {
  6639. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6640. }
  6641. }
  6642. }
  6643. function mergeHook$1 (f1, f2) {
  6644. var merged = function (a, b) {
  6645. // flow complains about extra args which is why we use any
  6646. f1(a, b);
  6647. f2(a, b);
  6648. };
  6649. merged._merged = true;
  6650. return merged
  6651. }
  6652. // transform component v-model info (value and callback) into
  6653. // prop and event handler respectively.
  6654. function transformModel (options, data) {
  6655. var prop = (options.model && options.model.prop) || 'value';
  6656. var event = (options.model && options.model.event) || 'input'
  6657. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6658. var on = data.on || (data.on = {});
  6659. var existing = on[event];
  6660. var callback = data.model.callback;
  6661. if (isDef(existing)) {
  6662. if (
  6663. Array.isArray(existing)
  6664. ? existing.indexOf(callback) === -1
  6665. : existing !== callback
  6666. ) {
  6667. on[event] = [callback].concat(existing);
  6668. }
  6669. } else {
  6670. on[event] = callback;
  6671. }
  6672. }
  6673. /* */
  6674. var SIMPLE_NORMALIZE = 1;
  6675. var ALWAYS_NORMALIZE = 2;
  6676. // wrapper function for providing a more flexible interface
  6677. // without getting yelled at by flow
  6678. function createElement (
  6679. context,
  6680. tag,
  6681. data,
  6682. children,
  6683. normalizationType,
  6684. alwaysNormalize
  6685. ) {
  6686. if (Array.isArray(data) || isPrimitive(data)) {
  6687. normalizationType = children;
  6688. children = data;
  6689. data = undefined;
  6690. }
  6691. if (isTrue(alwaysNormalize)) {
  6692. normalizationType = ALWAYS_NORMALIZE;
  6693. }
  6694. return _createElement(context, tag, data, children, normalizationType)
  6695. }
  6696. function _createElement (
  6697. context,
  6698. tag,
  6699. data,
  6700. children,
  6701. normalizationType
  6702. ) {
  6703. if (isDef(data) && isDef((data).__ob__)) {
  6704. true && warn(
  6705. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6706. 'Always create fresh vnode data objects in each render!',
  6707. context
  6708. );
  6709. return createEmptyVNode()
  6710. }
  6711. // object syntax in v-bind
  6712. if (isDef(data) && isDef(data.is)) {
  6713. tag = data.is;
  6714. }
  6715. if (!tag) {
  6716. // in case of component :is set to falsy value
  6717. return createEmptyVNode()
  6718. }
  6719. // warn against non-primitive key
  6720. if ( true &&
  6721. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6722. ) {
  6723. {
  6724. warn(
  6725. 'Avoid using non-primitive value as key, ' +
  6726. 'use string/number value instead.',
  6727. context
  6728. );
  6729. }
  6730. }
  6731. // support single function children as default scoped slot
  6732. if (Array.isArray(children) &&
  6733. typeof children[0] === 'function'
  6734. ) {
  6735. data = data || {};
  6736. data.scopedSlots = { default: children[0] };
  6737. children.length = 0;
  6738. }
  6739. if (normalizationType === ALWAYS_NORMALIZE) {
  6740. children = normalizeChildren(children);
  6741. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6742. children = simpleNormalizeChildren(children);
  6743. }
  6744. var vnode, ns;
  6745. if (typeof tag === 'string') {
  6746. var Ctor;
  6747. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6748. if (config.isReservedTag(tag)) {
  6749. // platform built-in elements
  6750. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6751. warn(
  6752. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6753. context
  6754. );
  6755. }
  6756. vnode = new VNode(
  6757. config.parsePlatformTagName(tag), data, children,
  6758. undefined, undefined, context
  6759. );
  6760. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6761. // component
  6762. vnode = createComponent(Ctor, data, context, children, tag);
  6763. } else {
  6764. // unknown or unlisted namespaced elements
  6765. // check at runtime because it may get assigned a namespace when its
  6766. // parent normalizes children
  6767. vnode = new VNode(
  6768. tag, data, children,
  6769. undefined, undefined, context
  6770. );
  6771. }
  6772. } else {
  6773. // direct component options / constructor
  6774. vnode = createComponent(tag, data, context, children);
  6775. }
  6776. if (Array.isArray(vnode)) {
  6777. return vnode
  6778. } else if (isDef(vnode)) {
  6779. if (isDef(ns)) { applyNS(vnode, ns); }
  6780. if (isDef(data)) { registerDeepBindings(data); }
  6781. return vnode
  6782. } else {
  6783. return createEmptyVNode()
  6784. }
  6785. }
  6786. function applyNS (vnode, ns, force) {
  6787. vnode.ns = ns;
  6788. if (vnode.tag === 'foreignObject') {
  6789. // use default namespace inside foreignObject
  6790. ns = undefined;
  6791. force = true;
  6792. }
  6793. if (isDef(vnode.children)) {
  6794. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6795. var child = vnode.children[i];
  6796. if (isDef(child.tag) && (
  6797. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6798. applyNS(child, ns, force);
  6799. }
  6800. }
  6801. }
  6802. }
  6803. // ref #5318
  6804. // necessary to ensure parent re-render when deep bindings like :style and
  6805. // :class are used on slot nodes
  6806. function registerDeepBindings (data) {
  6807. if (isObject(data.style)) {
  6808. traverse(data.style);
  6809. }
  6810. if (isObject(data.class)) {
  6811. traverse(data.class);
  6812. }
  6813. }
  6814. /* */
  6815. function initRender (vm) {
  6816. vm._vnode = null; // the root of the child tree
  6817. vm._staticTrees = null; // v-once cached trees
  6818. var options = vm.$options;
  6819. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6820. var renderContext = parentVnode && parentVnode.context;
  6821. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6822. vm.$scopedSlots = emptyObject;
  6823. // bind the createElement fn to this instance
  6824. // so that we get proper render context inside it.
  6825. // args order: tag, data, children, normalizationType, alwaysNormalize
  6826. // internal version is used by render functions compiled from templates
  6827. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6828. // normalization is always applied for the public version, used in
  6829. // user-written render functions.
  6830. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6831. // $attrs & $listeners are exposed for easier HOC creation.
  6832. // they need to be reactive so that HOCs using them are always updated
  6833. var parentData = parentVnode && parentVnode.data;
  6834. /* istanbul ignore else */
  6835. if (true) {
  6836. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6837. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6838. }, true);
  6839. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6840. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6841. }, true);
  6842. } else {}
  6843. }
  6844. var currentRenderingInstance = null;
  6845. function renderMixin (Vue) {
  6846. // install runtime convenience helpers
  6847. installRenderHelpers(Vue.prototype);
  6848. Vue.prototype.$nextTick = function (fn) {
  6849. return nextTick(fn, this)
  6850. };
  6851. Vue.prototype._render = function () {
  6852. var vm = this;
  6853. var ref = vm.$options;
  6854. var render = ref.render;
  6855. var _parentVnode = ref._parentVnode;
  6856. if (_parentVnode) {
  6857. vm.$scopedSlots = normalizeScopedSlots(
  6858. _parentVnode.data.scopedSlots,
  6859. vm.$slots,
  6860. vm.$scopedSlots
  6861. );
  6862. }
  6863. // set parent vnode. this allows render functions to have access
  6864. // to the data on the placeholder node.
  6865. vm.$vnode = _parentVnode;
  6866. // render self
  6867. var vnode;
  6868. try {
  6869. // There's no need to maintain a stack because all render fns are called
  6870. // separately from one another. Nested component's render fns are called
  6871. // when parent component is patched.
  6872. currentRenderingInstance = vm;
  6873. vnode = render.call(vm._renderProxy, vm.$createElement);
  6874. } catch (e) {
  6875. handleError(e, vm, "render");
  6876. // return error render result,
  6877. // or previous vnode to prevent render error causing blank component
  6878. /* istanbul ignore else */
  6879. if ( true && vm.$options.renderError) {
  6880. try {
  6881. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6882. } catch (e) {
  6883. handleError(e, vm, "renderError");
  6884. vnode = vm._vnode;
  6885. }
  6886. } else {
  6887. vnode = vm._vnode;
  6888. }
  6889. } finally {
  6890. currentRenderingInstance = null;
  6891. }
  6892. // if the returned array contains only a single node, allow it
  6893. if (Array.isArray(vnode) && vnode.length === 1) {
  6894. vnode = vnode[0];
  6895. }
  6896. // return empty vnode in case the render function errored out
  6897. if (!(vnode instanceof VNode)) {
  6898. if ( true && Array.isArray(vnode)) {
  6899. warn(
  6900. 'Multiple root nodes returned from render function. Render function ' +
  6901. 'should return a single root node.',
  6902. vm
  6903. );
  6904. }
  6905. vnode = createEmptyVNode();
  6906. }
  6907. // set parent
  6908. vnode.parent = _parentVnode;
  6909. return vnode
  6910. };
  6911. }
  6912. /* */
  6913. function ensureCtor (comp, base) {
  6914. if (
  6915. comp.__esModule ||
  6916. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6917. ) {
  6918. comp = comp.default;
  6919. }
  6920. return isObject(comp)
  6921. ? base.extend(comp)
  6922. : comp
  6923. }
  6924. function createAsyncPlaceholder (
  6925. factory,
  6926. data,
  6927. context,
  6928. children,
  6929. tag
  6930. ) {
  6931. var node = createEmptyVNode();
  6932. node.asyncFactory = factory;
  6933. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6934. return node
  6935. }
  6936. function resolveAsyncComponent (
  6937. factory,
  6938. baseCtor
  6939. ) {
  6940. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6941. return factory.errorComp
  6942. }
  6943. if (isDef(factory.resolved)) {
  6944. return factory.resolved
  6945. }
  6946. var owner = currentRenderingInstance;
  6947. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6948. // already pending
  6949. factory.owners.push(owner);
  6950. }
  6951. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6952. return factory.loadingComp
  6953. }
  6954. if (owner && !isDef(factory.owners)) {
  6955. var owners = factory.owners = [owner];
  6956. var sync = true;
  6957. var timerLoading = null;
  6958. var timerTimeout = null
  6959. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6960. var forceRender = function (renderCompleted) {
  6961. for (var i = 0, l = owners.length; i < l; i++) {
  6962. (owners[i]).$forceUpdate();
  6963. }
  6964. if (renderCompleted) {
  6965. owners.length = 0;
  6966. if (timerLoading !== null) {
  6967. clearTimeout(timerLoading);
  6968. timerLoading = null;
  6969. }
  6970. if (timerTimeout !== null) {
  6971. clearTimeout(timerTimeout);
  6972. timerTimeout = null;
  6973. }
  6974. }
  6975. };
  6976. var resolve = once(function (res) {
  6977. // cache resolved
  6978. factory.resolved = ensureCtor(res, baseCtor);
  6979. // invoke callbacks only if this is not a synchronous resolve
  6980. // (async resolves are shimmed as synchronous during SSR)
  6981. if (!sync) {
  6982. forceRender(true);
  6983. } else {
  6984. owners.length = 0;
  6985. }
  6986. });
  6987. var reject = once(function (reason) {
  6988. true && warn(
  6989. "Failed to resolve async component: " + (String(factory)) +
  6990. (reason ? ("\nReason: " + reason) : '')
  6991. );
  6992. if (isDef(factory.errorComp)) {
  6993. factory.error = true;
  6994. forceRender(true);
  6995. }
  6996. });
  6997. var res = factory(resolve, reject);
  6998. if (isObject(res)) {
  6999. if (isPromise(res)) {
  7000. // () => Promise
  7001. if (isUndef(factory.resolved)) {
  7002. res.then(resolve, reject);
  7003. }
  7004. } else if (isPromise(res.component)) {
  7005. res.component.then(resolve, reject);
  7006. if (isDef(res.error)) {
  7007. factory.errorComp = ensureCtor(res.error, baseCtor);
  7008. }
  7009. if (isDef(res.loading)) {
  7010. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7011. if (res.delay === 0) {
  7012. factory.loading = true;
  7013. } else {
  7014. timerLoading = setTimeout(function () {
  7015. timerLoading = null;
  7016. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7017. factory.loading = true;
  7018. forceRender(false);
  7019. }
  7020. }, res.delay || 200);
  7021. }
  7022. }
  7023. if (isDef(res.timeout)) {
  7024. timerTimeout = setTimeout(function () {
  7025. timerTimeout = null;
  7026. if (isUndef(factory.resolved)) {
  7027. reject(
  7028. true
  7029. ? ("timeout (" + (res.timeout) + "ms)")
  7030. : undefined
  7031. );
  7032. }
  7033. }, res.timeout);
  7034. }
  7035. }
  7036. }
  7037. sync = false;
  7038. // return in case resolved synchronously
  7039. return factory.loading
  7040. ? factory.loadingComp
  7041. : factory.resolved
  7042. }
  7043. }
  7044. /* */
  7045. function isAsyncPlaceholder (node) {
  7046. return node.isComment && node.asyncFactory
  7047. }
  7048. /* */
  7049. function getFirstComponentChild (children) {
  7050. if (Array.isArray(children)) {
  7051. for (var i = 0; i < children.length; i++) {
  7052. var c = children[i];
  7053. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7054. return c
  7055. }
  7056. }
  7057. }
  7058. }
  7059. /* */
  7060. /* */
  7061. function initEvents (vm) {
  7062. vm._events = Object.create(null);
  7063. vm._hasHookEvent = false;
  7064. // init parent attached events
  7065. var listeners = vm.$options._parentListeners;
  7066. if (listeners) {
  7067. updateComponentListeners(vm, listeners);
  7068. }
  7069. }
  7070. var target;
  7071. function add (event, fn) {
  7072. target.$on(event, fn);
  7073. }
  7074. function remove$1 (event, fn) {
  7075. target.$off(event, fn);
  7076. }
  7077. function createOnceHandler (event, fn) {
  7078. var _target = target;
  7079. return function onceHandler () {
  7080. var res = fn.apply(null, arguments);
  7081. if (res !== null) {
  7082. _target.$off(event, onceHandler);
  7083. }
  7084. }
  7085. }
  7086. function updateComponentListeners (
  7087. vm,
  7088. listeners,
  7089. oldListeners
  7090. ) {
  7091. target = vm;
  7092. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7093. target = undefined;
  7094. }
  7095. function eventsMixin (Vue) {
  7096. var hookRE = /^hook:/;
  7097. Vue.prototype.$on = function (event, fn) {
  7098. var vm = this;
  7099. if (Array.isArray(event)) {
  7100. for (var i = 0, l = event.length; i < l; i++) {
  7101. vm.$on(event[i], fn);
  7102. }
  7103. } else {
  7104. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7105. // optimize hook:event cost by using a boolean flag marked at registration
  7106. // instead of a hash lookup
  7107. if (hookRE.test(event)) {
  7108. vm._hasHookEvent = true;
  7109. }
  7110. }
  7111. return vm
  7112. };
  7113. Vue.prototype.$once = function (event, fn) {
  7114. var vm = this;
  7115. function on () {
  7116. vm.$off(event, on);
  7117. fn.apply(vm, arguments);
  7118. }
  7119. on.fn = fn;
  7120. vm.$on(event, on);
  7121. return vm
  7122. };
  7123. Vue.prototype.$off = function (event, fn) {
  7124. var vm = this;
  7125. // all
  7126. if (!arguments.length) {
  7127. vm._events = Object.create(null);
  7128. return vm
  7129. }
  7130. // array of events
  7131. if (Array.isArray(event)) {
  7132. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7133. vm.$off(event[i$1], fn);
  7134. }
  7135. return vm
  7136. }
  7137. // specific event
  7138. var cbs = vm._events[event];
  7139. if (!cbs) {
  7140. return vm
  7141. }
  7142. if (!fn) {
  7143. vm._events[event] = null;
  7144. return vm
  7145. }
  7146. // specific handler
  7147. var cb;
  7148. var i = cbs.length;
  7149. while (i--) {
  7150. cb = cbs[i];
  7151. if (cb === fn || cb.fn === fn) {
  7152. cbs.splice(i, 1);
  7153. break
  7154. }
  7155. }
  7156. return vm
  7157. };
  7158. Vue.prototype.$emit = function (event) {
  7159. var vm = this;
  7160. if (true) {
  7161. var lowerCaseEvent = event.toLowerCase();
  7162. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7163. tip(
  7164. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7165. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7166. "Note that HTML attributes are case-insensitive and you cannot use " +
  7167. "v-on to listen to camelCase events when using in-DOM templates. " +
  7168. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7169. );
  7170. }
  7171. }
  7172. var cbs = vm._events[event];
  7173. if (cbs) {
  7174. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7175. var args = toArray(arguments, 1);
  7176. var info = "event handler for \"" + event + "\"";
  7177. for (var i = 0, l = cbs.length; i < l; i++) {
  7178. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7179. }
  7180. }
  7181. return vm
  7182. };
  7183. }
  7184. /* */
  7185. var activeInstance = null;
  7186. var isUpdatingChildComponent = false;
  7187. function setActiveInstance(vm) {
  7188. var prevActiveInstance = activeInstance;
  7189. activeInstance = vm;
  7190. return function () {
  7191. activeInstance = prevActiveInstance;
  7192. }
  7193. }
  7194. function initLifecycle (vm) {
  7195. var options = vm.$options;
  7196. // locate first non-abstract parent
  7197. var parent = options.parent;
  7198. if (parent && !options.abstract) {
  7199. while (parent.$options.abstract && parent.$parent) {
  7200. parent = parent.$parent;
  7201. }
  7202. parent.$children.push(vm);
  7203. }
  7204. vm.$parent = parent;
  7205. vm.$root = parent ? parent.$root : vm;
  7206. vm.$children = [];
  7207. vm.$refs = {};
  7208. vm._watcher = null;
  7209. vm._inactive = null;
  7210. vm._directInactive = false;
  7211. vm._isMounted = false;
  7212. vm._isDestroyed = false;
  7213. vm._isBeingDestroyed = false;
  7214. }
  7215. function lifecycleMixin (Vue) {
  7216. Vue.prototype._update = function (vnode, hydrating) {
  7217. var vm = this;
  7218. var prevEl = vm.$el;
  7219. var prevVnode = vm._vnode;
  7220. var restoreActiveInstance = setActiveInstance(vm);
  7221. vm._vnode = vnode;
  7222. // Vue.prototype.__patch__ is injected in entry points
  7223. // based on the rendering backend used.
  7224. if (!prevVnode) {
  7225. // initial render
  7226. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7227. } else {
  7228. // updates
  7229. vm.$el = vm.__patch__(prevVnode, vnode);
  7230. }
  7231. restoreActiveInstance();
  7232. // update __vue__ reference
  7233. if (prevEl) {
  7234. prevEl.__vue__ = null;
  7235. }
  7236. if (vm.$el) {
  7237. vm.$el.__vue__ = vm;
  7238. }
  7239. // if parent is an HOC, update its $el as well
  7240. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7241. vm.$parent.$el = vm.$el;
  7242. }
  7243. // updated hook is called by the scheduler to ensure that children are
  7244. // updated in a parent's updated hook.
  7245. };
  7246. Vue.prototype.$forceUpdate = function () {
  7247. var vm = this;
  7248. if (vm._watcher) {
  7249. vm._watcher.update();
  7250. }
  7251. };
  7252. Vue.prototype.$destroy = function () {
  7253. var vm = this;
  7254. if (vm._isBeingDestroyed) {
  7255. return
  7256. }
  7257. callHook(vm, 'beforeDestroy');
  7258. vm._isBeingDestroyed = true;
  7259. // remove self from parent
  7260. var parent = vm.$parent;
  7261. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7262. remove(parent.$children, vm);
  7263. }
  7264. // teardown watchers
  7265. if (vm._watcher) {
  7266. vm._watcher.teardown();
  7267. }
  7268. var i = vm._watchers.length;
  7269. while (i--) {
  7270. vm._watchers[i].teardown();
  7271. }
  7272. // remove reference from data ob
  7273. // frozen object may not have observer.
  7274. if (vm._data.__ob__) {
  7275. vm._data.__ob__.vmCount--;
  7276. }
  7277. // call the last hook...
  7278. vm._isDestroyed = true;
  7279. // invoke destroy hooks on current rendered tree
  7280. vm.__patch__(vm._vnode, null);
  7281. // fire destroyed hook
  7282. callHook(vm, 'destroyed');
  7283. // turn off all instance listeners.
  7284. vm.$off();
  7285. // remove __vue__ reference
  7286. if (vm.$el) {
  7287. vm.$el.__vue__ = null;
  7288. }
  7289. // release circular reference (#6759)
  7290. if (vm.$vnode) {
  7291. vm.$vnode.parent = null;
  7292. }
  7293. };
  7294. }
  7295. function updateChildComponent (
  7296. vm,
  7297. propsData,
  7298. listeners,
  7299. parentVnode,
  7300. renderChildren
  7301. ) {
  7302. if (true) {
  7303. isUpdatingChildComponent = true;
  7304. }
  7305. // determine whether component has slot children
  7306. // we need to do this before overwriting $options._renderChildren.
  7307. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7308. // dynamic slot names). Static scoped slots compiled from template has the
  7309. // "$stable" marker.
  7310. var newScopedSlots = parentVnode.data.scopedSlots;
  7311. var oldScopedSlots = vm.$scopedSlots;
  7312. var hasDynamicScopedSlot = !!(
  7313. (newScopedSlots && !newScopedSlots.$stable) ||
  7314. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7315. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7316. );
  7317. // Any static slot children from the parent may have changed during parent's
  7318. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7319. // update is necessary to ensure correctness.
  7320. var needsForceUpdate = !!(
  7321. renderChildren || // has new static slots
  7322. vm.$options._renderChildren || // has old static slots
  7323. hasDynamicScopedSlot
  7324. );
  7325. vm.$options._parentVnode = parentVnode;
  7326. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7327. if (vm._vnode) { // update child tree's parent
  7328. vm._vnode.parent = parentVnode;
  7329. }
  7330. vm.$options._renderChildren = renderChildren;
  7331. // update $attrs and $listeners hash
  7332. // these are also reactive so they may trigger child update if the child
  7333. // used them during render
  7334. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7335. vm.$listeners = listeners || emptyObject;
  7336. // update props
  7337. if (propsData && vm.$options.props) {
  7338. toggleObserving(false);
  7339. var props = vm._props;
  7340. var propKeys = vm.$options._propKeys || [];
  7341. for (var i = 0; i < propKeys.length; i++) {
  7342. var key = propKeys[i];
  7343. var propOptions = vm.$options.props; // wtf flow?
  7344. props[key] = validateProp(key, propOptions, propsData, vm);
  7345. }
  7346. toggleObserving(true);
  7347. // keep a copy of raw propsData
  7348. vm.$options.propsData = propsData;
  7349. }
  7350. // fixed by xxxxxx update properties(mp runtime)
  7351. vm._$updateProperties && vm._$updateProperties(vm);
  7352. // update listeners
  7353. listeners = listeners || emptyObject;
  7354. var oldListeners = vm.$options._parentListeners;
  7355. vm.$options._parentListeners = listeners;
  7356. updateComponentListeners(vm, listeners, oldListeners);
  7357. // resolve slots + force update if has children
  7358. if (needsForceUpdate) {
  7359. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7360. vm.$forceUpdate();
  7361. }
  7362. if (true) {
  7363. isUpdatingChildComponent = false;
  7364. }
  7365. }
  7366. function isInInactiveTree (vm) {
  7367. while (vm && (vm = vm.$parent)) {
  7368. if (vm._inactive) { return true }
  7369. }
  7370. return false
  7371. }
  7372. function activateChildComponent (vm, direct) {
  7373. if (direct) {
  7374. vm._directInactive = false;
  7375. if (isInInactiveTree(vm)) {
  7376. return
  7377. }
  7378. } else if (vm._directInactive) {
  7379. return
  7380. }
  7381. if (vm._inactive || vm._inactive === null) {
  7382. vm._inactive = false;
  7383. for (var i = 0; i < vm.$children.length; i++) {
  7384. activateChildComponent(vm.$children[i]);
  7385. }
  7386. callHook(vm, 'activated');
  7387. }
  7388. }
  7389. function deactivateChildComponent (vm, direct) {
  7390. if (direct) {
  7391. vm._directInactive = true;
  7392. if (isInInactiveTree(vm)) {
  7393. return
  7394. }
  7395. }
  7396. if (!vm._inactive) {
  7397. vm._inactive = true;
  7398. for (var i = 0; i < vm.$children.length; i++) {
  7399. deactivateChildComponent(vm.$children[i]);
  7400. }
  7401. callHook(vm, 'deactivated');
  7402. }
  7403. }
  7404. function callHook (vm, hook) {
  7405. // #7573 disable dep collection when invoking lifecycle hooks
  7406. pushTarget();
  7407. var handlers = vm.$options[hook];
  7408. var info = hook + " hook";
  7409. if (handlers) {
  7410. for (var i = 0, j = handlers.length; i < j; i++) {
  7411. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7412. }
  7413. }
  7414. if (vm._hasHookEvent) {
  7415. vm.$emit('hook:' + hook);
  7416. }
  7417. popTarget();
  7418. }
  7419. /* */
  7420. var MAX_UPDATE_COUNT = 100;
  7421. var queue = [];
  7422. var activatedChildren = [];
  7423. var has = {};
  7424. var circular = {};
  7425. var waiting = false;
  7426. var flushing = false;
  7427. var index = 0;
  7428. /**
  7429. * Reset the scheduler's state.
  7430. */
  7431. function resetSchedulerState () {
  7432. index = queue.length = activatedChildren.length = 0;
  7433. has = {};
  7434. if (true) {
  7435. circular = {};
  7436. }
  7437. waiting = flushing = false;
  7438. }
  7439. // Async edge case #6566 requires saving the timestamp when event listeners are
  7440. // attached. However, calling performance.now() has a perf overhead especially
  7441. // if the page has thousands of event listeners. Instead, we take a timestamp
  7442. // every time the scheduler flushes and use that for all event listeners
  7443. // attached during that flush.
  7444. var currentFlushTimestamp = 0;
  7445. // Async edge case fix requires storing an event listener's attach timestamp.
  7446. var getNow = Date.now;
  7447. // Determine what event timestamp the browser is using. Annoyingly, the
  7448. // timestamp can either be hi-res (relative to page load) or low-res
  7449. // (relative to UNIX epoch), so in order to compare time we have to use the
  7450. // same timestamp type when saving the flush timestamp.
  7451. // All IE versions use low-res event timestamps, and have problematic clock
  7452. // implementations (#9632)
  7453. if (inBrowser && !isIE) {
  7454. var performance = window.performance;
  7455. if (
  7456. performance &&
  7457. typeof performance.now === 'function' &&
  7458. getNow() > document.createEvent('Event').timeStamp
  7459. ) {
  7460. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7461. // smaller than it, it means the event is using a hi-res timestamp,
  7462. // and we need to use the hi-res version for event listener timestamps as
  7463. // well.
  7464. getNow = function () { return performance.now(); };
  7465. }
  7466. }
  7467. /**
  7468. * Flush both queues and run the watchers.
  7469. */
  7470. function flushSchedulerQueue () {
  7471. currentFlushTimestamp = getNow();
  7472. flushing = true;
  7473. var watcher, id;
  7474. // Sort queue before flush.
  7475. // This ensures that:
  7476. // 1. Components are updated from parent to child. (because parent is always
  7477. // created before the child)
  7478. // 2. A component's user watchers are run before its render watcher (because
  7479. // user watchers are created before the render watcher)
  7480. // 3. If a component is destroyed during a parent component's watcher run,
  7481. // its watchers can be skipped.
  7482. queue.sort(function (a, b) { return a.id - b.id; });
  7483. // do not cache length because more watchers might be pushed
  7484. // as we run existing watchers
  7485. for (index = 0; index < queue.length; index++) {
  7486. watcher = queue[index];
  7487. if (watcher.before) {
  7488. watcher.before();
  7489. }
  7490. id = watcher.id;
  7491. has[id] = null;
  7492. watcher.run();
  7493. // in dev build, check and stop circular updates.
  7494. if ( true && has[id] != null) {
  7495. circular[id] = (circular[id] || 0) + 1;
  7496. if (circular[id] > MAX_UPDATE_COUNT) {
  7497. warn(
  7498. 'You may have an infinite update loop ' + (
  7499. watcher.user
  7500. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7501. : "in a component render function."
  7502. ),
  7503. watcher.vm
  7504. );
  7505. break
  7506. }
  7507. }
  7508. }
  7509. // keep copies of post queues before resetting state
  7510. var activatedQueue = activatedChildren.slice();
  7511. var updatedQueue = queue.slice();
  7512. resetSchedulerState();
  7513. // call component updated and activated hooks
  7514. callActivatedHooks(activatedQueue);
  7515. callUpdatedHooks(updatedQueue);
  7516. // devtool hook
  7517. /* istanbul ignore if */
  7518. if (devtools && config.devtools) {
  7519. devtools.emit('flush');
  7520. }
  7521. }
  7522. function callUpdatedHooks (queue) {
  7523. var i = queue.length;
  7524. while (i--) {
  7525. var watcher = queue[i];
  7526. var vm = watcher.vm;
  7527. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7528. callHook(vm, 'updated');
  7529. }
  7530. }
  7531. }
  7532. /**
  7533. * Queue a kept-alive component that was activated during patch.
  7534. * The queue will be processed after the entire tree has been patched.
  7535. */
  7536. function queueActivatedComponent (vm) {
  7537. // setting _inactive to false here so that a render function can
  7538. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7539. vm._inactive = false;
  7540. activatedChildren.push(vm);
  7541. }
  7542. function callActivatedHooks (queue) {
  7543. for (var i = 0; i < queue.length; i++) {
  7544. queue[i]._inactive = true;
  7545. activateChildComponent(queue[i], true /* true */);
  7546. }
  7547. }
  7548. /**
  7549. * Push a watcher into the watcher queue.
  7550. * Jobs with duplicate IDs will be skipped unless it's
  7551. * pushed when the queue is being flushed.
  7552. */
  7553. function queueWatcher (watcher) {
  7554. var id = watcher.id;
  7555. if (has[id] == null) {
  7556. has[id] = true;
  7557. if (!flushing) {
  7558. queue.push(watcher);
  7559. } else {
  7560. // if already flushing, splice the watcher based on its id
  7561. // if already past its id, it will be run next immediately.
  7562. var i = queue.length - 1;
  7563. while (i > index && queue[i].id > watcher.id) {
  7564. i--;
  7565. }
  7566. queue.splice(i + 1, 0, watcher);
  7567. }
  7568. // queue the flush
  7569. if (!waiting) {
  7570. waiting = true;
  7571. if ( true && !config.async) {
  7572. flushSchedulerQueue();
  7573. return
  7574. }
  7575. nextTick(flushSchedulerQueue);
  7576. }
  7577. }
  7578. }
  7579. /* */
  7580. var uid$2 = 0;
  7581. /**
  7582. * A watcher parses an expression, collects dependencies,
  7583. * and fires callback when the expression value changes.
  7584. * This is used for both the $watch() api and directives.
  7585. */
  7586. var Watcher = function Watcher (
  7587. vm,
  7588. expOrFn,
  7589. cb,
  7590. options,
  7591. isRenderWatcher
  7592. ) {
  7593. this.vm = vm;
  7594. if (isRenderWatcher) {
  7595. vm._watcher = this;
  7596. }
  7597. vm._watchers.push(this);
  7598. // options
  7599. if (options) {
  7600. this.deep = !!options.deep;
  7601. this.user = !!options.user;
  7602. this.lazy = !!options.lazy;
  7603. this.sync = !!options.sync;
  7604. this.before = options.before;
  7605. } else {
  7606. this.deep = this.user = this.lazy = this.sync = false;
  7607. }
  7608. this.cb = cb;
  7609. this.id = ++uid$2; // uid for batching
  7610. this.active = true;
  7611. this.dirty = this.lazy; // for lazy watchers
  7612. this.deps = [];
  7613. this.newDeps = [];
  7614. this.depIds = new _Set();
  7615. this.newDepIds = new _Set();
  7616. this.expression = true
  7617. ? expOrFn.toString()
  7618. : undefined;
  7619. // parse expression for getter
  7620. if (typeof expOrFn === 'function') {
  7621. this.getter = expOrFn;
  7622. } else {
  7623. this.getter = parsePath(expOrFn);
  7624. if (!this.getter) {
  7625. this.getter = noop;
  7626. true && warn(
  7627. "Failed watching path: \"" + expOrFn + "\" " +
  7628. 'Watcher only accepts simple dot-delimited paths. ' +
  7629. 'For full control, use a function instead.',
  7630. vm
  7631. );
  7632. }
  7633. }
  7634. this.value = this.lazy
  7635. ? undefined
  7636. : this.get();
  7637. };
  7638. /**
  7639. * Evaluate the getter, and re-collect dependencies.
  7640. */
  7641. Watcher.prototype.get = function get () {
  7642. pushTarget(this);
  7643. var value;
  7644. var vm = this.vm;
  7645. try {
  7646. value = this.getter.call(vm, vm);
  7647. } catch (e) {
  7648. if (this.user) {
  7649. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7650. } else {
  7651. throw e
  7652. }
  7653. } finally {
  7654. // "touch" every property so they are all tracked as
  7655. // dependencies for deep watching
  7656. if (this.deep) {
  7657. traverse(value);
  7658. }
  7659. popTarget();
  7660. this.cleanupDeps();
  7661. }
  7662. return value
  7663. };
  7664. /**
  7665. * Add a dependency to this directive.
  7666. */
  7667. Watcher.prototype.addDep = function addDep (dep) {
  7668. var id = dep.id;
  7669. if (!this.newDepIds.has(id)) {
  7670. this.newDepIds.add(id);
  7671. this.newDeps.push(dep);
  7672. if (!this.depIds.has(id)) {
  7673. dep.addSub(this);
  7674. }
  7675. }
  7676. };
  7677. /**
  7678. * Clean up for dependency collection.
  7679. */
  7680. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7681. var i = this.deps.length;
  7682. while (i--) {
  7683. var dep = this.deps[i];
  7684. if (!this.newDepIds.has(dep.id)) {
  7685. dep.removeSub(this);
  7686. }
  7687. }
  7688. var tmp = this.depIds;
  7689. this.depIds = this.newDepIds;
  7690. this.newDepIds = tmp;
  7691. this.newDepIds.clear();
  7692. tmp = this.deps;
  7693. this.deps = this.newDeps;
  7694. this.newDeps = tmp;
  7695. this.newDeps.length = 0;
  7696. };
  7697. /**
  7698. * Subscriber interface.
  7699. * Will be called when a dependency changes.
  7700. */
  7701. Watcher.prototype.update = function update () {
  7702. /* istanbul ignore else */
  7703. if (this.lazy) {
  7704. this.dirty = true;
  7705. } else if (this.sync) {
  7706. this.run();
  7707. } else {
  7708. queueWatcher(this);
  7709. }
  7710. };
  7711. /**
  7712. * Scheduler job interface.
  7713. * Will be called by the scheduler.
  7714. */
  7715. Watcher.prototype.run = function run () {
  7716. if (this.active) {
  7717. var value = this.get();
  7718. if (
  7719. value !== this.value ||
  7720. // Deep watchers and watchers on Object/Arrays should fire even
  7721. // when the value is the same, because the value may
  7722. // have mutated.
  7723. isObject(value) ||
  7724. this.deep
  7725. ) {
  7726. // set new value
  7727. var oldValue = this.value;
  7728. this.value = value;
  7729. if (this.user) {
  7730. try {
  7731. this.cb.call(this.vm, value, oldValue);
  7732. } catch (e) {
  7733. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7734. }
  7735. } else {
  7736. this.cb.call(this.vm, value, oldValue);
  7737. }
  7738. }
  7739. }
  7740. };
  7741. /**
  7742. * Evaluate the value of the watcher.
  7743. * This only gets called for lazy watchers.
  7744. */
  7745. Watcher.prototype.evaluate = function evaluate () {
  7746. this.value = this.get();
  7747. this.dirty = false;
  7748. };
  7749. /**
  7750. * Depend on all deps collected by this watcher.
  7751. */
  7752. Watcher.prototype.depend = function depend () {
  7753. var i = this.deps.length;
  7754. while (i--) {
  7755. this.deps[i].depend();
  7756. }
  7757. };
  7758. /**
  7759. * Remove self from all dependencies' subscriber list.
  7760. */
  7761. Watcher.prototype.teardown = function teardown () {
  7762. if (this.active) {
  7763. // remove self from vm's watcher list
  7764. // this is a somewhat expensive operation so we skip it
  7765. // if the vm is being destroyed.
  7766. if (!this.vm._isBeingDestroyed) {
  7767. remove(this.vm._watchers, this);
  7768. }
  7769. var i = this.deps.length;
  7770. while (i--) {
  7771. this.deps[i].removeSub(this);
  7772. }
  7773. this.active = false;
  7774. }
  7775. };
  7776. /* */
  7777. var sharedPropertyDefinition = {
  7778. enumerable: true,
  7779. configurable: true,
  7780. get: noop,
  7781. set: noop
  7782. };
  7783. function proxy (target, sourceKey, key) {
  7784. sharedPropertyDefinition.get = function proxyGetter () {
  7785. return this[sourceKey][key]
  7786. };
  7787. sharedPropertyDefinition.set = function proxySetter (val) {
  7788. this[sourceKey][key] = val;
  7789. };
  7790. Object.defineProperty(target, key, sharedPropertyDefinition);
  7791. }
  7792. function initState (vm) {
  7793. vm._watchers = [];
  7794. var opts = vm.$options;
  7795. if (opts.props) { initProps(vm, opts.props); }
  7796. if (opts.methods) { initMethods(vm, opts.methods); }
  7797. if (opts.data) {
  7798. initData(vm);
  7799. } else {
  7800. observe(vm._data = {}, true /* asRootData */);
  7801. }
  7802. if (opts.computed) { initComputed(vm, opts.computed); }
  7803. if (opts.watch && opts.watch !== nativeWatch) {
  7804. initWatch(vm, opts.watch);
  7805. }
  7806. }
  7807. function initProps (vm, propsOptions) {
  7808. var propsData = vm.$options.propsData || {};
  7809. var props = vm._props = {};
  7810. // cache prop keys so that future props updates can iterate using Array
  7811. // instead of dynamic object key enumeration.
  7812. var keys = vm.$options._propKeys = [];
  7813. var isRoot = !vm.$parent;
  7814. // root instance props should be converted
  7815. if (!isRoot) {
  7816. toggleObserving(false);
  7817. }
  7818. var loop = function ( key ) {
  7819. keys.push(key);
  7820. var value = validateProp(key, propsOptions, propsData, vm);
  7821. /* istanbul ignore else */
  7822. if (true) {
  7823. var hyphenatedKey = hyphenate(key);
  7824. if (isReservedAttribute(hyphenatedKey) ||
  7825. config.isReservedAttr(hyphenatedKey)) {
  7826. warn(
  7827. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7828. vm
  7829. );
  7830. }
  7831. defineReactive$$1(props, key, value, function () {
  7832. if (!isRoot && !isUpdatingChildComponent) {
  7833. {
  7834. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7835. return
  7836. }
  7837. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7838. if(
  7839. key === 'value' &&
  7840. Array.isArray(vm.$options.behaviors) &&
  7841. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7842. ){
  7843. return
  7844. }
  7845. if(vm._getFormData){
  7846. return
  7847. }
  7848. var $parent = vm.$parent;
  7849. while($parent){
  7850. if($parent.__next_tick_pending){
  7851. return
  7852. }
  7853. $parent = $parent.$parent;
  7854. }
  7855. }
  7856. warn(
  7857. "Avoid mutating a prop directly since the value will be " +
  7858. "overwritten whenever the parent component re-renders. " +
  7859. "Instead, use a data or computed property based on the prop's " +
  7860. "value. Prop being mutated: \"" + key + "\"",
  7861. vm
  7862. );
  7863. }
  7864. });
  7865. } else {}
  7866. // static props are already proxied on the component's prototype
  7867. // during Vue.extend(). We only need to proxy props defined at
  7868. // instantiation here.
  7869. if (!(key in vm)) {
  7870. proxy(vm, "_props", key);
  7871. }
  7872. };
  7873. for (var key in propsOptions) loop( key );
  7874. toggleObserving(true);
  7875. }
  7876. function initData (vm) {
  7877. var data = vm.$options.data;
  7878. data = vm._data = typeof data === 'function'
  7879. ? getData(data, vm)
  7880. : data || {};
  7881. if (!isPlainObject(data)) {
  7882. data = {};
  7883. true && warn(
  7884. 'data functions should return an object:\n' +
  7885. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7886. vm
  7887. );
  7888. }
  7889. // proxy data on instance
  7890. var keys = Object.keys(data);
  7891. var props = vm.$options.props;
  7892. var methods = vm.$options.methods;
  7893. var i = keys.length;
  7894. while (i--) {
  7895. var key = keys[i];
  7896. if (true) {
  7897. if (methods && hasOwn(methods, key)) {
  7898. warn(
  7899. ("Method \"" + key + "\" has already been defined as a data property."),
  7900. vm
  7901. );
  7902. }
  7903. }
  7904. if (props && hasOwn(props, key)) {
  7905. true && warn(
  7906. "The data property \"" + key + "\" is already declared as a prop. " +
  7907. "Use prop default value instead.",
  7908. vm
  7909. );
  7910. } else if (!isReserved(key)) {
  7911. proxy(vm, "_data", key);
  7912. }
  7913. }
  7914. // observe data
  7915. observe(data, true /* asRootData */);
  7916. }
  7917. function getData (data, vm) {
  7918. // #7573 disable dep collection when invoking data getters
  7919. pushTarget();
  7920. try {
  7921. return data.call(vm, vm)
  7922. } catch (e) {
  7923. handleError(e, vm, "data()");
  7924. return {}
  7925. } finally {
  7926. popTarget();
  7927. }
  7928. }
  7929. var computedWatcherOptions = { lazy: true };
  7930. function initComputed (vm, computed) {
  7931. // $flow-disable-line
  7932. var watchers = vm._computedWatchers = Object.create(null);
  7933. // computed properties are just getters during SSR
  7934. var isSSR = isServerRendering();
  7935. for (var key in computed) {
  7936. var userDef = computed[key];
  7937. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7938. if ( true && getter == null) {
  7939. warn(
  7940. ("Getter is missing for computed property \"" + key + "\"."),
  7941. vm
  7942. );
  7943. }
  7944. if (!isSSR) {
  7945. // create internal watcher for the computed property.
  7946. watchers[key] = new Watcher(
  7947. vm,
  7948. getter || noop,
  7949. noop,
  7950. computedWatcherOptions
  7951. );
  7952. }
  7953. // component-defined computed properties are already defined on the
  7954. // component prototype. We only need to define computed properties defined
  7955. // at instantiation here.
  7956. if (!(key in vm)) {
  7957. defineComputed(vm, key, userDef);
  7958. } else if (true) {
  7959. if (key in vm.$data) {
  7960. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7961. } else if (vm.$options.props && key in vm.$options.props) {
  7962. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7963. }
  7964. }
  7965. }
  7966. }
  7967. function defineComputed (
  7968. target,
  7969. key,
  7970. userDef
  7971. ) {
  7972. var shouldCache = !isServerRendering();
  7973. if (typeof userDef === 'function') {
  7974. sharedPropertyDefinition.get = shouldCache
  7975. ? createComputedGetter(key)
  7976. : createGetterInvoker(userDef);
  7977. sharedPropertyDefinition.set = noop;
  7978. } else {
  7979. sharedPropertyDefinition.get = userDef.get
  7980. ? shouldCache && userDef.cache !== false
  7981. ? createComputedGetter(key)
  7982. : createGetterInvoker(userDef.get)
  7983. : noop;
  7984. sharedPropertyDefinition.set = userDef.set || noop;
  7985. }
  7986. if ( true &&
  7987. sharedPropertyDefinition.set === noop) {
  7988. sharedPropertyDefinition.set = function () {
  7989. warn(
  7990. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7991. this
  7992. );
  7993. };
  7994. }
  7995. Object.defineProperty(target, key, sharedPropertyDefinition);
  7996. }
  7997. function createComputedGetter (key) {
  7998. return function computedGetter () {
  7999. var watcher = this._computedWatchers && this._computedWatchers[key];
  8000. if (watcher) {
  8001. if (watcher.dirty) {
  8002. watcher.evaluate();
  8003. }
  8004. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8005. watcher.depend();
  8006. }
  8007. return watcher.value
  8008. }
  8009. }
  8010. }
  8011. function createGetterInvoker(fn) {
  8012. return function computedGetter () {
  8013. return fn.call(this, this)
  8014. }
  8015. }
  8016. function initMethods (vm, methods) {
  8017. var props = vm.$options.props;
  8018. for (var key in methods) {
  8019. if (true) {
  8020. if (typeof methods[key] !== 'function') {
  8021. warn(
  8022. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8023. "Did you reference the function correctly?",
  8024. vm
  8025. );
  8026. }
  8027. if (props && hasOwn(props, key)) {
  8028. warn(
  8029. ("Method \"" + key + "\" has already been defined as a prop."),
  8030. vm
  8031. );
  8032. }
  8033. if ((key in vm) && isReserved(key)) {
  8034. warn(
  8035. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8036. "Avoid defining component methods that start with _ or $."
  8037. );
  8038. }
  8039. }
  8040. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8041. }
  8042. }
  8043. function initWatch (vm, watch) {
  8044. for (var key in watch) {
  8045. var handler = watch[key];
  8046. if (Array.isArray(handler)) {
  8047. for (var i = 0; i < handler.length; i++) {
  8048. createWatcher(vm, key, handler[i]);
  8049. }
  8050. } else {
  8051. createWatcher(vm, key, handler);
  8052. }
  8053. }
  8054. }
  8055. function createWatcher (
  8056. vm,
  8057. expOrFn,
  8058. handler,
  8059. options
  8060. ) {
  8061. if (isPlainObject(handler)) {
  8062. options = handler;
  8063. handler = handler.handler;
  8064. }
  8065. if (typeof handler === 'string') {
  8066. handler = vm[handler];
  8067. }
  8068. return vm.$watch(expOrFn, handler, options)
  8069. }
  8070. function stateMixin (Vue) {
  8071. // flow somehow has problems with directly declared definition object
  8072. // when using Object.defineProperty, so we have to procedurally build up
  8073. // the object here.
  8074. var dataDef = {};
  8075. dataDef.get = function () { return this._data };
  8076. var propsDef = {};
  8077. propsDef.get = function () { return this._props };
  8078. if (true) {
  8079. dataDef.set = function () {
  8080. warn(
  8081. 'Avoid replacing instance root $data. ' +
  8082. 'Use nested data properties instead.',
  8083. this
  8084. );
  8085. };
  8086. propsDef.set = function () {
  8087. warn("$props is readonly.", this);
  8088. };
  8089. }
  8090. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8091. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8092. Vue.prototype.$set = set;
  8093. Vue.prototype.$delete = del;
  8094. Vue.prototype.$watch = function (
  8095. expOrFn,
  8096. cb,
  8097. options
  8098. ) {
  8099. var vm = this;
  8100. if (isPlainObject(cb)) {
  8101. return createWatcher(vm, expOrFn, cb, options)
  8102. }
  8103. options = options || {};
  8104. options.user = true;
  8105. var watcher = new Watcher(vm, expOrFn, cb, options);
  8106. if (options.immediate) {
  8107. try {
  8108. cb.call(vm, watcher.value);
  8109. } catch (error) {
  8110. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8111. }
  8112. }
  8113. return function unwatchFn () {
  8114. watcher.teardown();
  8115. }
  8116. };
  8117. }
  8118. /* */
  8119. var uid$3 = 0;
  8120. function initMixin (Vue) {
  8121. Vue.prototype._init = function (options) {
  8122. var vm = this;
  8123. // a uid
  8124. vm._uid = uid$3++;
  8125. var startTag, endTag;
  8126. /* istanbul ignore if */
  8127. if ( true && config.performance && mark) {
  8128. startTag = "vue-perf-start:" + (vm._uid);
  8129. endTag = "vue-perf-end:" + (vm._uid);
  8130. mark(startTag);
  8131. }
  8132. // a flag to avoid this being observed
  8133. vm._isVue = true;
  8134. // merge options
  8135. if (options && options._isComponent) {
  8136. // optimize internal component instantiation
  8137. // since dynamic options merging is pretty slow, and none of the
  8138. // internal component options needs special treatment.
  8139. initInternalComponent(vm, options);
  8140. } else {
  8141. vm.$options = mergeOptions(
  8142. resolveConstructorOptions(vm.constructor),
  8143. options || {},
  8144. vm
  8145. );
  8146. }
  8147. /* istanbul ignore else */
  8148. if (true) {
  8149. initProxy(vm);
  8150. } else {}
  8151. // expose real self
  8152. vm._self = vm;
  8153. initLifecycle(vm);
  8154. initEvents(vm);
  8155. initRender(vm);
  8156. callHook(vm, 'beforeCreate');
  8157. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8158. initState(vm);
  8159. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8160. !vm._$fallback && callHook(vm, 'created');
  8161. /* istanbul ignore if */
  8162. if ( true && config.performance && mark) {
  8163. vm._name = formatComponentName(vm, false);
  8164. mark(endTag);
  8165. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8166. }
  8167. if (vm.$options.el) {
  8168. vm.$mount(vm.$options.el);
  8169. }
  8170. };
  8171. }
  8172. function initInternalComponent (vm, options) {
  8173. var opts = vm.$options = Object.create(vm.constructor.options);
  8174. // doing this because it's faster than dynamic enumeration.
  8175. var parentVnode = options._parentVnode;
  8176. opts.parent = options.parent;
  8177. opts._parentVnode = parentVnode;
  8178. var vnodeComponentOptions = parentVnode.componentOptions;
  8179. opts.propsData = vnodeComponentOptions.propsData;
  8180. opts._parentListeners = vnodeComponentOptions.listeners;
  8181. opts._renderChildren = vnodeComponentOptions.children;
  8182. opts._componentTag = vnodeComponentOptions.tag;
  8183. if (options.render) {
  8184. opts.render = options.render;
  8185. opts.staticRenderFns = options.staticRenderFns;
  8186. }
  8187. }
  8188. function resolveConstructorOptions (Ctor) {
  8189. var options = Ctor.options;
  8190. if (Ctor.super) {
  8191. var superOptions = resolveConstructorOptions(Ctor.super);
  8192. var cachedSuperOptions = Ctor.superOptions;
  8193. if (superOptions !== cachedSuperOptions) {
  8194. // super option changed,
  8195. // need to resolve new options.
  8196. Ctor.superOptions = superOptions;
  8197. // check if there are any late-modified/attached options (#4976)
  8198. var modifiedOptions = resolveModifiedOptions(Ctor);
  8199. // update base extend options
  8200. if (modifiedOptions) {
  8201. extend(Ctor.extendOptions, modifiedOptions);
  8202. }
  8203. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8204. if (options.name) {
  8205. options.components[options.name] = Ctor;
  8206. }
  8207. }
  8208. }
  8209. return options
  8210. }
  8211. function resolveModifiedOptions (Ctor) {
  8212. var modified;
  8213. var latest = Ctor.options;
  8214. var sealed = Ctor.sealedOptions;
  8215. for (var key in latest) {
  8216. if (latest[key] !== sealed[key]) {
  8217. if (!modified) { modified = {}; }
  8218. modified[key] = latest[key];
  8219. }
  8220. }
  8221. return modified
  8222. }
  8223. function Vue (options) {
  8224. if ( true &&
  8225. !(this instanceof Vue)
  8226. ) {
  8227. warn('Vue is a constructor and should be called with the `new` keyword');
  8228. }
  8229. this._init(options);
  8230. }
  8231. initMixin(Vue);
  8232. stateMixin(Vue);
  8233. eventsMixin(Vue);
  8234. lifecycleMixin(Vue);
  8235. renderMixin(Vue);
  8236. /* */
  8237. function initUse (Vue) {
  8238. Vue.use = function (plugin) {
  8239. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8240. if (installedPlugins.indexOf(plugin) > -1) {
  8241. return this
  8242. }
  8243. // additional parameters
  8244. var args = toArray(arguments, 1);
  8245. args.unshift(this);
  8246. if (typeof plugin.install === 'function') {
  8247. plugin.install.apply(plugin, args);
  8248. } else if (typeof plugin === 'function') {
  8249. plugin.apply(null, args);
  8250. }
  8251. installedPlugins.push(plugin);
  8252. return this
  8253. };
  8254. }
  8255. /* */
  8256. function initMixin$1 (Vue) {
  8257. Vue.mixin = function (mixin) {
  8258. this.options = mergeOptions(this.options, mixin);
  8259. return this
  8260. };
  8261. }
  8262. /* */
  8263. function initExtend (Vue) {
  8264. /**
  8265. * Each instance constructor, including Vue, has a unique
  8266. * cid. This enables us to create wrapped "child
  8267. * constructors" for prototypal inheritance and cache them.
  8268. */
  8269. Vue.cid = 0;
  8270. var cid = 1;
  8271. /**
  8272. * Class inheritance
  8273. */
  8274. Vue.extend = function (extendOptions) {
  8275. extendOptions = extendOptions || {};
  8276. var Super = this;
  8277. var SuperId = Super.cid;
  8278. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8279. if (cachedCtors[SuperId]) {
  8280. return cachedCtors[SuperId]
  8281. }
  8282. var name = extendOptions.name || Super.options.name;
  8283. if ( true && name) {
  8284. validateComponentName(name);
  8285. }
  8286. var Sub = function VueComponent (options) {
  8287. this._init(options);
  8288. };
  8289. Sub.prototype = Object.create(Super.prototype);
  8290. Sub.prototype.constructor = Sub;
  8291. Sub.cid = cid++;
  8292. Sub.options = mergeOptions(
  8293. Super.options,
  8294. extendOptions
  8295. );
  8296. Sub['super'] = Super;
  8297. // For props and computed properties, we define the proxy getters on
  8298. // the Vue instances at extension time, on the extended prototype. This
  8299. // avoids Object.defineProperty calls for each instance created.
  8300. if (Sub.options.props) {
  8301. initProps$1(Sub);
  8302. }
  8303. if (Sub.options.computed) {
  8304. initComputed$1(Sub);
  8305. }
  8306. // allow further extension/mixin/plugin usage
  8307. Sub.extend = Super.extend;
  8308. Sub.mixin = Super.mixin;
  8309. Sub.use = Super.use;
  8310. // create asset registers, so extended classes
  8311. // can have their private assets too.
  8312. ASSET_TYPES.forEach(function (type) {
  8313. Sub[type] = Super[type];
  8314. });
  8315. // enable recursive self-lookup
  8316. if (name) {
  8317. Sub.options.components[name] = Sub;
  8318. }
  8319. // keep a reference to the super options at extension time.
  8320. // later at instantiation we can check if Super's options have
  8321. // been updated.
  8322. Sub.superOptions = Super.options;
  8323. Sub.extendOptions = extendOptions;
  8324. Sub.sealedOptions = extend({}, Sub.options);
  8325. // cache constructor
  8326. cachedCtors[SuperId] = Sub;
  8327. return Sub
  8328. };
  8329. }
  8330. function initProps$1 (Comp) {
  8331. var props = Comp.options.props;
  8332. for (var key in props) {
  8333. proxy(Comp.prototype, "_props", key);
  8334. }
  8335. }
  8336. function initComputed$1 (Comp) {
  8337. var computed = Comp.options.computed;
  8338. for (var key in computed) {
  8339. defineComputed(Comp.prototype, key, computed[key]);
  8340. }
  8341. }
  8342. /* */
  8343. function initAssetRegisters (Vue) {
  8344. /**
  8345. * Create asset registration methods.
  8346. */
  8347. ASSET_TYPES.forEach(function (type) {
  8348. Vue[type] = function (
  8349. id,
  8350. definition
  8351. ) {
  8352. if (!definition) {
  8353. return this.options[type + 's'][id]
  8354. } else {
  8355. /* istanbul ignore if */
  8356. if ( true && type === 'component') {
  8357. validateComponentName(id);
  8358. }
  8359. if (type === 'component' && isPlainObject(definition)) {
  8360. definition.name = definition.name || id;
  8361. definition = this.options._base.extend(definition);
  8362. }
  8363. if (type === 'directive' && typeof definition === 'function') {
  8364. definition = { bind: definition, update: definition };
  8365. }
  8366. this.options[type + 's'][id] = definition;
  8367. return definition
  8368. }
  8369. };
  8370. });
  8371. }
  8372. /* */
  8373. function getComponentName (opts) {
  8374. return opts && (opts.Ctor.options.name || opts.tag)
  8375. }
  8376. function matches (pattern, name) {
  8377. if (Array.isArray(pattern)) {
  8378. return pattern.indexOf(name) > -1
  8379. } else if (typeof pattern === 'string') {
  8380. return pattern.split(',').indexOf(name) > -1
  8381. } else if (isRegExp(pattern)) {
  8382. return pattern.test(name)
  8383. }
  8384. /* istanbul ignore next */
  8385. return false
  8386. }
  8387. function pruneCache (keepAliveInstance, filter) {
  8388. var cache = keepAliveInstance.cache;
  8389. var keys = keepAliveInstance.keys;
  8390. var _vnode = keepAliveInstance._vnode;
  8391. for (var key in cache) {
  8392. var cachedNode = cache[key];
  8393. if (cachedNode) {
  8394. var name = getComponentName(cachedNode.componentOptions);
  8395. if (name && !filter(name)) {
  8396. pruneCacheEntry(cache, key, keys, _vnode);
  8397. }
  8398. }
  8399. }
  8400. }
  8401. function pruneCacheEntry (
  8402. cache,
  8403. key,
  8404. keys,
  8405. current
  8406. ) {
  8407. var cached$$1 = cache[key];
  8408. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8409. cached$$1.componentInstance.$destroy();
  8410. }
  8411. cache[key] = null;
  8412. remove(keys, key);
  8413. }
  8414. var patternTypes = [String, RegExp, Array];
  8415. var KeepAlive = {
  8416. name: 'keep-alive',
  8417. abstract: true,
  8418. props: {
  8419. include: patternTypes,
  8420. exclude: patternTypes,
  8421. max: [String, Number]
  8422. },
  8423. created: function created () {
  8424. this.cache = Object.create(null);
  8425. this.keys = [];
  8426. },
  8427. destroyed: function destroyed () {
  8428. for (var key in this.cache) {
  8429. pruneCacheEntry(this.cache, key, this.keys);
  8430. }
  8431. },
  8432. mounted: function mounted () {
  8433. var this$1 = this;
  8434. this.$watch('include', function (val) {
  8435. pruneCache(this$1, function (name) { return matches(val, name); });
  8436. });
  8437. this.$watch('exclude', function (val) {
  8438. pruneCache(this$1, function (name) { return !matches(val, name); });
  8439. });
  8440. },
  8441. render: function render () {
  8442. var slot = this.$slots.default;
  8443. var vnode = getFirstComponentChild(slot);
  8444. var componentOptions = vnode && vnode.componentOptions;
  8445. if (componentOptions) {
  8446. // check pattern
  8447. var name = getComponentName(componentOptions);
  8448. var ref = this;
  8449. var include = ref.include;
  8450. var exclude = ref.exclude;
  8451. if (
  8452. // not included
  8453. (include && (!name || !matches(include, name))) ||
  8454. // excluded
  8455. (exclude && name && matches(exclude, name))
  8456. ) {
  8457. return vnode
  8458. }
  8459. var ref$1 = this;
  8460. var cache = ref$1.cache;
  8461. var keys = ref$1.keys;
  8462. var key = vnode.key == null
  8463. // same constructor may get registered as different local components
  8464. // so cid alone is not enough (#3269)
  8465. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8466. : vnode.key;
  8467. if (cache[key]) {
  8468. vnode.componentInstance = cache[key].componentInstance;
  8469. // make current key freshest
  8470. remove(keys, key);
  8471. keys.push(key);
  8472. } else {
  8473. cache[key] = vnode;
  8474. keys.push(key);
  8475. // prune oldest entry
  8476. if (this.max && keys.length > parseInt(this.max)) {
  8477. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8478. }
  8479. }
  8480. vnode.data.keepAlive = true;
  8481. }
  8482. return vnode || (slot && slot[0])
  8483. }
  8484. };
  8485. var builtInComponents = {
  8486. KeepAlive: KeepAlive
  8487. };
  8488. /* */
  8489. function initGlobalAPI (Vue) {
  8490. // config
  8491. var configDef = {};
  8492. configDef.get = function () { return config; };
  8493. if (true) {
  8494. configDef.set = function () {
  8495. warn(
  8496. 'Do not replace the Vue.config object, set individual fields instead.'
  8497. );
  8498. };
  8499. }
  8500. Object.defineProperty(Vue, 'config', configDef);
  8501. // exposed util methods.
  8502. // NOTE: these are not considered part of the public API - avoid relying on
  8503. // them unless you are aware of the risk.
  8504. Vue.util = {
  8505. warn: warn,
  8506. extend: extend,
  8507. mergeOptions: mergeOptions,
  8508. defineReactive: defineReactive$$1
  8509. };
  8510. Vue.set = set;
  8511. Vue.delete = del;
  8512. Vue.nextTick = nextTick;
  8513. // 2.6 explicit observable API
  8514. Vue.observable = function (obj) {
  8515. observe(obj);
  8516. return obj
  8517. };
  8518. Vue.options = Object.create(null);
  8519. ASSET_TYPES.forEach(function (type) {
  8520. Vue.options[type + 's'] = Object.create(null);
  8521. });
  8522. // this is used to identify the "base" constructor to extend all plain-object
  8523. // components with in Weex's multi-instance scenarios.
  8524. Vue.options._base = Vue;
  8525. extend(Vue.options.components, builtInComponents);
  8526. initUse(Vue);
  8527. initMixin$1(Vue);
  8528. initExtend(Vue);
  8529. initAssetRegisters(Vue);
  8530. }
  8531. initGlobalAPI(Vue);
  8532. Object.defineProperty(Vue.prototype, '$isServer', {
  8533. get: isServerRendering
  8534. });
  8535. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8536. get: function get () {
  8537. /* istanbul ignore next */
  8538. return this.$vnode && this.$vnode.ssrContext
  8539. }
  8540. });
  8541. // expose FunctionalRenderContext for ssr runtime helper installation
  8542. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8543. value: FunctionalRenderContext
  8544. });
  8545. Vue.version = '2.6.11';
  8546. /**
  8547. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8548. */
  8549. var ARRAYTYPE = '[object Array]';
  8550. var OBJECTTYPE = '[object Object]';
  8551. var NULLTYPE = '[object Null]';
  8552. var UNDEFINEDTYPE = '[object Undefined]';
  8553. // const FUNCTIONTYPE = '[object Function]'
  8554. function diff(current, pre) {
  8555. var result = {};
  8556. syncKeys(current, pre);
  8557. _diff(current, pre, '', result);
  8558. return result
  8559. }
  8560. function syncKeys(current, pre) {
  8561. if (current === pre) { return }
  8562. var rootCurrentType = type(current);
  8563. var rootPreType = type(pre);
  8564. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8565. if(Object.keys(current).length >= Object.keys(pre).length){
  8566. for (var key in pre) {
  8567. var currentValue = current[key];
  8568. if (currentValue === undefined) {
  8569. current[key] = null;
  8570. } else {
  8571. syncKeys(currentValue, pre[key]);
  8572. }
  8573. }
  8574. }
  8575. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8576. if (current.length >= pre.length) {
  8577. pre.forEach(function (item, index) {
  8578. syncKeys(current[index], item);
  8579. });
  8580. }
  8581. }
  8582. }
  8583. function nullOrUndefined(currentType, preType) {
  8584. if(
  8585. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8586. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8587. ) {
  8588. return false
  8589. }
  8590. return true
  8591. }
  8592. function _diff(current, pre, path, result) {
  8593. if (current === pre) { return }
  8594. var rootCurrentType = type(current);
  8595. var rootPreType = type(pre);
  8596. if (rootCurrentType == OBJECTTYPE) {
  8597. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8598. setResult(result, path, current);
  8599. } else {
  8600. var loop = function ( key ) {
  8601. var currentValue = current[key];
  8602. var preValue = pre[key];
  8603. var currentType = type(currentValue);
  8604. var preType = type(preValue);
  8605. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8606. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8607. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8608. }
  8609. } else if (currentType == ARRAYTYPE) {
  8610. if (preType != ARRAYTYPE) {
  8611. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8612. } else {
  8613. if (currentValue.length < preValue.length) {
  8614. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8615. } else {
  8616. currentValue.forEach(function (item, index) {
  8617. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8618. });
  8619. }
  8620. }
  8621. } else if (currentType == OBJECTTYPE) {
  8622. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8623. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8624. } else {
  8625. for (var subKey in currentValue) {
  8626. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8627. }
  8628. }
  8629. }
  8630. };
  8631. for (var key in current) loop( key );
  8632. }
  8633. } else if (rootCurrentType == ARRAYTYPE) {
  8634. if (rootPreType != ARRAYTYPE) {
  8635. setResult(result, path, current);
  8636. } else {
  8637. if (current.length < pre.length) {
  8638. setResult(result, path, current);
  8639. } else {
  8640. current.forEach(function (item, index) {
  8641. _diff(item, pre[index], path + '[' + index + ']', result);
  8642. });
  8643. }
  8644. }
  8645. } else {
  8646. setResult(result, path, current);
  8647. }
  8648. }
  8649. function setResult(result, k, v) {
  8650. // if (type(v) != FUNCTIONTYPE) {
  8651. result[k] = v;
  8652. // }
  8653. }
  8654. function type(obj) {
  8655. return Object.prototype.toString.call(obj)
  8656. }
  8657. /* */
  8658. function flushCallbacks$1(vm) {
  8659. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8660. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"水箱计算","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8661. var mpInstance = vm.$scope;
  8662. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8663. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8664. }
  8665. var copies = vm.__next_tick_callbacks.slice(0);
  8666. vm.__next_tick_callbacks.length = 0;
  8667. for (var i = 0; i < copies.length; i++) {
  8668. copies[i]();
  8669. }
  8670. }
  8671. }
  8672. function hasRenderWatcher(vm) {
  8673. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8674. }
  8675. function nextTick$1(vm, cb) {
  8676. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8677. //2.nextTick 之前存在 render watcher
  8678. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8679. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"水箱计算","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8680. var mpInstance = vm.$scope;
  8681. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8682. ']:nextVueTick');
  8683. }
  8684. return nextTick(cb, vm)
  8685. }else{
  8686. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"水箱计算","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8687. var mpInstance$1 = vm.$scope;
  8688. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8689. ']:nextMPTick');
  8690. }
  8691. }
  8692. var _resolve;
  8693. if (!vm.__next_tick_callbacks) {
  8694. vm.__next_tick_callbacks = [];
  8695. }
  8696. vm.__next_tick_callbacks.push(function () {
  8697. if (cb) {
  8698. try {
  8699. cb.call(vm);
  8700. } catch (e) {
  8701. handleError(e, vm, 'nextTick');
  8702. }
  8703. } else if (_resolve) {
  8704. _resolve(vm);
  8705. }
  8706. });
  8707. // $flow-disable-line
  8708. if (!cb && typeof Promise !== 'undefined') {
  8709. return new Promise(function (resolve) {
  8710. _resolve = resolve;
  8711. })
  8712. }
  8713. }
  8714. /* */
  8715. function clearInstance(key, value) {
  8716. // 简易去除 Vue 和小程序组件实例
  8717. if (value) {
  8718. if (value._isVue || value.__v_isMPComponent) {
  8719. return {}
  8720. }
  8721. }
  8722. return value
  8723. }
  8724. function cloneWithData(vm) {
  8725. // 确保当前 vm 所有数据被同步
  8726. var ret = Object.create(null);
  8727. var dataKeys = [].concat(
  8728. Object.keys(vm._data || {}),
  8729. Object.keys(vm._computedWatchers || {}));
  8730. dataKeys.reduce(function(ret, key) {
  8731. ret[key] = vm[key];
  8732. return ret
  8733. }, ret);
  8734. // vue-composition-api
  8735. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8736. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8737. if (rawBindings) {
  8738. Object.keys(rawBindings).forEach(function (key) {
  8739. ret[key] = vm[key];
  8740. });
  8741. }
  8742. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8743. Object.assign(ret, vm.$mp.data || {});
  8744. if (
  8745. Array.isArray(vm.$options.behaviors) &&
  8746. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8747. ) { //form-field
  8748. ret['name'] = vm.name;
  8749. ret['value'] = vm.value;
  8750. }
  8751. return JSON.parse(JSON.stringify(ret, clearInstance))
  8752. }
  8753. var patch = function(oldVnode, vnode) {
  8754. var this$1 = this;
  8755. if (vnode === null) { //destroy
  8756. return
  8757. }
  8758. if (this.mpType === 'page' || this.mpType === 'component') {
  8759. var mpInstance = this.$scope;
  8760. var data = Object.create(null);
  8761. try {
  8762. data = cloneWithData(this);
  8763. } catch (err) {
  8764. console.error(err);
  8765. }
  8766. data.__webviewId__ = mpInstance.data.__webviewId__;
  8767. var mpData = Object.create(null);
  8768. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8769. mpData[key] = mpInstance.data[key];
  8770. });
  8771. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8772. if (Object.keys(diffData).length) {
  8773. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"水箱计算","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8774. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8775. ']差量更新',
  8776. JSON.stringify(diffData));
  8777. }
  8778. this.__next_tick_pending = true;
  8779. mpInstance.setData(diffData, function () {
  8780. this$1.__next_tick_pending = false;
  8781. flushCallbacks$1(this$1);
  8782. });
  8783. } else {
  8784. flushCallbacks$1(this);
  8785. }
  8786. }
  8787. };
  8788. /* */
  8789. function createEmptyRender() {
  8790. }
  8791. function mountComponent$1(
  8792. vm,
  8793. el,
  8794. hydrating
  8795. ) {
  8796. if (!vm.mpType) {//main.js 中的 new Vue
  8797. return vm
  8798. }
  8799. if (vm.mpType === 'app') {
  8800. vm.$options.render = createEmptyRender;
  8801. }
  8802. if (!vm.$options.render) {
  8803. vm.$options.render = createEmptyRender;
  8804. if (true) {
  8805. /* istanbul ignore if */
  8806. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8807. vm.$options.el || el) {
  8808. warn(
  8809. 'You are using the runtime-only build of Vue where the template ' +
  8810. 'compiler is not available. Either pre-compile the templates into ' +
  8811. 'render functions, or use the compiler-included build.',
  8812. vm
  8813. );
  8814. } else {
  8815. warn(
  8816. 'Failed to mount component: template or render function not defined.',
  8817. vm
  8818. );
  8819. }
  8820. }
  8821. }
  8822. !vm._$fallback && callHook(vm, 'beforeMount');
  8823. var updateComponent = function () {
  8824. vm._update(vm._render(), hydrating);
  8825. };
  8826. // we set this to vm._watcher inside the watcher's constructor
  8827. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8828. // component's mounted hook), which relies on vm._watcher being already defined
  8829. new Watcher(vm, updateComponent, noop, {
  8830. before: function before() {
  8831. if (vm._isMounted && !vm._isDestroyed) {
  8832. callHook(vm, 'beforeUpdate');
  8833. }
  8834. }
  8835. }, true /* isRenderWatcher */);
  8836. hydrating = false;
  8837. return vm
  8838. }
  8839. /* */
  8840. function renderClass (
  8841. staticClass,
  8842. dynamicClass
  8843. ) {
  8844. if (isDef(staticClass) || isDef(dynamicClass)) {
  8845. return concat(staticClass, stringifyClass(dynamicClass))
  8846. }
  8847. /* istanbul ignore next */
  8848. return ''
  8849. }
  8850. function concat (a, b) {
  8851. return a ? b ? (a + ' ' + b) : a : (b || '')
  8852. }
  8853. function stringifyClass (value) {
  8854. if (Array.isArray(value)) {
  8855. return stringifyArray(value)
  8856. }
  8857. if (isObject(value)) {
  8858. return stringifyObject(value)
  8859. }
  8860. if (typeof value === 'string') {
  8861. return value
  8862. }
  8863. /* istanbul ignore next */
  8864. return ''
  8865. }
  8866. function stringifyArray (value) {
  8867. var res = '';
  8868. var stringified;
  8869. for (var i = 0, l = value.length; i < l; i++) {
  8870. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8871. if (res) { res += ' '; }
  8872. res += stringified;
  8873. }
  8874. }
  8875. return res
  8876. }
  8877. function stringifyObject (value) {
  8878. var res = '';
  8879. for (var key in value) {
  8880. if (value[key]) {
  8881. if (res) { res += ' '; }
  8882. res += key;
  8883. }
  8884. }
  8885. return res
  8886. }
  8887. /* */
  8888. var parseStyleText = cached(function (cssText) {
  8889. var res = {};
  8890. var listDelimiter = /;(?![^(]*\))/g;
  8891. var propertyDelimiter = /:(.+)/;
  8892. cssText.split(listDelimiter).forEach(function (item) {
  8893. if (item) {
  8894. var tmp = item.split(propertyDelimiter);
  8895. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8896. }
  8897. });
  8898. return res
  8899. });
  8900. // normalize possible array / string values into Object
  8901. function normalizeStyleBinding (bindingStyle) {
  8902. if (Array.isArray(bindingStyle)) {
  8903. return toObject(bindingStyle)
  8904. }
  8905. if (typeof bindingStyle === 'string') {
  8906. return parseStyleText(bindingStyle)
  8907. }
  8908. return bindingStyle
  8909. }
  8910. /* */
  8911. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8912. function getTarget(obj, path) {
  8913. var parts = path.split('.');
  8914. var key = parts[0];
  8915. if (key.indexOf('__$n') === 0) { //number index
  8916. key = parseInt(key.replace('__$n', ''));
  8917. }
  8918. if (parts.length === 1) {
  8919. return obj[key]
  8920. }
  8921. return getTarget(obj[key], parts.slice(1).join('.'))
  8922. }
  8923. function internalMixin(Vue) {
  8924. Vue.config.errorHandler = function(err, vm, info) {
  8925. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8926. console.error(err);
  8927. /* eslint-disable no-undef */
  8928. var app = typeof getApp === 'function' && getApp();
  8929. if (app && app.onError) {
  8930. app.onError(err);
  8931. }
  8932. };
  8933. var oldEmit = Vue.prototype.$emit;
  8934. Vue.prototype.$emit = function(event) {
  8935. if (this.$scope && event) {
  8936. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8937. if (triggerEvent) {
  8938. try {
  8939. triggerEvent.call(this.$scope, event, {
  8940. __args__: toArray(arguments, 1)
  8941. });
  8942. } catch (error) {
  8943. }
  8944. }
  8945. }
  8946. return oldEmit.apply(this, arguments)
  8947. };
  8948. Vue.prototype.$nextTick = function(fn) {
  8949. return nextTick$1(this, fn)
  8950. };
  8951. MP_METHODS.forEach(function (method) {
  8952. Vue.prototype[method] = function(args) {
  8953. if (this.$scope && this.$scope[method]) {
  8954. return this.$scope[method](args)
  8955. }
  8956. // mp-alipay
  8957. if (typeof my === 'undefined') {
  8958. return
  8959. }
  8960. if (method === 'createSelectorQuery') {
  8961. /* eslint-disable no-undef */
  8962. return my.createSelectorQuery(args)
  8963. } else if (method === 'createIntersectionObserver') {
  8964. /* eslint-disable no-undef */
  8965. return my.createIntersectionObserver(args)
  8966. }
  8967. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8968. };
  8969. });
  8970. Vue.prototype.__init_provide = initProvide;
  8971. Vue.prototype.__init_injections = initInjections;
  8972. Vue.prototype.__call_hook = function(hook, args) {
  8973. var vm = this;
  8974. // #7573 disable dep collection when invoking lifecycle hooks
  8975. pushTarget();
  8976. var handlers = vm.$options[hook];
  8977. var info = hook + " hook";
  8978. var ret;
  8979. if (handlers) {
  8980. for (var i = 0, j = handlers.length; i < j; i++) {
  8981. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8982. }
  8983. }
  8984. if (vm._hasHookEvent) {
  8985. vm.$emit('hook:' + hook, args);
  8986. }
  8987. popTarget();
  8988. return ret
  8989. };
  8990. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8991. if (Array.isArray(modifiers)) {
  8992. if (modifiers.indexOf('trim') !== -1) {
  8993. value = value.trim();
  8994. }
  8995. if (modifiers.indexOf('number') !== -1) {
  8996. value = this._n(value);
  8997. }
  8998. }
  8999. if (!target) {
  9000. target = this;
  9001. }
  9002. // 解决动态属性添加
  9003. Vue.set(target, key, value);
  9004. };
  9005. Vue.prototype.__set_sync = function(target, key, value) {
  9006. if (!target) {
  9007. target = this;
  9008. }
  9009. // 解决动态属性添加
  9010. Vue.set(target, key, value);
  9011. };
  9012. Vue.prototype.__get_orig = function(item) {
  9013. if (isPlainObject(item)) {
  9014. return item['$orig'] || item
  9015. }
  9016. return item
  9017. };
  9018. Vue.prototype.__get_value = function(dataPath, target) {
  9019. return getTarget(target || this, dataPath)
  9020. };
  9021. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9022. return renderClass(staticClass, dynamicClass)
  9023. };
  9024. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9025. if (!dynamicStyle && !staticStyle) {
  9026. return ''
  9027. }
  9028. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9029. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9030. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9031. };
  9032. Vue.prototype.__map = function(val, iteratee) {
  9033. //TODO 暂不考虑 string
  9034. var ret, i, l, keys, key;
  9035. if (Array.isArray(val)) {
  9036. ret = new Array(val.length);
  9037. for (i = 0, l = val.length; i < l; i++) {
  9038. ret[i] = iteratee(val[i], i);
  9039. }
  9040. return ret
  9041. } else if (isObject(val)) {
  9042. keys = Object.keys(val);
  9043. ret = Object.create(null);
  9044. for (i = 0, l = keys.length; i < l; i++) {
  9045. key = keys[i];
  9046. ret[key] = iteratee(val[key], key, i);
  9047. }
  9048. return ret
  9049. } else if (typeof val === 'number') {
  9050. ret = new Array(val);
  9051. for (i = 0, l = val; i < l; i++) {
  9052. // 第一个参数暂时仍和小程序一致
  9053. ret[i] = iteratee(i, i);
  9054. }
  9055. return ret
  9056. }
  9057. return []
  9058. };
  9059. }
  9060. /* */
  9061. var LIFECYCLE_HOOKS$1 = [
  9062. //App
  9063. 'onLaunch',
  9064. 'onShow',
  9065. 'onHide',
  9066. 'onUniNViewMessage',
  9067. 'onPageNotFound',
  9068. 'onThemeChange',
  9069. 'onError',
  9070. 'onUnhandledRejection',
  9071. //Page
  9072. 'onInit',
  9073. 'onLoad',
  9074. // 'onShow',
  9075. 'onReady',
  9076. // 'onHide',
  9077. 'onUnload',
  9078. 'onPullDownRefresh',
  9079. 'onReachBottom',
  9080. 'onTabItemTap',
  9081. 'onAddToFavorites',
  9082. 'onShareTimeline',
  9083. 'onShareAppMessage',
  9084. 'onResize',
  9085. 'onPageScroll',
  9086. 'onNavigationBarButtonTap',
  9087. 'onBackPress',
  9088. 'onNavigationBarSearchInputChanged',
  9089. 'onNavigationBarSearchInputConfirmed',
  9090. 'onNavigationBarSearchInputClicked',
  9091. //Component
  9092. // 'onReady', // 兼容旧版本,应该移除该事件
  9093. 'onPageShow',
  9094. 'onPageHide',
  9095. 'onPageResize',
  9096. 'onUploadDouyinVideo'
  9097. ];
  9098. function lifecycleMixin$1(Vue) {
  9099. //fixed vue-class-component
  9100. var oldExtend = Vue.extend;
  9101. Vue.extend = function(extendOptions) {
  9102. extendOptions = extendOptions || {};
  9103. var methods = extendOptions.methods;
  9104. if (methods) {
  9105. Object.keys(methods).forEach(function (methodName) {
  9106. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9107. extendOptions[methodName] = methods[methodName];
  9108. delete methods[methodName];
  9109. }
  9110. });
  9111. }
  9112. return oldExtend.call(this, extendOptions)
  9113. };
  9114. var strategies = Vue.config.optionMergeStrategies;
  9115. var mergeHook = strategies.created;
  9116. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9117. strategies[hook] = mergeHook;
  9118. });
  9119. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9120. }
  9121. /* */
  9122. // install platform patch function
  9123. Vue.prototype.__patch__ = patch;
  9124. // public mount method
  9125. Vue.prototype.$mount = function(
  9126. el ,
  9127. hydrating
  9128. ) {
  9129. return mountComponent$1(this, el, hydrating)
  9130. };
  9131. lifecycleMixin$1(Vue);
  9132. internalMixin(Vue);
  9133. /* */
  9134. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9135. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9136. /***/ }),
  9137. /***/ 256:
  9138. /*!**************************************************!*\
  9139. !*** D:/2022/9/sx/components/uni-icons/icons.js ***!
  9140. \**************************************************/
  9141. /*! no static exports found */
  9142. /***/ (function(module, exports, __webpack_require__) {
  9143. "use strict";
  9144. Object.defineProperty(exports, "__esModule", {
  9145. value: true
  9146. });
  9147. exports.default = void 0;
  9148. var _default = {
  9149. 'contact': "\uE100",
  9150. 'person': "\uE101",
  9151. 'personadd': "\uE102",
  9152. 'contact-filled': "\uE130",
  9153. 'person-filled': "\uE131",
  9154. 'personadd-filled': "\uE132",
  9155. 'phone': "\uE200",
  9156. 'email': "\uE201",
  9157. 'chatbubble': "\uE202",
  9158. 'chatboxes': "\uE203",
  9159. 'phone-filled': "\uE230",
  9160. 'email-filled': "\uE231",
  9161. 'chatbubble-filled': "\uE232",
  9162. 'chatboxes-filled': "\uE233",
  9163. 'weibo': "\uE260",
  9164. 'weixin': "\uE261",
  9165. 'pengyouquan': "\uE262",
  9166. 'chat': "\uE263",
  9167. 'qq': "\uE264",
  9168. 'videocam': "\uE300",
  9169. 'camera': "\uE301",
  9170. 'mic': "\uE302",
  9171. 'location': "\uE303",
  9172. 'mic-filled': "\uE332",
  9173. 'speech': "\uE332",
  9174. 'location-filled': "\uE333",
  9175. 'micoff': "\uE360",
  9176. 'image': "\uE363",
  9177. 'map': "\uE364",
  9178. 'compose': "\uE400",
  9179. 'trash': "\uE401",
  9180. 'upload': "\uE402",
  9181. 'download': "\uE403",
  9182. 'close': "\uE404",
  9183. 'redo': "\uE405",
  9184. 'undo': "\uE406",
  9185. 'refresh': "\uE407",
  9186. 'star': "\uE408",
  9187. 'plus': "\uE409",
  9188. 'minus': "\uE410",
  9189. 'circle': "\uE411",
  9190. 'checkbox': "\uE411",
  9191. 'close-filled': "\uE434",
  9192. 'clear': "\uE434",
  9193. 'refresh-filled': "\uE437",
  9194. 'star-filled': "\uE438",
  9195. 'plus-filled': "\uE439",
  9196. 'minus-filled': "\uE440",
  9197. 'circle-filled': "\uE441",
  9198. 'checkbox-filled': "\uE442",
  9199. 'closeempty': "\uE460",
  9200. 'refreshempty': "\uE461",
  9201. 'reload': "\uE462",
  9202. 'starhalf': "\uE463",
  9203. 'spinner': "\uE464",
  9204. 'spinner-cycle': "\uE465",
  9205. 'search': "\uE466",
  9206. 'plusempty': "\uE468",
  9207. 'forward': "\uE470",
  9208. 'back': "\uE471",
  9209. 'left-nav': "\uE471",
  9210. 'checkmarkempty': "\uE472",
  9211. 'home': "\uE500",
  9212. 'navigate': "\uE501",
  9213. 'gear': "\uE502",
  9214. 'paperplane': "\uE503",
  9215. 'info': "\uE504",
  9216. 'help': "\uE505",
  9217. 'locked': "\uE506",
  9218. 'more': "\uE507",
  9219. 'flag': "\uE508",
  9220. 'home-filled': "\uE530",
  9221. 'gear-filled': "\uE532",
  9222. 'info-filled': "\uE534",
  9223. 'help-filled': "\uE535",
  9224. 'more-filled': "\uE537",
  9225. 'settings': "\uE560",
  9226. 'list': "\uE562",
  9227. 'bars': "\uE563",
  9228. 'loop': "\uE565",
  9229. 'paperclip': "\uE567",
  9230. 'eye': "\uE568",
  9231. 'arrowup': "\uE580",
  9232. 'arrowdown': "\uE581",
  9233. 'arrowleft': "\uE582",
  9234. 'arrowright': "\uE583",
  9235. 'arrowthinup': "\uE584",
  9236. 'arrowthindown': "\uE585",
  9237. 'arrowthinleft': "\uE586",
  9238. 'arrowthinright': "\uE587",
  9239. 'pulldown': "\uE588",
  9240. 'closefill': "\uE589",
  9241. 'sound': "\uE590",
  9242. 'scan': "\uE612"
  9243. };
  9244. exports.default = _default;
  9245. /***/ }),
  9246. /***/ 26:
  9247. /*!*******************************!*\
  9248. !*** D:/2022/9/sx/pages.json ***!
  9249. \*******************************/
  9250. /*! no static exports found */
  9251. /***/ (function(module, exports) {
  9252. /***/ }),
  9253. /***/ 27:
  9254. /*!***********************************!*\
  9255. !*** D:/2022/9/sx/store/index.js ***!
  9256. \***********************************/
  9257. /*! no static exports found */
  9258. /***/ (function(module, exports, __webpack_require__) {
  9259. "use strict";
  9260. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9261. Object.defineProperty(exports, "__esModule", {
  9262. value: true
  9263. });
  9264. exports.default = void 0;
  9265. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  9266. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 28));
  9267. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 29));
  9268. _vue.default.use(_vuex.default);
  9269. var store = new _vuex.default.Store({
  9270. state: {
  9271. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  9272. baseURL: 'https://water.liuniu946.com',
  9273. //请求地址配置
  9274. urlFile: '/index',
  9275. //项目部署所在文件夹
  9276. userInfo: {},
  9277. //登录信息
  9278. loginInterceptor: false,
  9279. //是否打开强制登录
  9280. weichatInfo: {},
  9281. //保存微信注册信息
  9282. weichatObj: '' //微信对象
  9283. },
  9284. mutations: {
  9285. //保存微信信息
  9286. setWeiChatInfo: function setWeiChatInfo(state, provider) {
  9287. state.weichatInfo = provider;
  9288. },
  9289. //保存微信对象
  9290. setWeiChatObj: function setWeiChatObj(state, provider) {
  9291. state.weichatObj = provider;
  9292. }
  9293. },
  9294. modules: {
  9295. user: _user.default
  9296. },
  9297. actions: {}
  9298. });
  9299. var _default = store;
  9300. exports.default = _default;
  9301. /***/ }),
  9302. /***/ 28:
  9303. /*!**************************************************************************************!*\
  9304. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  9305. \**************************************************************************************/
  9306. /*! no static exports found */
  9307. /***/ (function(module, exports, __webpack_require__) {
  9308. "use strict";
  9309. /* WEBPACK VAR INJECTION */(function(global) {/*!
  9310. * vuex v3.6.2
  9311. * (c) 2021 Evan You
  9312. * @license MIT
  9313. */
  9314. function applyMixin (Vue) {
  9315. var version = Number(Vue.version.split('.')[0]);
  9316. if (version >= 2) {
  9317. Vue.mixin({ beforeCreate: vuexInit });
  9318. } else {
  9319. // override init and inject vuex init procedure
  9320. // for 1.x backwards compatibility.
  9321. var _init = Vue.prototype._init;
  9322. Vue.prototype._init = function (options) {
  9323. if ( options === void 0 ) options = {};
  9324. options.init = options.init
  9325. ? [vuexInit].concat(options.init)
  9326. : vuexInit;
  9327. _init.call(this, options);
  9328. };
  9329. }
  9330. /**
  9331. * Vuex init hook, injected into each instances init hooks list.
  9332. */
  9333. function vuexInit () {
  9334. var options = this.$options;
  9335. // store injection
  9336. if (options.store) {
  9337. this.$store = typeof options.store === 'function'
  9338. ? options.store()
  9339. : options.store;
  9340. } else if (options.parent && options.parent.$store) {
  9341. this.$store = options.parent.$store;
  9342. }
  9343. }
  9344. }
  9345. var target = typeof window !== 'undefined'
  9346. ? window
  9347. : typeof global !== 'undefined'
  9348. ? global
  9349. : {};
  9350. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  9351. function devtoolPlugin (store) {
  9352. if (!devtoolHook) { return }
  9353. store._devtoolHook = devtoolHook;
  9354. devtoolHook.emit('vuex:init', store);
  9355. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  9356. store.replaceState(targetState);
  9357. });
  9358. store.subscribe(function (mutation, state) {
  9359. devtoolHook.emit('vuex:mutation', mutation, state);
  9360. }, { prepend: true });
  9361. store.subscribeAction(function (action, state) {
  9362. devtoolHook.emit('vuex:action', action, state);
  9363. }, { prepend: true });
  9364. }
  9365. /**
  9366. * Get the first item that pass the test
  9367. * by second argument function
  9368. *
  9369. * @param {Array} list
  9370. * @param {Function} f
  9371. * @return {*}
  9372. */
  9373. function find (list, f) {
  9374. return list.filter(f)[0]
  9375. }
  9376. /**
  9377. * Deep copy the given object considering circular structure.
  9378. * This function caches all nested objects and its copies.
  9379. * If it detects circular structure, use cached copy to avoid infinite loop.
  9380. *
  9381. * @param {*} obj
  9382. * @param {Array<Object>} cache
  9383. * @return {*}
  9384. */
  9385. function deepCopy (obj, cache) {
  9386. if ( cache === void 0 ) cache = [];
  9387. // just return if obj is immutable value
  9388. if (obj === null || typeof obj !== 'object') {
  9389. return obj
  9390. }
  9391. // if obj is hit, it is in circular structure
  9392. var hit = find(cache, function (c) { return c.original === obj; });
  9393. if (hit) {
  9394. return hit.copy
  9395. }
  9396. var copy = Array.isArray(obj) ? [] : {};
  9397. // put the copy into cache at first
  9398. // because we want to refer it in recursive deepCopy
  9399. cache.push({
  9400. original: obj,
  9401. copy: copy
  9402. });
  9403. Object.keys(obj).forEach(function (key) {
  9404. copy[key] = deepCopy(obj[key], cache);
  9405. });
  9406. return copy
  9407. }
  9408. /**
  9409. * forEach for object
  9410. */
  9411. function forEachValue (obj, fn) {
  9412. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  9413. }
  9414. function isObject (obj) {
  9415. return obj !== null && typeof obj === 'object'
  9416. }
  9417. function isPromise (val) {
  9418. return val && typeof val.then === 'function'
  9419. }
  9420. function assert (condition, msg) {
  9421. if (!condition) { throw new Error(("[vuex] " + msg)) }
  9422. }
  9423. function partial (fn, arg) {
  9424. return function () {
  9425. return fn(arg)
  9426. }
  9427. }
  9428. // Base data struct for store's module, package with some attribute and method
  9429. var Module = function Module (rawModule, runtime) {
  9430. this.runtime = runtime;
  9431. // Store some children item
  9432. this._children = Object.create(null);
  9433. // Store the origin module object which passed by programmer
  9434. this._rawModule = rawModule;
  9435. var rawState = rawModule.state;
  9436. // Store the origin module's state
  9437. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  9438. };
  9439. var prototypeAccessors = { namespaced: { configurable: true } };
  9440. prototypeAccessors.namespaced.get = function () {
  9441. return !!this._rawModule.namespaced
  9442. };
  9443. Module.prototype.addChild = function addChild (key, module) {
  9444. this._children[key] = module;
  9445. };
  9446. Module.prototype.removeChild = function removeChild (key) {
  9447. delete this._children[key];
  9448. };
  9449. Module.prototype.getChild = function getChild (key) {
  9450. return this._children[key]
  9451. };
  9452. Module.prototype.hasChild = function hasChild (key) {
  9453. return key in this._children
  9454. };
  9455. Module.prototype.update = function update (rawModule) {
  9456. this._rawModule.namespaced = rawModule.namespaced;
  9457. if (rawModule.actions) {
  9458. this._rawModule.actions = rawModule.actions;
  9459. }
  9460. if (rawModule.mutations) {
  9461. this._rawModule.mutations = rawModule.mutations;
  9462. }
  9463. if (rawModule.getters) {
  9464. this._rawModule.getters = rawModule.getters;
  9465. }
  9466. };
  9467. Module.prototype.forEachChild = function forEachChild (fn) {
  9468. forEachValue(this._children, fn);
  9469. };
  9470. Module.prototype.forEachGetter = function forEachGetter (fn) {
  9471. if (this._rawModule.getters) {
  9472. forEachValue(this._rawModule.getters, fn);
  9473. }
  9474. };
  9475. Module.prototype.forEachAction = function forEachAction (fn) {
  9476. if (this._rawModule.actions) {
  9477. forEachValue(this._rawModule.actions, fn);
  9478. }
  9479. };
  9480. Module.prototype.forEachMutation = function forEachMutation (fn) {
  9481. if (this._rawModule.mutations) {
  9482. forEachValue(this._rawModule.mutations, fn);
  9483. }
  9484. };
  9485. Object.defineProperties( Module.prototype, prototypeAccessors );
  9486. var ModuleCollection = function ModuleCollection (rawRootModule) {
  9487. // register root module (Vuex.Store options)
  9488. this.register([], rawRootModule, false);
  9489. };
  9490. ModuleCollection.prototype.get = function get (path) {
  9491. return path.reduce(function (module, key) {
  9492. return module.getChild(key)
  9493. }, this.root)
  9494. };
  9495. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  9496. var module = this.root;
  9497. return path.reduce(function (namespace, key) {
  9498. module = module.getChild(key);
  9499. return namespace + (module.namespaced ? key + '/' : '')
  9500. }, '')
  9501. };
  9502. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  9503. update([], this.root, rawRootModule);
  9504. };
  9505. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  9506. var this$1 = this;
  9507. if ( runtime === void 0 ) runtime = true;
  9508. if ((true)) {
  9509. assertRawModule(path, rawModule);
  9510. }
  9511. var newModule = new Module(rawModule, runtime);
  9512. if (path.length === 0) {
  9513. this.root = newModule;
  9514. } else {
  9515. var parent = this.get(path.slice(0, -1));
  9516. parent.addChild(path[path.length - 1], newModule);
  9517. }
  9518. // register nested modules
  9519. if (rawModule.modules) {
  9520. forEachValue(rawModule.modules, function (rawChildModule, key) {
  9521. this$1.register(path.concat(key), rawChildModule, runtime);
  9522. });
  9523. }
  9524. };
  9525. ModuleCollection.prototype.unregister = function unregister (path) {
  9526. var parent = this.get(path.slice(0, -1));
  9527. var key = path[path.length - 1];
  9528. var child = parent.getChild(key);
  9529. if (!child) {
  9530. if ((true)) {
  9531. console.warn(
  9532. "[vuex] trying to unregister module '" + key + "', which is " +
  9533. "not registered"
  9534. );
  9535. }
  9536. return
  9537. }
  9538. if (!child.runtime) {
  9539. return
  9540. }
  9541. parent.removeChild(key);
  9542. };
  9543. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  9544. var parent = this.get(path.slice(0, -1));
  9545. var key = path[path.length - 1];
  9546. if (parent) {
  9547. return parent.hasChild(key)
  9548. }
  9549. return false
  9550. };
  9551. function update (path, targetModule, newModule) {
  9552. if ((true)) {
  9553. assertRawModule(path, newModule);
  9554. }
  9555. // update target module
  9556. targetModule.update(newModule);
  9557. // update nested modules
  9558. if (newModule.modules) {
  9559. for (var key in newModule.modules) {
  9560. if (!targetModule.getChild(key)) {
  9561. if ((true)) {
  9562. console.warn(
  9563. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  9564. 'manual reload is needed'
  9565. );
  9566. }
  9567. return
  9568. }
  9569. update(
  9570. path.concat(key),
  9571. targetModule.getChild(key),
  9572. newModule.modules[key]
  9573. );
  9574. }
  9575. }
  9576. }
  9577. var functionAssert = {
  9578. assert: function (value) { return typeof value === 'function'; },
  9579. expected: 'function'
  9580. };
  9581. var objectAssert = {
  9582. assert: function (value) { return typeof value === 'function' ||
  9583. (typeof value === 'object' && typeof value.handler === 'function'); },
  9584. expected: 'function or object with "handler" function'
  9585. };
  9586. var assertTypes = {
  9587. getters: functionAssert,
  9588. mutations: functionAssert,
  9589. actions: objectAssert
  9590. };
  9591. function assertRawModule (path, rawModule) {
  9592. Object.keys(assertTypes).forEach(function (key) {
  9593. if (!rawModule[key]) { return }
  9594. var assertOptions = assertTypes[key];
  9595. forEachValue(rawModule[key], function (value, type) {
  9596. assert(
  9597. assertOptions.assert(value),
  9598. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  9599. );
  9600. });
  9601. });
  9602. }
  9603. function makeAssertionMessage (path, key, type, value, expected) {
  9604. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  9605. if (path.length > 0) {
  9606. buf += " in module \"" + (path.join('.')) + "\"";
  9607. }
  9608. buf += " is " + (JSON.stringify(value)) + ".";
  9609. return buf
  9610. }
  9611. var Vue; // bind on install
  9612. var Store = function Store (options) {
  9613. var this$1 = this;
  9614. if ( options === void 0 ) options = {};
  9615. // Auto install if it is not done yet and `window` has `Vue`.
  9616. // To allow users to avoid auto-installation in some cases,
  9617. // this code should be placed here. See #731
  9618. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  9619. install(window.Vue);
  9620. }
  9621. if ((true)) {
  9622. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  9623. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  9624. assert(this instanceof Store, "store must be called with the new operator.");
  9625. }
  9626. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  9627. var strict = options.strict; if ( strict === void 0 ) strict = false;
  9628. // store internal state
  9629. this._committing = false;
  9630. this._actions = Object.create(null);
  9631. this._actionSubscribers = [];
  9632. this._mutations = Object.create(null);
  9633. this._wrappedGetters = Object.create(null);
  9634. this._modules = new ModuleCollection(options);
  9635. this._modulesNamespaceMap = Object.create(null);
  9636. this._subscribers = [];
  9637. this._watcherVM = new Vue();
  9638. this._makeLocalGettersCache = Object.create(null);
  9639. // bind commit and dispatch to self
  9640. var store = this;
  9641. var ref = this;
  9642. var dispatch = ref.dispatch;
  9643. var commit = ref.commit;
  9644. this.dispatch = function boundDispatch (type, payload) {
  9645. return dispatch.call(store, type, payload)
  9646. };
  9647. this.commit = function boundCommit (type, payload, options) {
  9648. return commit.call(store, type, payload, options)
  9649. };
  9650. // strict mode
  9651. this.strict = strict;
  9652. var state = this._modules.root.state;
  9653. // init root module.
  9654. // this also recursively registers all sub-modules
  9655. // and collects all module getters inside this._wrappedGetters
  9656. installModule(this, state, [], this._modules.root);
  9657. // initialize the store vm, which is responsible for the reactivity
  9658. // (also registers _wrappedGetters as computed properties)
  9659. resetStoreVM(this, state);
  9660. // apply plugins
  9661. plugins.forEach(function (plugin) { return plugin(this$1); });
  9662. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  9663. if (useDevtools) {
  9664. devtoolPlugin(this);
  9665. }
  9666. };
  9667. var prototypeAccessors$1 = { state: { configurable: true } };
  9668. prototypeAccessors$1.state.get = function () {
  9669. return this._vm._data.$$state
  9670. };
  9671. prototypeAccessors$1.state.set = function (v) {
  9672. if ((true)) {
  9673. assert(false, "use store.replaceState() to explicit replace store state.");
  9674. }
  9675. };
  9676. Store.prototype.commit = function commit (_type, _payload, _options) {
  9677. var this$1 = this;
  9678. // check object-style commit
  9679. var ref = unifyObjectStyle(_type, _payload, _options);
  9680. var type = ref.type;
  9681. var payload = ref.payload;
  9682. var options = ref.options;
  9683. var mutation = { type: type, payload: payload };
  9684. var entry = this._mutations[type];
  9685. if (!entry) {
  9686. if ((true)) {
  9687. console.error(("[vuex] unknown mutation type: " + type));
  9688. }
  9689. return
  9690. }
  9691. this._withCommit(function () {
  9692. entry.forEach(function commitIterator (handler) {
  9693. handler(payload);
  9694. });
  9695. });
  9696. this._subscribers
  9697. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9698. .forEach(function (sub) { return sub(mutation, this$1.state); });
  9699. if (
  9700. ( true) &&
  9701. options && options.silent
  9702. ) {
  9703. console.warn(
  9704. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  9705. 'Use the filter functionality in the vue-devtools'
  9706. );
  9707. }
  9708. };
  9709. Store.prototype.dispatch = function dispatch (_type, _payload) {
  9710. var this$1 = this;
  9711. // check object-style dispatch
  9712. var ref = unifyObjectStyle(_type, _payload);
  9713. var type = ref.type;
  9714. var payload = ref.payload;
  9715. var action = { type: type, payload: payload };
  9716. var entry = this._actions[type];
  9717. if (!entry) {
  9718. if ((true)) {
  9719. console.error(("[vuex] unknown action type: " + type));
  9720. }
  9721. return
  9722. }
  9723. try {
  9724. this._actionSubscribers
  9725. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9726. .filter(function (sub) { return sub.before; })
  9727. .forEach(function (sub) { return sub.before(action, this$1.state); });
  9728. } catch (e) {
  9729. if ((true)) {
  9730. console.warn("[vuex] error in before action subscribers: ");
  9731. console.error(e);
  9732. }
  9733. }
  9734. var result = entry.length > 1
  9735. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  9736. : entry[0](payload);
  9737. return new Promise(function (resolve, reject) {
  9738. result.then(function (res) {
  9739. try {
  9740. this$1._actionSubscribers
  9741. .filter(function (sub) { return sub.after; })
  9742. .forEach(function (sub) { return sub.after(action, this$1.state); });
  9743. } catch (e) {
  9744. if ((true)) {
  9745. console.warn("[vuex] error in after action subscribers: ");
  9746. console.error(e);
  9747. }
  9748. }
  9749. resolve(res);
  9750. }, function (error) {
  9751. try {
  9752. this$1._actionSubscribers
  9753. .filter(function (sub) { return sub.error; })
  9754. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  9755. } catch (e) {
  9756. if ((true)) {
  9757. console.warn("[vuex] error in error action subscribers: ");
  9758. console.error(e);
  9759. }
  9760. }
  9761. reject(error);
  9762. });
  9763. })
  9764. };
  9765. Store.prototype.subscribe = function subscribe (fn, options) {
  9766. return genericSubscribe(fn, this._subscribers, options)
  9767. };
  9768. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  9769. var subs = typeof fn === 'function' ? { before: fn } : fn;
  9770. return genericSubscribe(subs, this._actionSubscribers, options)
  9771. };
  9772. Store.prototype.watch = function watch (getter, cb, options) {
  9773. var this$1 = this;
  9774. if ((true)) {
  9775. assert(typeof getter === 'function', "store.watch only accepts a function.");
  9776. }
  9777. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  9778. };
  9779. Store.prototype.replaceState = function replaceState (state) {
  9780. var this$1 = this;
  9781. this._withCommit(function () {
  9782. this$1._vm._data.$$state = state;
  9783. });
  9784. };
  9785. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  9786. if ( options === void 0 ) options = {};
  9787. if (typeof path === 'string') { path = [path]; }
  9788. if ((true)) {
  9789. assert(Array.isArray(path), "module path must be a string or an Array.");
  9790. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  9791. }
  9792. this._modules.register(path, rawModule);
  9793. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  9794. // reset store to update getters...
  9795. resetStoreVM(this, this.state);
  9796. };
  9797. Store.prototype.unregisterModule = function unregisterModule (path) {
  9798. var this$1 = this;
  9799. if (typeof path === 'string') { path = [path]; }
  9800. if ((true)) {
  9801. assert(Array.isArray(path), "module path must be a string or an Array.");
  9802. }
  9803. this._modules.unregister(path);
  9804. this._withCommit(function () {
  9805. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  9806. Vue.delete(parentState, path[path.length - 1]);
  9807. });
  9808. resetStore(this);
  9809. };
  9810. Store.prototype.hasModule = function hasModule (path) {
  9811. if (typeof path === 'string') { path = [path]; }
  9812. if ((true)) {
  9813. assert(Array.isArray(path), "module path must be a string or an Array.");
  9814. }
  9815. return this._modules.isRegistered(path)
  9816. };
  9817. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  9818. this._modules.update(newOptions);
  9819. resetStore(this, true);
  9820. };
  9821. Store.prototype._withCommit = function _withCommit (fn) {
  9822. var committing = this._committing;
  9823. this._committing = true;
  9824. fn();
  9825. this._committing = committing;
  9826. };
  9827. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  9828. function genericSubscribe (fn, subs, options) {
  9829. if (subs.indexOf(fn) < 0) {
  9830. options && options.prepend
  9831. ? subs.unshift(fn)
  9832. : subs.push(fn);
  9833. }
  9834. return function () {
  9835. var i = subs.indexOf(fn);
  9836. if (i > -1) {
  9837. subs.splice(i, 1);
  9838. }
  9839. }
  9840. }
  9841. function resetStore (store, hot) {
  9842. store._actions = Object.create(null);
  9843. store._mutations = Object.create(null);
  9844. store._wrappedGetters = Object.create(null);
  9845. store._modulesNamespaceMap = Object.create(null);
  9846. var state = store.state;
  9847. // init all modules
  9848. installModule(store, state, [], store._modules.root, true);
  9849. // reset vm
  9850. resetStoreVM(store, state, hot);
  9851. }
  9852. function resetStoreVM (store, state, hot) {
  9853. var oldVm = store._vm;
  9854. // bind store public getters
  9855. store.getters = {};
  9856. // reset local getters cache
  9857. store._makeLocalGettersCache = Object.create(null);
  9858. var wrappedGetters = store._wrappedGetters;
  9859. var computed = {};
  9860. forEachValue(wrappedGetters, function (fn, key) {
  9861. // use computed to leverage its lazy-caching mechanism
  9862. // direct inline function use will lead to closure preserving oldVm.
  9863. // using partial to return function with only arguments preserved in closure environment.
  9864. computed[key] = partial(fn, store);
  9865. Object.defineProperty(store.getters, key, {
  9866. get: function () { return store._vm[key]; },
  9867. enumerable: true // for local getters
  9868. });
  9869. });
  9870. // use a Vue instance to store the state tree
  9871. // suppress warnings just in case the user has added
  9872. // some funky global mixins
  9873. var silent = Vue.config.silent;
  9874. Vue.config.silent = true;
  9875. store._vm = new Vue({
  9876. data: {
  9877. $$state: state
  9878. },
  9879. computed: computed
  9880. });
  9881. Vue.config.silent = silent;
  9882. // enable strict mode for new vm
  9883. if (store.strict) {
  9884. enableStrictMode(store);
  9885. }
  9886. if (oldVm) {
  9887. if (hot) {
  9888. // dispatch changes in all subscribed watchers
  9889. // to force getter re-evaluation for hot reloading.
  9890. store._withCommit(function () {
  9891. oldVm._data.$$state = null;
  9892. });
  9893. }
  9894. Vue.nextTick(function () { return oldVm.$destroy(); });
  9895. }
  9896. }
  9897. function installModule (store, rootState, path, module, hot) {
  9898. var isRoot = !path.length;
  9899. var namespace = store._modules.getNamespace(path);
  9900. // register in namespace map
  9901. if (module.namespaced) {
  9902. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  9903. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  9904. }
  9905. store._modulesNamespaceMap[namespace] = module;
  9906. }
  9907. // set state
  9908. if (!isRoot && !hot) {
  9909. var parentState = getNestedState(rootState, path.slice(0, -1));
  9910. var moduleName = path[path.length - 1];
  9911. store._withCommit(function () {
  9912. if ((true)) {
  9913. if (moduleName in parentState) {
  9914. console.warn(
  9915. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  9916. );
  9917. }
  9918. }
  9919. Vue.set(parentState, moduleName, module.state);
  9920. });
  9921. }
  9922. var local = module.context = makeLocalContext(store, namespace, path);
  9923. module.forEachMutation(function (mutation, key) {
  9924. var namespacedType = namespace + key;
  9925. registerMutation(store, namespacedType, mutation, local);
  9926. });
  9927. module.forEachAction(function (action, key) {
  9928. var type = action.root ? key : namespace + key;
  9929. var handler = action.handler || action;
  9930. registerAction(store, type, handler, local);
  9931. });
  9932. module.forEachGetter(function (getter, key) {
  9933. var namespacedType = namespace + key;
  9934. registerGetter(store, namespacedType, getter, local);
  9935. });
  9936. module.forEachChild(function (child, key) {
  9937. installModule(store, rootState, path.concat(key), child, hot);
  9938. });
  9939. }
  9940. /**
  9941. * make localized dispatch, commit, getters and state
  9942. * if there is no namespace, just use root ones
  9943. */
  9944. function makeLocalContext (store, namespace, path) {
  9945. var noNamespace = namespace === '';
  9946. var local = {
  9947. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  9948. var args = unifyObjectStyle(_type, _payload, _options);
  9949. var payload = args.payload;
  9950. var options = args.options;
  9951. var type = args.type;
  9952. if (!options || !options.root) {
  9953. type = namespace + type;
  9954. if (( true) && !store._actions[type]) {
  9955. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  9956. return
  9957. }
  9958. }
  9959. return store.dispatch(type, payload)
  9960. },
  9961. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  9962. var args = unifyObjectStyle(_type, _payload, _options);
  9963. var payload = args.payload;
  9964. var options = args.options;
  9965. var type = args.type;
  9966. if (!options || !options.root) {
  9967. type = namespace + type;
  9968. if (( true) && !store._mutations[type]) {
  9969. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  9970. return
  9971. }
  9972. }
  9973. store.commit(type, payload, options);
  9974. }
  9975. };
  9976. // getters and state object must be gotten lazily
  9977. // because they will be changed by vm update
  9978. Object.defineProperties(local, {
  9979. getters: {
  9980. get: noNamespace
  9981. ? function () { return store.getters; }
  9982. : function () { return makeLocalGetters(store, namespace); }
  9983. },
  9984. state: {
  9985. get: function () { return getNestedState(store.state, path); }
  9986. }
  9987. });
  9988. return local
  9989. }
  9990. function makeLocalGetters (store, namespace) {
  9991. if (!store._makeLocalGettersCache[namespace]) {
  9992. var gettersProxy = {};
  9993. var splitPos = namespace.length;
  9994. Object.keys(store.getters).forEach(function (type) {
  9995. // skip if the target getter is not match this namespace
  9996. if (type.slice(0, splitPos) !== namespace) { return }
  9997. // extract local getter type
  9998. var localType = type.slice(splitPos);
  9999. // Add a port to the getters proxy.
  10000. // Define as getter property because
  10001. // we do not want to evaluate the getters in this time.
  10002. Object.defineProperty(gettersProxy, localType, {
  10003. get: function () { return store.getters[type]; },
  10004. enumerable: true
  10005. });
  10006. });
  10007. store._makeLocalGettersCache[namespace] = gettersProxy;
  10008. }
  10009. return store._makeLocalGettersCache[namespace]
  10010. }
  10011. function registerMutation (store, type, handler, local) {
  10012. var entry = store._mutations[type] || (store._mutations[type] = []);
  10013. entry.push(function wrappedMutationHandler (payload) {
  10014. handler.call(store, local.state, payload);
  10015. });
  10016. }
  10017. function registerAction (store, type, handler, local) {
  10018. var entry = store._actions[type] || (store._actions[type] = []);
  10019. entry.push(function wrappedActionHandler (payload) {
  10020. var res = handler.call(store, {
  10021. dispatch: local.dispatch,
  10022. commit: local.commit,
  10023. getters: local.getters,
  10024. state: local.state,
  10025. rootGetters: store.getters,
  10026. rootState: store.state
  10027. }, payload);
  10028. if (!isPromise(res)) {
  10029. res = Promise.resolve(res);
  10030. }
  10031. if (store._devtoolHook) {
  10032. return res.catch(function (err) {
  10033. store._devtoolHook.emit('vuex:error', err);
  10034. throw err
  10035. })
  10036. } else {
  10037. return res
  10038. }
  10039. });
  10040. }
  10041. function registerGetter (store, type, rawGetter, local) {
  10042. if (store._wrappedGetters[type]) {
  10043. if ((true)) {
  10044. console.error(("[vuex] duplicate getter key: " + type));
  10045. }
  10046. return
  10047. }
  10048. store._wrappedGetters[type] = function wrappedGetter (store) {
  10049. return rawGetter(
  10050. local.state, // local state
  10051. local.getters, // local getters
  10052. store.state, // root state
  10053. store.getters // root getters
  10054. )
  10055. };
  10056. }
  10057. function enableStrictMode (store) {
  10058. store._vm.$watch(function () { return this._data.$$state }, function () {
  10059. if ((true)) {
  10060. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  10061. }
  10062. }, { deep: true, sync: true });
  10063. }
  10064. function getNestedState (state, path) {
  10065. return path.reduce(function (state, key) { return state[key]; }, state)
  10066. }
  10067. function unifyObjectStyle (type, payload, options) {
  10068. if (isObject(type) && type.type) {
  10069. options = payload;
  10070. payload = type;
  10071. type = type.type;
  10072. }
  10073. if ((true)) {
  10074. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10075. }
  10076. return { type: type, payload: payload, options: options }
  10077. }
  10078. function install (_Vue) {
  10079. if (Vue && _Vue === Vue) {
  10080. if ((true)) {
  10081. console.error(
  10082. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10083. );
  10084. }
  10085. return
  10086. }
  10087. Vue = _Vue;
  10088. applyMixin(Vue);
  10089. }
  10090. /**
  10091. * Reduce the code which written in Vue.js for getting the state.
  10092. * @param {String} [namespace] - Module's namespace
  10093. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  10094. * @param {Object}
  10095. */
  10096. var mapState = normalizeNamespace(function (namespace, states) {
  10097. var res = {};
  10098. if (( true) && !isValidMap(states)) {
  10099. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  10100. }
  10101. normalizeMap(states).forEach(function (ref) {
  10102. var key = ref.key;
  10103. var val = ref.val;
  10104. res[key] = function mappedState () {
  10105. var state = this.$store.state;
  10106. var getters = this.$store.getters;
  10107. if (namespace) {
  10108. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  10109. if (!module) {
  10110. return
  10111. }
  10112. state = module.context.state;
  10113. getters = module.context.getters;
  10114. }
  10115. return typeof val === 'function'
  10116. ? val.call(this, state, getters)
  10117. : state[val]
  10118. };
  10119. // mark vuex getter for devtools
  10120. res[key].vuex = true;
  10121. });
  10122. return res
  10123. });
  10124. /**
  10125. * Reduce the code which written in Vue.js for committing the mutation
  10126. * @param {String} [namespace] - Module's namespace
  10127. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10128. * @return {Object}
  10129. */
  10130. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  10131. var res = {};
  10132. if (( true) && !isValidMap(mutations)) {
  10133. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  10134. }
  10135. normalizeMap(mutations).forEach(function (ref) {
  10136. var key = ref.key;
  10137. var val = ref.val;
  10138. res[key] = function mappedMutation () {
  10139. var args = [], len = arguments.length;
  10140. while ( len-- ) args[ len ] = arguments[ len ];
  10141. // Get the commit method from store
  10142. var commit = this.$store.commit;
  10143. if (namespace) {
  10144. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10145. if (!module) {
  10146. return
  10147. }
  10148. commit = module.context.commit;
  10149. }
  10150. return typeof val === 'function'
  10151. ? val.apply(this, [commit].concat(args))
  10152. : commit.apply(this.$store, [val].concat(args))
  10153. };
  10154. });
  10155. return res
  10156. });
  10157. /**
  10158. * Reduce the code which written in Vue.js for getting the getters
  10159. * @param {String} [namespace] - Module's namespace
  10160. * @param {Object|Array} getters
  10161. * @return {Object}
  10162. */
  10163. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10164. var res = {};
  10165. if (( true) && !isValidMap(getters)) {
  10166. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10167. }
  10168. normalizeMap(getters).forEach(function (ref) {
  10169. var key = ref.key;
  10170. var val = ref.val;
  10171. // The namespace has been mutated by normalizeNamespace
  10172. val = namespace + val;
  10173. res[key] = function mappedGetter () {
  10174. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10175. return
  10176. }
  10177. if (( true) && !(val in this.$store.getters)) {
  10178. console.error(("[vuex] unknown getter: " + val));
  10179. return
  10180. }
  10181. return this.$store.getters[val]
  10182. };
  10183. // mark vuex getter for devtools
  10184. res[key].vuex = true;
  10185. });
  10186. return res
  10187. });
  10188. /**
  10189. * Reduce the code which written in Vue.js for dispatch the action
  10190. * @param {String} [namespace] - Module's namespace
  10191. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10192. * @return {Object}
  10193. */
  10194. var mapActions = normalizeNamespace(function (namespace, actions) {
  10195. var res = {};
  10196. if (( true) && !isValidMap(actions)) {
  10197. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10198. }
  10199. normalizeMap(actions).forEach(function (ref) {
  10200. var key = ref.key;
  10201. var val = ref.val;
  10202. res[key] = function mappedAction () {
  10203. var args = [], len = arguments.length;
  10204. while ( len-- ) args[ len ] = arguments[ len ];
  10205. // get dispatch function from store
  10206. var dispatch = this.$store.dispatch;
  10207. if (namespace) {
  10208. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  10209. if (!module) {
  10210. return
  10211. }
  10212. dispatch = module.context.dispatch;
  10213. }
  10214. return typeof val === 'function'
  10215. ? val.apply(this, [dispatch].concat(args))
  10216. : dispatch.apply(this.$store, [val].concat(args))
  10217. };
  10218. });
  10219. return res
  10220. });
  10221. /**
  10222. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  10223. * @param {String} namespace
  10224. * @return {Object}
  10225. */
  10226. var createNamespacedHelpers = function (namespace) { return ({
  10227. mapState: mapState.bind(null, namespace),
  10228. mapGetters: mapGetters.bind(null, namespace),
  10229. mapMutations: mapMutations.bind(null, namespace),
  10230. mapActions: mapActions.bind(null, namespace)
  10231. }); };
  10232. /**
  10233. * Normalize the map
  10234. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  10235. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  10236. * @param {Array|Object} map
  10237. * @return {Object}
  10238. */
  10239. function normalizeMap (map) {
  10240. if (!isValidMap(map)) {
  10241. return []
  10242. }
  10243. return Array.isArray(map)
  10244. ? map.map(function (key) { return ({ key: key, val: key }); })
  10245. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  10246. }
  10247. /**
  10248. * Validate whether given map is valid or not
  10249. * @param {*} map
  10250. * @return {Boolean}
  10251. */
  10252. function isValidMap (map) {
  10253. return Array.isArray(map) || isObject(map)
  10254. }
  10255. /**
  10256. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  10257. * @param {Function} fn
  10258. * @return {Function}
  10259. */
  10260. function normalizeNamespace (fn) {
  10261. return function (namespace, map) {
  10262. if (typeof namespace !== 'string') {
  10263. map = namespace;
  10264. namespace = '';
  10265. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  10266. namespace += '/';
  10267. }
  10268. return fn(namespace, map)
  10269. }
  10270. }
  10271. /**
  10272. * Search a special module from store by namespace. if module not exist, print error message.
  10273. * @param {Object} store
  10274. * @param {String} helper
  10275. * @param {String} namespace
  10276. * @return {Object}
  10277. */
  10278. function getModuleByNamespace (store, helper, namespace) {
  10279. var module = store._modulesNamespaceMap[namespace];
  10280. if (( true) && !module) {
  10281. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  10282. }
  10283. return module
  10284. }
  10285. // Credits: borrowed code from fcomb/redux-logger
  10286. function createLogger (ref) {
  10287. if ( ref === void 0 ) ref = {};
  10288. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  10289. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  10290. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  10291. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  10292. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  10293. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  10294. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  10295. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  10296. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  10297. return function (store) {
  10298. var prevState = deepCopy(store.state);
  10299. if (typeof logger === 'undefined') {
  10300. return
  10301. }
  10302. if (logMutations) {
  10303. store.subscribe(function (mutation, state) {
  10304. var nextState = deepCopy(state);
  10305. if (filter(mutation, prevState, nextState)) {
  10306. var formattedTime = getFormattedTime();
  10307. var formattedMutation = mutationTransformer(mutation);
  10308. var message = "mutation " + (mutation.type) + formattedTime;
  10309. startMessage(logger, message, collapsed);
  10310. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  10311. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  10312. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  10313. endMessage(logger);
  10314. }
  10315. prevState = nextState;
  10316. });
  10317. }
  10318. if (logActions) {
  10319. store.subscribeAction(function (action, state) {
  10320. if (actionFilter(action, state)) {
  10321. var formattedTime = getFormattedTime();
  10322. var formattedAction = actionTransformer(action);
  10323. var message = "action " + (action.type) + formattedTime;
  10324. startMessage(logger, message, collapsed);
  10325. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  10326. endMessage(logger);
  10327. }
  10328. });
  10329. }
  10330. }
  10331. }
  10332. function startMessage (logger, message, collapsed) {
  10333. var startMessage = collapsed
  10334. ? logger.groupCollapsed
  10335. : logger.group;
  10336. // render
  10337. try {
  10338. startMessage.call(logger, message);
  10339. } catch (e) {
  10340. logger.log(message);
  10341. }
  10342. }
  10343. function endMessage (logger) {
  10344. try {
  10345. logger.groupEnd();
  10346. } catch (e) {
  10347. logger.log('—— log end ——');
  10348. }
  10349. }
  10350. function getFormattedTime () {
  10351. var time = new Date();
  10352. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  10353. }
  10354. function repeat (str, times) {
  10355. return (new Array(times + 1)).join(str)
  10356. }
  10357. function pad (num, maxLength) {
  10358. return repeat('0', maxLength - num.toString().length) + num
  10359. }
  10360. var index_cjs = {
  10361. Store: Store,
  10362. install: install,
  10363. version: '3.6.2',
  10364. mapState: mapState,
  10365. mapMutations: mapMutations,
  10366. mapGetters: mapGetters,
  10367. mapActions: mapActions,
  10368. createNamespacedHelpers: createNamespacedHelpers,
  10369. createLogger: createLogger
  10370. };
  10371. module.exports = index_cjs;
  10372. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  10373. /***/ }),
  10374. /***/ 29:
  10375. /*!****************************************!*\
  10376. !*** D:/2022/9/sx/store/model/user.js ***!
  10377. \****************************************/
  10378. /*! no static exports found */
  10379. /***/ (function(module, exports, __webpack_require__) {
  10380. "use strict";
  10381. /* WEBPACK VAR INJECTION */(function(uni) {
  10382. Object.defineProperty(exports, "__esModule", {
  10383. value: true
  10384. });
  10385. exports.default = void 0;
  10386. var state = {
  10387. userInfo: {},
  10388. //用户信息
  10389. orderInfo: {
  10390. complete_count: 0,
  10391. //完成
  10392. received_count: 0,
  10393. //待收货
  10394. unshipped_count: 0,
  10395. //待发货
  10396. order_count: 0,
  10397. //订单总数
  10398. unpaid_count: 0 //待付款
  10399. },
  10400. //订单信息
  10401. hasLogin: false //是否登录
  10402. };
  10403. var mutations = {
  10404. // 登录
  10405. login: function login(state) {
  10406. state.hasLogin = true;
  10407. },
  10408. // 退出登录
  10409. logout: function logout(state, provider) {
  10410. state.hasLogin = false;
  10411. // 清空基础信息
  10412. state.userInfo = {};
  10413. state.orderInfo = {
  10414. complete_count: 0,
  10415. //完成
  10416. received_count: 0,
  10417. //待收货
  10418. unshipped_count: 0,
  10419. //待发货
  10420. order_count: 0,
  10421. //订单总数
  10422. unpaid_count: 0 //待付款
  10423. };
  10424. // 清除缓存用户信息
  10425. uni.removeStorage({
  10426. key: 'userInfo'
  10427. });
  10428. // 清除缓存token
  10429. uni.removeStorage({
  10430. key: 'token'
  10431. });
  10432. },
  10433. // 保存用户信息
  10434. setUserInfo: function setUserInfo(state, provider) {
  10435. state.userInfo = provider;
  10436. uni.setStorage({
  10437. //缓存用户登陆状态
  10438. key: 'userInfo',
  10439. data: provider
  10440. });
  10441. },
  10442. // 保存订单信息
  10443. setOrderInfo: function setOrderInfo(state, provider) {
  10444. state.orderInfo = provider;
  10445. }
  10446. };
  10447. var getters = {};
  10448. var _default = {
  10449. namespaced: true,
  10450. state: state,
  10451. mutations: mutations,
  10452. getters: getters
  10453. };
  10454. exports.default = _default;
  10455. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10456. /***/ }),
  10457. /***/ 3:
  10458. /*!***********************************!*\
  10459. !*** (webpack)/buildin/global.js ***!
  10460. \***********************************/
  10461. /*! no static exports found */
  10462. /***/ (function(module, exports) {
  10463. var g;
  10464. // This works in non-strict mode
  10465. g = (function() {
  10466. return this;
  10467. })();
  10468. try {
  10469. // This works if eval is allowed (see CSP)
  10470. g = g || new Function("return this")();
  10471. } catch (e) {
  10472. // This works if the window reference is available
  10473. if (typeof window === "object") g = window;
  10474. }
  10475. // g can still be undefined, but nothing to do about it...
  10476. // We return undefined, instead of nothing here, so it's
  10477. // easier to handle this case. if(!global) { ...}
  10478. module.exports = g;
  10479. /***/ }),
  10480. /***/ 35:
  10481. /*!**********************************************************************************************************!*\
  10482. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  10483. \**********************************************************************************************************/
  10484. /*! exports provided: default */
  10485. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10486. "use strict";
  10487. __webpack_require__.r(__webpack_exports__);
  10488. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  10489. /* globals __VUE_SSR_CONTEXT__ */
  10490. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  10491. // This module is a runtime utility for cleaner component module output and will
  10492. // be included in the final webpack user bundle.
  10493. function normalizeComponent (
  10494. scriptExports,
  10495. render,
  10496. staticRenderFns,
  10497. functionalTemplate,
  10498. injectStyles,
  10499. scopeId,
  10500. moduleIdentifier, /* server only */
  10501. shadowMode, /* vue-cli only */
  10502. components, // fixed by xxxxxx auto components
  10503. renderjs // fixed by xxxxxx renderjs
  10504. ) {
  10505. // Vue.extend constructor export interop
  10506. var options = typeof scriptExports === 'function'
  10507. ? scriptExports.options
  10508. : scriptExports
  10509. // fixed by xxxxxx auto components
  10510. if (components) {
  10511. if (!options.components) {
  10512. options.components = {}
  10513. }
  10514. var hasOwn = Object.prototype.hasOwnProperty
  10515. for (var name in components) {
  10516. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  10517. options.components[name] = components[name]
  10518. }
  10519. }
  10520. }
  10521. // fixed by xxxxxx renderjs
  10522. if (renderjs) {
  10523. if(typeof renderjs.beforeCreate === 'function'){
  10524. renderjs.beforeCreate = [renderjs.beforeCreate]
  10525. }
  10526. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  10527. this[renderjs.__module] = this
  10528. });
  10529. (options.mixins || (options.mixins = [])).push(renderjs)
  10530. }
  10531. // render functions
  10532. if (render) {
  10533. options.render = render
  10534. options.staticRenderFns = staticRenderFns
  10535. options._compiled = true
  10536. }
  10537. // functional template
  10538. if (functionalTemplate) {
  10539. options.functional = true
  10540. }
  10541. // scopedId
  10542. if (scopeId) {
  10543. options._scopeId = 'data-v-' + scopeId
  10544. }
  10545. var hook
  10546. if (moduleIdentifier) { // server build
  10547. hook = function (context) {
  10548. // 2.3 injection
  10549. context =
  10550. context || // cached call
  10551. (this.$vnode && this.$vnode.ssrContext) || // stateful
  10552. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  10553. // 2.2 with runInNewContext: true
  10554. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  10555. context = __VUE_SSR_CONTEXT__
  10556. }
  10557. // inject component styles
  10558. if (injectStyles) {
  10559. injectStyles.call(this, context)
  10560. }
  10561. // register component module identifier for async chunk inferrence
  10562. if (context && context._registeredComponents) {
  10563. context._registeredComponents.add(moduleIdentifier)
  10564. }
  10565. }
  10566. // used by ssr in case component is cached and beforeCreate
  10567. // never gets called
  10568. options._ssrRegister = hook
  10569. } else if (injectStyles) {
  10570. hook = shadowMode
  10571. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  10572. : injectStyles
  10573. }
  10574. if (hook) {
  10575. if (options.functional) {
  10576. // for template-only hot-reload because in that case the render fn doesn't
  10577. // go through the normalizer
  10578. options._injectStyles = hook
  10579. // register for functioal component in vue file
  10580. var originalRender = options.render
  10581. options.render = function renderWithStyleInjection (h, context) {
  10582. hook.call(context)
  10583. return originalRender(h, context)
  10584. }
  10585. } else {
  10586. // inject component registration as beforeCreate hook
  10587. var existing = options.beforeCreate
  10588. options.beforeCreate = existing
  10589. ? [].concat(existing, hook)
  10590. : [hook]
  10591. }
  10592. }
  10593. return {
  10594. exports: scriptExports,
  10595. options: options
  10596. }
  10597. }
  10598. /***/ }),
  10599. /***/ 4:
  10600. /*!**********************************************************************!*\
  10601. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  10602. \**********************************************************************/
  10603. /*! no static exports found */
  10604. /***/ (function(module, exports) {
  10605. function _interopRequireDefault(obj) {
  10606. return obj && obj.__esModule ? obj : {
  10607. "default": obj
  10608. };
  10609. }
  10610. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10611. /***/ }),
  10612. /***/ 42:
  10613. /*!************************************************************************************************!*\
  10614. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  10615. \************************************************************************************************/
  10616. /*! no static exports found */
  10617. /***/ (function(module, exports, __webpack_require__) {
  10618. // TODO(Babel 8): Remove this file.
  10619. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 43)();
  10620. module.exports = runtime;
  10621. /***/ }),
  10622. /***/ 43:
  10623. /*!*******************************************************************!*\
  10624. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  10625. \*******************************************************************/
  10626. /*! no static exports found */
  10627. /***/ (function(module, exports, __webpack_require__) {
  10628. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  10629. function _regeneratorRuntime() {
  10630. "use strict";
  10631. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  10632. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  10633. return exports;
  10634. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10635. var exports = {},
  10636. Op = Object.prototype,
  10637. hasOwn = Op.hasOwnProperty,
  10638. defineProperty = Object.defineProperty || function (obj, key, desc) {
  10639. obj[key] = desc.value;
  10640. },
  10641. $Symbol = "function" == typeof Symbol ? Symbol : {},
  10642. iteratorSymbol = $Symbol.iterator || "@@iterator",
  10643. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  10644. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  10645. function define(obj, key, value) {
  10646. return Object.defineProperty(obj, key, {
  10647. value: value,
  10648. enumerable: !0,
  10649. configurable: !0,
  10650. writable: !0
  10651. }), obj[key];
  10652. }
  10653. try {
  10654. define({}, "");
  10655. } catch (err) {
  10656. define = function define(obj, key, value) {
  10657. return obj[key] = value;
  10658. };
  10659. }
  10660. function wrap(innerFn, outerFn, self, tryLocsList) {
  10661. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  10662. generator = Object.create(protoGenerator.prototype),
  10663. context = new Context(tryLocsList || []);
  10664. return defineProperty(generator, "_invoke", {
  10665. value: makeInvokeMethod(innerFn, self, context)
  10666. }), generator;
  10667. }
  10668. function tryCatch(fn, obj, arg) {
  10669. try {
  10670. return {
  10671. type: "normal",
  10672. arg: fn.call(obj, arg)
  10673. };
  10674. } catch (err) {
  10675. return {
  10676. type: "throw",
  10677. arg: err
  10678. };
  10679. }
  10680. }
  10681. exports.wrap = wrap;
  10682. var ContinueSentinel = {};
  10683. function Generator() {}
  10684. function GeneratorFunction() {}
  10685. function GeneratorFunctionPrototype() {}
  10686. var IteratorPrototype = {};
  10687. define(IteratorPrototype, iteratorSymbol, function () {
  10688. return this;
  10689. });
  10690. var getProto = Object.getPrototypeOf,
  10691. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  10692. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  10693. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  10694. function defineIteratorMethods(prototype) {
  10695. ["next", "throw", "return"].forEach(function (method) {
  10696. define(prototype, method, function (arg) {
  10697. return this._invoke(method, arg);
  10698. });
  10699. });
  10700. }
  10701. function AsyncIterator(generator, PromiseImpl) {
  10702. function invoke(method, arg, resolve, reject) {
  10703. var record = tryCatch(generator[method], generator, arg);
  10704. if ("throw" !== record.type) {
  10705. var result = record.arg,
  10706. value = result.value;
  10707. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  10708. invoke("next", value, resolve, reject);
  10709. }, function (err) {
  10710. invoke("throw", err, resolve, reject);
  10711. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  10712. result.value = unwrapped, resolve(result);
  10713. }, function (error) {
  10714. return invoke("throw", error, resolve, reject);
  10715. });
  10716. }
  10717. reject(record.arg);
  10718. }
  10719. var previousPromise;
  10720. defineProperty(this, "_invoke", {
  10721. value: function value(method, arg) {
  10722. function callInvokeWithMethodAndArg() {
  10723. return new PromiseImpl(function (resolve, reject) {
  10724. invoke(method, arg, resolve, reject);
  10725. });
  10726. }
  10727. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  10728. }
  10729. });
  10730. }
  10731. function makeInvokeMethod(innerFn, self, context) {
  10732. var state = "suspendedStart";
  10733. return function (method, arg) {
  10734. if ("executing" === state) throw new Error("Generator is already running");
  10735. if ("completed" === state) {
  10736. if ("throw" === method) throw arg;
  10737. return doneResult();
  10738. }
  10739. for (context.method = method, context.arg = arg;;) {
  10740. var delegate = context.delegate;
  10741. if (delegate) {
  10742. var delegateResult = maybeInvokeDelegate(delegate, context);
  10743. if (delegateResult) {
  10744. if (delegateResult === ContinueSentinel) continue;
  10745. return delegateResult;
  10746. }
  10747. }
  10748. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  10749. if ("suspendedStart" === state) throw state = "completed", context.arg;
  10750. context.dispatchException(context.arg);
  10751. } else "return" === context.method && context.abrupt("return", context.arg);
  10752. state = "executing";
  10753. var record = tryCatch(innerFn, self, context);
  10754. if ("normal" === record.type) {
  10755. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  10756. return {
  10757. value: record.arg,
  10758. done: context.done
  10759. };
  10760. }
  10761. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  10762. }
  10763. };
  10764. }
  10765. function maybeInvokeDelegate(delegate, context) {
  10766. var methodName = context.method,
  10767. method = delegate.iterator[methodName];
  10768. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  10769. var record = tryCatch(method, delegate.iterator, context.arg);
  10770. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  10771. var info = record.arg;
  10772. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  10773. }
  10774. function pushTryEntry(locs) {
  10775. var entry = {
  10776. tryLoc: locs[0]
  10777. };
  10778. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  10779. }
  10780. function resetTryEntry(entry) {
  10781. var record = entry.completion || {};
  10782. record.type = "normal", delete record.arg, entry.completion = record;
  10783. }
  10784. function Context(tryLocsList) {
  10785. this.tryEntries = [{
  10786. tryLoc: "root"
  10787. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  10788. }
  10789. function values(iterable) {
  10790. if (iterable) {
  10791. var iteratorMethod = iterable[iteratorSymbol];
  10792. if (iteratorMethod) return iteratorMethod.call(iterable);
  10793. if ("function" == typeof iterable.next) return iterable;
  10794. if (!isNaN(iterable.length)) {
  10795. var i = -1,
  10796. next = function next() {
  10797. for (; ++i < iterable.length;) {
  10798. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  10799. }
  10800. return next.value = undefined, next.done = !0, next;
  10801. };
  10802. return next.next = next;
  10803. }
  10804. }
  10805. return {
  10806. next: doneResult
  10807. };
  10808. }
  10809. function doneResult() {
  10810. return {
  10811. value: undefined,
  10812. done: !0
  10813. };
  10814. }
  10815. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  10816. value: GeneratorFunctionPrototype,
  10817. configurable: !0
  10818. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  10819. value: GeneratorFunction,
  10820. configurable: !0
  10821. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  10822. var ctor = "function" == typeof genFun && genFun.constructor;
  10823. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  10824. }, exports.mark = function (genFun) {
  10825. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  10826. }, exports.awrap = function (arg) {
  10827. return {
  10828. __await: arg
  10829. };
  10830. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  10831. return this;
  10832. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  10833. void 0 === PromiseImpl && (PromiseImpl = Promise);
  10834. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  10835. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  10836. return result.done ? result.value : iter.next();
  10837. });
  10838. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  10839. return this;
  10840. }), define(Gp, "toString", function () {
  10841. return "[object Generator]";
  10842. }), exports.keys = function (val) {
  10843. var object = Object(val),
  10844. keys = [];
  10845. for (var key in object) {
  10846. keys.push(key);
  10847. }
  10848. return keys.reverse(), function next() {
  10849. for (; keys.length;) {
  10850. var key = keys.pop();
  10851. if (key in object) return next.value = key, next.done = !1, next;
  10852. }
  10853. return next.done = !0, next;
  10854. };
  10855. }, exports.values = values, Context.prototype = {
  10856. constructor: Context,
  10857. reset: function reset(skipTempReset) {
  10858. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  10859. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  10860. }
  10861. },
  10862. stop: function stop() {
  10863. this.done = !0;
  10864. var rootRecord = this.tryEntries[0].completion;
  10865. if ("throw" === rootRecord.type) throw rootRecord.arg;
  10866. return this.rval;
  10867. },
  10868. dispatchException: function dispatchException(exception) {
  10869. if (this.done) throw exception;
  10870. var context = this;
  10871. function handle(loc, caught) {
  10872. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  10873. }
  10874. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10875. var entry = this.tryEntries[i],
  10876. record = entry.completion;
  10877. if ("root" === entry.tryLoc) return handle("end");
  10878. if (entry.tryLoc <= this.prev) {
  10879. var hasCatch = hasOwn.call(entry, "catchLoc"),
  10880. hasFinally = hasOwn.call(entry, "finallyLoc");
  10881. if (hasCatch && hasFinally) {
  10882. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  10883. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  10884. } else if (hasCatch) {
  10885. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  10886. } else {
  10887. if (!hasFinally) throw new Error("try statement without catch or finally");
  10888. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  10889. }
  10890. }
  10891. }
  10892. },
  10893. abrupt: function abrupt(type, arg) {
  10894. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10895. var entry = this.tryEntries[i];
  10896. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  10897. var finallyEntry = entry;
  10898. break;
  10899. }
  10900. }
  10901. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  10902. var record = finallyEntry ? finallyEntry.completion : {};
  10903. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  10904. },
  10905. complete: function complete(record, afterLoc) {
  10906. if ("throw" === record.type) throw record.arg;
  10907. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  10908. },
  10909. finish: function finish(finallyLoc) {
  10910. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10911. var entry = this.tryEntries[i];
  10912. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  10913. }
  10914. },
  10915. "catch": function _catch(tryLoc) {
  10916. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  10917. var entry = this.tryEntries[i];
  10918. if (entry.tryLoc === tryLoc) {
  10919. var record = entry.completion;
  10920. if ("throw" === record.type) {
  10921. var thrown = record.arg;
  10922. resetTryEntry(entry);
  10923. }
  10924. return thrown;
  10925. }
  10926. }
  10927. throw new Error("illegal catch attempt");
  10928. },
  10929. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  10930. return this.delegate = {
  10931. iterator: values(iterable),
  10932. resultName: resultName,
  10933. nextLoc: nextLoc
  10934. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  10935. }
  10936. }, exports;
  10937. }
  10938. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10939. /***/ }),
  10940. /***/ 44:
  10941. /*!*****************************************************************!*\
  10942. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  10943. \*****************************************************************/
  10944. /*! no static exports found */
  10945. /***/ (function(module, exports) {
  10946. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  10947. try {
  10948. var info = gen[key](arg);
  10949. var value = info.value;
  10950. } catch (error) {
  10951. reject(error);
  10952. return;
  10953. }
  10954. if (info.done) {
  10955. resolve(value);
  10956. } else {
  10957. Promise.resolve(value).then(_next, _throw);
  10958. }
  10959. }
  10960. function _asyncToGenerator(fn) {
  10961. return function () {
  10962. var self = this,
  10963. args = arguments;
  10964. return new Promise(function (resolve, reject) {
  10965. var gen = fn.apply(self, args);
  10966. function _next(value) {
  10967. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  10968. }
  10969. function _throw(err) {
  10970. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  10971. }
  10972. _next(undefined);
  10973. });
  10974. };
  10975. }
  10976. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10977. /***/ }),
  10978. /***/ 45:
  10979. /*!****************************************!*\
  10980. !*** D:/2022/9/sx/utils/loginUtils.js ***!
  10981. \****************************************/
  10982. /*! no static exports found */
  10983. /***/ (function(module, exports, __webpack_require__) {
  10984. "use strict";
  10985. /* WEBPACK VAR INJECTION */(function(uni) {
  10986. Object.defineProperty(exports, "__esModule", {
  10987. value: true
  10988. });
  10989. exports.getActionPage = getActionPage;
  10990. exports.getPageUrl = getPageUrl;
  10991. exports.interceptor = interceptor;
  10992. exports.saveUrl = saveUrl;
  10993. function getActionPage() {
  10994. var pages = getCurrentPages();
  10995. return pages[pages.length - 1];
  10996. }
  10997. //登录拦截
  10998. function interceptor() {
  10999. var pages = getActionPage();
  11000. // 获取当前页面
  11001. var pageUrl = '/' + pages.route;
  11002. var url = '/pages/public/login';
  11003. url = '/pages/public/wxLogin';
  11004. if (pageUrl != url) {
  11005. uni.navigateTo({
  11006. url: url
  11007. });
  11008. }
  11009. }
  11010. // 保存页面
  11011. function saveUrl() {
  11012. var path = getPageUrl(true);
  11013. uni.setStorageSync('present', path);
  11014. }
  11015. // 处理分享链接地址
  11016. function getPageUrl() {
  11017. var showSpeard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  11018. var page = getActionPage();
  11019. var path = '/' + page.route;
  11020. var url = '';
  11021. // 获取对象可枚举键值列表
  11022. var objKeys = Object.keys(page.options);
  11023. // 判断有无传值
  11024. if (objKeys.length > 0) {
  11025. // 循环赋值对象数据
  11026. for (var a in page.options) {
  11027. // 判断有无邀请人
  11028. if (a != 'speard') {
  11029. url += a + "=" + page.options[a] + "&";
  11030. } else {
  11031. // 判断是否需要存储邀请人
  11032. if (showSpeard) {
  11033. url += a + "=" + page.options[a] + "&";
  11034. }
  11035. }
  11036. }
  11037. path += '?' + url.substr(0, url.length - 1);
  11038. }
  11039. // 返回处理邀请人后的邀请地址
  11040. return path;
  11041. }
  11042. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11043. /***/ }),
  11044. /***/ 46:
  11045. /*!*********************************!*\
  11046. !*** D:/2022/9/sx/api/index.js ***!
  11047. \*********************************/
  11048. /*! no static exports found */
  11049. /***/ (function(module, exports, __webpack_require__) {
  11050. "use strict";
  11051. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11052. Object.defineProperty(exports, "__esModule", {
  11053. value: true
  11054. });
  11055. exports.buyMenber = buyMenber;
  11056. exports.calculation = calculation;
  11057. exports.getDefault = getDefault;
  11058. exports.getGcb = getGcb;
  11059. exports.getMenberCard = getMenberCard;
  11060. exports.getZyList = getZyList;
  11061. exports.groom1 = groom1;
  11062. exports.groom3 = groom3;
  11063. exports.groom4 = groom4;
  11064. exports.loadIndexs = loadIndexs;
  11065. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 47));
  11066. // 促销商品
  11067. function groom4(data) {
  11068. return (0, _request.default)({
  11069. url: '/api/groom/list/4',
  11070. method: 'get',
  11071. data: data
  11072. });
  11073. }
  11074. // 精品推荐
  11075. function groom1(data) {
  11076. return (0, _request.default)({
  11077. url: '/api/groom/list/1',
  11078. method: 'get',
  11079. data: data
  11080. });
  11081. }
  11082. // 新品首发
  11083. function groom3(data) {
  11084. return (0, _request.default)({
  11085. url: '/api/groom/list/3',
  11086. method: 'get',
  11087. data: data
  11088. });
  11089. }
  11090. // 获取首页信息
  11091. function loadIndexs(data) {
  11092. return (0, _request.default)({
  11093. url: '/api/index',
  11094. method: 'get',
  11095. data: data
  11096. });
  11097. }
  11098. // 会员卡列表
  11099. function getMenberCard(data) {
  11100. return (0, _request.default)({
  11101. url: '/api/card/list',
  11102. method: 'get',
  11103. data: data
  11104. });
  11105. }
  11106. //购买会员卡
  11107. function buyMenber(data) {
  11108. return (0, _request.default)({
  11109. url: '/api/card/routine',
  11110. method: 'post',
  11111. data: data
  11112. });
  11113. }
  11114. //获取材料
  11115. function getZyList(data) {
  11116. return (0, _request.default)({
  11117. url: '/api/water/list',
  11118. method: 'get',
  11119. data: data
  11120. });
  11121. }
  11122. //api/water/calculation
  11123. function calculation(data) {
  11124. return (0, _request.default)({
  11125. url: '/api/water/calculation',
  11126. method: 'post',
  11127. data: data
  11128. });
  11129. }
  11130. //根据高度获取默认方案
  11131. function getDefault(data) {
  11132. return (0, _request.default)({
  11133. url: '/api/water/default',
  11134. method: 'get',
  11135. data: data
  11136. });
  11137. }
  11138. //
  11139. function getGcb(data) {
  11140. return (0, _request.default)({
  11141. url: '/api/gc',
  11142. method: 'get',
  11143. data: data
  11144. });
  11145. }
  11146. /***/ }),
  11147. /***/ 47:
  11148. /*!*************************************!*\
  11149. !*** D:/2022/9/sx/utils/request.js ***!
  11150. \*************************************/
  11151. /*! no static exports found */
  11152. /***/ (function(module, exports, __webpack_require__) {
  11153. "use strict";
  11154. /* WEBPACK VAR INJECTION */(function(uni) {
  11155. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11156. Object.defineProperty(exports, "__esModule", {
  11157. value: true
  11158. });
  11159. exports.upFilse = exports.default = void 0;
  11160. var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 48));
  11161. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  11162. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 45);
  11163. // 请求完成后拦截
  11164. _newRequest.default.interceptors.response(function (response) {
  11165. try {
  11166. var res = response.data;
  11167. // 解析字符串为数字
  11168. if (res.status !== 200) {
  11169. console.log(res.status);
  11170. if (res.status == 410000) {
  11171. // 调用退出登录方法清空用户信息
  11172. _store.default.commit('user/logout');
  11173. // 判断是否开启强制登录
  11174. uni.showModal({
  11175. title: "登陆",
  11176. content: '您未登录!是否马上登录?',
  11177. success: function success(e) {
  11178. // 判断是否点击确认按钮
  11179. if (e.confirm) {
  11180. // 保存当前页面地址
  11181. (0, _loginUtils.saveUrl)();
  11182. // 跳转页面
  11183. (0, _loginUtils.interceptor)();
  11184. }
  11185. }
  11186. });
  11187. } else {
  11188. if (res.msg != '系统出现异常') {
  11189. uni.showToast({
  11190. title: res.msg,
  11191. duration: 1500,
  11192. mask: false,
  11193. icon: 'none'
  11194. });
  11195. }
  11196. }
  11197. return Promise.reject(res);
  11198. } else {
  11199. return res;
  11200. }
  11201. } catch (e) {
  11202. console.log(e);
  11203. }
  11204. }, function (error) {
  11205. uni.showToast({
  11206. title: "加载错误请重试",
  11207. duration: 1500,
  11208. mask: false,
  11209. icon: 'none'
  11210. });
  11211. return Promise.reject(error);
  11212. });
  11213. // 请求前拦截器
  11214. _newRequest.default.interceptors.request(function (config) {
  11215. var token = uni.getStorageSync('token') || '';
  11216. // console.log(config);
  11217. if (!config.header) {
  11218. config.header = {
  11219. "Authori-zation": 'Bearer ' + token
  11220. };
  11221. } else {
  11222. // 添加key请求头
  11223. config.header["Authori-zation"] = 'Bearer ' + token;
  11224. }
  11225. return config;
  11226. }, function (error) {
  11227. // 错误处理
  11228. console.log(error);
  11229. return Promise.reject(error);
  11230. });
  11231. var upFilse = _newRequest.default.upFilse;
  11232. exports.upFilse = upFilse;
  11233. var _default = _newRequest.default.open;
  11234. exports.default = _default;
  11235. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11236. /***/ }),
  11237. /***/ 48:
  11238. /*!****************************************!*\
  11239. !*** D:/2022/9/sx/utils/newRequest.js ***!
  11240. \****************************************/
  11241. /*! no static exports found */
  11242. /***/ (function(module, exports, __webpack_require__) {
  11243. "use strict";
  11244. /* WEBPACK VAR INJECTION */(function(uni) {
  11245. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11246. Object.defineProperty(exports, "__esModule", {
  11247. value: true
  11248. });
  11249. exports.default = void 0;
  11250. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 42));
  11251. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 44));
  11252. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  11253. var service = {
  11254. baseURL: _store.default.state.baseURL,
  11255. // 请求头
  11256. header: {
  11257. 'Content-Type': "application/x-www-form-urlencoded"
  11258. },
  11259. // 请求拦截器
  11260. interceptors: {
  11261. // 安装请求前拦截
  11262. request: function request(success, iserror) {
  11263. service.request.success = success;
  11264. service.request.error = iserror;
  11265. },
  11266. // 安装请求完成后拦截
  11267. response: function response(success, iserror) {
  11268. service.response.success = success;
  11269. service.response.error = iserror;
  11270. }
  11271. },
  11272. // 请求前拦截
  11273. request: {
  11274. // 回调成功执行方法
  11275. success: function success(e) {
  11276. return e;
  11277. },
  11278. // 回调失败
  11279. error: function error(e) {
  11280. return e;
  11281. }
  11282. },
  11283. // 请求完成后拦截
  11284. response: {
  11285. // 回调成功执行方法
  11286. success: function success(e) {
  11287. return e;
  11288. },
  11289. // 回调失败
  11290. error: function error(e) {
  11291. return e;
  11292. }
  11293. },
  11294. // 开始请求
  11295. open: function () {
  11296. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {
  11297. return _regenerator.default.wrap(function _callee$(_context) {
  11298. while (1) {
  11299. switch (_context.prev = _context.next) {
  11300. case 0:
  11301. _context.next = 2;
  11302. return new Promise(function (resolve, reject) {
  11303. var requestData = ''; //保存处理完成后请求数据
  11304. var url = ''; //保存链接地址
  11305. //console.log(data);
  11306. // 请求前数据处理
  11307. requestData = service.request.success(data);
  11308. url = service.baseURL + requestData.url;
  11309. // 数据复制用于请求
  11310. uni.request({
  11311. url: url,
  11312. method: requestData.method || 'GET',
  11313. data: requestData.data,
  11314. header: data.header || service.header,
  11315. success: function success(res) {
  11316. if (res.statusCode == 200) {
  11317. try {
  11318. resolve(service.response.success(res));
  11319. } catch (e) {
  11320. service.response.error(e);
  11321. }
  11322. }
  11323. },
  11324. // 请求失败数据处理
  11325. fail: function fail(err) {
  11326. service.response.error(err);
  11327. }
  11328. });
  11329. });
  11330. case 2:
  11331. return _context.abrupt("return", _context.sent);
  11332. case 3:
  11333. case "end":
  11334. return _context.stop();
  11335. }
  11336. }
  11337. }, _callee);
  11338. }));
  11339. function open(_x) {
  11340. return _open.apply(this, arguments);
  11341. }
  11342. return open;
  11343. }(),
  11344. // 上传文件
  11345. upFilse: function () {
  11346. var _upFilse = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {
  11347. return _regenerator.default.wrap(function _callee4$(_context4) {
  11348. while (1) {
  11349. switch (_context4.prev = _context4.next) {
  11350. case 0:
  11351. _context4.next = 2;
  11352. return new Promise(function (resolve, reject) {
  11353. var requestData = ''; //保存处理完成后请求数据
  11354. var url = ''; //保存请求地址
  11355. try {
  11356. // 请求前数据处理
  11357. requestData = service.request.success(data);
  11358. } catch (e) {
  11359. // 请求报错拦截
  11360. service.request.error(e);
  11361. }
  11362. url = service.baseURL + requestData.url;
  11363. var config = {
  11364. // 上传图片的API
  11365. upload_img_url: url
  11366. };
  11367. var Uploader = {
  11368. // 选择图片
  11369. choose: function choose(num) {
  11370. return new Promise(function (resolve, reject) {
  11371. uni.chooseImage({
  11372. count: num,
  11373. success: function success(res) {
  11374. // console.log(res);
  11375. // 缓存文件路径
  11376. resolve(res.tempFilePaths);
  11377. },
  11378. fail: function fail(err) {
  11379. console.log(err);
  11380. reject(err);
  11381. }
  11382. });
  11383. });
  11384. },
  11385. // 上传图片
  11386. upload_one: function upload_one(path) {
  11387. return new Promise(function (resolve, reject) {
  11388. uni.showLoading({
  11389. title: '上传中'
  11390. });
  11391. uni.uploadFile({
  11392. url: config.upload_img_url,
  11393. //仅为示例,非真实的接口地址
  11394. filePath: path,
  11395. name: 'file',
  11396. header: {
  11397. "Authori-zation": 'Bearer ' + uni.getStorageSync('token')
  11398. },
  11399. success: function success(uploadFileRes) {
  11400. if ("string" === typeof uploadFileRes.data) {
  11401. resolve(JSON.parse(uploadFileRes.data).data);
  11402. } else {
  11403. resolve(uploadFileRes.data.data);
  11404. }
  11405. },
  11406. complete: function complete() {
  11407. uni.hideLoading();
  11408. }
  11409. });
  11410. });
  11411. },
  11412. // 上传多个图片
  11413. upload: function upload(path_arr) {
  11414. var _this = this;
  11415. var num = path_arr.length;
  11416. return new Promise( /*#__PURE__*/function () {
  11417. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
  11418. var img_urls, i, img_url;
  11419. return _regenerator.default.wrap(function _callee2$(_context2) {
  11420. while (1) {
  11421. switch (_context2.prev = _context2.next) {
  11422. case 0:
  11423. img_urls = [];
  11424. i = 0;
  11425. case 2:
  11426. if (!(i < num)) {
  11427. _context2.next = 10;
  11428. break;
  11429. }
  11430. _context2.next = 5;
  11431. return _this.upload_one(path_arr[i]);
  11432. case 5:
  11433. img_url = _context2.sent;
  11434. img_urls.push(img_url);
  11435. case 7:
  11436. i++;
  11437. _context2.next = 2;
  11438. break;
  11439. case 10:
  11440. ;
  11441. resolve(img_urls);
  11442. case 12:
  11443. case "end":
  11444. return _context2.stop();
  11445. }
  11446. }
  11447. }, _callee2);
  11448. }));
  11449. return function (_x3, _x4) {
  11450. return _ref.apply(this, arguments);
  11451. };
  11452. }());
  11453. },
  11454. // 触发上传图片事件
  11455. choose_and_upload: function choose_and_upload(num) {
  11456. var _this2 = this;
  11457. return new Promise( /*#__PURE__*/function () {
  11458. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {
  11459. var path_arr;
  11460. return _regenerator.default.wrap(function _callee3$(_context3) {
  11461. while (1) {
  11462. switch (_context3.prev = _context3.next) {
  11463. case 0:
  11464. _context3.next = 2;
  11465. return _this2.choose(num);
  11466. case 2:
  11467. path_arr = _context3.sent;
  11468. _context3.next = 5;
  11469. return _this2.upload(path_arr).then(function (e) {
  11470. resolve(e);
  11471. }).catch(function (e) {
  11472. reject(e);
  11473. });
  11474. case 5:
  11475. case "end":
  11476. return _context3.stop();
  11477. }
  11478. }
  11479. }, _callee3);
  11480. }));
  11481. return function (_x5, _x6) {
  11482. return _ref2.apply(this, arguments);
  11483. };
  11484. }());
  11485. }
  11486. };
  11487. Uploader.choose_and_upload(1).then(function (e) {
  11488. resolve(e);
  11489. }).catch(function (e) {
  11490. console.log(e);
  11491. });
  11492. });
  11493. case 2:
  11494. return _context4.abrupt("return", _context4.sent);
  11495. case 3:
  11496. case "end":
  11497. return _context4.stop();
  11498. }
  11499. }
  11500. }, _callee4);
  11501. }));
  11502. function upFilse(_x2) {
  11503. return _upFilse.apply(this, arguments);
  11504. }
  11505. return upFilse;
  11506. }()
  11507. };
  11508. var _default = service;
  11509. exports.default = _default;
  11510. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11511. /***/ }),
  11512. /***/ 49:
  11513. /*!********************************!*\
  11514. !*** D:/2022/9/sx/api/user.js ***!
  11515. \********************************/
  11516. /*! no static exports found */
  11517. /***/ (function(module, exports, __webpack_require__) {
  11518. "use strict";
  11519. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11520. Object.defineProperty(exports, "__esModule", {
  11521. value: true
  11522. });
  11523. exports.addressDel = addressDel;
  11524. exports.addressEdit = addressEdit;
  11525. exports.article = article;
  11526. exports.cartDel = cartDel;
  11527. exports.delcollect = delcollect;
  11528. exports.details = details;
  11529. exports.edit = edit;
  11530. exports.getAddressList = getAddressList;
  11531. exports.getCartList = getCartList;
  11532. exports.getCartNum = getCartNum;
  11533. exports.getJsList = getJsList;
  11534. exports.getUserInfo = getUserInfo;
  11535. exports.getcollectList = getcollectList;
  11536. exports.getjsDetail = getjsDetail;
  11537. exports.orderData = orderData;
  11538. exports.setAddressDefault = setAddressDefault;
  11539. exports.spreadBanner = spreadBanner;
  11540. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 47));
  11541. // 订单统计信息
  11542. function orderData(data) {
  11543. return (0, _request.default)({
  11544. url: '/api/order/data',
  11545. method: 'get',
  11546. data: data
  11547. });
  11548. }
  11549. // 获取用户信息
  11550. function getUserInfo(data) {
  11551. return (0, _request.default)({
  11552. url: '/api/userinfo',
  11553. method: 'get',
  11554. data: data
  11555. });
  11556. }
  11557. // 用户分享图
  11558. function spreadBanner(data) {
  11559. return (0, _request.default)({
  11560. url: '/api/spread/banner',
  11561. method: 'get',
  11562. data: data
  11563. });
  11564. }
  11565. // 获取地址列表
  11566. function getAddressList(data) {
  11567. return (0, _request.default)({
  11568. url: '/api/address/list',
  11569. method: 'get',
  11570. data: data
  11571. });
  11572. }
  11573. // 修改地址
  11574. function addressEdit(data) {
  11575. return (0, _request.default)({
  11576. url: '/api/address/edit',
  11577. method: 'post',
  11578. data: data
  11579. });
  11580. }
  11581. // 删除地址
  11582. function addressDel(data) {
  11583. return (0, _request.default)({
  11584. url: '/api/address/del',
  11585. method: 'post',
  11586. data: data
  11587. });
  11588. }
  11589. // 设为默认地址
  11590. function setAddressDefault(data) {
  11591. return (0, _request.default)({
  11592. url: '/api/address/default/set',
  11593. method: 'post',
  11594. data: data
  11595. });
  11596. }
  11597. // 购物车列表
  11598. function getCartList(data) {
  11599. return (0, _request.default)({
  11600. url: '/api/cart/list',
  11601. method: 'get',
  11602. data: data
  11603. });
  11604. }
  11605. // 修改购物车数量
  11606. function getCartNum(data) {
  11607. return (0, _request.default)({
  11608. url: '/api/cart/num',
  11609. method: 'post',
  11610. data: data
  11611. });
  11612. }
  11613. //删除购物车
  11614. function cartDel(data) {
  11615. return (0, _request.default)({
  11616. url: '/api/cart/del',
  11617. method: 'post',
  11618. data: data
  11619. });
  11620. }
  11621. //获取收藏夹列表
  11622. function getcollectList(data) {
  11623. return (0, _request.default)({
  11624. url: '/api/collect/user',
  11625. method: 'get',
  11626. data: data
  11627. });
  11628. }
  11629. // 取消收藏
  11630. function delcollect(data) {
  11631. return (0, _request.default)({
  11632. url: '/api/collect/del',
  11633. method: 'post',
  11634. data: data
  11635. });
  11636. }
  11637. //用户修改信息
  11638. function edit(data) {
  11639. return (0, _request.default)({
  11640. url: '/api/user/edit',
  11641. method: 'post',
  11642. data: data
  11643. });
  11644. }
  11645. // /api/article/list
  11646. function article(data, id) {
  11647. return (0, _request.default)({
  11648. url: '/api/article/list/' + id,
  11649. method: 'get',
  11650. data: data
  11651. });
  11652. }
  11653. function getJsList(data) {
  11654. return (0, _request.default)({
  11655. url: '/api/water/query_list',
  11656. method: 'get',
  11657. data: data
  11658. });
  11659. }
  11660. function getjsDetail(data) {
  11661. return (0, _request.default)({
  11662. url: '/api/water/query_details',
  11663. method: 'get',
  11664. data: data
  11665. });
  11666. }
  11667. function details(data, id) {
  11668. return (0, _request.default)({
  11669. url: '/api/article/details/' + id,
  11670. method: 'get',
  11671. data: data
  11672. });
  11673. }
  11674. /***/ }),
  11675. /***/ 5:
  11676. /*!**************************************************************!*\
  11677. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  11678. \**************************************************************/
  11679. /*! no static exports found */
  11680. /***/ (function(module, exports, __webpack_require__) {
  11681. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  11682. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  11683. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  11684. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  11685. function _slicedToArray(arr, i) {
  11686. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  11687. }
  11688. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11689. /***/ }),
  11690. /***/ 6:
  11691. /*!***************************************************************!*\
  11692. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  11693. \***************************************************************/
  11694. /*! no static exports found */
  11695. /***/ (function(module, exports) {
  11696. function _arrayWithHoles(arr) {
  11697. if (Array.isArray(arr)) return arr;
  11698. }
  11699. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11700. /***/ }),
  11701. /***/ 7:
  11702. /*!*********************************************************************!*\
  11703. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  11704. \*********************************************************************/
  11705. /*! no static exports found */
  11706. /***/ (function(module, exports) {
  11707. function _iterableToArrayLimit(arr, i) {
  11708. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  11709. if (null != _i) {
  11710. var _s,
  11711. _e,
  11712. _x,
  11713. _r,
  11714. _arr = [],
  11715. _n = !0,
  11716. _d = !1;
  11717. try {
  11718. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  11719. if (Object(_i) !== _i) return;
  11720. _n = !1;
  11721. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  11722. ;
  11723. }
  11724. } catch (err) {
  11725. _d = !0, _e = err;
  11726. } finally {
  11727. try {
  11728. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  11729. } finally {
  11730. if (_d) throw _e;
  11731. }
  11732. }
  11733. return _arr;
  11734. }
  11735. }
  11736. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11737. /***/ }),
  11738. /***/ 8:
  11739. /*!***************************************************************************!*\
  11740. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  11741. \***************************************************************************/
  11742. /*! no static exports found */
  11743. /***/ (function(module, exports, __webpack_require__) {
  11744. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  11745. function _unsupportedIterableToArray(o, minLen) {
  11746. if (!o) return;
  11747. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  11748. var n = Object.prototype.toString.call(o).slice(8, -1);
  11749. if (n === "Object" && o.constructor) n = o.constructor.name;
  11750. if (n === "Map" || n === "Set") return Array.from(o);
  11751. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  11752. }
  11753. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11754. /***/ }),
  11755. /***/ 82:
  11756. /*!*********************************!*\
  11757. !*** D:/2022/9/sx/api/login.js ***!
  11758. \*********************************/
  11759. /*! no static exports found */
  11760. /***/ (function(module, exports, __webpack_require__) {
  11761. "use strict";
  11762. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11763. Object.defineProperty(exports, "__esModule", {
  11764. value: true
  11765. });
  11766. exports.bangding = bangding;
  11767. exports.getUserInfo = getUserInfo;
  11768. exports.login = login;
  11769. exports.loginMobile = loginMobile;
  11770. exports.register = register;
  11771. exports.verify = verify;
  11772. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 47));
  11773. // 登录
  11774. function login(data) {
  11775. return (0, _request.default)({
  11776. url: '/api/login',
  11777. method: 'post',
  11778. data: data
  11779. });
  11780. }
  11781. // 注册
  11782. function register(data) {
  11783. return (0, _request.default)({
  11784. url: '/api/register',
  11785. method: 'post',
  11786. data: data
  11787. });
  11788. }
  11789. // 验证码
  11790. function verify(data) {
  11791. // type=register为注册
  11792. // type=login为登录
  11793. return (0, _request.default)({
  11794. url: '/api/register/verify',
  11795. method: 'post',
  11796. data: data
  11797. });
  11798. }
  11799. // 获取用户信息
  11800. function getUserInfo(data) {
  11801. return (0, _request.default)({
  11802. url: '/api/userinfo',
  11803. method: 'get',
  11804. data: data
  11805. });
  11806. }
  11807. // 短信登录
  11808. function loginMobile(data) {
  11809. return (0, _request.default)({
  11810. url: '/api/login/mobile',
  11811. method: 'post',
  11812. data: data
  11813. });
  11814. }
  11815. //绑定手机号
  11816. function bangding(data) {
  11817. return (0, _request.default)({
  11818. url: '/api/binding',
  11819. method: 'POST',
  11820. data: data
  11821. });
  11822. }
  11823. /***/ }),
  11824. /***/ 9:
  11825. /*!*****************************************************************!*\
  11826. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  11827. \*****************************************************************/
  11828. /*! no static exports found */
  11829. /***/ (function(module, exports) {
  11830. function _arrayLikeToArray(arr, len) {
  11831. if (len == null || len > arr.length) len = arr.length;
  11832. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  11833. arr2[i] = arr[i];
  11834. }
  11835. return arr2;
  11836. }
  11837. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11838. /***/ }),
  11839. /***/ 99:
  11840. /*!******************************************!*\
  11841. !*** D:/2022/9/sx/utils/wxMinProgram.js ***!
  11842. \******************************************/
  11843. /*! no static exports found */
  11844. /***/ (function(module, exports, __webpack_require__) {
  11845. "use strict";
  11846. /* WEBPACK VAR INJECTION */(function(uni, wx) {
  11847. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11848. Object.defineProperty(exports, "__esModule", {
  11849. value: true
  11850. });
  11851. exports.loginWinxinMp = loginWinxinMp;
  11852. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  11853. //微信登录
  11854. /**
  11855. * @param {string} 当前页面地址信息
  11856. */
  11857. function loginWinxinMp() {
  11858. var pages = getCurrentPages();
  11859. // 获取跳转前页面
  11860. var page = pages[pages.length - 2];
  11861. var queryUrl = '';
  11862. for (var key in page.options) {
  11863. queryUrl += key + '=' + page.options[key] + "&";
  11864. }
  11865. // 获取当页面路由地址
  11866. var path = '/' + page.route + '?' + queryUrl;
  11867. // 保存跳转前页面
  11868. uni.setStorageSync('present', path);
  11869. return new Promise(function (resolve, reject) {
  11870. wx.login({
  11871. success: function success(e) {
  11872. // uni.showModal({
  11873. // title:'zhi1',
  11874. // content:JSON.stringify(e)
  11875. // })
  11876. console.log(e);
  11877. resolve(e);
  11878. },
  11879. fill: function fill(e) {
  11880. reject(e);
  11881. }
  11882. });
  11883. });
  11884. }
  11885. ;
  11886. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  11887. /***/ })
  11888. }]);
  11889. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map