vendor.js 379 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  10. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. function sortObject(obj) {
  107. var sortObj = {};
  108. if (isPlainObject(obj)) {
  109. Object.keys(obj).sort().forEach(function (key) {
  110. sortObj[key] = obj[key];
  111. });
  112. }
  113. return !Object.keys(sortObj) ? obj : sortObj;
  114. }
  115. var HOOKS = [
  116. 'invoke',
  117. 'success',
  118. 'fail',
  119. 'complete',
  120. 'returnValue'];
  121. var globalInterceptors = {};
  122. var scopedInterceptors = {};
  123. function mergeHook(parentVal, childVal) {
  124. var res = childVal ?
  125. parentVal ?
  126. parentVal.concat(childVal) :
  127. Array.isArray(childVal) ?
  128. childVal : [childVal] :
  129. parentVal;
  130. return res ?
  131. dedupeHooks(res) :
  132. res;
  133. }
  134. function dedupeHooks(hooks) {
  135. var res = [];
  136. for (var i = 0; i < hooks.length; i++) {
  137. if (res.indexOf(hooks[i]) === -1) {
  138. res.push(hooks[i]);
  139. }
  140. }
  141. return res;
  142. }
  143. function removeHook(hooks, hook) {
  144. var index = hooks.indexOf(hook);
  145. if (index !== -1) {
  146. hooks.splice(index, 1);
  147. }
  148. }
  149. function mergeInterceptorHook(interceptor, option) {
  150. Object.keys(option).forEach(function (hook) {
  151. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  152. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  153. }
  154. });
  155. }
  156. function removeInterceptorHook(interceptor, option) {
  157. if (!interceptor || !option) {
  158. return;
  159. }
  160. Object.keys(option).forEach(function (hook) {
  161. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  162. removeHook(interceptor[hook], option[hook]);
  163. }
  164. });
  165. }
  166. function addInterceptor(method, option) {
  167. if (typeof method === 'string' && isPlainObject(option)) {
  168. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  169. } else if (isPlainObject(method)) {
  170. mergeInterceptorHook(globalInterceptors, method);
  171. }
  172. }
  173. function removeInterceptor(method, option) {
  174. if (typeof method === 'string') {
  175. if (isPlainObject(option)) {
  176. removeInterceptorHook(scopedInterceptors[method], option);
  177. } else {
  178. delete scopedInterceptors[method];
  179. }
  180. } else if (isPlainObject(method)) {
  181. removeInterceptorHook(globalInterceptors, method);
  182. }
  183. }
  184. function wrapperHook(hook) {
  185. return function (data) {
  186. return hook(data) || data;
  187. };
  188. }
  189. function isPromise(obj) {
  190. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  191. }
  192. function queue(hooks, data) {
  193. var promise = false;
  194. for (var i = 0; i < hooks.length; i++) {
  195. var hook = hooks[i];
  196. if (promise) {
  197. promise = Promise.resolve(wrapperHook(hook));
  198. } else {
  199. var res = hook(data);
  200. if (isPromise(res)) {
  201. promise = Promise.resolve(res);
  202. }
  203. if (res === false) {
  204. return {
  205. then: function then() {} };
  206. }
  207. }
  208. }
  209. return promise || {
  210. then: function then(callback) {
  211. return callback(data);
  212. } };
  213. }
  214. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  215. ['success', 'fail', 'complete'].forEach(function (name) {
  216. if (Array.isArray(interceptor[name])) {
  217. var oldCallback = options[name];
  218. options[name] = function callbackInterceptor(res) {
  219. queue(interceptor[name], res).then(function (res) {
  220. /* eslint-disable no-mixed-operators */
  221. return isFn(oldCallback) && oldCallback(res) || res;
  222. });
  223. };
  224. }
  225. });
  226. return options;
  227. }
  228. function wrapperReturnValue(method, returnValue) {
  229. var returnValueHooks = [];
  230. if (Array.isArray(globalInterceptors.returnValue)) {
  231. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  232. }
  233. var interceptor = scopedInterceptors[method];
  234. if (interceptor && Array.isArray(interceptor.returnValue)) {
  235. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  236. }
  237. returnValueHooks.forEach(function (hook) {
  238. returnValue = hook(returnValue) || returnValue;
  239. });
  240. return returnValue;
  241. }
  242. function getApiInterceptorHooks(method) {
  243. var interceptor = Object.create(null);
  244. Object.keys(globalInterceptors).forEach(function (hook) {
  245. if (hook !== 'returnValue') {
  246. interceptor[hook] = globalInterceptors[hook].slice();
  247. }
  248. });
  249. var scopedInterceptor = scopedInterceptors[method];
  250. if (scopedInterceptor) {
  251. Object.keys(scopedInterceptor).forEach(function (hook) {
  252. if (hook !== 'returnValue') {
  253. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  254. }
  255. });
  256. }
  257. return interceptor;
  258. }
  259. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  260. var interceptor = getApiInterceptorHooks(method);
  261. if (interceptor && Object.keys(interceptor).length) {
  262. if (Array.isArray(interceptor.invoke)) {
  263. var res = queue(interceptor.invoke, options);
  264. return res.then(function (options) {
  265. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  266. });
  267. } else {
  268. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  269. }
  270. }
  271. return api.apply(void 0, [options].concat(params));
  272. }
  273. var promiseInterceptor = {
  274. returnValue: function returnValue(res) {
  275. if (!isPromise(res)) {
  276. return res;
  277. }
  278. return new Promise(function (resolve, reject) {
  279. res.then(function (res) {
  280. if (res[0]) {
  281. reject(res[0]);
  282. } else {
  283. resolve(res[1]);
  284. }
  285. });
  286. });
  287. } };
  288. var SYNC_API_RE =
  289. /^\$|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/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  295. var CALLBACK_API_RE = /^on|^off/;
  296. function isContextApi(name) {
  297. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  298. }
  299. function isSyncApi(name) {
  300. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  301. }
  302. function isCallbackApi(name) {
  303. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  304. }
  305. function handlePromise(promise) {
  306. return promise.then(function (data) {
  307. return [null, data];
  308. }).
  309. catch(function (err) {return [err];});
  310. }
  311. function shouldPromise(name) {
  312. if (
  313. isContextApi(name) ||
  314. isSyncApi(name) ||
  315. isCallbackApi(name))
  316. {
  317. return false;
  318. }
  319. return true;
  320. }
  321. /* eslint-disable no-extend-native */
  322. if (!Promise.prototype.finally) {
  323. Promise.prototype.finally = function (callback) {
  324. var promise = this.constructor;
  325. return this.then(
  326. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  327. function (reason) {return promise.resolve(callback()).then(function () {
  328. throw reason;
  329. });});
  330. };
  331. }
  332. function promisify(name, api) {
  333. if (!shouldPromise(name)) {
  334. return api;
  335. }
  336. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  337. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  338. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  339. }
  340. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  341. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  342. success: resolve,
  343. fail: reject })].concat(
  344. params));
  345. })));
  346. };
  347. }
  348. var EPS = 1e-4;
  349. var BASE_DEVICE_WIDTH = 750;
  350. var isIOS = false;
  351. var deviceWidth = 0;
  352. var deviceDPR = 0;
  353. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  354. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  355. deviceWidth = windowWidth;
  356. deviceDPR = pixelRatio;
  357. isIOS = platform === 'ios';
  358. }
  359. function upx2px(number, newDeviceWidth) {
  360. if (deviceWidth === 0) {
  361. checkDeviceWidth();
  362. }
  363. number = Number(number);
  364. if (number === 0) {
  365. return 0;
  366. }
  367. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  368. if (result < 0) {
  369. result = -result;
  370. }
  371. result = Math.floor(result + EPS);
  372. if (result === 0) {
  373. if (deviceDPR === 1 || !isIOS) {
  374. result = 1;
  375. } else {
  376. result = 0.5;
  377. }
  378. }
  379. return number < 0 ? -result : result;
  380. }
  381. var LOCALE_ZH_HANS = 'zh-Hans';
  382. var LOCALE_ZH_HANT = 'zh-Hant';
  383. var LOCALE_EN = 'en';
  384. var LOCALE_FR = 'fr';
  385. var LOCALE_ES = 'es';
  386. var messages = {};
  387. var locale;
  388. {
  389. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  390. }
  391. function initI18nMessages() {
  392. if (!isEnableLocale()) {
  393. return;
  394. }
  395. var localeKeys = Object.keys(__uniConfig.locales);
  396. if (localeKeys.length) {
  397. localeKeys.forEach(function (locale) {
  398. var curMessages = messages[locale];
  399. var userMessages = __uniConfig.locales[locale];
  400. if (curMessages) {
  401. Object.assign(curMessages, userMessages);
  402. } else {
  403. messages[locale] = userMessages;
  404. }
  405. });
  406. }
  407. }
  408. initI18nMessages();
  409. var i18n = (0, _uniI18n.initVueI18n)(
  410. locale,
  411. {});
  412. var t = i18n.t;
  413. var i18nMixin = i18n.mixin = {
  414. beforeCreate: function beforeCreate() {var _this = this;
  415. var unwatch = i18n.i18n.watchLocale(function () {
  416. _this.$forceUpdate();
  417. });
  418. this.$once('hook:beforeDestroy', function () {
  419. unwatch();
  420. });
  421. },
  422. methods: {
  423. $$t: function $$t(key, values) {
  424. return t(key, values);
  425. } } };
  426. var setLocale = i18n.setLocale;
  427. var getLocale = i18n.getLocale;
  428. function initAppLocale(Vue, appVm, locale) {
  429. var state = Vue.observable({
  430. locale: locale || i18n.getLocale() });
  431. var localeWatchers = [];
  432. appVm.$watchLocale = function (fn) {
  433. localeWatchers.push(fn);
  434. };
  435. Object.defineProperty(appVm, '$locale', {
  436. get: function get() {
  437. return state.locale;
  438. },
  439. set: function set(v) {
  440. state.locale = v;
  441. localeWatchers.forEach(function (watch) {return watch(v);});
  442. } });
  443. }
  444. function isEnableLocale() {
  445. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  446. }
  447. function include(str, parts) {
  448. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  449. }
  450. function startsWith(str, parts) {
  451. return parts.find(function (part) {return str.indexOf(part) === 0;});
  452. }
  453. function normalizeLocale(locale, messages) {
  454. if (!locale) {
  455. return;
  456. }
  457. locale = locale.trim().replace(/_/g, '-');
  458. if (messages && messages[locale]) {
  459. return locale;
  460. }
  461. locale = locale.toLowerCase();
  462. if (locale === 'chinese') {
  463. // 支付宝
  464. return LOCALE_ZH_HANS;
  465. }
  466. if (locale.indexOf('zh') === 0) {
  467. if (locale.indexOf('-hans') > -1) {
  468. return LOCALE_ZH_HANS;
  469. }
  470. if (locale.indexOf('-hant') > -1) {
  471. return LOCALE_ZH_HANT;
  472. }
  473. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  474. return LOCALE_ZH_HANT;
  475. }
  476. return LOCALE_ZH_HANS;
  477. }
  478. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  479. if (lang) {
  480. return lang;
  481. }
  482. }
  483. // export function initI18n() {
  484. // const localeKeys = Object.keys(__uniConfig.locales || {})
  485. // if (localeKeys.length) {
  486. // localeKeys.forEach((locale) =>
  487. // i18n.add(locale, __uniConfig.locales[locale])
  488. // )
  489. // }
  490. // }
  491. function getLocale$1() {
  492. // 优先使用 $locale
  493. var app = getApp({
  494. allowDefault: true });
  495. if (app && app.$vm) {
  496. return app.$vm.$locale;
  497. }
  498. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  499. }
  500. function setLocale$1(locale) {
  501. var app = getApp();
  502. if (!app) {
  503. return false;
  504. }
  505. var oldLocale = app.$vm.$locale;
  506. if (oldLocale !== locale) {
  507. app.$vm.$locale = locale;
  508. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  509. locale: locale });});
  510. return true;
  511. }
  512. return false;
  513. }
  514. var onLocaleChangeCallbacks = [];
  515. function onLocaleChange(fn) {
  516. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  517. onLocaleChangeCallbacks.push(fn);
  518. }
  519. }
  520. if (typeof global !== 'undefined') {
  521. global.getLocale = getLocale$1;
  522. }
  523. var interceptors = {
  524. promiseInterceptor: promiseInterceptor };
  525. var baseApi = /*#__PURE__*/Object.freeze({
  526. __proto__: null,
  527. upx2px: upx2px,
  528. getLocale: getLocale$1,
  529. setLocale: setLocale$1,
  530. onLocaleChange: onLocaleChange,
  531. addInterceptor: addInterceptor,
  532. removeInterceptor: removeInterceptor,
  533. interceptors: interceptors });
  534. function findExistsPageIndex(url) {
  535. var pages = getCurrentPages();
  536. var len = pages.length;
  537. while (len--) {
  538. var page = pages[len];
  539. if (page.$page && page.$page.fullPath === url) {
  540. return len;
  541. }
  542. }
  543. return -1;
  544. }
  545. var redirectTo = {
  546. name: function name(fromArgs) {
  547. if (fromArgs.exists === 'back' && fromArgs.delta) {
  548. return 'navigateBack';
  549. }
  550. return 'redirectTo';
  551. },
  552. args: function args(fromArgs) {
  553. if (fromArgs.exists === 'back' && fromArgs.url) {
  554. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  555. if (existsPageIndex !== -1) {
  556. var delta = getCurrentPages().length - 1 - existsPageIndex;
  557. if (delta > 0) {
  558. fromArgs.delta = delta;
  559. }
  560. }
  561. }
  562. } };
  563. var previewImage = {
  564. args: function args(fromArgs) {
  565. var currentIndex = parseInt(fromArgs.current);
  566. if (isNaN(currentIndex)) {
  567. return;
  568. }
  569. var urls = fromArgs.urls;
  570. if (!Array.isArray(urls)) {
  571. return;
  572. }
  573. var len = urls.length;
  574. if (!len) {
  575. return;
  576. }
  577. if (currentIndex < 0) {
  578. currentIndex = 0;
  579. } else if (currentIndex >= len) {
  580. currentIndex = len - 1;
  581. }
  582. if (currentIndex > 0) {
  583. fromArgs.current = urls[currentIndex];
  584. fromArgs.urls = urls.filter(
  585. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  586. } else {
  587. fromArgs.current = urls[0];
  588. }
  589. return {
  590. indicator: false,
  591. loop: false };
  592. } };
  593. var UUID_KEY = '__DC_STAT_UUID';
  594. var deviceId;
  595. function useDeviceId(result) {
  596. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  597. if (!deviceId) {
  598. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  599. wx.setStorage({
  600. key: UUID_KEY,
  601. data: deviceId });
  602. }
  603. result.deviceId = deviceId;
  604. }
  605. function addSafeAreaInsets(result) {
  606. if (result.safeArea) {
  607. var safeArea = result.safeArea;
  608. result.safeAreaInsets = {
  609. top: safeArea.top,
  610. left: safeArea.left,
  611. right: result.windowWidth - safeArea.right,
  612. bottom: result.screenHeight - safeArea.bottom };
  613. }
  614. }
  615. function populateParameters(result) {var _result$brand =
  616. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  617. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  618. // osName osVersion
  619. var osName = '';
  620. var osVersion = '';
  621. {
  622. osName = system.split(' ')[0] || '';
  623. osVersion = system.split(' ')[1] || '';
  624. }
  625. var hostVersion = version;
  626. // deviceType
  627. var deviceType = getGetDeviceType(result, model);
  628. // deviceModel
  629. var deviceBrand = getDeviceBrand(brand);
  630. // hostName
  631. var _hostName = getHostName(result);
  632. // deviceOrientation
  633. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  634. // devicePixelRatio
  635. var _devicePixelRatio = pixelRatio;
  636. // SDKVersion
  637. var _SDKVersion = SDKVersion;
  638. // hostLanguage
  639. var hostLanguage = language.replace(/_/g, '-');
  640. // wx.getAccountInfoSync
  641. var parameters = {
  642. appId: "__UNI__EEC3739",
  643. appName: "台州互联融媒体",
  644. appVersion: "1.0.7",
  645. appVersionCode: "107",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.5.3",
  648. uniRuntimeVersion: "3.5.3",
  649. uniPlatform: undefined || "mp-weixin",
  650. deviceBrand: deviceBrand,
  651. deviceModel: model,
  652. deviceType: deviceType,
  653. devicePixelRatio: _devicePixelRatio,
  654. deviceOrientation: _deviceOrientation,
  655. osName: osName.toLocaleLowerCase(),
  656. osVersion: osVersion,
  657. hostTheme: theme,
  658. hostVersion: hostVersion,
  659. hostLanguage: hostLanguage,
  660. hostName: _hostName,
  661. hostSDKVersion: _SDKVersion,
  662. hostFontSizeSetting: fontSizeSetting,
  663. windowTop: 0,
  664. windowBottom: 0,
  665. // TODO
  666. osLanguage: undefined,
  667. osTheme: undefined,
  668. ua: undefined,
  669. hostPackageName: undefined,
  670. browserName: undefined,
  671. browserVersion: undefined };
  672. Object.assign(result, parameters);
  673. }
  674. function getGetDeviceType(result, model) {
  675. var deviceType = result.deviceType || 'phone';
  676. {
  677. var deviceTypeMaps = {
  678. ipad: 'pad',
  679. windows: 'pc',
  680. mac: 'pc' };
  681. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  682. var _model = model.toLocaleLowerCase();
  683. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  684. var _m = deviceTypeMapsKeys[index];
  685. if (_model.indexOf(_m) !== -1) {
  686. deviceType = deviceTypeMaps[_m];
  687. break;
  688. }
  689. }
  690. }
  691. return deviceType;
  692. }
  693. function getDeviceBrand(brand) {
  694. var deviceBrand = brand;
  695. if (deviceBrand) {
  696. deviceBrand = brand.toLocaleLowerCase();
  697. }
  698. return deviceBrand;
  699. }
  700. function getAppLanguage(defaultLanguage) {
  701. return getLocale$1 ?
  702. getLocale$1() :
  703. defaultLanguage;
  704. }
  705. function getHostName(result) {
  706. var _platform = 'WeChat';
  707. var _hostName = result.hostName || _platform; // mp-jd
  708. {
  709. if (result.environment) {
  710. _hostName = result.environment;
  711. } else if (result.host && result.host.env) {
  712. _hostName = result.host.env;
  713. }
  714. }
  715. return _hostName;
  716. }
  717. var getSystemInfo = {
  718. returnValue: function returnValue(result) {
  719. useDeviceId(result);
  720. addSafeAreaInsets(result);
  721. populateParameters(result);
  722. } };
  723. var showActionSheet = {
  724. args: function args(fromArgs) {
  725. if (typeof fromArgs === 'object') {
  726. fromArgs.alertText = fromArgs.title;
  727. }
  728. } };
  729. var getAppBaseInfo = {
  730. returnValue: function returnValue(result) {var _result =
  731. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  732. var _hostName = getHostName(result);
  733. var hostLanguage = language.replace('_', '-');
  734. result = sortObject(Object.assign(result, {
  735. appId: "__UNI__EEC3739",
  736. appName: "台州互联融媒体",
  737. appVersion: "1.0.7",
  738. appVersionCode: "107",
  739. appLanguage: getAppLanguage(hostLanguage),
  740. hostVersion: version,
  741. hostLanguage: hostLanguage,
  742. hostName: _hostName,
  743. hostSDKVersion: SDKVersion,
  744. hostTheme: theme }));
  745. } };
  746. var getDeviceInfo = {
  747. returnValue: function returnValue(result) {var _result2 =
  748. result,brand = _result2.brand,model = _result2.model;
  749. var deviceType = getGetDeviceType(result, model);
  750. var deviceBrand = getDeviceBrand(brand);
  751. useDeviceId(result);
  752. result = sortObject(Object.assign(result, {
  753. deviceType: deviceType,
  754. deviceBrand: deviceBrand,
  755. deviceModel: model }));
  756. } };
  757. var getWindowInfo = {
  758. returnValue: function returnValue(result) {
  759. addSafeAreaInsets(result);
  760. result = sortObject(Object.assign(result, {
  761. windowTop: 0,
  762. windowBottom: 0 }));
  763. } };
  764. var getAppAuthorizeSetting = {
  765. returnValue: function returnValue(result) {var
  766. locationReducedAccuracy = result.locationReducedAccuracy;
  767. result.locationAccuracy = 'unsupported';
  768. if (locationReducedAccuracy === true) {
  769. result.locationAccuracy = 'reduced';
  770. } else if (locationReducedAccuracy === false) {
  771. result.locationAccuracy = 'full';
  772. }
  773. } };
  774. // import navigateTo from 'uni-helpers/navigate-to'
  775. var protocols = {
  776. redirectTo: redirectTo,
  777. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  778. previewImage: previewImage,
  779. getSystemInfo: getSystemInfo,
  780. getSystemInfoSync: getSystemInfo,
  781. showActionSheet: showActionSheet,
  782. getAppBaseInfo: getAppBaseInfo,
  783. getDeviceInfo: getDeviceInfo,
  784. getWindowInfo: getWindowInfo,
  785. getAppAuthorizeSetting: getAppAuthorizeSetting };
  786. var todos = [
  787. 'vibrate',
  788. 'preloadPage',
  789. 'unPreloadPage',
  790. 'loadSubPackage'];
  791. var canIUses = [];
  792. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  793. function processCallback(methodName, method, returnValue) {
  794. return function (res) {
  795. return method(processReturnValue(methodName, res, returnValue));
  796. };
  797. }
  798. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  799. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  800. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  801. if (isFn(argsOption)) {
  802. argsOption = argsOption(fromArgs, toArgs) || {};
  803. }
  804. for (var key in fromArgs) {
  805. if (hasOwn(argsOption, key)) {
  806. var keyOption = argsOption[key];
  807. if (isFn(keyOption)) {
  808. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  809. }
  810. if (!keyOption) {// 不支持的参数
  811. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  812. } else if (isStr(keyOption)) {// 重写参数 key
  813. toArgs[keyOption] = fromArgs[key];
  814. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  815. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  816. }
  817. } else if (CALLBACKS.indexOf(key) !== -1) {
  818. if (isFn(fromArgs[key])) {
  819. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  820. }
  821. } else {
  822. if (!keepFromArgs) {
  823. toArgs[key] = fromArgs[key];
  824. }
  825. }
  826. }
  827. return toArgs;
  828. } else if (isFn(fromArgs)) {
  829. fromArgs = processCallback(methodName, fromArgs, returnValue);
  830. }
  831. return fromArgs;
  832. }
  833. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  834. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  835. res = protocols.returnValue(methodName, res);
  836. }
  837. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  838. }
  839. function wrapper(methodName, method) {
  840. if (hasOwn(protocols, methodName)) {
  841. var protocol = protocols[methodName];
  842. if (!protocol) {// 暂不支持的 api
  843. return function () {
  844. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  845. };
  846. }
  847. return function (arg1, arg2) {// 目前 api 最多两个参数
  848. var options = protocol;
  849. if (isFn(protocol)) {
  850. options = protocol(arg1);
  851. }
  852. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  853. var args = [arg1];
  854. if (typeof arg2 !== 'undefined') {
  855. args.push(arg2);
  856. }
  857. if (isFn(options.name)) {
  858. methodName = options.name(arg1);
  859. } else if (isStr(options.name)) {
  860. methodName = options.name;
  861. }
  862. var returnValue = wx[methodName].apply(wx, args);
  863. if (isSyncApi(methodName)) {// 同步 api
  864. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  865. }
  866. return returnValue;
  867. };
  868. }
  869. return method;
  870. }
  871. var todoApis = Object.create(null);
  872. var TODOS = [
  873. 'onTabBarMidButtonTap',
  874. 'subscribePush',
  875. 'unsubscribePush',
  876. 'onPush',
  877. 'offPush',
  878. 'share'];
  879. function createTodoApi(name) {
  880. return function todoApi(_ref)
  881. {var fail = _ref.fail,complete = _ref.complete;
  882. var res = {
  883. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  884. isFn(fail) && fail(res);
  885. isFn(complete) && complete(res);
  886. };
  887. }
  888. TODOS.forEach(function (name) {
  889. todoApis[name] = createTodoApi(name);
  890. });
  891. var providers = {
  892. oauth: ['weixin'],
  893. share: ['weixin'],
  894. payment: ['wxpay'],
  895. push: ['weixin'] };
  896. function getProvider(_ref2)
  897. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  898. var res = false;
  899. if (providers[service]) {
  900. res = {
  901. errMsg: 'getProvider:ok',
  902. service: service,
  903. provider: providers[service] };
  904. isFn(success) && success(res);
  905. } else {
  906. res = {
  907. errMsg: 'getProvider:fail service not found' };
  908. isFn(fail) && fail(res);
  909. }
  910. isFn(complete) && complete(res);
  911. }
  912. var extraApi = /*#__PURE__*/Object.freeze({
  913. __proto__: null,
  914. getProvider: getProvider });
  915. var getEmitter = function () {
  916. var Emitter;
  917. return function getUniEmitter() {
  918. if (!Emitter) {
  919. Emitter = new _vue.default();
  920. }
  921. return Emitter;
  922. };
  923. }();
  924. function apply(ctx, method, args) {
  925. return ctx[method].apply(ctx, args);
  926. }
  927. function $on() {
  928. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  929. }
  930. function $off() {
  931. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  932. }
  933. function $once() {
  934. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  935. }
  936. function $emit() {
  937. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  938. }
  939. var eventApi = /*#__PURE__*/Object.freeze({
  940. __proto__: null,
  941. $on: $on,
  942. $off: $off,
  943. $once: $once,
  944. $emit: $emit });
  945. /**
  946. * 框架内 try-catch
  947. */
  948. /**
  949. * 开发者 try-catch
  950. */
  951. function tryCatch(fn) {
  952. return function () {
  953. try {
  954. return fn.apply(fn, arguments);
  955. } catch (e) {
  956. // TODO
  957. console.error(e);
  958. }
  959. };
  960. }
  961. function getApiCallbacks(params) {
  962. var apiCallbacks = {};
  963. for (var name in params) {
  964. var param = params[name];
  965. if (isFn(param)) {
  966. apiCallbacks[name] = tryCatch(param);
  967. delete params[name];
  968. }
  969. }
  970. return apiCallbacks;
  971. }
  972. var cid;
  973. var cidErrMsg;
  974. var enabled;
  975. function normalizePushMessage(message) {
  976. try {
  977. return JSON.parse(message);
  978. } catch (e) {}
  979. return message;
  980. }
  981. function invokePushCallback(
  982. args)
  983. {
  984. if (args.type === 'enabled') {
  985. enabled = true;
  986. } else if (args.type === 'clientId') {
  987. cid = args.cid;
  988. cidErrMsg = args.errMsg;
  989. invokeGetPushCidCallbacks(cid, args.errMsg);
  990. } else if (args.type === 'pushMsg') {
  991. var message = {
  992. type: 'receive',
  993. data: normalizePushMessage(args.message) };
  994. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  995. var callback = onPushMessageCallbacks[i];
  996. callback(message);
  997. // 该消息已被阻止
  998. if (message.stopped) {
  999. break;
  1000. }
  1001. }
  1002. } else if (args.type === 'click') {
  1003. onPushMessageCallbacks.forEach(function (callback) {
  1004. callback({
  1005. type: 'click',
  1006. data: normalizePushMessage(args.message) });
  1007. });
  1008. }
  1009. }
  1010. var getPushCidCallbacks = [];
  1011. function invokeGetPushCidCallbacks(cid, errMsg) {
  1012. getPushCidCallbacks.forEach(function (callback) {
  1013. callback(cid, errMsg);
  1014. });
  1015. getPushCidCallbacks.length = 0;
  1016. }
  1017. function getPushClientId(args) {
  1018. if (!isPlainObject(args)) {
  1019. args = {};
  1020. }var _getApiCallbacks =
  1021. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1022. var hasSuccess = isFn(success);
  1023. var hasFail = isFn(fail);
  1024. var hasComplete = isFn(complete);
  1025. Promise.resolve().then(function () {
  1026. if (typeof enabled === 'undefined') {
  1027. enabled = false;
  1028. cid = '';
  1029. cidErrMsg = 'unipush is not enabled';
  1030. }
  1031. getPushCidCallbacks.push(function (cid, errMsg) {
  1032. var res;
  1033. if (cid) {
  1034. res = {
  1035. errMsg: 'getPushClientId:ok',
  1036. cid: cid };
  1037. hasSuccess && success(res);
  1038. } else {
  1039. res = {
  1040. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '') };
  1041. hasFail && fail(res);
  1042. }
  1043. hasComplete && complete(res);
  1044. });
  1045. if (typeof cid !== 'undefined') {
  1046. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1047. }
  1048. });
  1049. }
  1050. var onPushMessageCallbacks = [];
  1051. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1052. var onPushMessage = function onPushMessage(fn) {
  1053. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1054. onPushMessageCallbacks.push(fn);
  1055. }
  1056. };
  1057. var offPushMessage = function offPushMessage(fn) {
  1058. if (!fn) {
  1059. onPushMessageCallbacks.length = 0;
  1060. } else {
  1061. var index = onPushMessageCallbacks.indexOf(fn);
  1062. if (index > -1) {
  1063. onPushMessageCallbacks.splice(index, 1);
  1064. }
  1065. }
  1066. };
  1067. var api = /*#__PURE__*/Object.freeze({
  1068. __proto__: null,
  1069. getPushClientId: getPushClientId,
  1070. onPushMessage: onPushMessage,
  1071. offPushMessage: offPushMessage,
  1072. invokePushCallback: invokePushCallback });
  1073. var MPPage = Page;
  1074. var MPComponent = Component;
  1075. var customizeRE = /:/g;
  1076. var customize = cached(function (str) {
  1077. return camelize(str.replace(customizeRE, '-'));
  1078. });
  1079. function initTriggerEvent(mpInstance) {
  1080. var oldTriggerEvent = mpInstance.triggerEvent;
  1081. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1082. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1083. };
  1084. try {
  1085. // 京东小程序 triggerEvent 为只读
  1086. mpInstance.triggerEvent = newTriggerEvent;
  1087. } catch (error) {
  1088. mpInstance._triggerEvent = newTriggerEvent;
  1089. }
  1090. }
  1091. function initHook(name, options, isComponent) {
  1092. var oldHook = options[name];
  1093. if (!oldHook) {
  1094. options[name] = function () {
  1095. initTriggerEvent(this);
  1096. };
  1097. } else {
  1098. options[name] = function () {
  1099. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1100. return oldHook.apply(this, args);
  1101. };
  1102. }
  1103. }
  1104. if (!MPPage.__$wrappered) {
  1105. MPPage.__$wrappered = true;
  1106. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1107. initHook('onLoad', options);
  1108. return MPPage(options);
  1109. };
  1110. Page.after = MPPage.after;
  1111. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1112. initHook('created', options);
  1113. return MPComponent(options);
  1114. };
  1115. }
  1116. var PAGE_EVENT_HOOKS = [
  1117. 'onPullDownRefresh',
  1118. 'onReachBottom',
  1119. 'onAddToFavorites',
  1120. 'onShareTimeline',
  1121. 'onShareAppMessage',
  1122. 'onPageScroll',
  1123. 'onResize',
  1124. 'onTabItemTap'];
  1125. function initMocks(vm, mocks) {
  1126. var mpInstance = vm.$mp[vm.mpType];
  1127. mocks.forEach(function (mock) {
  1128. if (hasOwn(mpInstance, mock)) {
  1129. vm[mock] = mpInstance[mock];
  1130. }
  1131. });
  1132. }
  1133. function hasHook(hook, vueOptions) {
  1134. if (!vueOptions) {
  1135. return true;
  1136. }
  1137. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1138. return true;
  1139. }
  1140. vueOptions = vueOptions.default || vueOptions;
  1141. if (isFn(vueOptions)) {
  1142. if (isFn(vueOptions.extendOptions[hook])) {
  1143. return true;
  1144. }
  1145. if (vueOptions.super &&
  1146. vueOptions.super.options &&
  1147. Array.isArray(vueOptions.super.options[hook])) {
  1148. return true;
  1149. }
  1150. return false;
  1151. }
  1152. if (isFn(vueOptions[hook])) {
  1153. return true;
  1154. }
  1155. var mixins = vueOptions.mixins;
  1156. if (Array.isArray(mixins)) {
  1157. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1158. }
  1159. }
  1160. function initHooks(mpOptions, hooks, vueOptions) {
  1161. hooks.forEach(function (hook) {
  1162. if (hasHook(hook, vueOptions)) {
  1163. mpOptions[hook] = function (args) {
  1164. return this.$vm && this.$vm.__call_hook(hook, args);
  1165. };
  1166. }
  1167. });
  1168. }
  1169. function initVueComponent(Vue, vueOptions) {
  1170. vueOptions = vueOptions.default || vueOptions;
  1171. var VueComponent;
  1172. if (isFn(vueOptions)) {
  1173. VueComponent = vueOptions;
  1174. } else {
  1175. VueComponent = Vue.extend(vueOptions);
  1176. }
  1177. vueOptions = VueComponent.options;
  1178. return [VueComponent, vueOptions];
  1179. }
  1180. function initSlots(vm, vueSlots) {
  1181. if (Array.isArray(vueSlots) && vueSlots.length) {
  1182. var $slots = Object.create(null);
  1183. vueSlots.forEach(function (slotName) {
  1184. $slots[slotName] = true;
  1185. });
  1186. vm.$scopedSlots = vm.$slots = $slots;
  1187. }
  1188. }
  1189. function initVueIds(vueIds, mpInstance) {
  1190. vueIds = (vueIds || '').split(',');
  1191. var len = vueIds.length;
  1192. if (len === 1) {
  1193. mpInstance._$vueId = vueIds[0];
  1194. } else if (len === 2) {
  1195. mpInstance._$vueId = vueIds[0];
  1196. mpInstance._$vuePid = vueIds[1];
  1197. }
  1198. }
  1199. function initData(vueOptions, context) {
  1200. var data = vueOptions.data || {};
  1201. var methods = vueOptions.methods || {};
  1202. if (typeof data === 'function') {
  1203. try {
  1204. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1205. } catch (e) {
  1206. if (Object({"VUE_APP_NAME":"台州互联融媒体","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1207. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1208. }
  1209. }
  1210. } else {
  1211. try {
  1212. // 对 data 格式化
  1213. data = JSON.parse(JSON.stringify(data));
  1214. } catch (e) {}
  1215. }
  1216. if (!isPlainObject(data)) {
  1217. data = {};
  1218. }
  1219. Object.keys(methods).forEach(function (methodName) {
  1220. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1221. data[methodName] = methods[methodName];
  1222. }
  1223. });
  1224. return data;
  1225. }
  1226. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1227. function createObserver(name) {
  1228. return function observer(newVal, oldVal) {
  1229. if (this.$vm) {
  1230. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1231. }
  1232. };
  1233. }
  1234. function initBehaviors(vueOptions, initBehavior) {
  1235. var vueBehaviors = vueOptions.behaviors;
  1236. var vueExtends = vueOptions.extends;
  1237. var vueMixins = vueOptions.mixins;
  1238. var vueProps = vueOptions.props;
  1239. if (!vueProps) {
  1240. vueOptions.props = vueProps = [];
  1241. }
  1242. var behaviors = [];
  1243. if (Array.isArray(vueBehaviors)) {
  1244. vueBehaviors.forEach(function (behavior) {
  1245. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1246. if (behavior === 'uni://form-field') {
  1247. if (Array.isArray(vueProps)) {
  1248. vueProps.push('name');
  1249. vueProps.push('value');
  1250. } else {
  1251. vueProps.name = {
  1252. type: String,
  1253. default: '' };
  1254. vueProps.value = {
  1255. type: [String, Number, Boolean, Array, Object, Date],
  1256. default: '' };
  1257. }
  1258. }
  1259. });
  1260. }
  1261. if (isPlainObject(vueExtends) && vueExtends.props) {
  1262. behaviors.push(
  1263. initBehavior({
  1264. properties: initProperties(vueExtends.props, true) }));
  1265. }
  1266. if (Array.isArray(vueMixins)) {
  1267. vueMixins.forEach(function (vueMixin) {
  1268. if (isPlainObject(vueMixin) && vueMixin.props) {
  1269. behaviors.push(
  1270. initBehavior({
  1271. properties: initProperties(vueMixin.props, true) }));
  1272. }
  1273. });
  1274. }
  1275. return behaviors;
  1276. }
  1277. function parsePropType(key, type, defaultValue, file) {
  1278. // [String]=>String
  1279. if (Array.isArray(type) && type.length === 1) {
  1280. return type[0];
  1281. }
  1282. return type;
  1283. }
  1284. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var options = arguments.length > 3 ? arguments[3] : undefined;
  1285. var properties = {};
  1286. if (!isBehavior) {
  1287. properties.vueId = {
  1288. type: String,
  1289. value: '' };
  1290. {
  1291. if (options.virtualHost) {
  1292. properties.virtualHostStyle = {
  1293. type: null,
  1294. value: '' };
  1295. properties.virtualHostClass = {
  1296. type: null,
  1297. value: '' };
  1298. }
  1299. }
  1300. // scopedSlotsCompiler auto
  1301. properties.scopedSlotsCompiler = {
  1302. type: String,
  1303. value: '' };
  1304. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1305. type: null,
  1306. value: [],
  1307. observer: function observer(newVal, oldVal) {
  1308. var $slots = Object.create(null);
  1309. newVal.forEach(function (slotName) {
  1310. $slots[slotName] = true;
  1311. });
  1312. this.setData({
  1313. $slots: $slots });
  1314. } };
  1315. }
  1316. if (Array.isArray(props)) {// ['title']
  1317. props.forEach(function (key) {
  1318. properties[key] = {
  1319. type: null,
  1320. observer: createObserver(key) };
  1321. });
  1322. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1323. Object.keys(props).forEach(function (key) {
  1324. var opts = props[key];
  1325. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1326. var value = opts.default;
  1327. if (isFn(value)) {
  1328. value = value();
  1329. }
  1330. opts.type = parsePropType(key, opts.type);
  1331. properties[key] = {
  1332. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1333. value: value,
  1334. observer: createObserver(key) };
  1335. } else {// content:String
  1336. var type = parsePropType(key, opts);
  1337. properties[key] = {
  1338. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1339. observer: createObserver(key) };
  1340. }
  1341. });
  1342. }
  1343. return properties;
  1344. }
  1345. function wrapper$1(event) {
  1346. // TODO 又得兼容 mpvue 的 mp 对象
  1347. try {
  1348. event.mp = JSON.parse(JSON.stringify(event));
  1349. } catch (e) {}
  1350. event.stopPropagation = noop;
  1351. event.preventDefault = noop;
  1352. event.target = event.target || {};
  1353. if (!hasOwn(event, 'detail')) {
  1354. event.detail = {};
  1355. }
  1356. if (hasOwn(event, 'markerId')) {
  1357. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1358. event.detail.markerId = event.markerId;
  1359. }
  1360. if (isPlainObject(event.detail)) {
  1361. event.target = Object.assign({}, event.target, event.detail);
  1362. }
  1363. return event;
  1364. }
  1365. function getExtraValue(vm, dataPathsArray) {
  1366. var context = vm;
  1367. dataPathsArray.forEach(function (dataPathArray) {
  1368. var dataPath = dataPathArray[0];
  1369. var value = dataPathArray[2];
  1370. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1371. var propPath = dataPathArray[1];
  1372. var valuePath = dataPathArray[3];
  1373. var vFor;
  1374. if (Number.isInteger(dataPath)) {
  1375. vFor = dataPath;
  1376. } else if (!dataPath) {
  1377. vFor = context;
  1378. } else if (typeof dataPath === 'string' && dataPath) {
  1379. if (dataPath.indexOf('#s#') === 0) {
  1380. vFor = dataPath.substr(3);
  1381. } else {
  1382. vFor = vm.__get_value(dataPath, context);
  1383. }
  1384. }
  1385. if (Number.isInteger(vFor)) {
  1386. context = value;
  1387. } else if (!propPath) {
  1388. context = vFor[value];
  1389. } else {
  1390. if (Array.isArray(vFor)) {
  1391. context = vFor.find(function (vForItem) {
  1392. return vm.__get_value(propPath, vForItem) === value;
  1393. });
  1394. } else if (isPlainObject(vFor)) {
  1395. context = Object.keys(vFor).find(function (vForKey) {
  1396. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1397. });
  1398. } else {
  1399. console.error('v-for 暂不支持循环数据:', vFor);
  1400. }
  1401. }
  1402. if (valuePath) {
  1403. context = vm.__get_value(valuePath, context);
  1404. }
  1405. }
  1406. });
  1407. return context;
  1408. }
  1409. function processEventExtra(vm, extra, event) {
  1410. var extraObj = {};
  1411. if (Array.isArray(extra) && extra.length) {
  1412. /**
  1413. *[
  1414. * ['data.items', 'data.id', item.data.id],
  1415. * ['metas', 'id', meta.id]
  1416. *],
  1417. *[
  1418. * ['data.items', 'data.id', item.data.id],
  1419. * ['metas', 'id', meta.id]
  1420. *],
  1421. *'test'
  1422. */
  1423. extra.forEach(function (dataPath, index) {
  1424. if (typeof dataPath === 'string') {
  1425. if (!dataPath) {// model,prop.sync
  1426. extraObj['$' + index] = vm;
  1427. } else {
  1428. if (dataPath === '$event') {// $event
  1429. extraObj['$' + index] = event;
  1430. } else if (dataPath === 'arguments') {
  1431. if (event.detail && event.detail.__args__) {
  1432. extraObj['$' + index] = event.detail.__args__;
  1433. } else {
  1434. extraObj['$' + index] = [event];
  1435. }
  1436. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1437. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1438. } else {
  1439. extraObj['$' + index] = vm.__get_value(dataPath);
  1440. }
  1441. }
  1442. } else {
  1443. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1444. }
  1445. });
  1446. }
  1447. return extraObj;
  1448. }
  1449. function getObjByArray(arr) {
  1450. var obj = {};
  1451. for (var i = 1; i < arr.length; i++) {
  1452. var element = arr[i];
  1453. obj[element[0]] = element[1];
  1454. }
  1455. return obj;
  1456. }
  1457. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1458. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1459. if (isCustom) {// 自定义事件
  1460. isCustomMPEvent = event.currentTarget &&
  1461. event.currentTarget.dataset &&
  1462. event.currentTarget.dataset.comType === 'wx';
  1463. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1464. if (isCustomMPEvent) {
  1465. return [event];
  1466. }
  1467. return event.detail.__args__ || event.detail;
  1468. }
  1469. }
  1470. var extraObj = processEventExtra(vm, extra, event);
  1471. var ret = [];
  1472. args.forEach(function (arg) {
  1473. if (arg === '$event') {
  1474. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1475. ret.push(event.target.value);
  1476. } else {
  1477. if (isCustom && !isCustomMPEvent) {
  1478. ret.push(event.detail.__args__[0]);
  1479. } else {// wxcomponent 组件或内置组件
  1480. ret.push(event);
  1481. }
  1482. }
  1483. } else {
  1484. if (Array.isArray(arg) && arg[0] === 'o') {
  1485. ret.push(getObjByArray(arg));
  1486. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1487. ret.push(extraObj[arg]);
  1488. } else {
  1489. ret.push(arg);
  1490. }
  1491. }
  1492. });
  1493. return ret;
  1494. }
  1495. var ONCE = '~';
  1496. var CUSTOM = '^';
  1497. function isMatchEventType(eventType, optType) {
  1498. return eventType === optType ||
  1499. optType === 'regionchange' && (
  1500. eventType === 'begin' ||
  1501. eventType === 'end');
  1502. }
  1503. function getContextVm(vm) {
  1504. var $parent = vm.$parent;
  1505. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1506. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1507. $parent = $parent.$parent;
  1508. }
  1509. return $parent && $parent.$parent;
  1510. }
  1511. function handleEvent(event) {var _this2 = this;
  1512. event = wrapper$1(event);
  1513. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1514. var dataset = (event.currentTarget || event.target).dataset;
  1515. if (!dataset) {
  1516. return console.warn('事件信息不存在');
  1517. }
  1518. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1519. if (!eventOpts) {
  1520. return console.warn('事件信息不存在');
  1521. }
  1522. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1523. var eventType = event.type;
  1524. var ret = [];
  1525. eventOpts.forEach(function (eventOpt) {
  1526. var type = eventOpt[0];
  1527. var eventsArray = eventOpt[1];
  1528. var isCustom = type.charAt(0) === CUSTOM;
  1529. type = isCustom ? type.slice(1) : type;
  1530. var isOnce = type.charAt(0) === ONCE;
  1531. type = isOnce ? type.slice(1) : type;
  1532. if (eventsArray && isMatchEventType(eventType, type)) {
  1533. eventsArray.forEach(function (eventArray) {
  1534. var methodName = eventArray[0];
  1535. if (methodName) {
  1536. var handlerCtx = _this2.$vm;
  1537. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1538. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1539. }
  1540. if (methodName === '$emit') {
  1541. handlerCtx.$emit.apply(handlerCtx,
  1542. processEventArgs(
  1543. _this2.$vm,
  1544. event,
  1545. eventArray[1],
  1546. eventArray[2],
  1547. isCustom,
  1548. methodName));
  1549. return;
  1550. }
  1551. var handler = handlerCtx[methodName];
  1552. if (!isFn(handler)) {
  1553. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1554. var path = _this2.route || _this2.is;
  1555. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1556. }
  1557. if (isOnce) {
  1558. if (handler.once) {
  1559. return;
  1560. }
  1561. handler.once = true;
  1562. }
  1563. var params = processEventArgs(
  1564. _this2.$vm,
  1565. event,
  1566. eventArray[1],
  1567. eventArray[2],
  1568. isCustom,
  1569. methodName);
  1570. params = Array.isArray(params) ? params : [];
  1571. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1572. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1573. // eslint-disable-next-line no-sparse-arrays
  1574. params = params.concat([,,,,,,,,,, event]);
  1575. }
  1576. ret.push(handler.apply(handlerCtx, params));
  1577. }
  1578. });
  1579. }
  1580. });
  1581. if (
  1582. eventType === 'input' &&
  1583. ret.length === 1 &&
  1584. typeof ret[0] !== 'undefined')
  1585. {
  1586. return ret[0];
  1587. }
  1588. }
  1589. var eventChannels = {};
  1590. var eventChannelStack = [];
  1591. function getEventChannel(id) {
  1592. if (id) {
  1593. var eventChannel = eventChannels[id];
  1594. delete eventChannels[id];
  1595. return eventChannel;
  1596. }
  1597. return eventChannelStack.shift();
  1598. }
  1599. var hooks = [
  1600. 'onShow',
  1601. 'onHide',
  1602. 'onError',
  1603. 'onPageNotFound',
  1604. 'onThemeChange',
  1605. 'onUnhandledRejection'];
  1606. function initEventChannel() {
  1607. _vue.default.prototype.getOpenerEventChannel = function () {
  1608. // 微信小程序使用自身getOpenerEventChannel
  1609. {
  1610. return this.$scope.getOpenerEventChannel();
  1611. }
  1612. };
  1613. var callHook = _vue.default.prototype.__call_hook;
  1614. _vue.default.prototype.__call_hook = function (hook, args) {
  1615. if (hook === 'onLoad' && args && args.__id__) {
  1616. this.__eventChannel__ = getEventChannel(args.__id__);
  1617. delete args.__id__;
  1618. }
  1619. return callHook.call(this, hook, args);
  1620. };
  1621. }
  1622. function initScopedSlotsParams() {
  1623. var center = {};
  1624. var parents = {};
  1625. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1626. var has = center[vueId];
  1627. if (!has) {
  1628. parents[vueId] = this;
  1629. this.$on('hook:destroyed', function () {
  1630. delete parents[vueId];
  1631. });
  1632. }
  1633. return has;
  1634. };
  1635. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1636. var data = center[vueId];
  1637. if (data) {
  1638. var object = data[name] || {};
  1639. return key ? object[key] : object;
  1640. } else {
  1641. parents[vueId] = this;
  1642. this.$on('hook:destroyed', function () {
  1643. delete parents[vueId];
  1644. });
  1645. }
  1646. };
  1647. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1648. var vueIds = this.$options.propsData.vueId;
  1649. if (vueIds) {
  1650. var vueId = vueIds.split(',')[0];
  1651. var object = center[vueId] = center[vueId] || {};
  1652. object[name] = value;
  1653. if (parents[vueId]) {
  1654. parents[vueId].$forceUpdate();
  1655. }
  1656. }
  1657. };
  1658. _vue.default.mixin({
  1659. destroyed: function destroyed() {
  1660. var propsData = this.$options.propsData;
  1661. var vueId = propsData && propsData.vueId;
  1662. if (vueId) {
  1663. delete center[vueId];
  1664. delete parents[vueId];
  1665. }
  1666. } });
  1667. }
  1668. function parseBaseApp(vm, _ref3)
  1669. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1670. initEventChannel();
  1671. {
  1672. initScopedSlotsParams();
  1673. }
  1674. if (vm.$options.store) {
  1675. _vue.default.prototype.$store = vm.$options.store;
  1676. }
  1677. uniIdMixin(_vue.default);
  1678. _vue.default.prototype.mpHost = "mp-weixin";
  1679. _vue.default.mixin({
  1680. beforeCreate: function beforeCreate() {
  1681. if (!this.$options.mpType) {
  1682. return;
  1683. }
  1684. this.mpType = this.$options.mpType;
  1685. this.$mp = _defineProperty({
  1686. data: {} },
  1687. this.mpType, this.$options.mpInstance);
  1688. this.$scope = this.$options.mpInstance;
  1689. delete this.$options.mpType;
  1690. delete this.$options.mpInstance;
  1691. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1692. var app = getApp();
  1693. if (app.$vm && app.$vm.$i18n) {
  1694. this._i18n = app.$vm.$i18n;
  1695. }
  1696. }
  1697. if (this.mpType !== 'app') {
  1698. initRefs(this);
  1699. initMocks(this, mocks);
  1700. }
  1701. } });
  1702. var appOptions = {
  1703. onLaunch: function onLaunch(args) {
  1704. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1705. return;
  1706. }
  1707. {
  1708. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1709. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1710. }
  1711. }
  1712. this.$vm = vm;
  1713. this.$vm.$mp = {
  1714. app: this };
  1715. this.$vm.$scope = this;
  1716. // vm 上也挂载 globalData
  1717. this.$vm.globalData = this.globalData;
  1718. this.$vm._isMounted = true;
  1719. this.$vm.__call_hook('mounted', args);
  1720. this.$vm.__call_hook('onLaunch', args);
  1721. } };
  1722. // 兼容旧版本 globalData
  1723. appOptions.globalData = vm.$options.globalData || {};
  1724. // 将 methods 中的方法挂在 getApp() 中
  1725. var methods = vm.$options.methods;
  1726. if (methods) {
  1727. Object.keys(methods).forEach(function (name) {
  1728. appOptions[name] = methods[name];
  1729. });
  1730. }
  1731. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1732. initHooks(appOptions, hooks);
  1733. return appOptions;
  1734. }
  1735. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1736. function findVmByVueId(vm, vuePid) {
  1737. var $children = vm.$children;
  1738. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1739. for (var i = $children.length - 1; i >= 0; i--) {
  1740. var childVm = $children[i];
  1741. if (childVm.$scope._$vueId === vuePid) {
  1742. return childVm;
  1743. }
  1744. }
  1745. // 反向递归查找
  1746. var parentVm;
  1747. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1748. parentVm = findVmByVueId($children[_i], vuePid);
  1749. if (parentVm) {
  1750. return parentVm;
  1751. }
  1752. }
  1753. }
  1754. function initBehavior(options) {
  1755. return Behavior(options);
  1756. }
  1757. function isPage() {
  1758. return !!this.route;
  1759. }
  1760. function initRelation(detail) {
  1761. this.triggerEvent('__l', detail);
  1762. }
  1763. function selectAllComponents(mpInstance, selector, $refs) {
  1764. var components = mpInstance.selectAllComponents(selector);
  1765. components.forEach(function (component) {
  1766. var ref = component.dataset.ref;
  1767. $refs[ref] = component.$vm || component;
  1768. {
  1769. if (component.dataset.vueGeneric === 'scoped') {
  1770. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1771. selectAllComponents(scopedComponent, selector, $refs);
  1772. });
  1773. }
  1774. }
  1775. });
  1776. }
  1777. function initRefs(vm) {
  1778. var mpInstance = vm.$scope;
  1779. Object.defineProperty(vm, '$refs', {
  1780. get: function get() {
  1781. var $refs = {};
  1782. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1783. // TODO 暂不考虑 for 中的 scoped
  1784. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1785. forComponents.forEach(function (component) {
  1786. var ref = component.dataset.ref;
  1787. if (!$refs[ref]) {
  1788. $refs[ref] = [];
  1789. }
  1790. $refs[ref].push(component.$vm || component);
  1791. });
  1792. return $refs;
  1793. } });
  1794. }
  1795. function handleLink(event) {var _ref4 =
  1796. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1797. var parentVm;
  1798. if (vuePid) {
  1799. parentVm = findVmByVueId(this.$vm, vuePid);
  1800. }
  1801. if (!parentVm) {
  1802. parentVm = this.$vm;
  1803. }
  1804. vueOptions.parent = parentVm;
  1805. }
  1806. function parseApp(vm) {
  1807. return parseBaseApp(vm, {
  1808. mocks: mocks,
  1809. initRefs: initRefs });
  1810. }
  1811. function createApp(vm) {
  1812. App(parseApp(vm));
  1813. return vm;
  1814. }
  1815. var encodeReserveRE = /[!'()*]/g;
  1816. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1817. var commaRE = /%2C/g;
  1818. // fixed encodeURIComponent which is more conformant to RFC3986:
  1819. // - escapes [!'()*]
  1820. // - preserve commas
  1821. var encode = function encode(str) {return encodeURIComponent(str).
  1822. replace(encodeReserveRE, encodeReserveReplacer).
  1823. replace(commaRE, ',');};
  1824. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1825. var res = obj ? Object.keys(obj).map(function (key) {
  1826. var val = obj[key];
  1827. if (val === undefined) {
  1828. return '';
  1829. }
  1830. if (val === null) {
  1831. return encodeStr(key);
  1832. }
  1833. if (Array.isArray(val)) {
  1834. var result = [];
  1835. val.forEach(function (val2) {
  1836. if (val2 === undefined) {
  1837. return;
  1838. }
  1839. if (val2 === null) {
  1840. result.push(encodeStr(key));
  1841. } else {
  1842. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1843. }
  1844. });
  1845. return result.join('&');
  1846. }
  1847. return encodeStr(key) + '=' + encodeStr(val);
  1848. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1849. return res ? "?".concat(res) : '';
  1850. }
  1851. function parseBaseComponent(vueComponentOptions)
  1852. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1853. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1854. var options = _objectSpread({
  1855. multipleSlots: true,
  1856. addGlobalClass: true },
  1857. vueOptions.options || {});
  1858. {
  1859. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1860. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1861. Object.assign(options, vueOptions['mp-weixin'].options);
  1862. }
  1863. }
  1864. var componentOptions = {
  1865. options: options,
  1866. data: initData(vueOptions, _vue.default.prototype),
  1867. behaviors: initBehaviors(vueOptions, initBehavior),
  1868. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  1869. lifetimes: {
  1870. attached: function attached() {
  1871. var properties = this.properties;
  1872. var options = {
  1873. mpType: isPage.call(this) ? 'page' : 'component',
  1874. mpInstance: this,
  1875. propsData: properties };
  1876. initVueIds(properties.vueId, this);
  1877. // 处理父子关系
  1878. initRelation.call(this, {
  1879. vuePid: this._$vuePid,
  1880. vueOptions: options });
  1881. // 初始化 vue 实例
  1882. this.$vm = new VueComponent(options);
  1883. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1884. initSlots(this.$vm, properties.vueSlots);
  1885. // 触发首次 setData
  1886. this.$vm.$mount();
  1887. },
  1888. ready: function ready() {
  1889. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1890. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1891. if (this.$vm) {
  1892. this.$vm._isMounted = true;
  1893. this.$vm.__call_hook('mounted');
  1894. this.$vm.__call_hook('onReady');
  1895. }
  1896. },
  1897. detached: function detached() {
  1898. this.$vm && this.$vm.$destroy();
  1899. } },
  1900. pageLifetimes: {
  1901. show: function show(args) {
  1902. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1903. },
  1904. hide: function hide() {
  1905. this.$vm && this.$vm.__call_hook('onPageHide');
  1906. },
  1907. resize: function resize(size) {
  1908. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1909. } },
  1910. methods: {
  1911. __l: handleLink,
  1912. __e: handleEvent } };
  1913. // externalClasses
  1914. if (vueOptions.externalClasses) {
  1915. componentOptions.externalClasses = vueOptions.externalClasses;
  1916. }
  1917. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1918. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1919. componentOptions.methods[callMethod] = function (args) {
  1920. return this.$vm[callMethod](args);
  1921. };
  1922. });
  1923. }
  1924. if (isPage) {
  1925. return componentOptions;
  1926. }
  1927. return [componentOptions, VueComponent];
  1928. }
  1929. function parseComponent(vueComponentOptions) {
  1930. return parseBaseComponent(vueComponentOptions, {
  1931. isPage: isPage,
  1932. initRelation: initRelation });
  1933. }
  1934. var hooks$1 = [
  1935. 'onShow',
  1936. 'onHide',
  1937. 'onUnload'];
  1938. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1939. function parseBasePage(vuePageOptions, _ref6)
  1940. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1941. var pageOptions = parseComponent(vuePageOptions);
  1942. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1943. pageOptions.methods.onLoad = function (query) {
  1944. this.options = query;
  1945. var copyQuery = Object.assign({}, query);
  1946. delete copyQuery.__id__;
  1947. this.$page = {
  1948. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1949. this.$vm.$mp.query = query; // 兼容 mpvue
  1950. this.$vm.__call_hook('onLoad', query);
  1951. };
  1952. return pageOptions;
  1953. }
  1954. function parsePage(vuePageOptions) {
  1955. return parseBasePage(vuePageOptions, {
  1956. isPage: isPage,
  1957. initRelation: initRelation });
  1958. }
  1959. function createPage(vuePageOptions) {
  1960. {
  1961. return Component(parsePage(vuePageOptions));
  1962. }
  1963. }
  1964. function createComponent(vueOptions) {
  1965. {
  1966. return Component(parseComponent(vueOptions));
  1967. }
  1968. }
  1969. function createSubpackageApp(vm) {
  1970. var appOptions = parseApp(vm);
  1971. var app = getApp({
  1972. allowDefault: true });
  1973. vm.$scope = app;
  1974. var globalData = app.globalData;
  1975. if (globalData) {
  1976. Object.keys(appOptions.globalData).forEach(function (name) {
  1977. if (!hasOwn(globalData, name)) {
  1978. globalData[name] = appOptions.globalData[name];
  1979. }
  1980. });
  1981. }
  1982. Object.keys(appOptions).forEach(function (name) {
  1983. if (!hasOwn(app, name)) {
  1984. app[name] = appOptions[name];
  1985. }
  1986. });
  1987. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1988. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1989. vm.__call_hook('onShow', args);
  1990. });
  1991. }
  1992. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1993. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1994. vm.__call_hook('onHide', args);
  1995. });
  1996. }
  1997. if (isFn(appOptions.onLaunch)) {
  1998. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1999. vm.__call_hook('onLaunch', args);
  2000. }
  2001. return vm;
  2002. }
  2003. function createPlugin(vm) {
  2004. var appOptions = parseApp(vm);
  2005. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2006. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  2007. vm.__call_hook('onShow', args);
  2008. });
  2009. }
  2010. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2011. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  2012. vm.__call_hook('onHide', args);
  2013. });
  2014. }
  2015. if (isFn(appOptions.onLaunch)) {
  2016. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2017. vm.__call_hook('onLaunch', args);
  2018. }
  2019. return vm;
  2020. }
  2021. todos.forEach(function (todoApi) {
  2022. protocols[todoApi] = false;
  2023. });
  2024. canIUses.forEach(function (canIUseApi) {
  2025. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  2026. canIUseApi;
  2027. if (!wx.canIUse(apiName)) {
  2028. protocols[canIUseApi] = false;
  2029. }
  2030. });
  2031. var uni = {};
  2032. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2033. uni = new Proxy({}, {
  2034. get: function get(target, name) {
  2035. if (hasOwn(target, name)) {
  2036. return target[name];
  2037. }
  2038. if (baseApi[name]) {
  2039. return baseApi[name];
  2040. }
  2041. if (api[name]) {
  2042. return promisify(name, api[name]);
  2043. }
  2044. {
  2045. if (extraApi[name]) {
  2046. return promisify(name, extraApi[name]);
  2047. }
  2048. if (todoApis[name]) {
  2049. return promisify(name, todoApis[name]);
  2050. }
  2051. }
  2052. if (eventApi[name]) {
  2053. return eventApi[name];
  2054. }
  2055. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2056. return;
  2057. }
  2058. return promisify(name, wrapper(name, wx[name]));
  2059. },
  2060. set: function set(target, name, value) {
  2061. target[name] = value;
  2062. return true;
  2063. } });
  2064. } else {
  2065. Object.keys(baseApi).forEach(function (name) {
  2066. uni[name] = baseApi[name];
  2067. });
  2068. {
  2069. Object.keys(todoApis).forEach(function (name) {
  2070. uni[name] = promisify(name, todoApis[name]);
  2071. });
  2072. Object.keys(extraApi).forEach(function (name) {
  2073. uni[name] = promisify(name, todoApis[name]);
  2074. });
  2075. }
  2076. Object.keys(eventApi).forEach(function (name) {
  2077. uni[name] = eventApi[name];
  2078. });
  2079. Object.keys(api).forEach(function (name) {
  2080. uni[name] = promisify(name, api[name]);
  2081. });
  2082. Object.keys(wx).forEach(function (name) {
  2083. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2084. uni[name] = promisify(name, wrapper(name, wx[name]));
  2085. }
  2086. });
  2087. }
  2088. wx.createApp = createApp;
  2089. wx.createPage = createPage;
  2090. wx.createComponent = createComponent;
  2091. wx.createSubpackageApp = createSubpackageApp;
  2092. wx.createPlugin = createPlugin;
  2093. var uni$1 = uni;var _default =
  2094. uni$1;exports.default = _default;
  2095. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2096. /***/ }),
  2097. /***/ 108:
  2098. /*!***********************************************************!*\
  2099. !*** C:/Users/Administrator/Desktop/xmt_new/api/order.js ***!
  2100. \***********************************************************/
  2101. /*! no static exports found */
  2102. /***/ (function(module, exports, __webpack_require__) {
  2103. "use strict";
  2104. Object.defineProperty(exports, "__esModule", { value: true });exports.confirm = confirm;exports.couponsOrder = couponsOrder;exports.getCouponsList = getCouponsList;exports.order_comment = order_comment;exports.product = product;exports.express_query = express_query;exports.upload = upload;exports.orderList = orderList;exports.orderDetail = orderDetail;exports.orderCancel = orderCancel;exports.orderDel = orderDel;exports.refund = refund;exports.refundReason = refundReason;exports.orderTake = orderTake;exports.orderPay = orderPay;exports.createOrderkey = createOrderkey;exports.computedOrderkey = computedOrderkey;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 26));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  2105. // 订单确认
  2106. function confirm(data) {
  2107. return (0, _request.default)({
  2108. url: '/api/order/confirm',
  2109. method: 'post',
  2110. data: data });
  2111. }
  2112. //获取可使用优惠券
  2113. function couponsOrder(data, price) {
  2114. return (0, _request.default)({
  2115. url: '/api/coupons/order/' + price,
  2116. method: 'get',
  2117. data: data });
  2118. }
  2119. //获取优惠券列表
  2120. function getCouponsList(data, types) {
  2121. //优惠券状态 0全部 1未使用 2已使用
  2122. return (0, _request.default)({
  2123. url: '/api/coupons/user/' + types,
  2124. method: 'get',
  2125. data: data });
  2126. }
  2127. //提交评论
  2128. function order_comment(data) {
  2129. return (0, _request.default)({
  2130. url: '/api/order/comment',
  2131. method: 'post',
  2132. data: data });
  2133. }
  2134. //订单产品信息
  2135. function product(data) {
  2136. return (0, _request.default)({
  2137. url: '/api/order/product',
  2138. method: 'post',
  2139. data: data });
  2140. }
  2141. // 快递查询
  2142. function express_query(data) {
  2143. return (0, _request.default)({
  2144. url: '/api/order/express_query',
  2145. method: 'get',
  2146. data: data });
  2147. }
  2148. //上传图片
  2149. function upload(data) {
  2150. return (0, _request.upFilse)({
  2151. url: '/api/upload/image',
  2152. method: 'post',
  2153. data: data });
  2154. }
  2155. // 订单列表
  2156. function orderList(data) {
  2157. return (0, _request.default)({
  2158. url: '/api/order/list',
  2159. method: 'get',
  2160. data: data });
  2161. }
  2162. // 订单详细
  2163. function orderDetail(data, orderid) {
  2164. return (0, _request.default)({
  2165. url: '/api/order/detail/' + orderid,
  2166. method: 'get',
  2167. data: data });
  2168. }
  2169. // 取消订单
  2170. function orderCancel(data) {
  2171. return (0, _request.default)({
  2172. url: '/api/order/cancel',
  2173. method: 'post',
  2174. data: data });
  2175. }
  2176. // 删除订单
  2177. function orderDel(data) {
  2178. return (0, _request.default)({
  2179. url: '/api/order/del',
  2180. method: 'get',
  2181. data: data });
  2182. }
  2183. // 申请退款
  2184. function refund(data) {
  2185. return (0, _request.default)({
  2186. url: '/api/order/refund/verify',
  2187. method: 'post',
  2188. data: data });
  2189. }
  2190. // 退款理由列表
  2191. function refundReason(data) {
  2192. return (0, _request.default)({
  2193. url: '/api/order/refund/reason',
  2194. method: 'get',
  2195. data: data });
  2196. }
  2197. // 确认收货
  2198. function orderTake(data) {
  2199. return (0, _request.default)({
  2200. url: '/api/order/take',
  2201. method: 'post',
  2202. data: data });
  2203. }
  2204. // 订单支付
  2205. function orderPay(data) {
  2206. return (0, _request.default)({
  2207. url: '/api/order/pay',
  2208. method: 'post',
  2209. data: data });
  2210. }
  2211. // 创建订单
  2212. function createOrderkey(data, key) {
  2213. return (0, _request.default)({
  2214. url: '/api/order/create/' + key,
  2215. method: 'post',
  2216. data: data });
  2217. }
  2218. // 统计订单金额
  2219. function computedOrderkey(data) {
  2220. return (0, _request.default)({
  2221. url: '/api/order/computed/' + data.orderkey,
  2222. method: 'post',
  2223. data: data });
  2224. }
  2225. /***/ }),
  2226. /***/ 14:
  2227. /*!**********************************************************************************************************!*\
  2228. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2229. \**********************************************************************************************************/
  2230. /*! exports provided: default */
  2231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2232. "use strict";
  2233. __webpack_require__.r(__webpack_exports__);
  2234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2235. /* globals __VUE_SSR_CONTEXT__ */
  2236. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2237. // This module is a runtime utility for cleaner component module output and will
  2238. // be included in the final webpack user bundle.
  2239. function normalizeComponent (
  2240. scriptExports,
  2241. render,
  2242. staticRenderFns,
  2243. functionalTemplate,
  2244. injectStyles,
  2245. scopeId,
  2246. moduleIdentifier, /* server only */
  2247. shadowMode, /* vue-cli only */
  2248. components, // fixed by xxxxxx auto components
  2249. renderjs // fixed by xxxxxx renderjs
  2250. ) {
  2251. // Vue.extend constructor export interop
  2252. var options = typeof scriptExports === 'function'
  2253. ? scriptExports.options
  2254. : scriptExports
  2255. // fixed by xxxxxx auto components
  2256. if (components) {
  2257. if (!options.components) {
  2258. options.components = {}
  2259. }
  2260. var hasOwn = Object.prototype.hasOwnProperty
  2261. for (var name in components) {
  2262. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2263. options.components[name] = components[name]
  2264. }
  2265. }
  2266. }
  2267. // fixed by xxxxxx renderjs
  2268. if (renderjs) {
  2269. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2270. this[renderjs.__module] = this
  2271. });
  2272. (options.mixins || (options.mixins = [])).push(renderjs)
  2273. }
  2274. // render functions
  2275. if (render) {
  2276. options.render = render
  2277. options.staticRenderFns = staticRenderFns
  2278. options._compiled = true
  2279. }
  2280. // functional template
  2281. if (functionalTemplate) {
  2282. options.functional = true
  2283. }
  2284. // scopedId
  2285. if (scopeId) {
  2286. options._scopeId = 'data-v-' + scopeId
  2287. }
  2288. var hook
  2289. if (moduleIdentifier) { // server build
  2290. hook = function (context) {
  2291. // 2.3 injection
  2292. context =
  2293. context || // cached call
  2294. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2295. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2296. // 2.2 with runInNewContext: true
  2297. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2298. context = __VUE_SSR_CONTEXT__
  2299. }
  2300. // inject component styles
  2301. if (injectStyles) {
  2302. injectStyles.call(this, context)
  2303. }
  2304. // register component module identifier for async chunk inferrence
  2305. if (context && context._registeredComponents) {
  2306. context._registeredComponents.add(moduleIdentifier)
  2307. }
  2308. }
  2309. // used by ssr in case component is cached and beforeCreate
  2310. // never gets called
  2311. options._ssrRegister = hook
  2312. } else if (injectStyles) {
  2313. hook = shadowMode
  2314. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2315. : injectStyles
  2316. }
  2317. if (hook) {
  2318. if (options.functional) {
  2319. // for template-only hot-reload because in that case the render fn doesn't
  2320. // go through the normalizer
  2321. options._injectStyles = hook
  2322. // register for functioal component in vue file
  2323. var originalRender = options.render
  2324. options.render = function renderWithStyleInjection (h, context) {
  2325. hook.call(context)
  2326. return originalRender(h, context)
  2327. }
  2328. } else {
  2329. // inject component registration as beforeCreate hook
  2330. var existing = options.beforeCreate
  2331. options.beforeCreate = existing
  2332. ? [].concat(existing, hook)
  2333. : [hook]
  2334. }
  2335. }
  2336. return {
  2337. exports: scriptExports,
  2338. options: options
  2339. }
  2340. }
  2341. /***/ }),
  2342. /***/ 2:
  2343. /*!***********************************!*\
  2344. !*** (webpack)/buildin/global.js ***!
  2345. \***********************************/
  2346. /*! no static exports found */
  2347. /***/ (function(module, exports) {
  2348. var g;
  2349. // This works in non-strict mode
  2350. g = (function() {
  2351. return this;
  2352. })();
  2353. try {
  2354. // This works if eval is allowed (see CSP)
  2355. g = g || new Function("return this")();
  2356. } catch (e) {
  2357. // This works if the window reference is available
  2358. if (typeof window === "object") g = window;
  2359. }
  2360. // g can still be undefined, but nothing to do about it...
  2361. // We return undefined, instead of nothing here, so it's
  2362. // easier to handle this case. if(!global) { ...}
  2363. module.exports = g;
  2364. /***/ }),
  2365. /***/ 21:
  2366. /*!**********************************************************!*\
  2367. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2368. \**********************************************************/
  2369. /*! no static exports found */
  2370. /***/ (function(module, exports, __webpack_require__) {
  2371. module.exports = __webpack_require__(/*! regenerator-runtime */ 22);
  2372. /***/ }),
  2373. /***/ 22:
  2374. /*!************************************************************!*\
  2375. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2376. \************************************************************/
  2377. /*! no static exports found */
  2378. /***/ (function(module, exports, __webpack_require__) {
  2379. /**
  2380. * Copyright (c) 2014-present, Facebook, Inc.
  2381. *
  2382. * This source code is licensed under the MIT license found in the
  2383. * LICENSE file in the root directory of this source tree.
  2384. */
  2385. // This method of obtaining a reference to the global object needs to be
  2386. // kept identical to the way it is obtained in runtime.js
  2387. var g = (function() {
  2388. return this || (typeof self === "object" && self);
  2389. })() || Function("return this")();
  2390. // Use `getOwnPropertyNames` because not all browsers support calling
  2391. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2392. var hadRuntime = g.regeneratorRuntime &&
  2393. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2394. // Save the old regeneratorRuntime in case it needs to be restored later.
  2395. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2396. // Force reevalutation of runtime.js.
  2397. g.regeneratorRuntime = undefined;
  2398. module.exports = __webpack_require__(/*! ./runtime */ 23);
  2399. if (hadRuntime) {
  2400. // Restore the original runtime.
  2401. g.regeneratorRuntime = oldRuntime;
  2402. } else {
  2403. // Remove the global property added by runtime.js.
  2404. try {
  2405. delete g.regeneratorRuntime;
  2406. } catch(e) {
  2407. g.regeneratorRuntime = undefined;
  2408. }
  2409. }
  2410. /***/ }),
  2411. /***/ 23:
  2412. /*!*****************************************************!*\
  2413. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2414. \*****************************************************/
  2415. /*! no static exports found */
  2416. /***/ (function(module, exports) {
  2417. /**
  2418. * Copyright (c) 2014-present, Facebook, Inc.
  2419. *
  2420. * This source code is licensed under the MIT license found in the
  2421. * LICENSE file in the root directory of this source tree.
  2422. */
  2423. !(function(global) {
  2424. "use strict";
  2425. var Op = Object.prototype;
  2426. var hasOwn = Op.hasOwnProperty;
  2427. var undefined; // More compressible than void 0.
  2428. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2429. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2430. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2431. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2432. var inModule = typeof module === "object";
  2433. var runtime = global.regeneratorRuntime;
  2434. if (runtime) {
  2435. if (inModule) {
  2436. // If regeneratorRuntime is defined globally and we're in a module,
  2437. // make the exports object identical to regeneratorRuntime.
  2438. module.exports = runtime;
  2439. }
  2440. // Don't bother evaluating the rest of this file if the runtime was
  2441. // already defined globally.
  2442. return;
  2443. }
  2444. // Define the runtime globally (as expected by generated code) as either
  2445. // module.exports (if we're in a module) or a new, empty object.
  2446. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2447. function wrap(innerFn, outerFn, self, tryLocsList) {
  2448. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2449. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2450. var generator = Object.create(protoGenerator.prototype);
  2451. var context = new Context(tryLocsList || []);
  2452. // The ._invoke method unifies the implementations of the .next,
  2453. // .throw, and .return methods.
  2454. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2455. return generator;
  2456. }
  2457. runtime.wrap = wrap;
  2458. // Try/catch helper to minimize deoptimizations. Returns a completion
  2459. // record like context.tryEntries[i].completion. This interface could
  2460. // have been (and was previously) designed to take a closure to be
  2461. // invoked without arguments, but in all the cases we care about we
  2462. // already have an existing method we want to call, so there's no need
  2463. // to create a new function object. We can even get away with assuming
  2464. // the method takes exactly one argument, since that happens to be true
  2465. // in every case, so we don't have to touch the arguments object. The
  2466. // only additional allocation required is the completion record, which
  2467. // has a stable shape and so hopefully should be cheap to allocate.
  2468. function tryCatch(fn, obj, arg) {
  2469. try {
  2470. return { type: "normal", arg: fn.call(obj, arg) };
  2471. } catch (err) {
  2472. return { type: "throw", arg: err };
  2473. }
  2474. }
  2475. var GenStateSuspendedStart = "suspendedStart";
  2476. var GenStateSuspendedYield = "suspendedYield";
  2477. var GenStateExecuting = "executing";
  2478. var GenStateCompleted = "completed";
  2479. // Returning this object from the innerFn has the same effect as
  2480. // breaking out of the dispatch switch statement.
  2481. var ContinueSentinel = {};
  2482. // Dummy constructor functions that we use as the .constructor and
  2483. // .constructor.prototype properties for functions that return Generator
  2484. // objects. For full spec compliance, you may wish to configure your
  2485. // minifier not to mangle the names of these two functions.
  2486. function Generator() {}
  2487. function GeneratorFunction() {}
  2488. function GeneratorFunctionPrototype() {}
  2489. // This is a polyfill for %IteratorPrototype% for environments that
  2490. // don't natively support it.
  2491. var IteratorPrototype = {};
  2492. IteratorPrototype[iteratorSymbol] = function () {
  2493. return this;
  2494. };
  2495. var getProto = Object.getPrototypeOf;
  2496. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2497. if (NativeIteratorPrototype &&
  2498. NativeIteratorPrototype !== Op &&
  2499. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2500. // This environment has a native %IteratorPrototype%; use it instead
  2501. // of the polyfill.
  2502. IteratorPrototype = NativeIteratorPrototype;
  2503. }
  2504. var Gp = GeneratorFunctionPrototype.prototype =
  2505. Generator.prototype = Object.create(IteratorPrototype);
  2506. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2507. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2508. GeneratorFunctionPrototype[toStringTagSymbol] =
  2509. GeneratorFunction.displayName = "GeneratorFunction";
  2510. // Helper for defining the .next, .throw, and .return methods of the
  2511. // Iterator interface in terms of a single ._invoke method.
  2512. function defineIteratorMethods(prototype) {
  2513. ["next", "throw", "return"].forEach(function(method) {
  2514. prototype[method] = function(arg) {
  2515. return this._invoke(method, arg);
  2516. };
  2517. });
  2518. }
  2519. runtime.isGeneratorFunction = function(genFun) {
  2520. var ctor = typeof genFun === "function" && genFun.constructor;
  2521. return ctor
  2522. ? ctor === GeneratorFunction ||
  2523. // For the native GeneratorFunction constructor, the best we can
  2524. // do is to check its .name property.
  2525. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2526. : false;
  2527. };
  2528. runtime.mark = function(genFun) {
  2529. if (Object.setPrototypeOf) {
  2530. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2531. } else {
  2532. genFun.__proto__ = GeneratorFunctionPrototype;
  2533. if (!(toStringTagSymbol in genFun)) {
  2534. genFun[toStringTagSymbol] = "GeneratorFunction";
  2535. }
  2536. }
  2537. genFun.prototype = Object.create(Gp);
  2538. return genFun;
  2539. };
  2540. // Within the body of any async function, `await x` is transformed to
  2541. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2542. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2543. // meant to be awaited.
  2544. runtime.awrap = function(arg) {
  2545. return { __await: arg };
  2546. };
  2547. function AsyncIterator(generator) {
  2548. function invoke(method, arg, resolve, reject) {
  2549. var record = tryCatch(generator[method], generator, arg);
  2550. if (record.type === "throw") {
  2551. reject(record.arg);
  2552. } else {
  2553. var result = record.arg;
  2554. var value = result.value;
  2555. if (value &&
  2556. typeof value === "object" &&
  2557. hasOwn.call(value, "__await")) {
  2558. return Promise.resolve(value.__await).then(function(value) {
  2559. invoke("next", value, resolve, reject);
  2560. }, function(err) {
  2561. invoke("throw", err, resolve, reject);
  2562. });
  2563. }
  2564. return Promise.resolve(value).then(function(unwrapped) {
  2565. // When a yielded Promise is resolved, its final value becomes
  2566. // the .value of the Promise<{value,done}> result for the
  2567. // current iteration.
  2568. result.value = unwrapped;
  2569. resolve(result);
  2570. }, function(error) {
  2571. // If a rejected Promise was yielded, throw the rejection back
  2572. // into the async generator function so it can be handled there.
  2573. return invoke("throw", error, resolve, reject);
  2574. });
  2575. }
  2576. }
  2577. var previousPromise;
  2578. function enqueue(method, arg) {
  2579. function callInvokeWithMethodAndArg() {
  2580. return new Promise(function(resolve, reject) {
  2581. invoke(method, arg, resolve, reject);
  2582. });
  2583. }
  2584. return previousPromise =
  2585. // If enqueue has been called before, then we want to wait until
  2586. // all previous Promises have been resolved before calling invoke,
  2587. // so that results are always delivered in the correct order. If
  2588. // enqueue has not been called before, then it is important to
  2589. // call invoke immediately, without waiting on a callback to fire,
  2590. // so that the async generator function has the opportunity to do
  2591. // any necessary setup in a predictable way. This predictability
  2592. // is why the Promise constructor synchronously invokes its
  2593. // executor callback, and why async functions synchronously
  2594. // execute code before the first await. Since we implement simple
  2595. // async functions in terms of async generators, it is especially
  2596. // important to get this right, even though it requires care.
  2597. previousPromise ? previousPromise.then(
  2598. callInvokeWithMethodAndArg,
  2599. // Avoid propagating failures to Promises returned by later
  2600. // invocations of the iterator.
  2601. callInvokeWithMethodAndArg
  2602. ) : callInvokeWithMethodAndArg();
  2603. }
  2604. // Define the unified helper method that is used to implement .next,
  2605. // .throw, and .return (see defineIteratorMethods).
  2606. this._invoke = enqueue;
  2607. }
  2608. defineIteratorMethods(AsyncIterator.prototype);
  2609. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2610. return this;
  2611. };
  2612. runtime.AsyncIterator = AsyncIterator;
  2613. // Note that simple async functions are implemented on top of
  2614. // AsyncIterator objects; they just return a Promise for the value of
  2615. // the final result produced by the iterator.
  2616. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2617. var iter = new AsyncIterator(
  2618. wrap(innerFn, outerFn, self, tryLocsList)
  2619. );
  2620. return runtime.isGeneratorFunction(outerFn)
  2621. ? iter // If outerFn is a generator, return the full iterator.
  2622. : iter.next().then(function(result) {
  2623. return result.done ? result.value : iter.next();
  2624. });
  2625. };
  2626. function makeInvokeMethod(innerFn, self, context) {
  2627. var state = GenStateSuspendedStart;
  2628. return function invoke(method, arg) {
  2629. if (state === GenStateExecuting) {
  2630. throw new Error("Generator is already running");
  2631. }
  2632. if (state === GenStateCompleted) {
  2633. if (method === "throw") {
  2634. throw arg;
  2635. }
  2636. // Be forgiving, per 25.3.3.3.3 of the spec:
  2637. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  2638. return doneResult();
  2639. }
  2640. context.method = method;
  2641. context.arg = arg;
  2642. while (true) {
  2643. var delegate = context.delegate;
  2644. if (delegate) {
  2645. var delegateResult = maybeInvokeDelegate(delegate, context);
  2646. if (delegateResult) {
  2647. if (delegateResult === ContinueSentinel) continue;
  2648. return delegateResult;
  2649. }
  2650. }
  2651. if (context.method === "next") {
  2652. // Setting context._sent for legacy support of Babel's
  2653. // function.sent implementation.
  2654. context.sent = context._sent = context.arg;
  2655. } else if (context.method === "throw") {
  2656. if (state === GenStateSuspendedStart) {
  2657. state = GenStateCompleted;
  2658. throw context.arg;
  2659. }
  2660. context.dispatchException(context.arg);
  2661. } else if (context.method === "return") {
  2662. context.abrupt("return", context.arg);
  2663. }
  2664. state = GenStateExecuting;
  2665. var record = tryCatch(innerFn, self, context);
  2666. if (record.type === "normal") {
  2667. // If an exception is thrown from innerFn, we leave state ===
  2668. // GenStateExecuting and loop back for another invocation.
  2669. state = context.done
  2670. ? GenStateCompleted
  2671. : GenStateSuspendedYield;
  2672. if (record.arg === ContinueSentinel) {
  2673. continue;
  2674. }
  2675. return {
  2676. value: record.arg,
  2677. done: context.done
  2678. };
  2679. } else if (record.type === "throw") {
  2680. state = GenStateCompleted;
  2681. // Dispatch the exception by looping back around to the
  2682. // context.dispatchException(context.arg) call above.
  2683. context.method = "throw";
  2684. context.arg = record.arg;
  2685. }
  2686. }
  2687. };
  2688. }
  2689. // Call delegate.iterator[context.method](context.arg) and handle the
  2690. // result, either by returning a { value, done } result from the
  2691. // delegate iterator, or by modifying context.method and context.arg,
  2692. // setting context.delegate to null, and returning the ContinueSentinel.
  2693. function maybeInvokeDelegate(delegate, context) {
  2694. var method = delegate.iterator[context.method];
  2695. if (method === undefined) {
  2696. // A .throw or .return when the delegate iterator has no .throw
  2697. // method always terminates the yield* loop.
  2698. context.delegate = null;
  2699. if (context.method === "throw") {
  2700. if (delegate.iterator.return) {
  2701. // If the delegate iterator has a return method, give it a
  2702. // chance to clean up.
  2703. context.method = "return";
  2704. context.arg = undefined;
  2705. maybeInvokeDelegate(delegate, context);
  2706. if (context.method === "throw") {
  2707. // If maybeInvokeDelegate(context) changed context.method from
  2708. // "return" to "throw", let that override the TypeError below.
  2709. return ContinueSentinel;
  2710. }
  2711. }
  2712. context.method = "throw";
  2713. context.arg = new TypeError(
  2714. "The iterator does not provide a 'throw' method");
  2715. }
  2716. return ContinueSentinel;
  2717. }
  2718. var record = tryCatch(method, delegate.iterator, context.arg);
  2719. if (record.type === "throw") {
  2720. context.method = "throw";
  2721. context.arg = record.arg;
  2722. context.delegate = null;
  2723. return ContinueSentinel;
  2724. }
  2725. var info = record.arg;
  2726. if (! info) {
  2727. context.method = "throw";
  2728. context.arg = new TypeError("iterator result is not an object");
  2729. context.delegate = null;
  2730. return ContinueSentinel;
  2731. }
  2732. if (info.done) {
  2733. // Assign the result of the finished delegate to the temporary
  2734. // variable specified by delegate.resultName (see delegateYield).
  2735. context[delegate.resultName] = info.value;
  2736. // Resume execution at the desired location (see delegateYield).
  2737. context.next = delegate.nextLoc;
  2738. // If context.method was "throw" but the delegate handled the
  2739. // exception, let the outer generator proceed normally. If
  2740. // context.method was "next", forget context.arg since it has been
  2741. // "consumed" by the delegate iterator. If context.method was
  2742. // "return", allow the original .return call to continue in the
  2743. // outer generator.
  2744. if (context.method !== "return") {
  2745. context.method = "next";
  2746. context.arg = undefined;
  2747. }
  2748. } else {
  2749. // Re-yield the result returned by the delegate method.
  2750. return info;
  2751. }
  2752. // The delegate iterator is finished, so forget it and continue with
  2753. // the outer generator.
  2754. context.delegate = null;
  2755. return ContinueSentinel;
  2756. }
  2757. // Define Generator.prototype.{next,throw,return} in terms of the
  2758. // unified ._invoke helper method.
  2759. defineIteratorMethods(Gp);
  2760. Gp[toStringTagSymbol] = "Generator";
  2761. // A Generator should always return itself as the iterator object when the
  2762. // @@iterator function is called on it. Some browsers' implementations of the
  2763. // iterator prototype chain incorrectly implement this, causing the Generator
  2764. // object to not be returned from this call. This ensures that doesn't happen.
  2765. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2766. Gp[iteratorSymbol] = function() {
  2767. return this;
  2768. };
  2769. Gp.toString = function() {
  2770. return "[object Generator]";
  2771. };
  2772. function pushTryEntry(locs) {
  2773. var entry = { tryLoc: locs[0] };
  2774. if (1 in locs) {
  2775. entry.catchLoc = locs[1];
  2776. }
  2777. if (2 in locs) {
  2778. entry.finallyLoc = locs[2];
  2779. entry.afterLoc = locs[3];
  2780. }
  2781. this.tryEntries.push(entry);
  2782. }
  2783. function resetTryEntry(entry) {
  2784. var record = entry.completion || {};
  2785. record.type = "normal";
  2786. delete record.arg;
  2787. entry.completion = record;
  2788. }
  2789. function Context(tryLocsList) {
  2790. // The root entry object (effectively a try statement without a catch
  2791. // or a finally block) gives us a place to store values thrown from
  2792. // locations where there is no enclosing try statement.
  2793. this.tryEntries = [{ tryLoc: "root" }];
  2794. tryLocsList.forEach(pushTryEntry, this);
  2795. this.reset(true);
  2796. }
  2797. runtime.keys = function(object) {
  2798. var keys = [];
  2799. for (var key in object) {
  2800. keys.push(key);
  2801. }
  2802. keys.reverse();
  2803. // Rather than returning an object with a next method, we keep
  2804. // things simple and return the next function itself.
  2805. return function next() {
  2806. while (keys.length) {
  2807. var key = keys.pop();
  2808. if (key in object) {
  2809. next.value = key;
  2810. next.done = false;
  2811. return next;
  2812. }
  2813. }
  2814. // To avoid creating an additional object, we just hang the .value
  2815. // and .done properties off the next function object itself. This
  2816. // also ensures that the minifier will not anonymize the function.
  2817. next.done = true;
  2818. return next;
  2819. };
  2820. };
  2821. function values(iterable) {
  2822. if (iterable) {
  2823. var iteratorMethod = iterable[iteratorSymbol];
  2824. if (iteratorMethod) {
  2825. return iteratorMethod.call(iterable);
  2826. }
  2827. if (typeof iterable.next === "function") {
  2828. return iterable;
  2829. }
  2830. if (!isNaN(iterable.length)) {
  2831. var i = -1, next = function next() {
  2832. while (++i < iterable.length) {
  2833. if (hasOwn.call(iterable, i)) {
  2834. next.value = iterable[i];
  2835. next.done = false;
  2836. return next;
  2837. }
  2838. }
  2839. next.value = undefined;
  2840. next.done = true;
  2841. return next;
  2842. };
  2843. return next.next = next;
  2844. }
  2845. }
  2846. // Return an iterator with no values.
  2847. return { next: doneResult };
  2848. }
  2849. runtime.values = values;
  2850. function doneResult() {
  2851. return { value: undefined, done: true };
  2852. }
  2853. Context.prototype = {
  2854. constructor: Context,
  2855. reset: function(skipTempReset) {
  2856. this.prev = 0;
  2857. this.next = 0;
  2858. // Resetting context._sent for legacy support of Babel's
  2859. // function.sent implementation.
  2860. this.sent = this._sent = undefined;
  2861. this.done = false;
  2862. this.delegate = null;
  2863. this.method = "next";
  2864. this.arg = undefined;
  2865. this.tryEntries.forEach(resetTryEntry);
  2866. if (!skipTempReset) {
  2867. for (var name in this) {
  2868. // Not sure about the optimal order of these conditions:
  2869. if (name.charAt(0) === "t" &&
  2870. hasOwn.call(this, name) &&
  2871. !isNaN(+name.slice(1))) {
  2872. this[name] = undefined;
  2873. }
  2874. }
  2875. }
  2876. },
  2877. stop: function() {
  2878. this.done = true;
  2879. var rootEntry = this.tryEntries[0];
  2880. var rootRecord = rootEntry.completion;
  2881. if (rootRecord.type === "throw") {
  2882. throw rootRecord.arg;
  2883. }
  2884. return this.rval;
  2885. },
  2886. dispatchException: function(exception) {
  2887. if (this.done) {
  2888. throw exception;
  2889. }
  2890. var context = this;
  2891. function handle(loc, caught) {
  2892. record.type = "throw";
  2893. record.arg = exception;
  2894. context.next = loc;
  2895. if (caught) {
  2896. // If the dispatched exception was caught by a catch block,
  2897. // then let that catch block handle the exception normally.
  2898. context.method = "next";
  2899. context.arg = undefined;
  2900. }
  2901. return !! caught;
  2902. }
  2903. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2904. var entry = this.tryEntries[i];
  2905. var record = entry.completion;
  2906. if (entry.tryLoc === "root") {
  2907. // Exception thrown outside of any try block that could handle
  2908. // it, so set the completion value of the entire function to
  2909. // throw the exception.
  2910. return handle("end");
  2911. }
  2912. if (entry.tryLoc <= this.prev) {
  2913. var hasCatch = hasOwn.call(entry, "catchLoc");
  2914. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2915. if (hasCatch && hasFinally) {
  2916. if (this.prev < entry.catchLoc) {
  2917. return handle(entry.catchLoc, true);
  2918. } else if (this.prev < entry.finallyLoc) {
  2919. return handle(entry.finallyLoc);
  2920. }
  2921. } else if (hasCatch) {
  2922. if (this.prev < entry.catchLoc) {
  2923. return handle(entry.catchLoc, true);
  2924. }
  2925. } else if (hasFinally) {
  2926. if (this.prev < entry.finallyLoc) {
  2927. return handle(entry.finallyLoc);
  2928. }
  2929. } else {
  2930. throw new Error("try statement without catch or finally");
  2931. }
  2932. }
  2933. }
  2934. },
  2935. abrupt: function(type, arg) {
  2936. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2937. var entry = this.tryEntries[i];
  2938. if (entry.tryLoc <= this.prev &&
  2939. hasOwn.call(entry, "finallyLoc") &&
  2940. this.prev < entry.finallyLoc) {
  2941. var finallyEntry = entry;
  2942. break;
  2943. }
  2944. }
  2945. if (finallyEntry &&
  2946. (type === "break" ||
  2947. type === "continue") &&
  2948. finallyEntry.tryLoc <= arg &&
  2949. arg <= finallyEntry.finallyLoc) {
  2950. // Ignore the finally entry if control is not jumping to a
  2951. // location outside the try/catch block.
  2952. finallyEntry = null;
  2953. }
  2954. var record = finallyEntry ? finallyEntry.completion : {};
  2955. record.type = type;
  2956. record.arg = arg;
  2957. if (finallyEntry) {
  2958. this.method = "next";
  2959. this.next = finallyEntry.finallyLoc;
  2960. return ContinueSentinel;
  2961. }
  2962. return this.complete(record);
  2963. },
  2964. complete: function(record, afterLoc) {
  2965. if (record.type === "throw") {
  2966. throw record.arg;
  2967. }
  2968. if (record.type === "break" ||
  2969. record.type === "continue") {
  2970. this.next = record.arg;
  2971. } else if (record.type === "return") {
  2972. this.rval = this.arg = record.arg;
  2973. this.method = "return";
  2974. this.next = "end";
  2975. } else if (record.type === "normal" && afterLoc) {
  2976. this.next = afterLoc;
  2977. }
  2978. return ContinueSentinel;
  2979. },
  2980. finish: function(finallyLoc) {
  2981. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2982. var entry = this.tryEntries[i];
  2983. if (entry.finallyLoc === finallyLoc) {
  2984. this.complete(entry.completion, entry.afterLoc);
  2985. resetTryEntry(entry);
  2986. return ContinueSentinel;
  2987. }
  2988. }
  2989. },
  2990. "catch": function(tryLoc) {
  2991. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2992. var entry = this.tryEntries[i];
  2993. if (entry.tryLoc === tryLoc) {
  2994. var record = entry.completion;
  2995. if (record.type === "throw") {
  2996. var thrown = record.arg;
  2997. resetTryEntry(entry);
  2998. }
  2999. return thrown;
  3000. }
  3001. }
  3002. // The context.catch method must only be called with a location
  3003. // argument that corresponds to a known catch block.
  3004. throw new Error("illegal catch attempt");
  3005. },
  3006. delegateYield: function(iterable, resultName, nextLoc) {
  3007. this.delegate = {
  3008. iterator: values(iterable),
  3009. resultName: resultName,
  3010. nextLoc: nextLoc
  3011. };
  3012. if (this.method === "next") {
  3013. // Deliberately forget the last sent value so that we don't
  3014. // accidentally pass it on to the delegate.
  3015. this.arg = undefined;
  3016. }
  3017. return ContinueSentinel;
  3018. }
  3019. };
  3020. })(
  3021. // In sloppy mode, unbound `this` refers to the global object, fallback to
  3022. // Function constructor if we're in global strict mode. That is sadly a form
  3023. // of indirect eval which violates Content Security Policy.
  3024. (function() {
  3025. return this || (typeof self === "object" && self);
  3026. })() || Function("return this")()
  3027. );
  3028. /***/ }),
  3029. /***/ 24:
  3030. /*!********************************************************************!*\
  3031. !*** C:/Users/Administrator/Desktop/xmt_new/utils/wxAuthorized.js ***!
  3032. \********************************************************************/
  3033. /*! no static exports found */
  3034. /***/ (function(module, exports, __webpack_require__) {
  3035. "use strict";
  3036. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.loginWinxin = loginWinxin;exports.weixindata = weixindata;exports.shareLoad = shareLoad;exports.setRouter = setRouter;exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 21));var _wx = __webpack_require__(/*! @/api/wx */ 25);
  3037. var log = _interopRequireWildcard(__webpack_require__(/*! ./log.js */ 29));
  3038. var _platform = __webpack_require__(/*! ./platform.js */ 30);
  3039. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 6));
  3040. var _index = _interopRequireDefault(__webpack_require__(/*! @/plugin/jweixin-module/index.js */ 31));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _readOnlyError(name) {throw new Error("\"" + name + "\" is read-only");}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  3041. // 保存分享数据
  3042. var shareData = '';
  3043. // 保存注册返回appId数据
  3044. var appId = '';
  3045. //保存路由对象
  3046. var router = '';
  3047. //微信登录
  3048. /**
  3049. * @param {string} 当前页面地址信息
  3050. */function
  3051. loginWinxin() {return _loginWinxin.apply(this, arguments);}function _loginWinxin() {_loginWinxin = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var pages, page, path;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  3052. console.log('1');if (
  3053. router) {_context.next = 5;break;}_context.next = 4;return (
  3054. setRouter());case 4:router = _context.sent;case 5:
  3055. try {
  3056. pages = getCurrentPages();
  3057. // 获取跳转前页面
  3058. page = pages[pages.length - 1];
  3059. // 获取跳转前路由地址
  3060. path = page.route;
  3061. } catch (e) {
  3062. console.log(e);
  3063. //TODO handle the exception
  3064. }
  3065. // 判断是否在登录页
  3066. if (path != 'pages/redirect/redirect') {
  3067. log.addLog('开始注册微信');
  3068. weixindata().then(function () {
  3069. // 调用
  3070. try {
  3071. weixinSq();
  3072. } catch (e) {
  3073. console.log(e);
  3074. //TODO handle the exception
  3075. }
  3076. });
  3077. }case 7:case "end":return _context.stop();}}}, _callee);}));return _loginWinxin.apply(this, arguments);}
  3078. ;
  3079. // 微信授权登录
  3080. function weixinSq() {
  3081. // 微信授权后跳转页面
  3082. try {
  3083. // 判断是否真实路由模式
  3084. var type = router.mode === "history" ? '' : '/#';
  3085. var ul = encodeURIComponent(_store.default.state.baseURL + _store.default.state.urlFile + type + '/pages/redirect/redirect');
  3086. // 打开微信授权页面
  3087. var url =
  3088. 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
  3089. appId +
  3090. '&redirect_uri=' +
  3091. ul +
  3092. '&response_type=code&scope=snsapi_userinfo&state=' +
  3093. new Date().getTime() +
  3094. '#wechat_redirect';
  3095. window.location.href = url;
  3096. } catch (e) {
  3097. console.log(e);
  3098. //TODO handle the exception
  3099. }
  3100. };
  3101. // 微信注册
  3102. function weixindata(_x) {return _weixindata.apply(this, arguments);}
  3103. // 判断分享调用方法
  3104. function _weixindata() {_weixindata = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(config) {var url;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.prev = 0;if (router) {_context2.next = 5;break;}_context2.next = 4;return setRouter();case 4:router = _context2.sent;case 5:if (router.mode === "history") {// 在ios中时候注册为微信刚进入时候的页面
  3105. if (!window.entryUrl) {window.entryUrl = location.href.split('#')[0];}url = (0, _platform.isAndroid)() ? location.href.split('#')[0] : window.entryUrl;}if (router.mode === "hash") {url = location.href.split('#')[0];}log.addLog('注册开始', url);console.log('开始注册', url);_context2.next = 14;break;case 11:_context2.prev = 11;_context2.t0 = _context2["catch"](0);console.log('错误', _context2.t0);case 14:return _context2.abrupt("return", new Promise(function (ok, error) {try {//注册微信信息
  3106. (0, _wx.wechatConfig)({ url: url }).then(function (_ref2) {var data = _ref2.data;console.log('111111');try {// 保存appId
  3107. appId = data.appId; // 微信信息配置
  3108. _index.default.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  3109. appId: data.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
  3110. timestamp: data.timestamp, // 必填,生成签名的时间戳
  3111. nonceStr: data.nonceStr, // 必填,生成签名的随机串
  3112. signature: data.signature, // 必填,签名,见附录1
  3113. jsApiList: data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  3114. });_index.default.ready(function (e) {log.addLog("注册完毕", data);console.log('注册完毕');ok(_index.default);});} catch (e) {console.log(e);}}).catch(function (e) {error(e);console.log(e);});} catch (e) {console.log(e); //TODO handle the exception
  3115. }}));case 15:case "end":return _context2.stop();}}}, _callee2, null, [[0, 11]]);}));return _weixindata.apply(this, arguments);}function shareLoad(config) {console.log('开始调用分享');try {weixindata().then(function (e) {// 判断有无自定义数据
  3116. if (config) {console.log(config);shareFun(config);} else {// 判断是否已经缓存了默认数据
  3117. if (shareData) {shareFun();} else {// 请求获取默认数据
  3118. (0, _wx.share)({}).then(function (_ref)
  3119. {var data = _ref.data;
  3120. shareData = data.data;
  3121. shareFun();
  3122. });
  3123. }
  3124. }
  3125. });
  3126. } catch (e) {
  3127. console.log('报错', e);
  3128. //TODO handle the exception
  3129. }
  3130. }
  3131. // 配置分享数据
  3132. function shareFun(config) {
  3133. try {
  3134. console.log('再付分享内容', config);
  3135. var mess;
  3136. if (config) {
  3137. mess = {
  3138. link: config.link, // 分享链接
  3139. imgUrl: config.imgUrl,
  3140. desc: config.desc,
  3141. title: config.title,
  3142. success: config.success || function (e) {
  3143. console.log(e);
  3144. },
  3145. fail: config.fail || function (e) {
  3146. console.log(e);
  3147. } };
  3148. } else {
  3149. var userInfo = uni.getStorageSync('userInfo');
  3150. console.log(userInfo);
  3151. var url = window.location.href + '?spread=' + userInfo.uid;
  3152. url = (_readOnlyError("url"), url.replace(/[\?,&]{0,1}from=singlemessage/g, ''));
  3153. mess = {
  3154. title: shareData.title,
  3155. link: url, // 分享链接
  3156. imgUrl: shareData.img, // 分享图标
  3157. desc: shareData.synopsis,
  3158. success: function success() {
  3159. // uni.showModal({
  3160. // title: '分享',
  3161. // content: '分享成功',
  3162. // showCancel: false,
  3163. // success: res => {
  3164. // console.log('分享成功回调接口');
  3165. // },
  3166. // fail: () => {},
  3167. // complete: () => {}
  3168. // });
  3169. } };
  3170. }
  3171. // 获取仓库数据
  3172. // 分享好友
  3173. // weixinObj.updateAppMessageShareData(mess);
  3174. // // 分享朋友圈
  3175. // weixinObj.updateTimelineShareData(mess)
  3176. // weixinObj.updateAppMessageShareData(mess);
  3177. _index.default.onMenuShareAppMessage(mess); // 即将废弃
  3178. // 分享朋友圈
  3179. // weixinObj.updateTimelineShareData(mess)
  3180. _index.default.onMenuShareTimeline(mess); // 即将废弃
  3181. } catch (e) {
  3182. console.log(e);
  3183. //TODO handle the exception
  3184. }
  3185. }
  3186. // 保存路由对象
  3187. function setRouter(route) {
  3188. return new Promise(function (ok, err) {
  3189. router = getApp().$router;
  3190. console.log(router, '开始数据');
  3191. if (!router) {
  3192. var set = setInterval(function () {
  3193. router = getApp().$router;
  3194. console.log(router, '返回数据');
  3195. if (router) {
  3196. console.log(router, '结束');
  3197. clearInterval(set);
  3198. ok(router);
  3199. }
  3200. }, 100);
  3201. } else {
  3202. console.log(router, '成功');
  3203. ok(router);
  3204. }
  3205. });
  3206. }var _default =
  3207. {
  3208. weixinObj: _index.default,
  3209. shareData: shareData,
  3210. appId: appId,
  3211. setRouter: setRouter,
  3212. shareLoad: shareLoad };exports.default = _default;
  3213. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3214. /***/ }),
  3215. /***/ 25:
  3216. /*!********************************************************!*\
  3217. !*** C:/Users/Administrator/Desktop/xmt_new/api/wx.js ***!
  3218. \********************************************************/
  3219. /*! no static exports found */
  3220. /***/ (function(module, exports, __webpack_require__) {
  3221. "use strict";
  3222. Object.defineProperty(exports, "__esModule", { value: true });exports.wechatMpAuth = wechatMpAuth;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3223. // 微信code地址
  3224. function wechatMpAuth(data) {
  3225. return (0, _request.default)({
  3226. url: '/api/wechat/mp_auth',
  3227. method: 'post',
  3228. data: data });
  3229. }
  3230. /***/ }),
  3231. /***/ 26:
  3232. /*!***************************************************************!*\
  3233. !*** C:/Users/Administrator/Desktop/xmt_new/utils/request.js ***!
  3234. \***************************************************************/
  3235. /*! no static exports found */
  3236. /***/ (function(module, exports, __webpack_require__) {
  3237. "use strict";
  3238. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.upFilse = void 0;var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 27));
  3239. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 6));
  3240. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 28);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3241. // 请求完成后拦截
  3242. _newRequest.default.interceptors.response(
  3243. function (response) {
  3244. try {
  3245. var res = response.data;
  3246. // 解析字符串为数字
  3247. if (res.status !== 200) {
  3248. console.log(res.status);
  3249. if (res.status == 410000) {
  3250. // 调用退出登录方法清空用户信息
  3251. _store.default.commit('user/logout');
  3252. // 判断是否开启强制登录
  3253. uni.showModal({
  3254. title: "登陆",
  3255. content: '您未登录!是否马上登录?',
  3256. success: function success(e) {
  3257. // 判断是否点击确认按钮
  3258. if (e.confirm) {
  3259. // 保存当前页面地址
  3260. (0, _loginUtils.saveUrl)();
  3261. // 跳转页面
  3262. (0, _loginUtils.interceptor)();
  3263. }
  3264. } });
  3265. } else {
  3266. if (res.msg != '系统出现异常') {
  3267. uni.showToast({
  3268. title: res.msg,
  3269. duration: 1500,
  3270. mask: false,
  3271. icon: 'none' });
  3272. }
  3273. }
  3274. return Promise.reject(res);
  3275. } else {
  3276. return res;
  3277. }
  3278. } catch (e) {
  3279. console.log(e);
  3280. }
  3281. },
  3282. function (error) {
  3283. uni.showToast({
  3284. title: "加载错误请重试",
  3285. duration: 1500,
  3286. mask: false,
  3287. icon: 'none' });
  3288. return Promise.reject(error);
  3289. });
  3290. // 请求前拦截器
  3291. _newRequest.default.interceptors.request(
  3292. function (config) {
  3293. var token = uni.getStorageSync('token') || '';
  3294. // console.log(config);
  3295. if (!config.header) {
  3296. config.header = {
  3297. "Authori-zation": 'Bearer ' + token };
  3298. } else {
  3299. // 添加key请求头
  3300. config.header["Authori-zation"] = 'Bearer ' + token;
  3301. }
  3302. return config;
  3303. },
  3304. function (error) {
  3305. // 错误处理
  3306. console.log(error);
  3307. return Promise.reject(error);
  3308. });
  3309. var upFilse = _newRequest.default.upFilse;exports.upFilse = upFilse;var _default =
  3310. _newRequest.default.open;exports.default = _default;
  3311. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3312. /***/ }),
  3313. /***/ 27:
  3314. /*!******************************************************************!*\
  3315. !*** C:/Users/Administrator/Desktop/xmt_new/utils/newRequest.js ***!
  3316. \******************************************************************/
  3317. /*! no static exports found */
  3318. /***/ (function(module, exports, __webpack_require__) {
  3319. "use strict";
  3320. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 21));var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 6));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  3321. var baseURL = window.location.protocol + '//' + window.location.host;
  3322. var service = {
  3323. baseURL: baseURL, // 请求头
  3324. header: {
  3325. 'Content-Type': "application/x-www-form-urlencoded" },
  3326. // 请求拦截器
  3327. interceptors: {
  3328. // 安装请求前拦截
  3329. request: function request(success, iserror) {
  3330. service.request.success = success;
  3331. service.request.error = iserror;
  3332. },
  3333. // 安装请求完成后拦截
  3334. response: function response(success, iserror) {
  3335. service.response.success = success;
  3336. service.response.error = iserror;
  3337. } },
  3338. // 请求前拦截
  3339. request: {
  3340. // 回调成功执行方法
  3341. success: function success(e) {
  3342. return e;
  3343. },
  3344. // 回调失败
  3345. error: function error(e) {
  3346. return e;
  3347. } },
  3348. // 请求完成后拦截
  3349. response: {
  3350. // 回调成功执行方法
  3351. success: function success(e) {
  3352. return e;
  3353. },
  3354. // 回调失败
  3355. error: function error(e) {
  3356. return e;
  3357. } },
  3358. // 开始请求
  3359. open: function () {var _open = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  3360. new Promise(function (resolve, reject) {
  3361. var requestData = ''; //保存处理完成后请求数据
  3362. var url = ''; //保存链接地址
  3363. //console.log(data);
  3364. // 请求前数据处理
  3365. requestData = service.request.success(data);
  3366. url = service.baseURL + requestData.url;
  3367. // 数据复制用于请求
  3368. uni.request({
  3369. url: url,
  3370. method: requestData.method || 'GET',
  3371. data: requestData.data,
  3372. header: data.header || service.header,
  3373. success: function success(res) {
  3374. if (res.statusCode == 200) {
  3375. try {
  3376. resolve(service.response.success(res));
  3377. } catch (e) {
  3378. service.response.error(e);
  3379. }
  3380. }
  3381. },
  3382. // 请求失败数据处理
  3383. fail: function fail(err) {
  3384. service.response.error(err);
  3385. } });
  3386. }));case 2:return _context.abrupt("return", _context.sent);case 3:case "end":return _context.stop();}}}, _callee);}));function open(_x) {return _open.apply(this, arguments);}return open;}(),
  3387. // 上传文件
  3388. upFilse: function () {var _upFilse = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:_context4.next = 2;return (
  3389. new Promise(function (resolve, reject) {
  3390. var requestData = ''; //保存处理完成后请求数据
  3391. var url = ''; //保存请求地址
  3392. try {
  3393. // 请求前数据处理
  3394. requestData = service.request.success(data);
  3395. } catch (e) {
  3396. // 请求报错拦截
  3397. service.request.error(e);
  3398. }
  3399. url = service.baseURL + requestData.url;
  3400. var config = {
  3401. // 上传图片的API
  3402. upload_img_url: url };
  3403. var Uploader = {
  3404. // 选择图片
  3405. choose: function choose(num) {
  3406. return new Promise(function (resolve, reject) {
  3407. uni.chooseImage({
  3408. count: num,
  3409. success: function success(res) {
  3410. // console.log(res);
  3411. // 缓存文件路径
  3412. resolve(res.tempFilePaths);
  3413. },
  3414. fail: function fail(err) {
  3415. console.log(err);
  3416. reject(err);
  3417. } });
  3418. });
  3419. },
  3420. // 上传图片
  3421. upload_one: function upload_one(path) {
  3422. return new Promise(function (resolve, reject) {
  3423. uni.showLoading({
  3424. title: '上传中' });
  3425. uni.uploadFile({
  3426. url: config.upload_img_url, //仅为示例,非真实的接口地址
  3427. filePath: path,
  3428. name: 'file',
  3429. header: {
  3430. "Authori-zation": 'Bearer ' + uni.getStorageSync('token') },
  3431. success: function success(uploadFileRes) {
  3432. if ("string" === typeof uploadFileRes.data) {
  3433. resolve(JSON.parse(uploadFileRes.data).data);
  3434. } else {
  3435. resolve(uploadFileRes.data.data);
  3436. }
  3437. },
  3438. complete: function complete() {
  3439. uni.hideLoading();
  3440. } });
  3441. });
  3442. },
  3443. // 上传多个图片
  3444. upload: function upload(path_arr) {var _this = this;
  3445. var num = path_arr.length;
  3446. return new Promise( /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {var img_urls, i, img_url;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  3447. img_urls = [];
  3448. i = 0;case 2:if (!(i < num)) {_context2.next = 10;break;}_context2.next = 5;return (
  3449. _this.upload_one(path_arr[i]));case 5:img_url = _context2.sent;
  3450. img_urls.push(img_url);case 7:i++;_context2.next = 2;break;case 10:
  3451. ;
  3452. resolve(img_urls);case 12:case "end":return _context2.stop();}}}, _callee2);}));return function (_x3, _x4) {return _ref.apply(this, arguments);};}());
  3453. },
  3454. // 触发上传图片事件
  3455. choose_and_upload: function choose_and_upload(num) {var _this2 = this;
  3456. return new Promise( /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {var path_arr;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return (
  3457. _this2.choose(num));case 2:path_arr = _context3.sent;_context3.next = 5;return (
  3458. _this2.upload(path_arr).then(function (e) {
  3459. resolve(e);
  3460. }).catch(function (e) {
  3461. reject(e);
  3462. }));case 5:case "end":return _context3.stop();}}}, _callee3);}));return function (_x5, _x6) {return _ref2.apply(this, arguments);};}());
  3463. } };
  3464. Uploader.choose_and_upload(1).then(function (e) {
  3465. resolve(e);
  3466. }).catch(function (e) {
  3467. console.log(e);
  3468. });
  3469. }));case 2:return _context4.abrupt("return", _context4.sent);case 3:case "end":return _context4.stop();}}}, _callee4);}));function upFilse(_x2) {return _upFilse.apply(this, arguments);}return upFilse;}() };var _default =
  3470. service;exports.default = _default;
  3471. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3472. /***/ }),
  3473. /***/ 28:
  3474. /*!******************************************************************!*\
  3475. !*** C:/Users/Administrator/Desktop/xmt_new/utils/loginUtils.js ***!
  3476. \******************************************************************/
  3477. /*! no static exports found */
  3478. /***/ (function(module, exports, __webpack_require__) {
  3479. "use strict";
  3480. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getActionPage = getActionPage;exports.interceptor = interceptor;exports.saveUrl = saveUrl;exports.getPageUrl = getPageUrl;function getActionPage() {
  3481. var pages = getCurrentPages();
  3482. return pages[pages.length - 1];
  3483. }
  3484. //登录拦截
  3485. function interceptor() {
  3486. var pages = getActionPage();
  3487. // 获取当前页面
  3488. var pageUrl = '/' + pages.route;
  3489. var url = '/pages/public/login';
  3490. url = '/pages/public/wxLogin';
  3491. if (pageUrl != url) {
  3492. uni.navigateTo({
  3493. url: url });
  3494. }
  3495. }
  3496. // 保存页面
  3497. function saveUrl() {
  3498. var path = getPageUrl(true);
  3499. uni.setStorageSync('present', path);
  3500. }
  3501. // 处理分享链接地址
  3502. function getPageUrl() {var showSpeard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3503. var page = getActionPage();
  3504. var path = '/' + page.route;
  3505. var url = '';
  3506. // 获取对象可枚举键值列表
  3507. var objKeys = Object.keys(page.options);
  3508. // 判断有无传值
  3509. if (objKeys.length > 0) {
  3510. // 循环赋值对象数据
  3511. for (var a in page.options) {
  3512. // 判断有无邀请人
  3513. if (a != 'speard') {
  3514. url += a + "=" + page.options[a] + "&";
  3515. } else {
  3516. // 判断是否需要存储邀请人
  3517. if (showSpeard) {
  3518. url += a + "=" + page.options[a] + "&";
  3519. }
  3520. }
  3521. }
  3522. path += '?' + url.substr(0, url.length - 1);
  3523. }
  3524. // 返回处理邀请人后的邀请地址
  3525. return path;
  3526. }
  3527. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3528. /***/ }),
  3529. /***/ 29:
  3530. /*!***********************************************************!*\
  3531. !*** C:/Users/Administrator/Desktop/xmt_new/utils/log.js ***!
  3532. \***********************************************************/
  3533. /*! no static exports found */
  3534. /***/ (function(module, exports, __webpack_require__) {
  3535. "use strict";
  3536. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.addLog = addLog;exports.delLog = delLog;exports.getLog = getLog;exports.initLog = initLog;exports.showLog = showLog;
  3537. var logLength = 100; //缓存存储上限
  3538. var name = 'log'; //缓存名字
  3539. function addLog(data) {var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  3540. var log = uni.getStorageSync(name) || [];
  3541. log.unshift({
  3542. title: data,
  3543. content: content });
  3544. uni.setStorageSync(name, log);
  3545. initLog(log);
  3546. }
  3547. function delLog() {
  3548. return uni.setStorageSync(name, '');
  3549. }
  3550. function getLog() {
  3551. return uni.getStorageSync(name);
  3552. }
  3553. function initLog(log) {
  3554. if (log.length > logLength) {
  3555. var newarr = log.slice(log.length - logLength);
  3556. uni.setStorageSync(name, newarr);
  3557. }
  3558. }
  3559. function showLog(log) {
  3560. var str = '';
  3561. uni.getStorageSync(name).forEach(function (e) {
  3562. str += e.title + ':' + JSON.stringify(e.content);
  3563. });
  3564. uni.showModal({
  3565. title: "日志",
  3566. content: str });
  3567. }
  3568. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3569. /***/ }),
  3570. /***/ 290:
  3571. /*!****************************************************************************!*\
  3572. !*** C:/Users/Administrator/Desktop/xmt_new/components/uni-icons/icons.js ***!
  3573. \****************************************************************************/
  3574. /*! no static exports found */
  3575. /***/ (function(module, exports, __webpack_require__) {
  3576. "use strict";
  3577. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  3578. 'contact': "\uE100",
  3579. 'person': "\uE101",
  3580. 'personadd': "\uE102",
  3581. 'contact-filled': "\uE130",
  3582. 'person-filled': "\uE131",
  3583. 'personadd-filled': "\uE132",
  3584. 'phone': "\uE200",
  3585. 'email': "\uE201",
  3586. 'chatbubble': "\uE202",
  3587. 'chatboxes': "\uE203",
  3588. 'phone-filled': "\uE230",
  3589. 'email-filled': "\uE231",
  3590. 'chatbubble-filled': "\uE232",
  3591. 'chatboxes-filled': "\uE233",
  3592. 'weibo': "\uE260",
  3593. 'weixin': "\uE261",
  3594. 'pengyouquan': "\uE262",
  3595. 'chat': "\uE263",
  3596. 'qq': "\uE264",
  3597. 'videocam': "\uE300",
  3598. 'camera': "\uE301",
  3599. 'mic': "\uE302",
  3600. 'location': "\uE303",
  3601. 'mic-filled': "\uE332",
  3602. 'speech': "\uE332",
  3603. 'location-filled': "\uE333",
  3604. 'micoff': "\uE360",
  3605. 'image': "\uE363",
  3606. 'map': "\uE364",
  3607. 'compose': "\uE400",
  3608. 'trash': "\uE401",
  3609. 'upload': "\uE402",
  3610. 'download': "\uE403",
  3611. 'close': "\uE404",
  3612. 'redo': "\uE405",
  3613. 'undo': "\uE406",
  3614. 'refresh': "\uE407",
  3615. 'star': "\uE408",
  3616. 'plus': "\uE409",
  3617. 'minus': "\uE410",
  3618. 'circle': "\uE411",
  3619. 'checkbox': "\uE411",
  3620. 'close-filled': "\uE434",
  3621. 'clear': "\uE434",
  3622. 'refresh-filled': "\uE437",
  3623. 'star-filled': "\uE438",
  3624. 'plus-filled': "\uE439",
  3625. 'minus-filled': "\uE440",
  3626. 'circle-filled': "\uE441",
  3627. 'checkbox-filled': "\uE442",
  3628. 'closeempty': "\uE460",
  3629. 'refreshempty': "\uE461",
  3630. 'reload': "\uE462",
  3631. 'starhalf': "\uE463",
  3632. 'spinner': "\uE464",
  3633. 'spinner-cycle': "\uE465",
  3634. 'search': "\uE466",
  3635. 'plusempty': "\uE468",
  3636. 'forward': "\uE470",
  3637. 'back': "\uE471",
  3638. 'left-nav': "\uE471",
  3639. 'checkmarkempty': "\uE472",
  3640. 'home': "\uE500",
  3641. 'navigate': "\uE501",
  3642. 'gear': "\uE502",
  3643. 'paperplane': "\uE503",
  3644. 'info': "\uE504",
  3645. 'help': "\uE505",
  3646. 'locked': "\uE506",
  3647. 'more': "\uE507",
  3648. 'flag': "\uE508",
  3649. 'home-filled': "\uE530",
  3650. 'gear-filled': "\uE532",
  3651. 'info-filled': "\uE534",
  3652. 'help-filled': "\uE535",
  3653. 'more-filled': "\uE537",
  3654. 'settings': "\uE560",
  3655. 'list': "\uE562",
  3656. 'bars': "\uE563",
  3657. 'loop': "\uE565",
  3658. 'paperclip': "\uE567",
  3659. 'eye': "\uE568",
  3660. 'arrowup': "\uE580",
  3661. 'arrowdown': "\uE581",
  3662. 'arrowleft': "\uE582",
  3663. 'arrowright': "\uE583",
  3664. 'arrowthinup': "\uE584",
  3665. 'arrowthindown': "\uE585",
  3666. 'arrowthinleft': "\uE586",
  3667. 'arrowthinright': "\uE587",
  3668. 'pulldown': "\uE588",
  3669. 'closefill': "\uE589",
  3670. 'sound': "\uE590",
  3671. 'scan': "\uE612" };exports.default = _default;
  3672. /***/ }),
  3673. /***/ 3:
  3674. /*!*************************************************************!*\
  3675. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3676. \*************************************************************/
  3677. /*! no static exports found */
  3678. /***/ (function(module, exports, __webpack_require__) {
  3679. "use strict";
  3680. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  3681. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  3682. var defaultDelimiters = ['{', '}'];var
  3683. BaseFormatter = /*#__PURE__*/function () {
  3684. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  3685. this._caches = Object.create(null);
  3686. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  3687. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3688. if (!values) {
  3689. return [message];
  3690. }
  3691. var tokens = this._caches[message];
  3692. if (!tokens) {
  3693. tokens = parse(message, delimiters);
  3694. this._caches[message] = tokens;
  3695. }
  3696. return compile(tokens, values);
  3697. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  3698. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3699. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3700. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  3701. var tokens = [];
  3702. var position = 0;
  3703. var text = '';
  3704. while (position < format.length) {
  3705. var char = format[position++];
  3706. if (char === startDelimiter) {
  3707. if (text) {
  3708. tokens.push({ type: 'text', value: text });
  3709. }
  3710. text = '';
  3711. var sub = '';
  3712. char = format[position++];
  3713. while (char !== undefined && char !== endDelimiter) {
  3714. sub += char;
  3715. char = format[position++];
  3716. }
  3717. var isClosed = char === endDelimiter;
  3718. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  3719. 'list' :
  3720. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  3721. 'named' :
  3722. 'unknown';
  3723. tokens.push({ value: sub, type: type });
  3724. }
  3725. // else if (char === '%') {
  3726. // // when found rails i18n syntax, skip text capture
  3727. // if (format[position] !== '{') {
  3728. // text += char
  3729. // }
  3730. // }
  3731. else {
  3732. text += char;
  3733. }
  3734. }
  3735. text && tokens.push({ type: 'text', value: text });
  3736. return tokens;
  3737. }
  3738. function compile(tokens, values) {
  3739. var compiled = [];
  3740. var index = 0;
  3741. var mode = isArray(values) ?
  3742. 'list' :
  3743. isObject(values) ?
  3744. 'named' :
  3745. 'unknown';
  3746. if (mode === 'unknown') {
  3747. return compiled;
  3748. }
  3749. while (index < tokens.length) {
  3750. var token = tokens[index];
  3751. switch (token.type) {
  3752. case 'text':
  3753. compiled.push(token.value);
  3754. break;
  3755. case 'list':
  3756. compiled.push(values[parseInt(token.value, 10)]);
  3757. break;
  3758. case 'named':
  3759. if (mode === 'named') {
  3760. compiled.push(values[token.value]);
  3761. } else
  3762. {
  3763. if (true) {
  3764. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3765. }
  3766. }
  3767. break;
  3768. case 'unknown':
  3769. if (true) {
  3770. console.warn("Detect 'unknown' type of token!");
  3771. }
  3772. break;}
  3773. index++;
  3774. }
  3775. return compiled;
  3776. }
  3777. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3778. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3779. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  3780. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  3781. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  3782. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3783. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  3784. var defaultFormatter = new BaseFormatter();
  3785. function include(str, parts) {
  3786. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  3787. }
  3788. function startsWith(str, parts) {
  3789. return parts.find(function (part) {return str.indexOf(part) === 0;});
  3790. }
  3791. function normalizeLocale(locale, messages) {
  3792. if (!locale) {
  3793. return;
  3794. }
  3795. locale = locale.trim().replace(/_/g, '-');
  3796. if (messages && messages[locale]) {
  3797. return locale;
  3798. }
  3799. locale = locale.toLowerCase();
  3800. if (locale.indexOf('zh') === 0) {
  3801. if (locale.indexOf('-hans') > -1) {
  3802. return LOCALE_ZH_HANS;
  3803. }
  3804. if (locale.indexOf('-hant') > -1) {
  3805. return LOCALE_ZH_HANT;
  3806. }
  3807. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3808. return LOCALE_ZH_HANT;
  3809. }
  3810. return LOCALE_ZH_HANS;
  3811. }
  3812. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3813. if (lang) {
  3814. return lang;
  3815. }
  3816. }var
  3817. I18n = /*#__PURE__*/function () {
  3818. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  3819. this.locale = LOCALE_EN;
  3820. this.fallbackLocale = LOCALE_EN;
  3821. this.message = {};
  3822. this.messages = {};
  3823. this.watchers = [];
  3824. if (fallbackLocale) {
  3825. this.fallbackLocale = fallbackLocale;
  3826. }
  3827. this.formater = formater || defaultFormatter;
  3828. this.messages = messages || {};
  3829. this.setLocale(locale || LOCALE_EN);
  3830. if (watcher) {
  3831. this.watchLocale(watcher);
  3832. }
  3833. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  3834. locale) {var _this = this;
  3835. var oldLocale = this.locale;
  3836. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3837. if (!this.messages[this.locale]) {
  3838. // 可能初始化时不存在
  3839. this.messages[this.locale] = {};
  3840. }
  3841. this.message = this.messages[this.locale];
  3842. // 仅发生变化时,通知
  3843. if (oldLocale !== this.locale) {
  3844. this.watchers.forEach(function (watcher) {
  3845. watcher(_this.locale, oldLocale);
  3846. });
  3847. }
  3848. } }, { key: "getLocale", value: function getLocale()
  3849. {
  3850. return this.locale;
  3851. } }, { key: "watchLocale", value: function watchLocale(
  3852. fn) {var _this2 = this;
  3853. var index = this.watchers.push(fn) - 1;
  3854. return function () {
  3855. _this2.watchers.splice(index, 1);
  3856. };
  3857. } }, { key: "add", value: function add(
  3858. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3859. var curMessages = this.messages[locale];
  3860. if (curMessages) {
  3861. if (override) {
  3862. Object.assign(curMessages, message);
  3863. } else
  3864. {
  3865. Object.keys(message).forEach(function (key) {
  3866. if (!hasOwn(curMessages, key)) {
  3867. curMessages[key] = message[key];
  3868. }
  3869. });
  3870. }
  3871. } else
  3872. {
  3873. this.messages[locale] = message;
  3874. }
  3875. } }, { key: "f", value: function f(
  3876. message, values, delimiters) {
  3877. return this.formater.interpolate(message, values, delimiters).join('');
  3878. } }, { key: "t", value: function t(
  3879. key, locale, values) {
  3880. var message = this.message;
  3881. if (typeof locale === 'string') {
  3882. locale = normalizeLocale(locale, this.messages);
  3883. locale && (message = this.messages[locale]);
  3884. } else
  3885. {
  3886. values = locale;
  3887. }
  3888. if (!hasOwn(message, key)) {
  3889. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3890. return key;
  3891. }
  3892. return this.formater.interpolate(message[key], values).join('');
  3893. } }]);return I18n;}();exports.I18n = I18n;
  3894. function watchAppLocale(appVm, i18n) {
  3895. // 需要保证 watch 的触发在组件渲染之前
  3896. if (appVm.$watchLocale) {
  3897. // vue2
  3898. appVm.$watchLocale(function (newLocale) {
  3899. i18n.setLocale(newLocale);
  3900. });
  3901. } else
  3902. {
  3903. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  3904. i18n.setLocale(newLocale);
  3905. });
  3906. }
  3907. }
  3908. function getDefaultLocale() {
  3909. if (typeof uni !== 'undefined' && uni.getLocale) {
  3910. return uni.getLocale();
  3911. }
  3912. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3913. if (typeof global !== 'undefined' && global.getLocale) {
  3914. return global.getLocale();
  3915. }
  3916. return LOCALE_EN;
  3917. }
  3918. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3919. // 兼容旧版本入参
  3920. if (typeof locale !== 'string') {var _ref4 =
  3921. [
  3922. messages,
  3923. locale];locale = _ref4[0];messages = _ref4[1];
  3924. }
  3925. if (typeof locale !== 'string') {
  3926. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3927. locale = getDefaultLocale();
  3928. }
  3929. if (typeof fallbackLocale !== 'string') {
  3930. fallbackLocale =
  3931. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  3932. LOCALE_EN;
  3933. }
  3934. var i18n = new I18n({
  3935. locale: locale,
  3936. fallbackLocale: fallbackLocale,
  3937. messages: messages,
  3938. watcher: watcher });
  3939. var _t = function t(key, values) {
  3940. if (typeof getApp !== 'function') {
  3941. // app view
  3942. /* eslint-disable no-func-assign */
  3943. _t = function t(key, values) {
  3944. return i18n.t(key, values);
  3945. };
  3946. } else
  3947. {
  3948. var isWatchedAppLocale = false;
  3949. _t = function t(key, values) {
  3950. var appVm = getApp().$vm;
  3951. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3952. // options: {
  3953. // type: Array,
  3954. // default () {
  3955. // return [{
  3956. // icon: 'shop',
  3957. // text: t("uni-goods-nav.options.shop"),
  3958. // }, {
  3959. // icon: 'cart',
  3960. // text: t("uni-goods-nav.options.cart")
  3961. // }]
  3962. // }
  3963. // },
  3964. if (appVm) {
  3965. // 触发响应式
  3966. appVm.$locale;
  3967. if (!isWatchedAppLocale) {
  3968. isWatchedAppLocale = true;
  3969. watchAppLocale(appVm, i18n);
  3970. }
  3971. }
  3972. return i18n.t(key, values);
  3973. };
  3974. }
  3975. return _t(key, values);
  3976. };
  3977. return {
  3978. i18n: i18n,
  3979. f: function f(message, values, delimiters) {
  3980. return i18n.f(message, values, delimiters);
  3981. },
  3982. t: function t(key, values) {
  3983. return _t(key, values);
  3984. },
  3985. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3986. return i18n.add(locale, message, override);
  3987. },
  3988. watch: function watch(fn) {
  3989. return i18n.watchLocale(fn);
  3990. },
  3991. getLocale: function getLocale() {
  3992. return i18n.getLocale();
  3993. },
  3994. setLocale: function setLocale(newLocale) {
  3995. return i18n.setLocale(newLocale);
  3996. } };
  3997. }
  3998. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  3999. var formater;
  4000. function hasI18nJson(jsonObj, delimiters) {
  4001. if (!formater) {
  4002. formater = new BaseFormatter();
  4003. }
  4004. return walkJsonObj(jsonObj, function (jsonObj, key) {
  4005. var value = jsonObj[key];
  4006. if (isString(value)) {
  4007. if (isI18nStr(value, delimiters)) {
  4008. return true;
  4009. }
  4010. } else
  4011. {
  4012. return hasI18nJson(value, delimiters);
  4013. }
  4014. });
  4015. }
  4016. function parseI18nJson(jsonObj, values, delimiters) {
  4017. if (!formater) {
  4018. formater = new BaseFormatter();
  4019. }
  4020. walkJsonObj(jsonObj, function (jsonObj, key) {
  4021. var value = jsonObj[key];
  4022. if (isString(value)) {
  4023. if (isI18nStr(value, delimiters)) {
  4024. jsonObj[key] = compileStr(value, values, delimiters);
  4025. }
  4026. } else
  4027. {
  4028. parseI18nJson(value, values, delimiters);
  4029. }
  4030. });
  4031. return jsonObj;
  4032. }
  4033. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  4034. if (!isI18nStr(jsonStr, delimiters)) {
  4035. return jsonStr;
  4036. }
  4037. if (!formater) {
  4038. formater = new BaseFormatter();
  4039. }
  4040. var localeValues = [];
  4041. Object.keys(locales).forEach(function (name) {
  4042. if (name !== locale) {
  4043. localeValues.push({
  4044. locale: name,
  4045. values: locales[name] });
  4046. }
  4047. });
  4048. localeValues.unshift({ locale: locale, values: locales[locale] });
  4049. try {
  4050. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  4051. }
  4052. catch (e) {}
  4053. return jsonStr;
  4054. }
  4055. function isI18nStr(value, delimiters) {
  4056. return value.indexOf(delimiters[0]) > -1;
  4057. }
  4058. function compileStr(value, values, delimiters) {
  4059. return formater.interpolate(value, values, delimiters).join('');
  4060. }
  4061. function compileValue(jsonObj, key, localeValues, delimiters) {
  4062. var value = jsonObj[key];
  4063. if (isString(value)) {
  4064. // 存在国际化
  4065. if (isI18nStr(value, delimiters)) {
  4066. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4067. if (localeValues.length > 1) {
  4068. // 格式化国际化语言
  4069. var valueLocales = jsonObj[key + 'Locales'] = {};
  4070. localeValues.forEach(function (localValue) {
  4071. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4072. });
  4073. }
  4074. }
  4075. } else
  4076. {
  4077. compileJsonObj(value, localeValues, delimiters);
  4078. }
  4079. }
  4080. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4081. walkJsonObj(jsonObj, function (jsonObj, key) {
  4082. compileValue(jsonObj, key, localeValues, delimiters);
  4083. });
  4084. return jsonObj;
  4085. }
  4086. function walkJsonObj(jsonObj, walk) {
  4087. if (isArray(jsonObj)) {
  4088. for (var i = 0; i < jsonObj.length; i++) {
  4089. if (walk(jsonObj, i)) {
  4090. return true;
  4091. }
  4092. }
  4093. } else
  4094. if (isObject(jsonObj)) {
  4095. for (var key in jsonObj) {
  4096. if (walk(jsonObj, key)) {
  4097. return true;
  4098. }
  4099. }
  4100. }
  4101. return false;
  4102. }
  4103. function resolveLocale(locales) {
  4104. return function (locale) {
  4105. if (!locale) {
  4106. return locale;
  4107. }
  4108. locale = normalizeLocale(locale) || locale;
  4109. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  4110. };
  4111. }
  4112. function resolveLocaleChain(locale) {
  4113. var chain = [];
  4114. var tokens = locale.split('-');
  4115. while (tokens.length) {
  4116. chain.push(tokens.join('-'));
  4117. tokens.pop();
  4118. }
  4119. return chain;
  4120. }
  4121. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  4122. /***/ }),
  4123. /***/ 30:
  4124. /*!****************************************************************!*\
  4125. !*** C:/Users/Administrator/Desktop/xmt_new/utils/platform.js ***!
  4126. \****************************************************************/
  4127. /*! no static exports found */
  4128. /***/ (function(module, exports, __webpack_require__) {
  4129. "use strict";
  4130. Object.defineProperty(exports, "__esModule", { value: true });exports.isAndroid = isAndroid;exports.isIOS = isIOS;exports.isPad = isPad;exports.isWinPad = isWinPad;exports.default = void 0;function isAndroid() {
  4131. var ua = navigator.userAgent,
  4132. _isAndroid = ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1;
  4133. return _isAndroid;
  4134. }
  4135. function isIOS() {
  4136. return !!navigator.userAgent.match(/(i[^;]+\;(U;)? CPU.+Mac OS X)/);
  4137. }
  4138. function isPad() {
  4139. return navigator.userAgent.toLowerCase().match(/iPad/i) == "ipad";
  4140. }
  4141. function isWinPad() {
  4142. return navigator.userAgent.indexOf("Windows NT") >= 0;
  4143. }var _default =
  4144. {
  4145. isAndroid: isAndroid,
  4146. isIOS: isIOS,
  4147. isPad: isPad,
  4148. isWinPad: isWinPad };exports.default = _default;
  4149. /***/ }),
  4150. /***/ 31:
  4151. /*!*****************************************************************************!*\
  4152. !*** C:/Users/Administrator/Desktop/xmt_new/plugin/jweixin-module/index.js ***!
  4153. \*****************************************************************************/
  4154. /*! no static exports found */
  4155. /***/ (function(module, exports, __webpack_require__) {
  4156. var __WEBPACK_AMD_DEFINE_RESULT__;function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}!function (e, n) { true ? !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return n(e);}).call(exports, __webpack_require__, exports, module),
  4157. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;}(window, function (o, e) {if (!o.jWeixin) {var _w;var n,c = { config: "preVerifyJSAPI", onMenuShareTimeline: "menu:share:timeline", onMenuShareAppMessage: "menu:share:appmessage", onMenuShareQQ: "menu:share:qq", onMenuShareWeibo: "menu:share:weiboApp", onMenuShareQZone: "menu:share:QZone", previewImage: "imagePreview", getLocation: "geoLocation", openProductSpecificView: "openProductViewWithPid", addCard: "batchAddCard", openCard: "batchViewCard", chooseWXPay: "getBrandWCPayRequest", openEnterpriseRedPacket: "getRecevieBizHongBaoRequest", startSearchBeacons: "startMonitoringBeacons", stopSearchBeacons: "stopMonitoringBeacons", onSearchBeacons: "onBeaconsInRange", consumeAndShareCard: "consumedShareCard", openAddress: "editAddress" },a = function () {var e = {};for (var n in c) {e[c[n]] = n;}return e;}(),i = o.document,t = i.title,r = navigator.userAgent.toLowerCase(),s = navigator.platform.toLowerCase(),d = !(!s.match("mac") && !s.match("win")),u = -1 != r.indexOf("wxdebugger"),l = -1 != r.indexOf("micromessenger"),p = -1 != r.indexOf("android"),f = -1 != r.indexOf("iphone") || -1 != r.indexOf("ipad"),m = (n = r.match(/micromessenger\/(\d+\.\d+\.\d+)/) || r.match(/micromessenger\/(\d+\.\d+)/)) ? n[1] : "",g = { initStartTime: L(), initEndTime: 0, preVerifyStartTime: 0, preVerifyEndTime: 0 },h = { version: 1, appId: "", initTime: 0, preVerifyTime: 0, networkType: "", isPreVerifyOk: 1, systemType: f ? 1 : p ? 2 : -1, clientVersion: m, url: encodeURIComponent(location.href) },v = {},S = { _completes: [] },y = { state: 0, data: {} };O(function () {g.initEndTime = L();});var I = !1,_ = [],w = (_w = { config: function config(e) {B("config", v = e);var t = !1 !== v.check;O(function () {if (t) M(c.config, { verifyJsApiList: C(v.jsApiList), verifyOpenTagList: C(v.openTagList) }, function () {S._complete = function (e) {g.preVerifyEndTime = L(), y.state = 1, y.data = e;}, S.success = function (e) {h.isPreVerifyOk = 0;}, S.fail = function (e) {S._fail ? S._fail(e) : y.state = -1;};var t = S._completes;return t.push(function () {!function () {if (!(d || u || v.debug || m < "6.0.2" || h.systemType < 0)) {var i = new Image();h.appId = v.appId, h.initTime = g.initEndTime - g.initStartTime, h.preVerifyTime = g.preVerifyEndTime - g.preVerifyStartTime, w.getNetworkType({ isInnerInvoke: !0, success: function success(e) {h.networkType = e.networkType;var n = "https://open.weixin.qq.com/sdk/report?v=" + h.version + "&o=" + h.isPreVerifyOk + "&s=" + h.systemType + "&c=" + h.clientVersion + "&a=" + h.appId + "&n=" + h.networkType + "&i=" + h.initTime + "&p=" + h.preVerifyTime + "&u=" + h.url;i.src = n;} });}}();}), S.complete = function (e) {for (var n = 0, i = t.length; n < i; ++n) {t[n]();}S._completes = [];}, S;}()), g.preVerifyStartTime = L();else {y.state = 1;for (var e = S._completes, n = 0, i = e.length; n < i; ++n) {e[n]();}S._completes = [];}}), w.invoke || (w.invoke = function (e, n, i) {o.WeixinJSBridge && WeixinJSBridge.invoke(e, x(n), i);}, w.on = function (e, n) {o.WeixinJSBridge && WeixinJSBridge.on(e, n);});}, ready: function ready(e) {0 != y.state ? e() : (S._completes.push(e), !l && v.debug && e());}, error: function error(e) {m < "6.0.2" || (-1 == y.state ? e(y.data) : S._fail = e);}, checkJsApi: function checkJsApi(e) {M("checkJsApi", { jsApiList: C(e.jsApiList) }, (e._complete = function (e) {if (p) {var n = e.checkResult;n && (e.checkResult = JSON.parse(n));}e = function (e) {var n = e.checkResult;for (var i in n) {var t = a[i];t && (n[t] = n[i], delete n[i]);}return e;}(e);}, e));}, onMenuShareTimeline: function onMenuShareTimeline(e) {P(c.onMenuShareTimeline, { complete: function complete() {M("shareTimeline", { title: e.title || t, desc: e.title || t, img_url: e.imgUrl || "", link: e.link || location.href, type: e.type || "link", data_url: e.dataUrl || "" }, e);} }, e);}, onMenuShareAppMessage: function onMenuShareAppMessage(n) {P(c.onMenuShareAppMessage, { complete: function complete(e) {"favorite" === e.scene ? M("sendAppMessage", { title: n.title || t, desc: n.desc || "", link: n.link || location.href, img_url: n.imgUrl || "", type: n.type || "link", data_url: n.dataUrl || "" }) : M("sendAppMessage", { title: n.title || t, desc: n.desc || "", link: n.link || location.href, img_url: n.imgUrl || "", type: n.type || "link", data_url: n.dataUrl || "" }, n);} }, n);}, onMenuShareQQ: function onMenuShareQQ(e) {P(c.onMenuShareQQ, { complete: function complete() {M("shareQQ", { title: e.title || t, desc: e.desc || "", img_url: e.imgUrl || "", link: e.link || location.href }, e);} }, e);}, onMenuShareWeibo: function onMenuShareWeibo(e) {P(c.onMenuShareWeibo, { complete: function complete() {M("shareWeiboApp", { title: e.title || t, desc: e.desc || "", img_url: e.imgUrl || "", link: e.link || location.href }, e);} }, e);}, onMenuShareQZone: function onMenuShareQZone(e) {P(c.onMenuShareQZone, { complete: function complete() {M("shareQZone", { title: e.title || t, desc: e.desc || "", img_url: e.imgUrl || "", link: e.link || location.href }, e);} }, e);}, updateTimelineShareData: function updateTimelineShareData(e) {M("updateTimelineShareData", { title: e.title, link: e.link, imgUrl: e.imgUrl }, e);}, updateAppMessageShareData: function updateAppMessageShareData(e) {M("updateAppMessageShareData", { title: e.title, desc: e.desc, link: e.link, imgUrl: e.imgUrl }, e);}, startRecord: function startRecord(e) {M("startRecord", {}, e);}, stopRecord: function stopRecord(e) {M("stopRecord", {}, e);}, onVoiceRecordEnd: function onVoiceRecordEnd(e) {P("onVoiceRecordEnd", e);}, playVoice: function playVoice(e) {M("playVoice", { localId: e.localId }, e);}, pauseVoice: function pauseVoice(e) {M("pauseVoice", { localId: e.localId }, e);}, stopVoice: function stopVoice(e) {M("stopVoice", { localId: e.localId }, e);}, onVoicePlayEnd: function onVoicePlayEnd(e) {P("onVoicePlayEnd", e);}, uploadVoice: function uploadVoice(e) {M("uploadVoice", { localId: e.localId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);}, downloadVoice: function downloadVoice(e) {M("downloadVoice", { serverId: e.serverId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);}, translateVoice: function translateVoice(e) {M("translateVoice", { localId: e.localId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);}, chooseImage: function chooseImage(e) {M("chooseImage", { scene: "1|2", count: e.count || 9, sizeType: e.sizeType || ["original", "compressed"], sourceType: e.sourceType || ["album", "camera"] }, (e._complete = function (e) {if (p) {var n = e.localIds;try {n && (e.localIds = JSON.parse(n));} catch (e) {}}}, e));}, getLocation: function getLocation(e) {}, previewImage: function previewImage(e) {M(c.previewImage, { current: e.current, urls: e.urls }, e);}, uploadImage: function uploadImage(e) {M("uploadImage", { localId: e.localId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);}, downloadImage: function downloadImage(e) {M("downloadImage", { serverId: e.serverId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);}, getLocalImgData: function getLocalImgData(e) {!1 === I ? (I = !0, M("getLocalImgData", { localId: e.localId }, (e._complete = function (e) {if (I = !1, 0 < _.length) {var n = _.shift();wx.getLocalImgData(n);}}, e))) : _.push(e);}, getNetworkType: function getNetworkType(e) {M("getNetworkType", {}, (e._complete = function (e) {e = function (e) {var n = e.errMsg;e.errMsg = "getNetworkType:ok";var i = e.subtype;if (delete e.subtype, i) e.networkType = i;else {var t = n.indexOf(":"),o = n.substring(t + 1);switch (o) {case "wifi":case "edge":case "wwan":e.networkType = o;break;default:e.errMsg = "getNetworkType:fail";}}return e;}(e);}, e));}, openLocation: function openLocation(e) {M("openLocation", { latitude: e.latitude, longitude: e.longitude, name: e.name || "", address: e.address || "", scale: e.scale || 28, infoUrl: e.infoUrl || "" }, e);} }, _defineProperty(_w, "getLocation", function getLocation(e) {M(c.getLocation, { type: (e = e || {}).type || "wgs84" }, (e._complete = function (e) {delete e.type;}, e));}), _defineProperty(_w, "hideOptionMenu", function hideOptionMenu(e) {M("hideOptionMenu", {}, e);}), _defineProperty(_w, "showOptionMenu", function showOptionMenu(e) {M("showOptionMenu", {}, e);}), _defineProperty(_w, "closeWindow", function closeWindow(e) {M("closeWindow", {}, e = e || {});}), _defineProperty(_w, "hideMenuItems", function hideMenuItems(e) {M("hideMenuItems", { menuList: e.menuList }, e);}), _defineProperty(_w, "showMenuItems", function showMenuItems(e) {M("showMenuItems", { menuList: e.menuList }, e);}), _defineProperty(_w, "hideAllNonBaseMenuItem", function hideAllNonBaseMenuItem(e) {M("hideAllNonBaseMenuItem", {}, e);}), _defineProperty(_w, "showAllNonBaseMenuItem", function showAllNonBaseMenuItem(e) {M("showAllNonBaseMenuItem", {}, e);}), _defineProperty(_w, "scanQRCode", function scanQRCode(e) {M("scanQRCode", { needResult: (e = e || {}).needResult || 0, scanType: e.scanType || ["qrCode", "barCode"] }, (e._complete = function (e) {if (f) {var n = e.resultStr;if (n) {var i = JSON.parse(n);e.resultStr = i && i.scan_code && i.scan_code.scan_result;}}}, e));}), _defineProperty(_w, "openAddress", function openAddress(e) {M(c.openAddress, {}, (e._complete = function (e) {e = function (e) {return e.postalCode = e.addressPostalCode, delete e.addressPostalCode, e.provinceName = e.proviceFirstStageName, delete e.proviceFirstStageName, e.cityName = e.addressCitySecondStageName, delete e.addressCitySecondStageName, e.countryName = e.addressCountiesThirdStageName, delete e.addressCountiesThirdStageName, e.detailInfo = e.addressDetailInfo, delete e.addressDetailInfo, e;}(e);}, e));}), _defineProperty(_w, "openProductSpecificView", function openProductSpecificView(e) {M(c.openProductSpecificView, { pid: e.productId, view_type: e.viewType || 0, ext_info: e.extInfo }, e);}), _defineProperty(_w, "addCard", function addCard(e) {for (var n = e.cardList, i = [], t = 0, o = n.length; t < o; ++t) {var r = n[t],a = { card_id: r.cardId, card_ext: r.cardExt };i.push(a);}M(c.addCard, { card_list: i }, (e._complete = function (e) {var n = e.card_list;if (n) {for (var i = 0, t = (n = JSON.parse(n)).length; i < t; ++i) {var o = n[i];o.cardId = o.card_id, o.cardExt = o.card_ext, o.isSuccess = !!o.is_succ, delete o.card_id, delete o.card_ext, delete o.is_succ;}e.cardList = n, delete e.card_list;}}, e));}), _defineProperty(_w, "chooseCard", function chooseCard(e) {M("chooseCard", { app_id: v.appId, location_id: e.shopId || "", sign_type: e.signType || "SHA1", card_id: e.cardId || "", card_type: e.cardType || "", card_sign: e.cardSign, time_stamp: e.timestamp + "", nonce_str: e.nonceStr }, (e._complete = function (e) {e.cardList = e.choose_card_info, delete e.choose_card_info;}, e));}), _defineProperty(_w, "openCard", function openCard(e) {for (var n = e.cardList, i = [], t = 0, o = n.length; t < o; ++t) {var r = n[t],a = { card_id: r.cardId, code: r.code };i.push(a);}M(c.openCard, { card_list: i }, e);}), _defineProperty(_w, "consumeAndShareCard", function consumeAndShareCard(e) {M(c.consumeAndShareCard, { consumedCardId: e.cardId, consumedCode: e.code }, e);}), _defineProperty(_w, "chooseWXPay", function chooseWXPay(e) {M(c.chooseWXPay, V(e), e);}), _defineProperty(_w, "openEnterpriseRedPacket", function openEnterpriseRedPacket(e) {M(c.openEnterpriseRedPacket, V(e), e);}), _defineProperty(_w, "startSearchBeacons", function startSearchBeacons(e) {M(c.startSearchBeacons, { ticket: e.ticket }, e);}), _defineProperty(_w, "stopSearchBeacons", function stopSearchBeacons(e) {M(c.stopSearchBeacons, {}, e);}), _defineProperty(_w, "onSearchBeacons", function onSearchBeacons(e) {P(c.onSearchBeacons, e);}), _defineProperty(_w, "openEnterpriseChat", function openEnterpriseChat(e) {M("openEnterpriseChat", { useridlist: e.userIds, chatname: e.groupName }, e);}), _defineProperty(_w, "launchMiniProgram", function launchMiniProgram(e) {M("launchMiniProgram", { targetAppId: e.targetAppId, path: function (e) {if ("string" == typeof e && 0 < e.length) {var n = e.split("?")[0],i = e.split("?")[1];return n += ".html", void 0 !== i ? n + "?" + i : n;}}(e.path), envVersion: e.envVersion }, e);}), _defineProperty(_w, "openBusinessView", function openBusinessView(e) {M("openBusinessView", { businessType: e.businessType, queryString: e.queryString || "", envVersion: e.envVersion }, (e._complete = function (n) {if (p) {var e = n.extraData;if (e) try {n.extraData = JSON.parse(e);} catch (e) {n.extraData = {};}}}, e));}), _defineProperty(_w, "miniProgram", { navigateBack: function navigateBack(e) {e = e || {}, O(function () {M("invokeMiniProgramAPI", { name: "navigateBack", arg: { delta: e.delta || 1 } }, e);});}, navigateTo: function navigateTo(e) {O(function () {M("invokeMiniProgramAPI", { name: "navigateTo", arg: { url: e.url } }, e);});}, redirectTo: function redirectTo(e) {O(function () {M("invokeMiniProgramAPI", { name: "redirectTo", arg: { url: e.url } }, e);});}, switchTab: function switchTab(e) {O(function () {M("invokeMiniProgramAPI", { name: "switchTab", arg: { url: e.url } }, e);});}, reLaunch: function reLaunch(e) {O(function () {M("invokeMiniProgramAPI", { name: "reLaunch", arg: { url: e.url } }, e);});}, postMessage: function postMessage(e) {O(function () {M("invokeMiniProgramAPI", { name: "postMessage", arg: e.data || {} }, e);});}, getEnv: function getEnv(e) {O(function () {e({ miniprogram: "miniprogram" === o.__wxjs_environment });});} }), _w),T = 1,k = {};return i.addEventListener("error", function (e) {if (!p) {var n = e.target,i = n.tagName,t = n.src;if ("IMG" == i || "VIDEO" == i || "AUDIO" == i || "SOURCE" == i) if (-1 != t.indexOf("wxlocalresource://")) {e.preventDefault(), e.stopPropagation();var o = n["wx-id"];if (o || (o = T++, n["wx-id"] = o), k[o]) return;k[o] = !0, wx.ready(function () {wx.getLocalImgData({ localId: t, success: function success(e) {n.src = e.localData;} });});}}}, !0), i.addEventListener("load", function (e) {if (!p) {var n = e.target,i = n.tagName;n.src;if ("IMG" == i || "VIDEO" == i || "AUDIO" == i || "SOURCE" == i) {var t = n["wx-id"];t && (k[t] = !1);}}}, !0), e && (o.wx = o.jWeixin = w), w;}function M(n, e, i) {o.WeixinJSBridge ? WeixinJSBridge.invoke(n, x(e), function (e) {A(n, e, i);}) : B(n, i);}function P(n, i, t) {o.WeixinJSBridge ? WeixinJSBridge.on(n, function (e) {t && t.trigger && t.trigger(e), A(n, e, i);}) : B(n, t || i);}function x(e) {return (e = e || {}).appId = v.appId, e.verifyAppId = v.appId, e.verifySignType = "sha1", e.verifyTimestamp = v.timestamp + "", e.verifyNonceStr = v.nonceStr, e.verifySignature = v.signature, e;}function V(e) {return { timeStamp: e.timestamp + "", nonceStr: e.nonceStr, package: e.package, paySign: e.paySign, signType: e.signType || "SHA1" };}function A(e, n, i) {"openEnterpriseChat" != e && "openBusinessView" !== e || (n.errCode = n.err_code), delete n.err_code, delete n.err_desc, delete n.err_detail;var t = n.errMsg;t || (t = n.err_msg, delete n.err_msg, t = function (e, n) {var i = e,t = a[i];t && (i = t);var o = "ok";if (n) {var r = n.indexOf(":");"confirm" == (o = n.substring(r + 1)) && (o = "ok"), "failed" == o && (o = "fail"), -1 != o.indexOf("failed_") && (o = o.substring(7)), -1 != o.indexOf("fail_") && (o = o.substring(5)), "access denied" != (o = (o = o.replace(/_/g, " ")).toLowerCase()) && "no permission to execute" != o || (o = "permission denied"), "config" == i && "function not exist" == o && (o = "ok"), "" == o && (o = "fail");}return n = i + ":" + o;}(e, t), n.errMsg = t), (i = i || {})._complete && (i._complete(n), delete i._complete), t = n.errMsg || "", v.debug && !i.isInnerInvoke && alert(JSON.stringify(n));var o = t.indexOf(":");switch (t.substring(o + 1)) {case "ok":i.success && i.success(n);break;case "cancel":i.cancel && i.cancel(n);break;default:i.fail && i.fail(n);}i.complete && i.complete(n);}function C(e) {if (e) {for (var n = 0, i = e.length; n < i; ++n) {var t = e[n],o = c[t];o && (e[n] = o);}return e;}}function B(e, n) {if (!(!v.debug || n && n.isInnerInvoke)) {var i = a[e];i && (e = i), n && n._complete && delete n._complete, console.log('"' + e + '",', n || "");}}function L() {return new Date().getTime();}function O(e) {l && (o.WeixinJSBridge ? e() : i.addEventListener && i.addEventListener("WeixinJSBridgeReady", e, !1));}});
  4158. /***/ }),
  4159. /***/ 32:
  4160. /*!***********************************************************!*\
  4161. !*** C:/Users/Administrator/Desktop/xmt_new/api/index.js ***!
  4162. \***********************************************************/
  4163. /*! no static exports found */
  4164. /***/ (function(module, exports, __webpack_require__) {
  4165. "use strict";
  4166. Object.defineProperty(exports, "__esModule", { value: true });exports.groom4 = groom4;exports.groom1 = groom1;exports.groom3 = groom3;exports.loadIndexs = loadIndexs;exports.downFile = downFile;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  4167. // 促销商品
  4168. function groom4(data) {
  4169. return (0, _request.default)({
  4170. url: '/api/groom/list/4',
  4171. method: 'get',
  4172. data: data });
  4173. }
  4174. // 精品推荐
  4175. function groom1(data) {
  4176. return (0, _request.default)({
  4177. url: '/api/groom/list/1',
  4178. method: 'get',
  4179. data: data });
  4180. }
  4181. // 新品首发
  4182. function groom3(data) {
  4183. return (0, _request.default)({
  4184. url: '/api/groom/list/3',
  4185. method: 'get',
  4186. data: data });
  4187. }
  4188. // 获取首页信息
  4189. function loadIndexs(data) {
  4190. return (0, _request.default)({
  4191. url: '/api/index',
  4192. method: 'get',
  4193. data: data });
  4194. }
  4195. // 文件下载
  4196. function downFile(data) {
  4197. return (0, _request.default)({
  4198. url: '/api/index/topFileList',
  4199. method: 'get',
  4200. data: data });
  4201. }
  4202. /***/ }),
  4203. /***/ 33:
  4204. /*!**********************************************************!*\
  4205. !*** C:/Users/Administrator/Desktop/xmt_new/api/user.js ***!
  4206. \**********************************************************/
  4207. /*! no static exports found */
  4208. /***/ (function(module, exports, __webpack_require__) {
  4209. "use strict";
  4210. Object.defineProperty(exports, "__esModule", { value: true });exports.orderData = orderData;exports.changeInformation = changeInformation;exports.enterprise = enterprise;exports.getUserInfo = getUserInfo;exports.spreadBanner = spreadBanner;exports.getAddressList = getAddressList;exports.addressEdit = addressEdit;exports.addressDel = addressDel;exports.setAddressDefault = setAddressDefault;exports.getCartList = getCartList;exports.getCartNum = getCartNum;exports.cartDel = cartDel;exports.getcollectList = getcollectList;exports.delcollect = delcollect;exports.spread = spread;exports.stylelist = stylelist;exports.postlist = postlist;exports.joinSubmit = joinSubmit;exports.auth = auth;exports.subscribe = subscribe;exports.enDetails = enDetails;exports.my_reply = my_reply;exports.to_my_reply = to_my_reply;exports.getCyType = getCyType;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  4211. // 订单统计信息
  4212. function orderData(data) {
  4213. return (0, _request.default)({
  4214. url: '/api/order/data',
  4215. method: 'get',
  4216. data: data });
  4217. }
  4218. // 信息修改
  4219. function changeInformation(data) {
  4220. return (0, _request.default)({
  4221. url: '/api/enterprise/edit',
  4222. method: 'post',
  4223. data: data });
  4224. }
  4225. // 企业认证查询
  4226. function enterprise(data) {
  4227. return (0, _request.default)({
  4228. url: '/api/enterprise/rate',
  4229. method: 'get',
  4230. data: data });
  4231. }
  4232. // 获取用户信息
  4233. function getUserInfo(data) {
  4234. return (0, _request.default)({
  4235. url: '/api/userinfo',
  4236. method: 'get',
  4237. data: data });
  4238. }
  4239. // 用户分享图
  4240. function spreadBanner(data) {
  4241. return (0, _request.default)({
  4242. url: '/api/spread/banner',
  4243. method: 'get',
  4244. data: data });
  4245. }
  4246. // 获取地址列表
  4247. function getAddressList(data) {
  4248. return (0, _request.default)({
  4249. url: '/api/address/list',
  4250. method: 'get',
  4251. data: data });
  4252. }
  4253. // 修改地址
  4254. function addressEdit(data) {
  4255. return (0, _request.default)({
  4256. url: '/api/address/edit',
  4257. method: 'post',
  4258. data: data });
  4259. }
  4260. // 删除地址
  4261. function addressDel(data) {
  4262. return (0, _request.default)({
  4263. url: '/api/address/del',
  4264. method: 'post',
  4265. data: data });
  4266. }
  4267. // 设为默认地址
  4268. function setAddressDefault(data) {
  4269. return (0, _request.default)({
  4270. url: '/api/address/default/set',
  4271. method: 'post',
  4272. data: data });
  4273. }
  4274. // 购物车列表
  4275. function getCartList(data) {
  4276. return (0, _request.default)({
  4277. url: '/api/cart/list',
  4278. method: 'get',
  4279. data: data });
  4280. }
  4281. // 修改购物车数量
  4282. function getCartNum(data) {
  4283. return (0, _request.default)({
  4284. url: '/api/cart/num',
  4285. method: 'post',
  4286. data: data });
  4287. }
  4288. //删除购物车
  4289. function cartDel(data) {
  4290. return (0, _request.default)({
  4291. url: '/api/cart/del',
  4292. method: 'post',
  4293. data: data });
  4294. }
  4295. //获取收藏夹列表
  4296. function getcollectList(data) {
  4297. return (0, _request.default)({
  4298. url: '/api/collect/user',
  4299. method: 'get',
  4300. data: data });
  4301. }
  4302. // 取消收藏
  4303. function delcollect(data) {
  4304. return (0, _request.default)({
  4305. url: '/api/collect/del',
  4306. method: 'post',
  4307. data: data });
  4308. }
  4309. //我的推广
  4310. function spread(data) {
  4311. return (0, _request.default)({
  4312. url: '/api/spread/people',
  4313. method: 'POST',
  4314. data: data });
  4315. }
  4316. //企业类型
  4317. function stylelist(data) {
  4318. return (0, _request.default)({
  4319. url: '/api/enterprise/stylelist',
  4320. method: 'GET',
  4321. data: data });
  4322. }
  4323. //职务类型
  4324. function postlist(data) {
  4325. return (0, _request.default)({
  4326. url: '/api/enterprise/job/list',
  4327. method: 'GET',
  4328. data: data });
  4329. }
  4330. //加入提交
  4331. function joinSubmit(data) {
  4332. return (0, _request.default)({
  4333. url: '/api/enterprise/apply/add',
  4334. method: 'GET',
  4335. data: data });
  4336. }
  4337. //企业认证
  4338. function auth(data) {
  4339. return (0, _request.default)({
  4340. url: '/api/user/auth',
  4341. method: 'POST',
  4342. data: data });
  4343. }
  4344. //订阅列表
  4345. function subscribe(data) {
  4346. return (0, _request.default)({
  4347. url: '/api/user/subscribe',
  4348. method: 'GET',
  4349. data: data });
  4350. }
  4351. //订阅详情
  4352. function enDetails(data) {
  4353. return (0, _request.default)({
  4354. url: '/api/enterprise/details',
  4355. method: 'GET',
  4356. data: data });
  4357. }
  4358. //我的评论
  4359. function my_reply(data) {
  4360. return (0, _request.default)({
  4361. url: '/api/article/my_reply',
  4362. method: 'GET',
  4363. data: data });
  4364. }
  4365. //回复我的评论
  4366. function to_my_reply(data) {
  4367. return (0, _request.default)({
  4368. url: '/api/article/to_my_reply',
  4369. method: 'GET',
  4370. data: data });
  4371. }
  4372. //getCyType
  4373. function getCyType(data) {
  4374. return (0, _request.default)({
  4375. url: '/api/enterprise/category',
  4376. method: 'GET',
  4377. data: data });
  4378. }
  4379. /***/ }),
  4380. /***/ 34:
  4381. /*!*********************************************************!*\
  4382. !*** C:/Users/Administrator/Desktop/xmt_new/api/art.js ***!
  4383. \*********************************************************/
  4384. /*! no static exports found */
  4385. /***/ (function(module, exports, __webpack_require__) {
  4386. "use strict";
  4387. Object.defineProperty(exports, "__esModule", { value: true });exports.getZmtList = getZmtList;exports.getArtTypeList = getArtTypeList;exports.getArtList = getArtList;exports.getArtDetail = getArtDetail;exports.getQyType = getQyType;exports.getQyArtList = getQyArtList;exports.dingYue = dingYue;exports.searchZmt = searchZmt;exports.searchArt = searchArt;exports.getPlList = getPlList;exports.getXgList = getXgList;exports.dianZan = dianZan;exports.subPl = subPl;exports.getMeeting = getMeeting;exports.joinMeeting = joinMeeting;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request.js */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  4388. // 获取自媒体列表
  4389. function getZmtList(data) {
  4390. return (0, _request.default)({
  4391. url: '/api/enterprise/putlist',
  4392. method: 'get',
  4393. data: data });
  4394. }
  4395. // 获取文章分类列表
  4396. function getArtTypeList(data) {
  4397. return (0, _request.default)({
  4398. url: '/api/article/category/list',
  4399. method: 'get',
  4400. data: data });
  4401. }
  4402. // 获取文章列表
  4403. // type 不填则为推荐 为0 则为顶置 其他则为分类id
  4404. function getArtList(data) {
  4405. return (0, _request.default)({
  4406. url: '/api/article/hot/list',
  4407. method: 'get',
  4408. data: data });
  4409. }
  4410. // 获取文章详情
  4411. function getArtDetail(data, id) {
  4412. return (0, _request.default)({
  4413. url: '/api/article/details/' + id,
  4414. method: 'get',
  4415. data: data });
  4416. }
  4417. // 企业赋能分类、企业类型
  4418. function getQyType(data) {
  4419. return (0, _request.default)({
  4420. url: '/api/enterprise/stylelist',
  4421. method: 'get',
  4422. data: data });
  4423. }
  4424. ///企业文章列表
  4425. function getQyArtList(data) {
  4426. return (0, _request.default)({
  4427. url: '/api/enterprise/lists',
  4428. method: 'get',
  4429. data: data });
  4430. }
  4431. // 订阅/user/sub
  4432. function dingYue(data) {
  4433. return (0, _request.default)({
  4434. url: '/api/user/sub',
  4435. method: 'get',
  4436. data: data });
  4437. }
  4438. // 自媒体查询
  4439. function searchZmt(data) {
  4440. return (0, _request.default)({
  4441. url: '/api/enterprise/search',
  4442. method: 'get',
  4443. data: data });
  4444. }
  4445. //文章查询
  4446. function searchArt(data) {
  4447. return (0, _request.default)({
  4448. url: '/api/article/keyword',
  4449. method: 'get',
  4450. data: data });
  4451. }
  4452. //获取文章评论
  4453. function getPlList(data, id) {
  4454. return (0, _request.default)({
  4455. url: '/api/article/reply_list/' + id,
  4456. method: 'get',
  4457. data: data });
  4458. }
  4459. // 相关阅读
  4460. function getXgList(data) {
  4461. return (0, _request.default)({
  4462. url: '/api/article/relevant/list',
  4463. method: 'get',
  4464. data: data });
  4465. }
  4466. // 点赞
  4467. function dianZan(data, id) {
  4468. return (0, _request.default)({
  4469. url: '/api/article/good/' + id,
  4470. method: 'post',
  4471. data: data });
  4472. }
  4473. //发表评论article/reply/1
  4474. function subPl(data, id) {
  4475. return (0, _request.default)({
  4476. url: '/api/article/reply/' + id,
  4477. method: 'post',
  4478. data: data });
  4479. }
  4480. // 获取会议详情
  4481. function getMeeting(data) {
  4482. return (0, _request.default)({
  4483. url: '/api/mee/get',
  4484. method: 'get',
  4485. data: data });
  4486. }
  4487. // 参加会议
  4488. function joinMeeting(data) {
  4489. return (0, _request.default)({
  4490. url: '/api/mee/set',
  4491. method: 'post',
  4492. data: data });
  4493. }
  4494. /***/ }),
  4495. /***/ 35:
  4496. /*!****************************************************************!*\
  4497. !*** C:/Users/Administrator/Desktop/xmt_new/utils/rocessor.js ***!
  4498. \****************************************************************/
  4499. /*! no static exports found */
  4500. /***/ (function(module, exports, __webpack_require__) {
  4501. "use strict";
  4502. Object.defineProperty(exports, "__esModule", { value: true });exports.isCardNo = isCardNo;exports.getMoneyStyle = getMoneyStyle;exports.timeComputed = timeComputed;exports.openMap = openMap;exports.getTime = getTime; //身份证验证
  4503. function isCardNo(card) {
  4504. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  4505. var reg =
  4506. /(^[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}$)/;
  4507. if (reg.test(card) === false) {
  4508. console.log(card);
  4509. return false;
  4510. }
  4511. return true;
  4512. }
  4513. // 金额显示变化
  4514. function getMoneyStyle() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4515. if (typeof value == 'string') {
  4516. value = (+value).toFixed(2);
  4517. }
  4518. if (typeof value == 'number') {
  4519. value = value.toFixed(2);
  4520. }
  4521. // 将字符串转为数组
  4522. var n = value.split("");
  4523. // 反转数组并复制循环处理
  4524. var arr = n.reverse().map(function (e, ind, ar) {
  4525. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  4526. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  4527. return e + ',';
  4528. } else {
  4529. return e;
  4530. }
  4531. });
  4532. // 反转数组回复原来排序并合并回字符串
  4533. arr = arr.reverse().join('');
  4534. return arr;
  4535. }
  4536. // 倒计时计算
  4537. // 计算倒计时时间
  4538. function timeComputed(time) {
  4539. // 获取当前时间
  4540. var actTime = new Date().getTime();
  4541. // 获取到期时间
  4542. var stopTime = time - actTime;
  4543. // 判断是否小于0
  4544. if (stopTime < 0) {
  4545. stopTime = stopTime * -1;
  4546. }
  4547. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余天数
  4548. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  4549. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  4550. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  4551. return {
  4552. hours: hours, //倒计时小时数
  4553. minutes: minutes, //倒计时分钟数
  4554. seconds: seconds, //倒计时秒数
  4555. day: day //倒计时天数
  4556. };
  4557. }
  4558. // 调用打开地图方法
  4559. function openMap(e) {
  4560. var that = this;
  4561. return new Promise(function (resolve, reject) {
  4562. wx.getSetting({
  4563. success: function success(res) {
  4564. //这里判断是否有地位权限
  4565. if (!res.authSetting['scope.userLocation']) {
  4566. wx.showModal({
  4567. title: '提示',
  4568. content: '请求获取位置权限',
  4569. success: function success(res) {
  4570. if (res.confirm == false) {
  4571. // 授权失败
  4572. reject();
  4573. return false;
  4574. }
  4575. wx.openSetting({
  4576. success: function success(res) {
  4577. //如果再次拒绝则返回页面并提示
  4578. if (!res.authSetting['scope.userLocation']) {
  4579. wx.showToast({
  4580. title: '此功能需获取位置信息,请重新设置',
  4581. duration: 3000,
  4582. icon: 'none' });
  4583. } else {
  4584. //允许授权,调用地图
  4585. resolve();
  4586. }
  4587. } });
  4588. } });
  4589. } else {
  4590. //如果有定位权限,调用地图
  4591. resolve();
  4592. }
  4593. } });
  4594. });
  4595. }
  4596. //时间戳转换成时间
  4597. function getTime(time) {
  4598. var num = 13 - (time + '').length;
  4599. var l = 1; //倍数
  4600. for (var i = 0; i < num; i++) {
  4601. l += '0';
  4602. }
  4603. // 重新解析为数字
  4604. l = parseInt(l);
  4605. var date = new Date(parseInt(time) * l);
  4606. var year = date.getFullYear();
  4607. var mon = date.getMonth() + 1;
  4608. if (mon < 10) {
  4609. mon = '0' + mon;
  4610. }
  4611. var day = date.getDate();
  4612. if (day < 10) {
  4613. day = '0' + day;
  4614. }
  4615. var hours = date.getHours();
  4616. if (hours < 10) {
  4617. hours = '0' + hours;
  4618. }
  4619. var minu = date.getMinutes();
  4620. if (minu < 10) {
  4621. minu = '0' + minu;
  4622. }
  4623. var sec = date.getSeconds();
  4624. if (sec < 10) {
  4625. sec = '0' + sec;
  4626. }
  4627. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  4628. }
  4629. /***/ }),
  4630. /***/ 4:
  4631. /*!******************************************************************************************!*\
  4632. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4633. \******************************************************************************************/
  4634. /*! exports provided: default */
  4635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4636. "use strict";
  4637. __webpack_require__.r(__webpack_exports__);
  4638. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4639. * Vue.js v2.6.11
  4640. * (c) 2014-2022 Evan You
  4641. * Released under the MIT License.
  4642. */
  4643. /* */
  4644. var emptyObject = Object.freeze({});
  4645. // These helpers produce better VM code in JS engines due to their
  4646. // explicitness and function inlining.
  4647. function isUndef (v) {
  4648. return v === undefined || v === null
  4649. }
  4650. function isDef (v) {
  4651. return v !== undefined && v !== null
  4652. }
  4653. function isTrue (v) {
  4654. return v === true
  4655. }
  4656. function isFalse (v) {
  4657. return v === false
  4658. }
  4659. /**
  4660. * Check if value is primitive.
  4661. */
  4662. function isPrimitive (value) {
  4663. return (
  4664. typeof value === 'string' ||
  4665. typeof value === 'number' ||
  4666. // $flow-disable-line
  4667. typeof value === 'symbol' ||
  4668. typeof value === 'boolean'
  4669. )
  4670. }
  4671. /**
  4672. * Quick object check - this is primarily used to tell
  4673. * Objects from primitive values when we know the value
  4674. * is a JSON-compliant type.
  4675. */
  4676. function isObject (obj) {
  4677. return obj !== null && typeof obj === 'object'
  4678. }
  4679. /**
  4680. * Get the raw type string of a value, e.g., [object Object].
  4681. */
  4682. var _toString = Object.prototype.toString;
  4683. function toRawType (value) {
  4684. return _toString.call(value).slice(8, -1)
  4685. }
  4686. /**
  4687. * Strict object type check. Only returns true
  4688. * for plain JavaScript objects.
  4689. */
  4690. function isPlainObject (obj) {
  4691. return _toString.call(obj) === '[object Object]'
  4692. }
  4693. function isRegExp (v) {
  4694. return _toString.call(v) === '[object RegExp]'
  4695. }
  4696. /**
  4697. * Check if val is a valid array index.
  4698. */
  4699. function isValidArrayIndex (val) {
  4700. var n = parseFloat(String(val));
  4701. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4702. }
  4703. function isPromise (val) {
  4704. return (
  4705. isDef(val) &&
  4706. typeof val.then === 'function' &&
  4707. typeof val.catch === 'function'
  4708. )
  4709. }
  4710. /**
  4711. * Convert a value to a string that is actually rendered.
  4712. */
  4713. function toString (val) {
  4714. return val == null
  4715. ? ''
  4716. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4717. ? JSON.stringify(val, null, 2)
  4718. : String(val)
  4719. }
  4720. /**
  4721. * Convert an input value to a number for persistence.
  4722. * If the conversion fails, return original string.
  4723. */
  4724. function toNumber (val) {
  4725. var n = parseFloat(val);
  4726. return isNaN(n) ? val : n
  4727. }
  4728. /**
  4729. * Make a map and return a function for checking if a key
  4730. * is in that map.
  4731. */
  4732. function makeMap (
  4733. str,
  4734. expectsLowerCase
  4735. ) {
  4736. var map = Object.create(null);
  4737. var list = str.split(',');
  4738. for (var i = 0; i < list.length; i++) {
  4739. map[list[i]] = true;
  4740. }
  4741. return expectsLowerCase
  4742. ? function (val) { return map[val.toLowerCase()]; }
  4743. : function (val) { return map[val]; }
  4744. }
  4745. /**
  4746. * Check if a tag is a built-in tag.
  4747. */
  4748. var isBuiltInTag = makeMap('slot,component', true);
  4749. /**
  4750. * Check if an attribute is a reserved attribute.
  4751. */
  4752. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4753. /**
  4754. * Remove an item from an array.
  4755. */
  4756. function remove (arr, item) {
  4757. if (arr.length) {
  4758. var index = arr.indexOf(item);
  4759. if (index > -1) {
  4760. return arr.splice(index, 1)
  4761. }
  4762. }
  4763. }
  4764. /**
  4765. * Check whether an object has the property.
  4766. */
  4767. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4768. function hasOwn (obj, key) {
  4769. return hasOwnProperty.call(obj, key)
  4770. }
  4771. /**
  4772. * Create a cached version of a pure function.
  4773. */
  4774. function cached (fn) {
  4775. var cache = Object.create(null);
  4776. return (function cachedFn (str) {
  4777. var hit = cache[str];
  4778. return hit || (cache[str] = fn(str))
  4779. })
  4780. }
  4781. /**
  4782. * Camelize a hyphen-delimited string.
  4783. */
  4784. var camelizeRE = /-(\w)/g;
  4785. var camelize = cached(function (str) {
  4786. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4787. });
  4788. /**
  4789. * Capitalize a string.
  4790. */
  4791. var capitalize = cached(function (str) {
  4792. return str.charAt(0).toUpperCase() + str.slice(1)
  4793. });
  4794. /**
  4795. * Hyphenate a camelCase string.
  4796. */
  4797. var hyphenateRE = /\B([A-Z])/g;
  4798. var hyphenate = cached(function (str) {
  4799. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4800. });
  4801. /**
  4802. * Simple bind polyfill for environments that do not support it,
  4803. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4804. * since native bind is now performant enough in most browsers.
  4805. * But removing it would mean breaking code that was able to run in
  4806. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4807. */
  4808. /* istanbul ignore next */
  4809. function polyfillBind (fn, ctx) {
  4810. function boundFn (a) {
  4811. var l = arguments.length;
  4812. return l
  4813. ? l > 1
  4814. ? fn.apply(ctx, arguments)
  4815. : fn.call(ctx, a)
  4816. : fn.call(ctx)
  4817. }
  4818. boundFn._length = fn.length;
  4819. return boundFn
  4820. }
  4821. function nativeBind (fn, ctx) {
  4822. return fn.bind(ctx)
  4823. }
  4824. var bind = Function.prototype.bind
  4825. ? nativeBind
  4826. : polyfillBind;
  4827. /**
  4828. * Convert an Array-like object to a real Array.
  4829. */
  4830. function toArray (list, start) {
  4831. start = start || 0;
  4832. var i = list.length - start;
  4833. var ret = new Array(i);
  4834. while (i--) {
  4835. ret[i] = list[i + start];
  4836. }
  4837. return ret
  4838. }
  4839. /**
  4840. * Mix properties into target object.
  4841. */
  4842. function extend (to, _from) {
  4843. for (var key in _from) {
  4844. to[key] = _from[key];
  4845. }
  4846. return to
  4847. }
  4848. /**
  4849. * Merge an Array of Objects into a single Object.
  4850. */
  4851. function toObject (arr) {
  4852. var res = {};
  4853. for (var i = 0; i < arr.length; i++) {
  4854. if (arr[i]) {
  4855. extend(res, arr[i]);
  4856. }
  4857. }
  4858. return res
  4859. }
  4860. /* eslint-disable no-unused-vars */
  4861. /**
  4862. * Perform no operation.
  4863. * Stubbing args to make Flow happy without leaving useless transpiled code
  4864. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4865. */
  4866. function noop (a, b, c) {}
  4867. /**
  4868. * Always return false.
  4869. */
  4870. var no = function (a, b, c) { return false; };
  4871. /* eslint-enable no-unused-vars */
  4872. /**
  4873. * Return the same value.
  4874. */
  4875. var identity = function (_) { return _; };
  4876. /**
  4877. * Check if two values are loosely equal - that is,
  4878. * if they are plain objects, do they have the same shape?
  4879. */
  4880. function looseEqual (a, b) {
  4881. if (a === b) { return true }
  4882. var isObjectA = isObject(a);
  4883. var isObjectB = isObject(b);
  4884. if (isObjectA && isObjectB) {
  4885. try {
  4886. var isArrayA = Array.isArray(a);
  4887. var isArrayB = Array.isArray(b);
  4888. if (isArrayA && isArrayB) {
  4889. return a.length === b.length && a.every(function (e, i) {
  4890. return looseEqual(e, b[i])
  4891. })
  4892. } else if (a instanceof Date && b instanceof Date) {
  4893. return a.getTime() === b.getTime()
  4894. } else if (!isArrayA && !isArrayB) {
  4895. var keysA = Object.keys(a);
  4896. var keysB = Object.keys(b);
  4897. return keysA.length === keysB.length && keysA.every(function (key) {
  4898. return looseEqual(a[key], b[key])
  4899. })
  4900. } else {
  4901. /* istanbul ignore next */
  4902. return false
  4903. }
  4904. } catch (e) {
  4905. /* istanbul ignore next */
  4906. return false
  4907. }
  4908. } else if (!isObjectA && !isObjectB) {
  4909. return String(a) === String(b)
  4910. } else {
  4911. return false
  4912. }
  4913. }
  4914. /**
  4915. * Return the first index at which a loosely equal value can be
  4916. * found in the array (if value is a plain object, the array must
  4917. * contain an object of the same shape), or -1 if it is not present.
  4918. */
  4919. function looseIndexOf (arr, val) {
  4920. for (var i = 0; i < arr.length; i++) {
  4921. if (looseEqual(arr[i], val)) { return i }
  4922. }
  4923. return -1
  4924. }
  4925. /**
  4926. * Ensure a function is called only once.
  4927. */
  4928. function once (fn) {
  4929. var called = false;
  4930. return function () {
  4931. if (!called) {
  4932. called = true;
  4933. fn.apply(this, arguments);
  4934. }
  4935. }
  4936. }
  4937. var ASSET_TYPES = [
  4938. 'component',
  4939. 'directive',
  4940. 'filter'
  4941. ];
  4942. var LIFECYCLE_HOOKS = [
  4943. 'beforeCreate',
  4944. 'created',
  4945. 'beforeMount',
  4946. 'mounted',
  4947. 'beforeUpdate',
  4948. 'updated',
  4949. 'beforeDestroy',
  4950. 'destroyed',
  4951. 'activated',
  4952. 'deactivated',
  4953. 'errorCaptured',
  4954. 'serverPrefetch'
  4955. ];
  4956. /* */
  4957. var config = ({
  4958. /**
  4959. * Option merge strategies (used in core/util/options)
  4960. */
  4961. // $flow-disable-line
  4962. optionMergeStrategies: Object.create(null),
  4963. /**
  4964. * Whether to suppress warnings.
  4965. */
  4966. silent: false,
  4967. /**
  4968. * Show production mode tip message on boot?
  4969. */
  4970. productionTip: "development" !== 'production',
  4971. /**
  4972. * Whether to enable devtools
  4973. */
  4974. devtools: "development" !== 'production',
  4975. /**
  4976. * Whether to record perf
  4977. */
  4978. performance: false,
  4979. /**
  4980. * Error handler for watcher errors
  4981. */
  4982. errorHandler: null,
  4983. /**
  4984. * Warn handler for watcher warns
  4985. */
  4986. warnHandler: null,
  4987. /**
  4988. * Ignore certain custom elements
  4989. */
  4990. ignoredElements: [],
  4991. /**
  4992. * Custom user key aliases for v-on
  4993. */
  4994. // $flow-disable-line
  4995. keyCodes: Object.create(null),
  4996. /**
  4997. * Check if a tag is reserved so that it cannot be registered as a
  4998. * component. This is platform-dependent and may be overwritten.
  4999. */
  5000. isReservedTag: no,
  5001. /**
  5002. * Check if an attribute is reserved so that it cannot be used as a component
  5003. * prop. This is platform-dependent and may be overwritten.
  5004. */
  5005. isReservedAttr: no,
  5006. /**
  5007. * Check if a tag is an unknown element.
  5008. * Platform-dependent.
  5009. */
  5010. isUnknownElement: no,
  5011. /**
  5012. * Get the namespace of an element
  5013. */
  5014. getTagNamespace: noop,
  5015. /**
  5016. * Parse the real tag name for the specific platform.
  5017. */
  5018. parsePlatformTagName: identity,
  5019. /**
  5020. * Check if an attribute must be bound using property, e.g. value
  5021. * Platform-dependent.
  5022. */
  5023. mustUseProp: no,
  5024. /**
  5025. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  5026. * This will significantly reduce performance if set to false.
  5027. */
  5028. async: true,
  5029. /**
  5030. * Exposed for legacy reasons
  5031. */
  5032. _lifecycleHooks: LIFECYCLE_HOOKS
  5033. });
  5034. /* */
  5035. /**
  5036. * unicode letters used for parsing html tags, component names and property paths.
  5037. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  5038. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  5039. */
  5040. 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/;
  5041. /**
  5042. * Check if a string starts with $ or _
  5043. */
  5044. function isReserved (str) {
  5045. var c = (str + '').charCodeAt(0);
  5046. return c === 0x24 || c === 0x5F
  5047. }
  5048. /**
  5049. * Define a property.
  5050. */
  5051. function def (obj, key, val, enumerable) {
  5052. Object.defineProperty(obj, key, {
  5053. value: val,
  5054. enumerable: !!enumerable,
  5055. writable: true,
  5056. configurable: true
  5057. });
  5058. }
  5059. /**
  5060. * Parse simple path.
  5061. */
  5062. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  5063. function parsePath (path) {
  5064. if (bailRE.test(path)) {
  5065. return
  5066. }
  5067. var segments = path.split('.');
  5068. return function (obj) {
  5069. for (var i = 0; i < segments.length; i++) {
  5070. if (!obj) { return }
  5071. obj = obj[segments[i]];
  5072. }
  5073. return obj
  5074. }
  5075. }
  5076. /* */
  5077. // can we use __proto__?
  5078. var hasProto = '__proto__' in {};
  5079. // Browser environment sniffing
  5080. var inBrowser = typeof window !== 'undefined';
  5081. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  5082. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  5083. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  5084. var isIE = UA && /msie|trident/.test(UA);
  5085. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  5086. var isEdge = UA && UA.indexOf('edge/') > 0;
  5087. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  5088. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  5089. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  5090. var isPhantomJS = UA && /phantomjs/.test(UA);
  5091. var isFF = UA && UA.match(/firefox\/(\d+)/);
  5092. // Firefox has a "watch" function on Object.prototype...
  5093. var nativeWatch = ({}).watch;
  5094. if (inBrowser) {
  5095. try {
  5096. var opts = {};
  5097. Object.defineProperty(opts, 'passive', ({
  5098. get: function get () {
  5099. }
  5100. })); // https://github.com/facebook/flow/issues/285
  5101. window.addEventListener('test-passive', null, opts);
  5102. } catch (e) {}
  5103. }
  5104. // this needs to be lazy-evaled because vue may be required before
  5105. // vue-server-renderer can set VUE_ENV
  5106. var _isServer;
  5107. var isServerRendering = function () {
  5108. if (_isServer === undefined) {
  5109. /* istanbul ignore if */
  5110. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  5111. // detect presence of vue-server-renderer and avoid
  5112. // Webpack shimming the process
  5113. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  5114. } else {
  5115. _isServer = false;
  5116. }
  5117. }
  5118. return _isServer
  5119. };
  5120. // detect devtools
  5121. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  5122. /* istanbul ignore next */
  5123. function isNative (Ctor) {
  5124. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  5125. }
  5126. var hasSymbol =
  5127. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  5128. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  5129. var _Set;
  5130. /* istanbul ignore if */ // $flow-disable-line
  5131. if (typeof Set !== 'undefined' && isNative(Set)) {
  5132. // use native Set when available.
  5133. _Set = Set;
  5134. } else {
  5135. // a non-standard Set polyfill that only works with primitive keys.
  5136. _Set = /*@__PURE__*/(function () {
  5137. function Set () {
  5138. this.set = Object.create(null);
  5139. }
  5140. Set.prototype.has = function has (key) {
  5141. return this.set[key] === true
  5142. };
  5143. Set.prototype.add = function add (key) {
  5144. this.set[key] = true;
  5145. };
  5146. Set.prototype.clear = function clear () {
  5147. this.set = Object.create(null);
  5148. };
  5149. return Set;
  5150. }());
  5151. }
  5152. /* */
  5153. var warn = noop;
  5154. var tip = noop;
  5155. var generateComponentTrace = (noop); // work around flow check
  5156. var formatComponentName = (noop);
  5157. if (true) {
  5158. var hasConsole = typeof console !== 'undefined';
  5159. var classifyRE = /(?:^|[-_])(\w)/g;
  5160. var classify = function (str) { return str
  5161. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  5162. .replace(/[-_]/g, ''); };
  5163. warn = function (msg, vm) {
  5164. var trace = vm ? generateComponentTrace(vm) : '';
  5165. if (config.warnHandler) {
  5166. config.warnHandler.call(null, msg, vm, trace);
  5167. } else if (hasConsole && (!config.silent)) {
  5168. console.error(("[Vue warn]: " + msg + trace));
  5169. }
  5170. };
  5171. tip = function (msg, vm) {
  5172. if (hasConsole && (!config.silent)) {
  5173. console.warn("[Vue tip]: " + msg + (
  5174. vm ? generateComponentTrace(vm) : ''
  5175. ));
  5176. }
  5177. };
  5178. formatComponentName = function (vm, includeFile) {
  5179. if (vm.$root === vm) {
  5180. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  5181. return ('') + vm.$options.__file
  5182. }
  5183. return '<Root>'
  5184. }
  5185. var options = typeof vm === 'function' && vm.cid != null
  5186. ? vm.options
  5187. : vm._isVue
  5188. ? vm.$options || vm.constructor.options
  5189. : vm;
  5190. var name = options.name || options._componentTag;
  5191. var file = options.__file;
  5192. if (!name && file) {
  5193. var match = file.match(/([^/\\]+)\.vue$/);
  5194. name = match && match[1];
  5195. }
  5196. return (
  5197. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  5198. (file && includeFile !== false ? (" at " + file) : '')
  5199. )
  5200. };
  5201. var repeat = function (str, n) {
  5202. var res = '';
  5203. while (n) {
  5204. if (n % 2 === 1) { res += str; }
  5205. if (n > 1) { str += str; }
  5206. n >>= 1;
  5207. }
  5208. return res
  5209. };
  5210. generateComponentTrace = function (vm) {
  5211. if (vm._isVue && vm.$parent) {
  5212. var tree = [];
  5213. var currentRecursiveSequence = 0;
  5214. while (vm && vm.$options.name !== 'PageBody') {
  5215. if (tree.length > 0) {
  5216. var last = tree[tree.length - 1];
  5217. if (last.constructor === vm.constructor) {
  5218. currentRecursiveSequence++;
  5219. vm = vm.$parent;
  5220. continue
  5221. } else if (currentRecursiveSequence > 0) {
  5222. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5223. currentRecursiveSequence = 0;
  5224. }
  5225. }
  5226. !vm.$options.isReserved && tree.push(vm);
  5227. vm = vm.$parent;
  5228. }
  5229. return '\n\nfound in\n\n' + tree
  5230. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  5231. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  5232. : formatComponentName(vm))); })
  5233. .join('\n')
  5234. } else {
  5235. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  5236. }
  5237. };
  5238. }
  5239. /* */
  5240. var uid = 0;
  5241. /**
  5242. * A dep is an observable that can have multiple
  5243. * directives subscribing to it.
  5244. */
  5245. var Dep = function Dep () {
  5246. this.id = uid++;
  5247. this.subs = [];
  5248. };
  5249. Dep.prototype.addSub = function addSub (sub) {
  5250. this.subs.push(sub);
  5251. };
  5252. Dep.prototype.removeSub = function removeSub (sub) {
  5253. remove(this.subs, sub);
  5254. };
  5255. Dep.prototype.depend = function depend () {
  5256. if (Dep.SharedObject.target) {
  5257. Dep.SharedObject.target.addDep(this);
  5258. }
  5259. };
  5260. Dep.prototype.notify = function notify () {
  5261. // stabilize the subscriber list first
  5262. var subs = this.subs.slice();
  5263. if ( true && !config.async) {
  5264. // subs aren't sorted in scheduler if not running async
  5265. // we need to sort them now to make sure they fire in correct
  5266. // order
  5267. subs.sort(function (a, b) { return a.id - b.id; });
  5268. }
  5269. for (var i = 0, l = subs.length; i < l; i++) {
  5270. subs[i].update();
  5271. }
  5272. };
  5273. // The current target watcher being evaluated.
  5274. // This is globally unique because only one watcher
  5275. // can be evaluated at a time.
  5276. // fixed by xxxxxx (nvue shared vuex)
  5277. /* eslint-disable no-undef */
  5278. Dep.SharedObject = {};
  5279. Dep.SharedObject.target = null;
  5280. Dep.SharedObject.targetStack = [];
  5281. function pushTarget (target) {
  5282. Dep.SharedObject.targetStack.push(target);
  5283. Dep.SharedObject.target = target;
  5284. Dep.target = target;
  5285. }
  5286. function popTarget () {
  5287. Dep.SharedObject.targetStack.pop();
  5288. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5289. Dep.target = Dep.SharedObject.target;
  5290. }
  5291. /* */
  5292. var VNode = function VNode (
  5293. tag,
  5294. data,
  5295. children,
  5296. text,
  5297. elm,
  5298. context,
  5299. componentOptions,
  5300. asyncFactory
  5301. ) {
  5302. this.tag = tag;
  5303. this.data = data;
  5304. this.children = children;
  5305. this.text = text;
  5306. this.elm = elm;
  5307. this.ns = undefined;
  5308. this.context = context;
  5309. this.fnContext = undefined;
  5310. this.fnOptions = undefined;
  5311. this.fnScopeId = undefined;
  5312. this.key = data && data.key;
  5313. this.componentOptions = componentOptions;
  5314. this.componentInstance = undefined;
  5315. this.parent = undefined;
  5316. this.raw = false;
  5317. this.isStatic = false;
  5318. this.isRootInsert = true;
  5319. this.isComment = false;
  5320. this.isCloned = false;
  5321. this.isOnce = false;
  5322. this.asyncFactory = asyncFactory;
  5323. this.asyncMeta = undefined;
  5324. this.isAsyncPlaceholder = false;
  5325. };
  5326. var prototypeAccessors = { child: { configurable: true } };
  5327. // DEPRECATED: alias for componentInstance for backwards compat.
  5328. /* istanbul ignore next */
  5329. prototypeAccessors.child.get = function () {
  5330. return this.componentInstance
  5331. };
  5332. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5333. var createEmptyVNode = function (text) {
  5334. if ( text === void 0 ) text = '';
  5335. var node = new VNode();
  5336. node.text = text;
  5337. node.isComment = true;
  5338. return node
  5339. };
  5340. function createTextVNode (val) {
  5341. return new VNode(undefined, undefined, undefined, String(val))
  5342. }
  5343. // optimized shallow clone
  5344. // used for static nodes and slot nodes because they may be reused across
  5345. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5346. // on their elm reference.
  5347. function cloneVNode (vnode) {
  5348. var cloned = new VNode(
  5349. vnode.tag,
  5350. vnode.data,
  5351. // #7975
  5352. // clone children array to avoid mutating original in case of cloning
  5353. // a child.
  5354. vnode.children && vnode.children.slice(),
  5355. vnode.text,
  5356. vnode.elm,
  5357. vnode.context,
  5358. vnode.componentOptions,
  5359. vnode.asyncFactory
  5360. );
  5361. cloned.ns = vnode.ns;
  5362. cloned.isStatic = vnode.isStatic;
  5363. cloned.key = vnode.key;
  5364. cloned.isComment = vnode.isComment;
  5365. cloned.fnContext = vnode.fnContext;
  5366. cloned.fnOptions = vnode.fnOptions;
  5367. cloned.fnScopeId = vnode.fnScopeId;
  5368. cloned.asyncMeta = vnode.asyncMeta;
  5369. cloned.isCloned = true;
  5370. return cloned
  5371. }
  5372. /*
  5373. * not type checking this file because flow doesn't play well with
  5374. * dynamically accessing methods on Array prototype
  5375. */
  5376. var arrayProto = Array.prototype;
  5377. var arrayMethods = Object.create(arrayProto);
  5378. var methodsToPatch = [
  5379. 'push',
  5380. 'pop',
  5381. 'shift',
  5382. 'unshift',
  5383. 'splice',
  5384. 'sort',
  5385. 'reverse'
  5386. ];
  5387. /**
  5388. * Intercept mutating methods and emit events
  5389. */
  5390. methodsToPatch.forEach(function (method) {
  5391. // cache original method
  5392. var original = arrayProto[method];
  5393. def(arrayMethods, method, function mutator () {
  5394. var args = [], len = arguments.length;
  5395. while ( len-- ) args[ len ] = arguments[ len ];
  5396. var result = original.apply(this, args);
  5397. var ob = this.__ob__;
  5398. var inserted;
  5399. switch (method) {
  5400. case 'push':
  5401. case 'unshift':
  5402. inserted = args;
  5403. break
  5404. case 'splice':
  5405. inserted = args.slice(2);
  5406. break
  5407. }
  5408. if (inserted) { ob.observeArray(inserted); }
  5409. // notify change
  5410. ob.dep.notify();
  5411. return result
  5412. });
  5413. });
  5414. /* */
  5415. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5416. /**
  5417. * In some cases we may want to disable observation inside a component's
  5418. * update computation.
  5419. */
  5420. var shouldObserve = true;
  5421. function toggleObserving (value) {
  5422. shouldObserve = value;
  5423. }
  5424. /**
  5425. * Observer class that is attached to each observed
  5426. * object. Once attached, the observer converts the target
  5427. * object's property keys into getter/setters that
  5428. * collect dependencies and dispatch updates.
  5429. */
  5430. var Observer = function Observer (value) {
  5431. this.value = value;
  5432. this.dep = new Dep();
  5433. this.vmCount = 0;
  5434. def(value, '__ob__', this);
  5435. if (Array.isArray(value)) {
  5436. if (hasProto) {
  5437. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5438. if(value.push !== value.__proto__.push){
  5439. copyAugment(value, arrayMethods, arrayKeys);
  5440. } else {
  5441. protoAugment(value, arrayMethods);
  5442. }
  5443. }
  5444. } else {
  5445. copyAugment(value, arrayMethods, arrayKeys);
  5446. }
  5447. this.observeArray(value);
  5448. } else {
  5449. this.walk(value);
  5450. }
  5451. };
  5452. /**
  5453. * Walk through all properties and convert them into
  5454. * getter/setters. This method should only be called when
  5455. * value type is Object.
  5456. */
  5457. Observer.prototype.walk = function walk (obj) {
  5458. var keys = Object.keys(obj);
  5459. for (var i = 0; i < keys.length; i++) {
  5460. defineReactive$$1(obj, keys[i]);
  5461. }
  5462. };
  5463. /**
  5464. * Observe a list of Array items.
  5465. */
  5466. Observer.prototype.observeArray = function observeArray (items) {
  5467. for (var i = 0, l = items.length; i < l; i++) {
  5468. observe(items[i]);
  5469. }
  5470. };
  5471. // helpers
  5472. /**
  5473. * Augment a target Object or Array by intercepting
  5474. * the prototype chain using __proto__
  5475. */
  5476. function protoAugment (target, src) {
  5477. /* eslint-disable no-proto */
  5478. target.__proto__ = src;
  5479. /* eslint-enable no-proto */
  5480. }
  5481. /**
  5482. * Augment a target Object or Array by defining
  5483. * hidden properties.
  5484. */
  5485. /* istanbul ignore next */
  5486. function copyAugment (target, src, keys) {
  5487. for (var i = 0, l = keys.length; i < l; i++) {
  5488. var key = keys[i];
  5489. def(target, key, src[key]);
  5490. }
  5491. }
  5492. /**
  5493. * Attempt to create an observer instance for a value,
  5494. * returns the new observer if successfully observed,
  5495. * or the existing observer if the value already has one.
  5496. */
  5497. function observe (value, asRootData) {
  5498. if (!isObject(value) || value instanceof VNode) {
  5499. return
  5500. }
  5501. var ob;
  5502. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  5503. ob = value.__ob__;
  5504. } else if (
  5505. shouldObserve &&
  5506. !isServerRendering() &&
  5507. (Array.isArray(value) || isPlainObject(value)) &&
  5508. Object.isExtensible(value) &&
  5509. !value._isVue
  5510. ) {
  5511. ob = new Observer(value);
  5512. }
  5513. if (asRootData && ob) {
  5514. ob.vmCount++;
  5515. }
  5516. return ob
  5517. }
  5518. /**
  5519. * Define a reactive property on an Object.
  5520. */
  5521. function defineReactive$$1 (
  5522. obj,
  5523. key,
  5524. val,
  5525. customSetter,
  5526. shallow
  5527. ) {
  5528. var dep = new Dep();
  5529. var property = Object.getOwnPropertyDescriptor(obj, key);
  5530. if (property && property.configurable === false) {
  5531. return
  5532. }
  5533. // cater for pre-defined getter/setters
  5534. var getter = property && property.get;
  5535. var setter = property && property.set;
  5536. if ((!getter || setter) && arguments.length === 2) {
  5537. val = obj[key];
  5538. }
  5539. var childOb = !shallow && observe(val);
  5540. Object.defineProperty(obj, key, {
  5541. enumerable: true,
  5542. configurable: true,
  5543. get: function reactiveGetter () {
  5544. var value = getter ? getter.call(obj) : val;
  5545. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5546. dep.depend();
  5547. if (childOb) {
  5548. childOb.dep.depend();
  5549. if (Array.isArray(value)) {
  5550. dependArray(value);
  5551. }
  5552. }
  5553. }
  5554. return value
  5555. },
  5556. set: function reactiveSetter (newVal) {
  5557. var value = getter ? getter.call(obj) : val;
  5558. /* eslint-disable no-self-compare */
  5559. if (newVal === value || (newVal !== newVal && value !== value)) {
  5560. return
  5561. }
  5562. /* eslint-enable no-self-compare */
  5563. if ( true && customSetter) {
  5564. customSetter();
  5565. }
  5566. // #7981: for accessor properties without setter
  5567. if (getter && !setter) { return }
  5568. if (setter) {
  5569. setter.call(obj, newVal);
  5570. } else {
  5571. val = newVal;
  5572. }
  5573. childOb = !shallow && observe(newVal);
  5574. dep.notify();
  5575. }
  5576. });
  5577. }
  5578. /**
  5579. * Set a property on an object. Adds the new property and
  5580. * triggers change notification if the property doesn't
  5581. * already exist.
  5582. */
  5583. function set (target, key, val) {
  5584. if ( true &&
  5585. (isUndef(target) || isPrimitive(target))
  5586. ) {
  5587. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5588. }
  5589. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5590. target.length = Math.max(target.length, key);
  5591. target.splice(key, 1, val);
  5592. return val
  5593. }
  5594. if (key in target && !(key in Object.prototype)) {
  5595. target[key] = val;
  5596. return val
  5597. }
  5598. var ob = (target).__ob__;
  5599. if (target._isVue || (ob && ob.vmCount)) {
  5600. true && warn(
  5601. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5602. 'at runtime - declare it upfront in the data option.'
  5603. );
  5604. return val
  5605. }
  5606. if (!ob) {
  5607. target[key] = val;
  5608. return val
  5609. }
  5610. defineReactive$$1(ob.value, key, val);
  5611. ob.dep.notify();
  5612. return val
  5613. }
  5614. /**
  5615. * Delete a property and trigger change if necessary.
  5616. */
  5617. function del (target, key) {
  5618. if ( true &&
  5619. (isUndef(target) || isPrimitive(target))
  5620. ) {
  5621. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5622. }
  5623. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5624. target.splice(key, 1);
  5625. return
  5626. }
  5627. var ob = (target).__ob__;
  5628. if (target._isVue || (ob && ob.vmCount)) {
  5629. true && warn(
  5630. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5631. '- just set it to null.'
  5632. );
  5633. return
  5634. }
  5635. if (!hasOwn(target, key)) {
  5636. return
  5637. }
  5638. delete target[key];
  5639. if (!ob) {
  5640. return
  5641. }
  5642. ob.dep.notify();
  5643. }
  5644. /**
  5645. * Collect dependencies on array elements when the array is touched, since
  5646. * we cannot intercept array element access like property getters.
  5647. */
  5648. function dependArray (value) {
  5649. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5650. e = value[i];
  5651. e && e.__ob__ && e.__ob__.dep.depend();
  5652. if (Array.isArray(e)) {
  5653. dependArray(e);
  5654. }
  5655. }
  5656. }
  5657. /* */
  5658. /**
  5659. * Option overwriting strategies are functions that handle
  5660. * how to merge a parent option value and a child option
  5661. * value into the final value.
  5662. */
  5663. var strats = config.optionMergeStrategies;
  5664. /**
  5665. * Options with restrictions
  5666. */
  5667. if (true) {
  5668. strats.el = strats.propsData = function (parent, child, vm, key) {
  5669. if (!vm) {
  5670. warn(
  5671. "option \"" + key + "\" can only be used during instance " +
  5672. 'creation with the `new` keyword.'
  5673. );
  5674. }
  5675. return defaultStrat(parent, child)
  5676. };
  5677. }
  5678. /**
  5679. * Helper that recursively merges two data objects together.
  5680. */
  5681. function mergeData (to, from) {
  5682. if (!from) { return to }
  5683. var key, toVal, fromVal;
  5684. var keys = hasSymbol
  5685. ? Reflect.ownKeys(from)
  5686. : Object.keys(from);
  5687. for (var i = 0; i < keys.length; i++) {
  5688. key = keys[i];
  5689. // in case the object is already observed...
  5690. if (key === '__ob__') { continue }
  5691. toVal = to[key];
  5692. fromVal = from[key];
  5693. if (!hasOwn(to, key)) {
  5694. set(to, key, fromVal);
  5695. } else if (
  5696. toVal !== fromVal &&
  5697. isPlainObject(toVal) &&
  5698. isPlainObject(fromVal)
  5699. ) {
  5700. mergeData(toVal, fromVal);
  5701. }
  5702. }
  5703. return to
  5704. }
  5705. /**
  5706. * Data
  5707. */
  5708. function mergeDataOrFn (
  5709. parentVal,
  5710. childVal,
  5711. vm
  5712. ) {
  5713. if (!vm) {
  5714. // in a Vue.extend merge, both should be functions
  5715. if (!childVal) {
  5716. return parentVal
  5717. }
  5718. if (!parentVal) {
  5719. return childVal
  5720. }
  5721. // when parentVal & childVal are both present,
  5722. // we need to return a function that returns the
  5723. // merged result of both functions... no need to
  5724. // check if parentVal is a function here because
  5725. // it has to be a function to pass previous merges.
  5726. return function mergedDataFn () {
  5727. return mergeData(
  5728. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5729. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5730. )
  5731. }
  5732. } else {
  5733. return function mergedInstanceDataFn () {
  5734. // instance merge
  5735. var instanceData = typeof childVal === 'function'
  5736. ? childVal.call(vm, vm)
  5737. : childVal;
  5738. var defaultData = typeof parentVal === 'function'
  5739. ? parentVal.call(vm, vm)
  5740. : parentVal;
  5741. if (instanceData) {
  5742. return mergeData(instanceData, defaultData)
  5743. } else {
  5744. return defaultData
  5745. }
  5746. }
  5747. }
  5748. }
  5749. strats.data = function (
  5750. parentVal,
  5751. childVal,
  5752. vm
  5753. ) {
  5754. if (!vm) {
  5755. if (childVal && typeof childVal !== 'function') {
  5756. true && warn(
  5757. 'The "data" option should be a function ' +
  5758. 'that returns a per-instance value in component ' +
  5759. 'definitions.',
  5760. vm
  5761. );
  5762. return parentVal
  5763. }
  5764. return mergeDataOrFn(parentVal, childVal)
  5765. }
  5766. return mergeDataOrFn(parentVal, childVal, vm)
  5767. };
  5768. /**
  5769. * Hooks and props are merged as arrays.
  5770. */
  5771. function mergeHook (
  5772. parentVal,
  5773. childVal
  5774. ) {
  5775. var res = childVal
  5776. ? parentVal
  5777. ? parentVal.concat(childVal)
  5778. : Array.isArray(childVal)
  5779. ? childVal
  5780. : [childVal]
  5781. : parentVal;
  5782. return res
  5783. ? dedupeHooks(res)
  5784. : res
  5785. }
  5786. function dedupeHooks (hooks) {
  5787. var res = [];
  5788. for (var i = 0; i < hooks.length; i++) {
  5789. if (res.indexOf(hooks[i]) === -1) {
  5790. res.push(hooks[i]);
  5791. }
  5792. }
  5793. return res
  5794. }
  5795. LIFECYCLE_HOOKS.forEach(function (hook) {
  5796. strats[hook] = mergeHook;
  5797. });
  5798. /**
  5799. * Assets
  5800. *
  5801. * When a vm is present (instance creation), we need to do
  5802. * a three-way merge between constructor options, instance
  5803. * options and parent options.
  5804. */
  5805. function mergeAssets (
  5806. parentVal,
  5807. childVal,
  5808. vm,
  5809. key
  5810. ) {
  5811. var res = Object.create(parentVal || null);
  5812. if (childVal) {
  5813. true && assertObjectType(key, childVal, vm);
  5814. return extend(res, childVal)
  5815. } else {
  5816. return res
  5817. }
  5818. }
  5819. ASSET_TYPES.forEach(function (type) {
  5820. strats[type + 's'] = mergeAssets;
  5821. });
  5822. /**
  5823. * Watchers.
  5824. *
  5825. * Watchers hashes should not overwrite one
  5826. * another, so we merge them as arrays.
  5827. */
  5828. strats.watch = function (
  5829. parentVal,
  5830. childVal,
  5831. vm,
  5832. key
  5833. ) {
  5834. // work around Firefox's Object.prototype.watch...
  5835. if (parentVal === nativeWatch) { parentVal = undefined; }
  5836. if (childVal === nativeWatch) { childVal = undefined; }
  5837. /* istanbul ignore if */
  5838. if (!childVal) { return Object.create(parentVal || null) }
  5839. if (true) {
  5840. assertObjectType(key, childVal, vm);
  5841. }
  5842. if (!parentVal) { return childVal }
  5843. var ret = {};
  5844. extend(ret, parentVal);
  5845. for (var key$1 in childVal) {
  5846. var parent = ret[key$1];
  5847. var child = childVal[key$1];
  5848. if (parent && !Array.isArray(parent)) {
  5849. parent = [parent];
  5850. }
  5851. ret[key$1] = parent
  5852. ? parent.concat(child)
  5853. : Array.isArray(child) ? child : [child];
  5854. }
  5855. return ret
  5856. };
  5857. /**
  5858. * Other object hashes.
  5859. */
  5860. strats.props =
  5861. strats.methods =
  5862. strats.inject =
  5863. strats.computed = function (
  5864. parentVal,
  5865. childVal,
  5866. vm,
  5867. key
  5868. ) {
  5869. if (childVal && "development" !== 'production') {
  5870. assertObjectType(key, childVal, vm);
  5871. }
  5872. if (!parentVal) { return childVal }
  5873. var ret = Object.create(null);
  5874. extend(ret, parentVal);
  5875. if (childVal) { extend(ret, childVal); }
  5876. return ret
  5877. };
  5878. strats.provide = mergeDataOrFn;
  5879. /**
  5880. * Default strategy.
  5881. */
  5882. var defaultStrat = function (parentVal, childVal) {
  5883. return childVal === undefined
  5884. ? parentVal
  5885. : childVal
  5886. };
  5887. /**
  5888. * Validate component names
  5889. */
  5890. function checkComponents (options) {
  5891. for (var key in options.components) {
  5892. validateComponentName(key);
  5893. }
  5894. }
  5895. function validateComponentName (name) {
  5896. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5897. warn(
  5898. 'Invalid component name: "' + name + '". Component names ' +
  5899. 'should conform to valid custom element name in html5 specification.'
  5900. );
  5901. }
  5902. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5903. warn(
  5904. 'Do not use built-in or reserved HTML elements as component ' +
  5905. 'id: ' + name
  5906. );
  5907. }
  5908. }
  5909. /**
  5910. * Ensure all props option syntax are normalized into the
  5911. * Object-based format.
  5912. */
  5913. function normalizeProps (options, vm) {
  5914. var props = options.props;
  5915. if (!props) { return }
  5916. var res = {};
  5917. var i, val, name;
  5918. if (Array.isArray(props)) {
  5919. i = props.length;
  5920. while (i--) {
  5921. val = props[i];
  5922. if (typeof val === 'string') {
  5923. name = camelize(val);
  5924. res[name] = { type: null };
  5925. } else if (true) {
  5926. warn('props must be strings when using array syntax.');
  5927. }
  5928. }
  5929. } else if (isPlainObject(props)) {
  5930. for (var key in props) {
  5931. val = props[key];
  5932. name = camelize(key);
  5933. res[name] = isPlainObject(val)
  5934. ? val
  5935. : { type: val };
  5936. }
  5937. } else if (true) {
  5938. warn(
  5939. "Invalid value for option \"props\": expected an Array or an Object, " +
  5940. "but got " + (toRawType(props)) + ".",
  5941. vm
  5942. );
  5943. }
  5944. options.props = res;
  5945. }
  5946. /**
  5947. * Normalize all injections into Object-based format
  5948. */
  5949. function normalizeInject (options, vm) {
  5950. var inject = options.inject;
  5951. if (!inject) { return }
  5952. var normalized = options.inject = {};
  5953. if (Array.isArray(inject)) {
  5954. for (var i = 0; i < inject.length; i++) {
  5955. normalized[inject[i]] = { from: inject[i] };
  5956. }
  5957. } else if (isPlainObject(inject)) {
  5958. for (var key in inject) {
  5959. var val = inject[key];
  5960. normalized[key] = isPlainObject(val)
  5961. ? extend({ from: key }, val)
  5962. : { from: val };
  5963. }
  5964. } else if (true) {
  5965. warn(
  5966. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5967. "but got " + (toRawType(inject)) + ".",
  5968. vm
  5969. );
  5970. }
  5971. }
  5972. /**
  5973. * Normalize raw function directives into object format.
  5974. */
  5975. function normalizeDirectives (options) {
  5976. var dirs = options.directives;
  5977. if (dirs) {
  5978. for (var key in dirs) {
  5979. var def$$1 = dirs[key];
  5980. if (typeof def$$1 === 'function') {
  5981. dirs[key] = { bind: def$$1, update: def$$1 };
  5982. }
  5983. }
  5984. }
  5985. }
  5986. function assertObjectType (name, value, vm) {
  5987. if (!isPlainObject(value)) {
  5988. warn(
  5989. "Invalid value for option \"" + name + "\": expected an Object, " +
  5990. "but got " + (toRawType(value)) + ".",
  5991. vm
  5992. );
  5993. }
  5994. }
  5995. /**
  5996. * Merge two option objects into a new one.
  5997. * Core utility used in both instantiation and inheritance.
  5998. */
  5999. function mergeOptions (
  6000. parent,
  6001. child,
  6002. vm
  6003. ) {
  6004. if (true) {
  6005. checkComponents(child);
  6006. }
  6007. if (typeof child === 'function') {
  6008. child = child.options;
  6009. }
  6010. normalizeProps(child, vm);
  6011. normalizeInject(child, vm);
  6012. normalizeDirectives(child);
  6013. // Apply extends and mixins on the child options,
  6014. // but only if it is a raw options object that isn't
  6015. // the result of another mergeOptions call.
  6016. // Only merged options has the _base property.
  6017. if (!child._base) {
  6018. if (child.extends) {
  6019. parent = mergeOptions(parent, child.extends, vm);
  6020. }
  6021. if (child.mixins) {
  6022. for (var i = 0, l = child.mixins.length; i < l; i++) {
  6023. parent = mergeOptions(parent, child.mixins[i], vm);
  6024. }
  6025. }
  6026. }
  6027. var options = {};
  6028. var key;
  6029. for (key in parent) {
  6030. mergeField(key);
  6031. }
  6032. for (key in child) {
  6033. if (!hasOwn(parent, key)) {
  6034. mergeField(key);
  6035. }
  6036. }
  6037. function mergeField (key) {
  6038. var strat = strats[key] || defaultStrat;
  6039. options[key] = strat(parent[key], child[key], vm, key);
  6040. }
  6041. return options
  6042. }
  6043. /**
  6044. * Resolve an asset.
  6045. * This function is used because child instances need access
  6046. * to assets defined in its ancestor chain.
  6047. */
  6048. function resolveAsset (
  6049. options,
  6050. type,
  6051. id,
  6052. warnMissing
  6053. ) {
  6054. /* istanbul ignore if */
  6055. if (typeof id !== 'string') {
  6056. return
  6057. }
  6058. var assets = options[type];
  6059. // check local registration variations first
  6060. if (hasOwn(assets, id)) { return assets[id] }
  6061. var camelizedId = camelize(id);
  6062. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  6063. var PascalCaseId = capitalize(camelizedId);
  6064. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  6065. // fallback to prototype chain
  6066. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  6067. if ( true && warnMissing && !res) {
  6068. warn(
  6069. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  6070. options
  6071. );
  6072. }
  6073. return res
  6074. }
  6075. /* */
  6076. function validateProp (
  6077. key,
  6078. propOptions,
  6079. propsData,
  6080. vm
  6081. ) {
  6082. var prop = propOptions[key];
  6083. var absent = !hasOwn(propsData, key);
  6084. var value = propsData[key];
  6085. // boolean casting
  6086. var booleanIndex = getTypeIndex(Boolean, prop.type);
  6087. if (booleanIndex > -1) {
  6088. if (absent && !hasOwn(prop, 'default')) {
  6089. value = false;
  6090. } else if (value === '' || value === hyphenate(key)) {
  6091. // only cast empty string / same name to boolean if
  6092. // boolean has higher priority
  6093. var stringIndex = getTypeIndex(String, prop.type);
  6094. if (stringIndex < 0 || booleanIndex < stringIndex) {
  6095. value = true;
  6096. }
  6097. }
  6098. }
  6099. // check default value
  6100. if (value === undefined) {
  6101. value = getPropDefaultValue(vm, prop, key);
  6102. // since the default value is a fresh copy,
  6103. // make sure to observe it.
  6104. var prevShouldObserve = shouldObserve;
  6105. toggleObserving(true);
  6106. observe(value);
  6107. toggleObserving(prevShouldObserve);
  6108. }
  6109. if (
  6110. true
  6111. ) {
  6112. assertProp(prop, key, value, vm, absent);
  6113. }
  6114. return value
  6115. }
  6116. /**
  6117. * Get the default value of a prop.
  6118. */
  6119. function getPropDefaultValue (vm, prop, key) {
  6120. // no default, return undefined
  6121. if (!hasOwn(prop, 'default')) {
  6122. return undefined
  6123. }
  6124. var def = prop.default;
  6125. // warn against non-factory defaults for Object & Array
  6126. if ( true && isObject(def)) {
  6127. warn(
  6128. 'Invalid default value for prop "' + key + '": ' +
  6129. 'Props with type Object/Array must use a factory function ' +
  6130. 'to return the default value.',
  6131. vm
  6132. );
  6133. }
  6134. // the raw prop value was also undefined from previous render,
  6135. // return previous default value to avoid unnecessary watcher trigger
  6136. if (vm && vm.$options.propsData &&
  6137. vm.$options.propsData[key] === undefined &&
  6138. vm._props[key] !== undefined
  6139. ) {
  6140. return vm._props[key]
  6141. }
  6142. // call factory function for non-Function types
  6143. // a value is Function if its prototype is function even across different execution context
  6144. return typeof def === 'function' && getType(prop.type) !== 'Function'
  6145. ? def.call(vm)
  6146. : def
  6147. }
  6148. /**
  6149. * Assert whether a prop is valid.
  6150. */
  6151. function assertProp (
  6152. prop,
  6153. name,
  6154. value,
  6155. vm,
  6156. absent
  6157. ) {
  6158. if (prop.required && absent) {
  6159. warn(
  6160. 'Missing required prop: "' + name + '"',
  6161. vm
  6162. );
  6163. return
  6164. }
  6165. if (value == null && !prop.required) {
  6166. return
  6167. }
  6168. var type = prop.type;
  6169. var valid = !type || type === true;
  6170. var expectedTypes = [];
  6171. if (type) {
  6172. if (!Array.isArray(type)) {
  6173. type = [type];
  6174. }
  6175. for (var i = 0; i < type.length && !valid; i++) {
  6176. var assertedType = assertType(value, type[i]);
  6177. expectedTypes.push(assertedType.expectedType || '');
  6178. valid = assertedType.valid;
  6179. }
  6180. }
  6181. if (!valid) {
  6182. warn(
  6183. getInvalidTypeMessage(name, value, expectedTypes),
  6184. vm
  6185. );
  6186. return
  6187. }
  6188. var validator = prop.validator;
  6189. if (validator) {
  6190. if (!validator(value)) {
  6191. warn(
  6192. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6193. vm
  6194. );
  6195. }
  6196. }
  6197. }
  6198. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  6199. function assertType (value, type) {
  6200. var valid;
  6201. var expectedType = getType(type);
  6202. if (simpleCheckRE.test(expectedType)) {
  6203. var t = typeof value;
  6204. valid = t === expectedType.toLowerCase();
  6205. // for primitive wrapper objects
  6206. if (!valid && t === 'object') {
  6207. valid = value instanceof type;
  6208. }
  6209. } else if (expectedType === 'Object') {
  6210. valid = isPlainObject(value);
  6211. } else if (expectedType === 'Array') {
  6212. valid = Array.isArray(value);
  6213. } else {
  6214. valid = value instanceof type;
  6215. }
  6216. return {
  6217. valid: valid,
  6218. expectedType: expectedType
  6219. }
  6220. }
  6221. /**
  6222. * Use function string name to check built-in types,
  6223. * because a simple equality check will fail when running
  6224. * across different vms / iframes.
  6225. */
  6226. function getType (fn) {
  6227. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6228. return match ? match[1] : ''
  6229. }
  6230. function isSameType (a, b) {
  6231. return getType(a) === getType(b)
  6232. }
  6233. function getTypeIndex (type, expectedTypes) {
  6234. if (!Array.isArray(expectedTypes)) {
  6235. return isSameType(expectedTypes, type) ? 0 : -1
  6236. }
  6237. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  6238. if (isSameType(expectedTypes[i], type)) {
  6239. return i
  6240. }
  6241. }
  6242. return -1
  6243. }
  6244. function getInvalidTypeMessage (name, value, expectedTypes) {
  6245. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  6246. " Expected " + (expectedTypes.map(capitalize).join(', '));
  6247. var expectedType = expectedTypes[0];
  6248. var receivedType = toRawType(value);
  6249. var expectedValue = styleValue(value, expectedType);
  6250. var receivedValue = styleValue(value, receivedType);
  6251. // check if we need to specify expected value
  6252. if (expectedTypes.length === 1 &&
  6253. isExplicable(expectedType) &&
  6254. !isBoolean(expectedType, receivedType)) {
  6255. message += " with value " + expectedValue;
  6256. }
  6257. message += ", got " + receivedType + " ";
  6258. // check if we need to specify received value
  6259. if (isExplicable(receivedType)) {
  6260. message += "with value " + receivedValue + ".";
  6261. }
  6262. return message
  6263. }
  6264. function styleValue (value, type) {
  6265. if (type === 'String') {
  6266. return ("\"" + value + "\"")
  6267. } else if (type === 'Number') {
  6268. return ("" + (Number(value)))
  6269. } else {
  6270. return ("" + value)
  6271. }
  6272. }
  6273. function isExplicable (value) {
  6274. var explicitTypes = ['string', 'number', 'boolean'];
  6275. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6276. }
  6277. function isBoolean () {
  6278. var args = [], len = arguments.length;
  6279. while ( len-- ) args[ len ] = arguments[ len ];
  6280. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6281. }
  6282. /* */
  6283. function handleError (err, vm, info) {
  6284. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6285. // See: https://github.com/vuejs/vuex/issues/1505
  6286. pushTarget();
  6287. try {
  6288. if (vm) {
  6289. var cur = vm;
  6290. while ((cur = cur.$parent)) {
  6291. var hooks = cur.$options.errorCaptured;
  6292. if (hooks) {
  6293. for (var i = 0; i < hooks.length; i++) {
  6294. try {
  6295. var capture = hooks[i].call(cur, err, vm, info) === false;
  6296. if (capture) { return }
  6297. } catch (e) {
  6298. globalHandleError(e, cur, 'errorCaptured hook');
  6299. }
  6300. }
  6301. }
  6302. }
  6303. }
  6304. globalHandleError(err, vm, info);
  6305. } finally {
  6306. popTarget();
  6307. }
  6308. }
  6309. function invokeWithErrorHandling (
  6310. handler,
  6311. context,
  6312. args,
  6313. vm,
  6314. info
  6315. ) {
  6316. var res;
  6317. try {
  6318. res = args ? handler.apply(context, args) : handler.call(context);
  6319. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6320. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6321. // issue #9511
  6322. // avoid catch triggering multiple times when nested calls
  6323. res._handled = true;
  6324. }
  6325. } catch (e) {
  6326. handleError(e, vm, info);
  6327. }
  6328. return res
  6329. }
  6330. function globalHandleError (err, vm, info) {
  6331. if (config.errorHandler) {
  6332. try {
  6333. return config.errorHandler.call(null, err, vm, info)
  6334. } catch (e) {
  6335. // if the user intentionally throws the original error in the handler,
  6336. // do not log it twice
  6337. if (e !== err) {
  6338. logError(e, null, 'config.errorHandler');
  6339. }
  6340. }
  6341. }
  6342. logError(err, vm, info);
  6343. }
  6344. function logError (err, vm, info) {
  6345. if (true) {
  6346. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6347. }
  6348. /* istanbul ignore else */
  6349. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6350. console.error(err);
  6351. } else {
  6352. throw err
  6353. }
  6354. }
  6355. /* */
  6356. var callbacks = [];
  6357. var pending = false;
  6358. function flushCallbacks () {
  6359. pending = false;
  6360. var copies = callbacks.slice(0);
  6361. callbacks.length = 0;
  6362. for (var i = 0; i < copies.length; i++) {
  6363. copies[i]();
  6364. }
  6365. }
  6366. // Here we have async deferring wrappers using microtasks.
  6367. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6368. // However, it has subtle problems when state is changed right before repaint
  6369. // (e.g. #6813, out-in transitions).
  6370. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6371. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6372. // So we now use microtasks everywhere, again.
  6373. // A major drawback of this tradeoff is that there are some scenarios
  6374. // where microtasks have too high a priority and fire in between supposedly
  6375. // sequential events (e.g. #4521, #6690, which have workarounds)
  6376. // or even between bubbling of the same event (#6566).
  6377. var timerFunc;
  6378. // The nextTick behavior leverages the microtask queue, which can be accessed
  6379. // via either native Promise.then or MutationObserver.
  6380. // MutationObserver has wider support, however it is seriously bugged in
  6381. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6382. // completely stops working after triggering a few times... so, if native
  6383. // Promise is available, we will use it:
  6384. /* istanbul ignore next, $flow-disable-line */
  6385. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6386. var p = Promise.resolve();
  6387. timerFunc = function () {
  6388. p.then(flushCallbacks);
  6389. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6390. // it can get stuck in a weird state where callbacks are pushed into the
  6391. // microtask queue but the queue isn't being flushed, until the browser
  6392. // needs to do some other work, e.g. handle a timer. Therefore we can
  6393. // "force" the microtask queue to be flushed by adding an empty timer.
  6394. if (isIOS) { setTimeout(noop); }
  6395. };
  6396. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6397. isNative(MutationObserver) ||
  6398. // PhantomJS and iOS 7.x
  6399. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6400. )) {
  6401. // Use MutationObserver where native Promise is not available,
  6402. // e.g. PhantomJS, iOS7, Android 4.4
  6403. // (#6466 MutationObserver is unreliable in IE11)
  6404. var counter = 1;
  6405. var observer = new MutationObserver(flushCallbacks);
  6406. var textNode = document.createTextNode(String(counter));
  6407. observer.observe(textNode, {
  6408. characterData: true
  6409. });
  6410. timerFunc = function () {
  6411. counter = (counter + 1) % 2;
  6412. textNode.data = String(counter);
  6413. };
  6414. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6415. // Fallback to setImmediate.
  6416. // Technically it leverages the (macro) task queue,
  6417. // but it is still a better choice than setTimeout.
  6418. timerFunc = function () {
  6419. setImmediate(flushCallbacks);
  6420. };
  6421. } else {
  6422. // Fallback to setTimeout.
  6423. timerFunc = function () {
  6424. setTimeout(flushCallbacks, 0);
  6425. };
  6426. }
  6427. function nextTick (cb, ctx) {
  6428. var _resolve;
  6429. callbacks.push(function () {
  6430. if (cb) {
  6431. try {
  6432. cb.call(ctx);
  6433. } catch (e) {
  6434. handleError(e, ctx, 'nextTick');
  6435. }
  6436. } else if (_resolve) {
  6437. _resolve(ctx);
  6438. }
  6439. });
  6440. if (!pending) {
  6441. pending = true;
  6442. timerFunc();
  6443. }
  6444. // $flow-disable-line
  6445. if (!cb && typeof Promise !== 'undefined') {
  6446. return new Promise(function (resolve) {
  6447. _resolve = resolve;
  6448. })
  6449. }
  6450. }
  6451. /* */
  6452. /* not type checking this file because flow doesn't play well with Proxy */
  6453. var initProxy;
  6454. if (true) {
  6455. var allowedGlobals = makeMap(
  6456. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  6457. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  6458. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  6459. 'require' // for Webpack/Browserify
  6460. );
  6461. var warnNonPresent = function (target, key) {
  6462. warn(
  6463. "Property or method \"" + key + "\" is not defined on the instance but " +
  6464. 'referenced during render. Make sure that this property is reactive, ' +
  6465. 'either in the data option, or for class-based components, by ' +
  6466. 'initializing the property. ' +
  6467. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  6468. target
  6469. );
  6470. };
  6471. var warnReservedPrefix = function (target, key) {
  6472. warn(
  6473. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  6474. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  6475. 'prevent conflicts with Vue internals. ' +
  6476. 'See: https://vuejs.org/v2/api/#data',
  6477. target
  6478. );
  6479. };
  6480. var hasProxy =
  6481. typeof Proxy !== 'undefined' && isNative(Proxy);
  6482. if (hasProxy) {
  6483. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6484. config.keyCodes = new Proxy(config.keyCodes, {
  6485. set: function set (target, key, value) {
  6486. if (isBuiltInModifier(key)) {
  6487. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6488. return false
  6489. } else {
  6490. target[key] = value;
  6491. return true
  6492. }
  6493. }
  6494. });
  6495. }
  6496. var hasHandler = {
  6497. has: function has (target, key) {
  6498. var has = key in target;
  6499. var isAllowed = allowedGlobals(key) ||
  6500. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  6501. if (!has && !isAllowed) {
  6502. if (key in target.$data) { warnReservedPrefix(target, key); }
  6503. else { warnNonPresent(target, key); }
  6504. }
  6505. return has || !isAllowed
  6506. }
  6507. };
  6508. var getHandler = {
  6509. get: function get (target, key) {
  6510. if (typeof key === 'string' && !(key in target)) {
  6511. if (key in target.$data) { warnReservedPrefix(target, key); }
  6512. else { warnNonPresent(target, key); }
  6513. }
  6514. return target[key]
  6515. }
  6516. };
  6517. initProxy = function initProxy (vm) {
  6518. if (hasProxy) {
  6519. // determine which proxy handler to use
  6520. var options = vm.$options;
  6521. var handlers = options.render && options.render._withStripped
  6522. ? getHandler
  6523. : hasHandler;
  6524. vm._renderProxy = new Proxy(vm, handlers);
  6525. } else {
  6526. vm._renderProxy = vm;
  6527. }
  6528. };
  6529. }
  6530. /* */
  6531. var seenObjects = new _Set();
  6532. /**
  6533. * Recursively traverse an object to evoke all converted
  6534. * getters, so that every nested property inside the object
  6535. * is collected as a "deep" dependency.
  6536. */
  6537. function traverse (val) {
  6538. _traverse(val, seenObjects);
  6539. seenObjects.clear();
  6540. }
  6541. function _traverse (val, seen) {
  6542. var i, keys;
  6543. var isA = Array.isArray(val);
  6544. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6545. return
  6546. }
  6547. if (val.__ob__) {
  6548. var depId = val.__ob__.dep.id;
  6549. if (seen.has(depId)) {
  6550. return
  6551. }
  6552. seen.add(depId);
  6553. }
  6554. if (isA) {
  6555. i = val.length;
  6556. while (i--) { _traverse(val[i], seen); }
  6557. } else {
  6558. keys = Object.keys(val);
  6559. i = keys.length;
  6560. while (i--) { _traverse(val[keys[i]], seen); }
  6561. }
  6562. }
  6563. var mark;
  6564. var measure;
  6565. if (true) {
  6566. var perf = inBrowser && window.performance;
  6567. /* istanbul ignore if */
  6568. if (
  6569. perf &&
  6570. perf.mark &&
  6571. perf.measure &&
  6572. perf.clearMarks &&
  6573. perf.clearMeasures
  6574. ) {
  6575. mark = function (tag) { return perf.mark(tag); };
  6576. measure = function (name, startTag, endTag) {
  6577. perf.measure(name, startTag, endTag);
  6578. perf.clearMarks(startTag);
  6579. perf.clearMarks(endTag);
  6580. // perf.clearMeasures(name)
  6581. };
  6582. }
  6583. }
  6584. /* */
  6585. var normalizeEvent = cached(function (name) {
  6586. var passive = name.charAt(0) === '&';
  6587. name = passive ? name.slice(1) : name;
  6588. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6589. name = once$$1 ? name.slice(1) : name;
  6590. var capture = name.charAt(0) === '!';
  6591. name = capture ? name.slice(1) : name;
  6592. return {
  6593. name: name,
  6594. once: once$$1,
  6595. capture: capture,
  6596. passive: passive
  6597. }
  6598. });
  6599. function createFnInvoker (fns, vm) {
  6600. function invoker () {
  6601. var arguments$1 = arguments;
  6602. var fns = invoker.fns;
  6603. if (Array.isArray(fns)) {
  6604. var cloned = fns.slice();
  6605. for (var i = 0; i < cloned.length; i++) {
  6606. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6607. }
  6608. } else {
  6609. // return handler return value for single handlers
  6610. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6611. }
  6612. }
  6613. invoker.fns = fns;
  6614. return invoker
  6615. }
  6616. function updateListeners (
  6617. on,
  6618. oldOn,
  6619. add,
  6620. remove$$1,
  6621. createOnceHandler,
  6622. vm
  6623. ) {
  6624. var name, def$$1, cur, old, event;
  6625. for (name in on) {
  6626. def$$1 = cur = on[name];
  6627. old = oldOn[name];
  6628. event = normalizeEvent(name);
  6629. if (isUndef(cur)) {
  6630. true && warn(
  6631. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6632. vm
  6633. );
  6634. } else if (isUndef(old)) {
  6635. if (isUndef(cur.fns)) {
  6636. cur = on[name] = createFnInvoker(cur, vm);
  6637. }
  6638. if (isTrue(event.once)) {
  6639. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6640. }
  6641. add(event.name, cur, event.capture, event.passive, event.params);
  6642. } else if (cur !== old) {
  6643. old.fns = cur;
  6644. on[name] = old;
  6645. }
  6646. }
  6647. for (name in oldOn) {
  6648. if (isUndef(on[name])) {
  6649. event = normalizeEvent(name);
  6650. remove$$1(event.name, oldOn[name], event.capture);
  6651. }
  6652. }
  6653. }
  6654. /* */
  6655. /* */
  6656. // fixed by xxxxxx (mp properties)
  6657. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6658. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6659. if (isUndef(propOptions)) {
  6660. return res
  6661. }
  6662. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6663. var attrs = data.attrs;
  6664. var props = data.props;
  6665. if (isDef(attrs) || isDef(props)) {
  6666. for (var key in propOptions) {
  6667. var altKey = hyphenate(key);
  6668. var result = checkProp(res, props, key, altKey, true) ||
  6669. checkProp(res, attrs, key, altKey, false);
  6670. // externalClass
  6671. if (
  6672. result &&
  6673. res[key] &&
  6674. externalClasses.indexOf(altKey) !== -1 &&
  6675. context[camelize(res[key])]
  6676. ) {
  6677. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6678. res[key] = context[camelize(res[key])];
  6679. }
  6680. }
  6681. }
  6682. return res
  6683. }
  6684. function extractPropsFromVNodeData (
  6685. data,
  6686. Ctor,
  6687. tag,
  6688. context// fixed by xxxxxx
  6689. ) {
  6690. // we are only extracting raw values here.
  6691. // validation and default values are handled in the child
  6692. // component itself.
  6693. var propOptions = Ctor.options.props;
  6694. if (isUndef(propOptions)) {
  6695. // fixed by xxxxxx
  6696. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6697. }
  6698. var res = {};
  6699. var attrs = data.attrs;
  6700. var props = data.props;
  6701. if (isDef(attrs) || isDef(props)) {
  6702. for (var key in propOptions) {
  6703. var altKey = hyphenate(key);
  6704. if (true) {
  6705. var keyInLowerCase = key.toLowerCase();
  6706. if (
  6707. key !== keyInLowerCase &&
  6708. attrs && hasOwn(attrs, keyInLowerCase)
  6709. ) {
  6710. tip(
  6711. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6712. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6713. " \"" + key + "\". " +
  6714. "Note that HTML attributes are case-insensitive and camelCased " +
  6715. "props need to use their kebab-case equivalents when using in-DOM " +
  6716. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6717. );
  6718. }
  6719. }
  6720. checkProp(res, props, key, altKey, true) ||
  6721. checkProp(res, attrs, key, altKey, false);
  6722. }
  6723. }
  6724. // fixed by xxxxxx
  6725. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6726. }
  6727. function checkProp (
  6728. res,
  6729. hash,
  6730. key,
  6731. altKey,
  6732. preserve
  6733. ) {
  6734. if (isDef(hash)) {
  6735. if (hasOwn(hash, key)) {
  6736. res[key] = hash[key];
  6737. if (!preserve) {
  6738. delete hash[key];
  6739. }
  6740. return true
  6741. } else if (hasOwn(hash, altKey)) {
  6742. res[key] = hash[altKey];
  6743. if (!preserve) {
  6744. delete hash[altKey];
  6745. }
  6746. return true
  6747. }
  6748. }
  6749. return false
  6750. }
  6751. /* */
  6752. // The template compiler attempts to minimize the need for normalization by
  6753. // statically analyzing the template at compile time.
  6754. //
  6755. // For plain HTML markup, normalization can be completely skipped because the
  6756. // generated render function is guaranteed to return Array<VNode>. There are
  6757. // two cases where extra normalization is needed:
  6758. // 1. When the children contains components - because a functional component
  6759. // may return an Array instead of a single root. In this case, just a simple
  6760. // normalization is needed - if any child is an Array, we flatten the whole
  6761. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6762. // because functional components already normalize their own children.
  6763. function simpleNormalizeChildren (children) {
  6764. for (var i = 0; i < children.length; i++) {
  6765. if (Array.isArray(children[i])) {
  6766. return Array.prototype.concat.apply([], children)
  6767. }
  6768. }
  6769. return children
  6770. }
  6771. // 2. When the children contains constructs that always generated nested Arrays,
  6772. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6773. // with hand-written render functions / JSX. In such cases a full normalization
  6774. // is needed to cater to all possible types of children values.
  6775. function normalizeChildren (children) {
  6776. return isPrimitive(children)
  6777. ? [createTextVNode(children)]
  6778. : Array.isArray(children)
  6779. ? normalizeArrayChildren(children)
  6780. : undefined
  6781. }
  6782. function isTextNode (node) {
  6783. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6784. }
  6785. function normalizeArrayChildren (children, nestedIndex) {
  6786. var res = [];
  6787. var i, c, lastIndex, last;
  6788. for (i = 0; i < children.length; i++) {
  6789. c = children[i];
  6790. if (isUndef(c) || typeof c === 'boolean') { continue }
  6791. lastIndex = res.length - 1;
  6792. last = res[lastIndex];
  6793. // nested
  6794. if (Array.isArray(c)) {
  6795. if (c.length > 0) {
  6796. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6797. // merge adjacent text nodes
  6798. if (isTextNode(c[0]) && isTextNode(last)) {
  6799. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6800. c.shift();
  6801. }
  6802. res.push.apply(res, c);
  6803. }
  6804. } else if (isPrimitive(c)) {
  6805. if (isTextNode(last)) {
  6806. // merge adjacent text nodes
  6807. // this is necessary for SSR hydration because text nodes are
  6808. // essentially merged when rendered to HTML strings
  6809. res[lastIndex] = createTextVNode(last.text + c);
  6810. } else if (c !== '') {
  6811. // convert primitive to vnode
  6812. res.push(createTextVNode(c));
  6813. }
  6814. } else {
  6815. if (isTextNode(c) && isTextNode(last)) {
  6816. // merge adjacent text nodes
  6817. res[lastIndex] = createTextVNode(last.text + c.text);
  6818. } else {
  6819. // default key for nested array children (likely generated by v-for)
  6820. if (isTrue(children._isVList) &&
  6821. isDef(c.tag) &&
  6822. isUndef(c.key) &&
  6823. isDef(nestedIndex)) {
  6824. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6825. }
  6826. res.push(c);
  6827. }
  6828. }
  6829. }
  6830. return res
  6831. }
  6832. /* */
  6833. function initProvide (vm) {
  6834. var provide = vm.$options.provide;
  6835. if (provide) {
  6836. vm._provided = typeof provide === 'function'
  6837. ? provide.call(vm)
  6838. : provide;
  6839. }
  6840. }
  6841. function initInjections (vm) {
  6842. var result = resolveInject(vm.$options.inject, vm);
  6843. if (result) {
  6844. toggleObserving(false);
  6845. Object.keys(result).forEach(function (key) {
  6846. /* istanbul ignore else */
  6847. if (true) {
  6848. defineReactive$$1(vm, key, result[key], function () {
  6849. warn(
  6850. "Avoid mutating an injected value directly since the changes will be " +
  6851. "overwritten whenever the provided component re-renders. " +
  6852. "injection being mutated: \"" + key + "\"",
  6853. vm
  6854. );
  6855. });
  6856. } else {}
  6857. });
  6858. toggleObserving(true);
  6859. }
  6860. }
  6861. function resolveInject (inject, vm) {
  6862. if (inject) {
  6863. // inject is :any because flow is not smart enough to figure out cached
  6864. var result = Object.create(null);
  6865. var keys = hasSymbol
  6866. ? Reflect.ownKeys(inject)
  6867. : Object.keys(inject);
  6868. for (var i = 0; i < keys.length; i++) {
  6869. var key = keys[i];
  6870. // #6574 in case the inject object is observed...
  6871. if (key === '__ob__') { continue }
  6872. var provideKey = inject[key].from;
  6873. var source = vm;
  6874. while (source) {
  6875. if (source._provided && hasOwn(source._provided, provideKey)) {
  6876. result[key] = source._provided[provideKey];
  6877. break
  6878. }
  6879. source = source.$parent;
  6880. }
  6881. if (!source) {
  6882. if ('default' in inject[key]) {
  6883. var provideDefault = inject[key].default;
  6884. result[key] = typeof provideDefault === 'function'
  6885. ? provideDefault.call(vm)
  6886. : provideDefault;
  6887. } else if (true) {
  6888. warn(("Injection \"" + key + "\" not found"), vm);
  6889. }
  6890. }
  6891. }
  6892. return result
  6893. }
  6894. }
  6895. /* */
  6896. /**
  6897. * Runtime helper for resolving raw children VNodes into a slot object.
  6898. */
  6899. function resolveSlots (
  6900. children,
  6901. context
  6902. ) {
  6903. if (!children || !children.length) {
  6904. return {}
  6905. }
  6906. var slots = {};
  6907. for (var i = 0, l = children.length; i < l; i++) {
  6908. var child = children[i];
  6909. var data = child.data;
  6910. // remove slot attribute if the node is resolved as a Vue slot node
  6911. if (data && data.attrs && data.attrs.slot) {
  6912. delete data.attrs.slot;
  6913. }
  6914. // named slots should only be respected if the vnode was rendered in the
  6915. // same context.
  6916. if ((child.context === context || child.fnContext === context) &&
  6917. data && data.slot != null
  6918. ) {
  6919. var name = data.slot;
  6920. var slot = (slots[name] || (slots[name] = []));
  6921. if (child.tag === 'template') {
  6922. slot.push.apply(slot, child.children || []);
  6923. } else {
  6924. slot.push(child);
  6925. }
  6926. } else {
  6927. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6928. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6929. (slots['page'] || (slots['page'] = [])).push(child);
  6930. }else{
  6931. (slots.default || (slots.default = [])).push(child);
  6932. }
  6933. }
  6934. }
  6935. // ignore slots that contains only whitespace
  6936. for (var name$1 in slots) {
  6937. if (slots[name$1].every(isWhitespace)) {
  6938. delete slots[name$1];
  6939. }
  6940. }
  6941. return slots
  6942. }
  6943. function isWhitespace (node) {
  6944. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6945. }
  6946. /* */
  6947. function normalizeScopedSlots (
  6948. slots,
  6949. normalSlots,
  6950. prevSlots
  6951. ) {
  6952. var res;
  6953. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6954. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6955. var key = slots && slots.$key;
  6956. if (!slots) {
  6957. res = {};
  6958. } else if (slots._normalized) {
  6959. // fast path 1: child component re-render only, parent did not change
  6960. return slots._normalized
  6961. } else if (
  6962. isStable &&
  6963. prevSlots &&
  6964. prevSlots !== emptyObject &&
  6965. key === prevSlots.$key &&
  6966. !hasNormalSlots &&
  6967. !prevSlots.$hasNormal
  6968. ) {
  6969. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6970. // only need to normalize once
  6971. return prevSlots
  6972. } else {
  6973. res = {};
  6974. for (var key$1 in slots) {
  6975. if (slots[key$1] && key$1[0] !== '$') {
  6976. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6977. }
  6978. }
  6979. }
  6980. // expose normal slots on scopedSlots
  6981. for (var key$2 in normalSlots) {
  6982. if (!(key$2 in res)) {
  6983. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6984. }
  6985. }
  6986. // avoriaz seems to mock a non-extensible $scopedSlots object
  6987. // and when that is passed down this would cause an error
  6988. if (slots && Object.isExtensible(slots)) {
  6989. (slots)._normalized = res;
  6990. }
  6991. def(res, '$stable', isStable);
  6992. def(res, '$key', key);
  6993. def(res, '$hasNormal', hasNormalSlots);
  6994. return res
  6995. }
  6996. function normalizeScopedSlot(normalSlots, key, fn) {
  6997. var normalized = function () {
  6998. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6999. res = res && typeof res === 'object' && !Array.isArray(res)
  7000. ? [res] // single vnode
  7001. : normalizeChildren(res);
  7002. return res && (
  7003. res.length === 0 ||
  7004. (res.length === 1 && res[0].isComment) // #9658
  7005. ) ? undefined
  7006. : res
  7007. };
  7008. // this is a slot using the new v-slot syntax without scope. although it is
  7009. // compiled as a scoped slot, render fn users would expect it to be present
  7010. // on this.$slots because the usage is semantically a normal slot.
  7011. if (fn.proxy) {
  7012. Object.defineProperty(normalSlots, key, {
  7013. get: normalized,
  7014. enumerable: true,
  7015. configurable: true
  7016. });
  7017. }
  7018. return normalized
  7019. }
  7020. function proxyNormalSlot(slots, key) {
  7021. return function () { return slots[key]; }
  7022. }
  7023. /* */
  7024. /**
  7025. * Runtime helper for rendering v-for lists.
  7026. */
  7027. function renderList (
  7028. val,
  7029. render
  7030. ) {
  7031. var ret, i, l, keys, key;
  7032. if (Array.isArray(val) || typeof val === 'string') {
  7033. ret = new Array(val.length);
  7034. for (i = 0, l = val.length; i < l; i++) {
  7035. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  7036. }
  7037. } else if (typeof val === 'number') {
  7038. ret = new Array(val);
  7039. for (i = 0; i < val; i++) {
  7040. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  7041. }
  7042. } else if (isObject(val)) {
  7043. if (hasSymbol && val[Symbol.iterator]) {
  7044. ret = [];
  7045. var iterator = val[Symbol.iterator]();
  7046. var result = iterator.next();
  7047. while (!result.done) {
  7048. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  7049. result = iterator.next();
  7050. }
  7051. } else {
  7052. keys = Object.keys(val);
  7053. ret = new Array(keys.length);
  7054. for (i = 0, l = keys.length; i < l; i++) {
  7055. key = keys[i];
  7056. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  7057. }
  7058. }
  7059. }
  7060. if (!isDef(ret)) {
  7061. ret = [];
  7062. }
  7063. (ret)._isVList = true;
  7064. return ret
  7065. }
  7066. /* */
  7067. /**
  7068. * Runtime helper for rendering <slot>
  7069. */
  7070. function renderSlot (
  7071. name,
  7072. fallback,
  7073. props,
  7074. bindObject
  7075. ) {
  7076. var scopedSlotFn = this.$scopedSlots[name];
  7077. var nodes;
  7078. if (scopedSlotFn) { // scoped slot
  7079. props = props || {};
  7080. if (bindObject) {
  7081. if ( true && !isObject(bindObject)) {
  7082. warn(
  7083. 'slot v-bind without argument expects an Object',
  7084. this
  7085. );
  7086. }
  7087. props = extend(extend({}, bindObject), props);
  7088. }
  7089. // fixed by xxxxxx app-plus scopedSlot
  7090. nodes = scopedSlotFn(props, this, props._i) || fallback;
  7091. } else {
  7092. nodes = this.$slots[name] || fallback;
  7093. }
  7094. var target = props && props.slot;
  7095. if (target) {
  7096. return this.$createElement('template', { slot: target }, nodes)
  7097. } else {
  7098. return nodes
  7099. }
  7100. }
  7101. /* */
  7102. /**
  7103. * Runtime helper for resolving filters
  7104. */
  7105. function resolveFilter (id) {
  7106. return resolveAsset(this.$options, 'filters', id, true) || identity
  7107. }
  7108. /* */
  7109. function isKeyNotMatch (expect, actual) {
  7110. if (Array.isArray(expect)) {
  7111. return expect.indexOf(actual) === -1
  7112. } else {
  7113. return expect !== actual
  7114. }
  7115. }
  7116. /**
  7117. * Runtime helper for checking keyCodes from config.
  7118. * exposed as Vue.prototype._k
  7119. * passing in eventKeyName as last argument separately for backwards compat
  7120. */
  7121. function checkKeyCodes (
  7122. eventKeyCode,
  7123. key,
  7124. builtInKeyCode,
  7125. eventKeyName,
  7126. builtInKeyName
  7127. ) {
  7128. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  7129. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  7130. return isKeyNotMatch(builtInKeyName, eventKeyName)
  7131. } else if (mappedKeyCode) {
  7132. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  7133. } else if (eventKeyName) {
  7134. return hyphenate(eventKeyName) !== key
  7135. }
  7136. }
  7137. /* */
  7138. /**
  7139. * Runtime helper for merging v-bind="object" into a VNode's data.
  7140. */
  7141. function bindObjectProps (
  7142. data,
  7143. tag,
  7144. value,
  7145. asProp,
  7146. isSync
  7147. ) {
  7148. if (value) {
  7149. if (!isObject(value)) {
  7150. true && warn(
  7151. 'v-bind without argument expects an Object or Array value',
  7152. this
  7153. );
  7154. } else {
  7155. if (Array.isArray(value)) {
  7156. value = toObject(value);
  7157. }
  7158. var hash;
  7159. var loop = function ( key ) {
  7160. if (
  7161. key === 'class' ||
  7162. key === 'style' ||
  7163. isReservedAttribute(key)
  7164. ) {
  7165. hash = data;
  7166. } else {
  7167. var type = data.attrs && data.attrs.type;
  7168. hash = asProp || config.mustUseProp(tag, type, key)
  7169. ? data.domProps || (data.domProps = {})
  7170. : data.attrs || (data.attrs = {});
  7171. }
  7172. var camelizedKey = camelize(key);
  7173. var hyphenatedKey = hyphenate(key);
  7174. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  7175. hash[key] = value[key];
  7176. if (isSync) {
  7177. var on = data.on || (data.on = {});
  7178. on[("update:" + key)] = function ($event) {
  7179. value[key] = $event;
  7180. };
  7181. }
  7182. }
  7183. };
  7184. for (var key in value) loop( key );
  7185. }
  7186. }
  7187. return data
  7188. }
  7189. /* */
  7190. /**
  7191. * Runtime helper for rendering static trees.
  7192. */
  7193. function renderStatic (
  7194. index,
  7195. isInFor
  7196. ) {
  7197. var cached = this._staticTrees || (this._staticTrees = []);
  7198. var tree = cached[index];
  7199. // if has already-rendered static tree and not inside v-for,
  7200. // we can reuse the same tree.
  7201. if (tree && !isInFor) {
  7202. return tree
  7203. }
  7204. // otherwise, render a fresh tree.
  7205. tree = cached[index] = this.$options.staticRenderFns[index].call(
  7206. this._renderProxy,
  7207. null,
  7208. this // for render fns generated for functional component templates
  7209. );
  7210. markStatic(tree, ("__static__" + index), false);
  7211. return tree
  7212. }
  7213. /**
  7214. * Runtime helper for v-once.
  7215. * Effectively it means marking the node as static with a unique key.
  7216. */
  7217. function markOnce (
  7218. tree,
  7219. index,
  7220. key
  7221. ) {
  7222. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  7223. return tree
  7224. }
  7225. function markStatic (
  7226. tree,
  7227. key,
  7228. isOnce
  7229. ) {
  7230. if (Array.isArray(tree)) {
  7231. for (var i = 0; i < tree.length; i++) {
  7232. if (tree[i] && typeof tree[i] !== 'string') {
  7233. markStaticNode(tree[i], (key + "_" + i), isOnce);
  7234. }
  7235. }
  7236. } else {
  7237. markStaticNode(tree, key, isOnce);
  7238. }
  7239. }
  7240. function markStaticNode (node, key, isOnce) {
  7241. node.isStatic = true;
  7242. node.key = key;
  7243. node.isOnce = isOnce;
  7244. }
  7245. /* */
  7246. function bindObjectListeners (data, value) {
  7247. if (value) {
  7248. if (!isPlainObject(value)) {
  7249. true && warn(
  7250. 'v-on without argument expects an Object value',
  7251. this
  7252. );
  7253. } else {
  7254. var on = data.on = data.on ? extend({}, data.on) : {};
  7255. for (var key in value) {
  7256. var existing = on[key];
  7257. var ours = value[key];
  7258. on[key] = existing ? [].concat(existing, ours) : ours;
  7259. }
  7260. }
  7261. }
  7262. return data
  7263. }
  7264. /* */
  7265. function resolveScopedSlots (
  7266. fns, // see flow/vnode
  7267. res,
  7268. // the following are added in 2.6
  7269. hasDynamicKeys,
  7270. contentHashKey
  7271. ) {
  7272. res = res || { $stable: !hasDynamicKeys };
  7273. for (var i = 0; i < fns.length; i++) {
  7274. var slot = fns[i];
  7275. if (Array.isArray(slot)) {
  7276. resolveScopedSlots(slot, res, hasDynamicKeys);
  7277. } else if (slot) {
  7278. // marker for reverse proxying v-slot without scope on this.$slots
  7279. if (slot.proxy) {
  7280. slot.fn.proxy = true;
  7281. }
  7282. res[slot.key] = slot.fn;
  7283. }
  7284. }
  7285. if (contentHashKey) {
  7286. (res).$key = contentHashKey;
  7287. }
  7288. return res
  7289. }
  7290. /* */
  7291. function bindDynamicKeys (baseObj, values) {
  7292. for (var i = 0; i < values.length; i += 2) {
  7293. var key = values[i];
  7294. if (typeof key === 'string' && key) {
  7295. baseObj[values[i]] = values[i + 1];
  7296. } else if ( true && key !== '' && key !== null) {
  7297. // null is a special value for explicitly removing a binding
  7298. warn(
  7299. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7300. this
  7301. );
  7302. }
  7303. }
  7304. return baseObj
  7305. }
  7306. // helper to dynamically append modifier runtime markers to event names.
  7307. // ensure only append when value is already string, otherwise it will be cast
  7308. // to string and cause the type check to miss.
  7309. function prependModifier (value, symbol) {
  7310. return typeof value === 'string' ? symbol + value : value
  7311. }
  7312. /* */
  7313. function installRenderHelpers (target) {
  7314. target._o = markOnce;
  7315. target._n = toNumber;
  7316. target._s = toString;
  7317. target._l = renderList;
  7318. target._t = renderSlot;
  7319. target._q = looseEqual;
  7320. target._i = looseIndexOf;
  7321. target._m = renderStatic;
  7322. target._f = resolveFilter;
  7323. target._k = checkKeyCodes;
  7324. target._b = bindObjectProps;
  7325. target._v = createTextVNode;
  7326. target._e = createEmptyVNode;
  7327. target._u = resolveScopedSlots;
  7328. target._g = bindObjectListeners;
  7329. target._d = bindDynamicKeys;
  7330. target._p = prependModifier;
  7331. }
  7332. /* */
  7333. function FunctionalRenderContext (
  7334. data,
  7335. props,
  7336. children,
  7337. parent,
  7338. Ctor
  7339. ) {
  7340. var this$1 = this;
  7341. var options = Ctor.options;
  7342. // ensure the createElement function in functional components
  7343. // gets a unique context - this is necessary for correct named slot check
  7344. var contextVm;
  7345. if (hasOwn(parent, '_uid')) {
  7346. contextVm = Object.create(parent);
  7347. // $flow-disable-line
  7348. contextVm._original = parent;
  7349. } else {
  7350. // the context vm passed in is a functional context as well.
  7351. // in this case we want to make sure we are able to get a hold to the
  7352. // real context instance.
  7353. contextVm = parent;
  7354. // $flow-disable-line
  7355. parent = parent._original;
  7356. }
  7357. var isCompiled = isTrue(options._compiled);
  7358. var needNormalization = !isCompiled;
  7359. this.data = data;
  7360. this.props = props;
  7361. this.children = children;
  7362. this.parent = parent;
  7363. this.listeners = data.on || emptyObject;
  7364. this.injections = resolveInject(options.inject, parent);
  7365. this.slots = function () {
  7366. if (!this$1.$slots) {
  7367. normalizeScopedSlots(
  7368. data.scopedSlots,
  7369. this$1.$slots = resolveSlots(children, parent)
  7370. );
  7371. }
  7372. return this$1.$slots
  7373. };
  7374. Object.defineProperty(this, 'scopedSlots', ({
  7375. enumerable: true,
  7376. get: function get () {
  7377. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7378. }
  7379. }));
  7380. // support for compiled functional template
  7381. if (isCompiled) {
  7382. // exposing $options for renderStatic()
  7383. this.$options = options;
  7384. // pre-resolve slots for renderSlot()
  7385. this.$slots = this.slots();
  7386. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7387. }
  7388. if (options._scopeId) {
  7389. this._c = function (a, b, c, d) {
  7390. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7391. if (vnode && !Array.isArray(vnode)) {
  7392. vnode.fnScopeId = options._scopeId;
  7393. vnode.fnContext = parent;
  7394. }
  7395. return vnode
  7396. };
  7397. } else {
  7398. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7399. }
  7400. }
  7401. installRenderHelpers(FunctionalRenderContext.prototype);
  7402. function createFunctionalComponent (
  7403. Ctor,
  7404. propsData,
  7405. data,
  7406. contextVm,
  7407. children
  7408. ) {
  7409. var options = Ctor.options;
  7410. var props = {};
  7411. var propOptions = options.props;
  7412. if (isDef(propOptions)) {
  7413. for (var key in propOptions) {
  7414. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7415. }
  7416. } else {
  7417. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7418. if (isDef(data.props)) { mergeProps(props, data.props); }
  7419. }
  7420. var renderContext = new FunctionalRenderContext(
  7421. data,
  7422. props,
  7423. children,
  7424. contextVm,
  7425. Ctor
  7426. );
  7427. var vnode = options.render.call(null, renderContext._c, renderContext);
  7428. if (vnode instanceof VNode) {
  7429. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7430. } else if (Array.isArray(vnode)) {
  7431. var vnodes = normalizeChildren(vnode) || [];
  7432. var res = new Array(vnodes.length);
  7433. for (var i = 0; i < vnodes.length; i++) {
  7434. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7435. }
  7436. return res
  7437. }
  7438. }
  7439. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7440. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7441. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7442. // that should not be matched to match.
  7443. var clone = cloneVNode(vnode);
  7444. clone.fnContext = contextVm;
  7445. clone.fnOptions = options;
  7446. if (true) {
  7447. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  7448. }
  7449. if (data.slot) {
  7450. (clone.data || (clone.data = {})).slot = data.slot;
  7451. }
  7452. return clone
  7453. }
  7454. function mergeProps (to, from) {
  7455. for (var key in from) {
  7456. to[camelize(key)] = from[key];
  7457. }
  7458. }
  7459. /* */
  7460. /* */
  7461. /* */
  7462. /* */
  7463. // inline hooks to be invoked on component VNodes during patch
  7464. var componentVNodeHooks = {
  7465. init: function init (vnode, hydrating) {
  7466. if (
  7467. vnode.componentInstance &&
  7468. !vnode.componentInstance._isDestroyed &&
  7469. vnode.data.keepAlive
  7470. ) {
  7471. // kept-alive components, treat as a patch
  7472. var mountedNode = vnode; // work around flow
  7473. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  7474. } else {
  7475. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7476. vnode,
  7477. activeInstance
  7478. );
  7479. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7480. }
  7481. },
  7482. prepatch: function prepatch (oldVnode, vnode) {
  7483. var options = vnode.componentOptions;
  7484. var child = vnode.componentInstance = oldVnode.componentInstance;
  7485. updateChildComponent(
  7486. child,
  7487. options.propsData, // updated props
  7488. options.listeners, // updated listeners
  7489. vnode, // new parent vnode
  7490. options.children // new children
  7491. );
  7492. },
  7493. insert: function insert (vnode) {
  7494. var context = vnode.context;
  7495. var componentInstance = vnode.componentInstance;
  7496. if (!componentInstance._isMounted) {
  7497. callHook(componentInstance, 'onServiceCreated');
  7498. callHook(componentInstance, 'onServiceAttached');
  7499. componentInstance._isMounted = true;
  7500. callHook(componentInstance, 'mounted');
  7501. }
  7502. if (vnode.data.keepAlive) {
  7503. if (context._isMounted) {
  7504. // vue-router#1212
  7505. // During updates, a kept-alive component's child components may
  7506. // change, so directly walking the tree here may call activated hooks
  7507. // on incorrect children. Instead we push them into a queue which will
  7508. // be processed after the whole patch process ended.
  7509. queueActivatedComponent(componentInstance);
  7510. } else {
  7511. activateChildComponent(componentInstance, true /* direct */);
  7512. }
  7513. }
  7514. },
  7515. destroy: function destroy (vnode) {
  7516. var componentInstance = vnode.componentInstance;
  7517. if (!componentInstance._isDestroyed) {
  7518. if (!vnode.data.keepAlive) {
  7519. componentInstance.$destroy();
  7520. } else {
  7521. deactivateChildComponent(componentInstance, true /* direct */);
  7522. }
  7523. }
  7524. }
  7525. };
  7526. var hooksToMerge = Object.keys(componentVNodeHooks);
  7527. function createComponent (
  7528. Ctor,
  7529. data,
  7530. context,
  7531. children,
  7532. tag
  7533. ) {
  7534. if (isUndef(Ctor)) {
  7535. return
  7536. }
  7537. var baseCtor = context.$options._base;
  7538. // plain options object: turn it into a constructor
  7539. if (isObject(Ctor)) {
  7540. Ctor = baseCtor.extend(Ctor);
  7541. }
  7542. // if at this stage it's not a constructor or an async component factory,
  7543. // reject.
  7544. if (typeof Ctor !== 'function') {
  7545. if (true) {
  7546. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7547. }
  7548. return
  7549. }
  7550. // async component
  7551. var asyncFactory;
  7552. if (isUndef(Ctor.cid)) {
  7553. asyncFactory = Ctor;
  7554. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7555. if (Ctor === undefined) {
  7556. // return a placeholder node for async component, which is rendered
  7557. // as a comment node but preserves all the raw information for the node.
  7558. // the information will be used for async server-rendering and hydration.
  7559. return createAsyncPlaceholder(
  7560. asyncFactory,
  7561. data,
  7562. context,
  7563. children,
  7564. tag
  7565. )
  7566. }
  7567. }
  7568. data = data || {};
  7569. // resolve constructor options in case global mixins are applied after
  7570. // component constructor creation
  7571. resolveConstructorOptions(Ctor);
  7572. // transform component v-model data into props & events
  7573. if (isDef(data.model)) {
  7574. transformModel(Ctor.options, data);
  7575. }
  7576. // extract props
  7577. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7578. // functional component
  7579. if (isTrue(Ctor.options.functional)) {
  7580. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7581. }
  7582. // extract listeners, since these needs to be treated as
  7583. // child component listeners instead of DOM listeners
  7584. var listeners = data.on;
  7585. // replace with listeners with .native modifier
  7586. // so it gets processed during parent component patch.
  7587. data.on = data.nativeOn;
  7588. if (isTrue(Ctor.options.abstract)) {
  7589. // abstract components do not keep anything
  7590. // other than props & listeners & slot
  7591. // work around flow
  7592. var slot = data.slot;
  7593. data = {};
  7594. if (slot) {
  7595. data.slot = slot;
  7596. }
  7597. }
  7598. // install component management hooks onto the placeholder node
  7599. installComponentHooks(data);
  7600. // return a placeholder vnode
  7601. var name = Ctor.options.name || tag;
  7602. var vnode = new VNode(
  7603. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7604. data, undefined, undefined, undefined, context,
  7605. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7606. asyncFactory
  7607. );
  7608. return vnode
  7609. }
  7610. function createComponentInstanceForVnode (
  7611. vnode, // we know it's MountedComponentVNode but flow doesn't
  7612. parent // activeInstance in lifecycle state
  7613. ) {
  7614. var options = {
  7615. _isComponent: true,
  7616. _parentVnode: vnode,
  7617. parent: parent
  7618. };
  7619. // check inline-template render functions
  7620. var inlineTemplate = vnode.data.inlineTemplate;
  7621. if (isDef(inlineTemplate)) {
  7622. options.render = inlineTemplate.render;
  7623. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7624. }
  7625. return new vnode.componentOptions.Ctor(options)
  7626. }
  7627. function installComponentHooks (data) {
  7628. var hooks = data.hook || (data.hook = {});
  7629. for (var i = 0; i < hooksToMerge.length; i++) {
  7630. var key = hooksToMerge[i];
  7631. var existing = hooks[key];
  7632. var toMerge = componentVNodeHooks[key];
  7633. if (existing !== toMerge && !(existing && existing._merged)) {
  7634. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7635. }
  7636. }
  7637. }
  7638. function mergeHook$1 (f1, f2) {
  7639. var merged = function (a, b) {
  7640. // flow complains about extra args which is why we use any
  7641. f1(a, b);
  7642. f2(a, b);
  7643. };
  7644. merged._merged = true;
  7645. return merged
  7646. }
  7647. // transform component v-model info (value and callback) into
  7648. // prop and event handler respectively.
  7649. function transformModel (options, data) {
  7650. var prop = (options.model && options.model.prop) || 'value';
  7651. var event = (options.model && options.model.event) || 'input'
  7652. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7653. var on = data.on || (data.on = {});
  7654. var existing = on[event];
  7655. var callback = data.model.callback;
  7656. if (isDef(existing)) {
  7657. if (
  7658. Array.isArray(existing)
  7659. ? existing.indexOf(callback) === -1
  7660. : existing !== callback
  7661. ) {
  7662. on[event] = [callback].concat(existing);
  7663. }
  7664. } else {
  7665. on[event] = callback;
  7666. }
  7667. }
  7668. /* */
  7669. var SIMPLE_NORMALIZE = 1;
  7670. var ALWAYS_NORMALIZE = 2;
  7671. // wrapper function for providing a more flexible interface
  7672. // without getting yelled at by flow
  7673. function createElement (
  7674. context,
  7675. tag,
  7676. data,
  7677. children,
  7678. normalizationType,
  7679. alwaysNormalize
  7680. ) {
  7681. if (Array.isArray(data) || isPrimitive(data)) {
  7682. normalizationType = children;
  7683. children = data;
  7684. data = undefined;
  7685. }
  7686. if (isTrue(alwaysNormalize)) {
  7687. normalizationType = ALWAYS_NORMALIZE;
  7688. }
  7689. return _createElement(context, tag, data, children, normalizationType)
  7690. }
  7691. function _createElement (
  7692. context,
  7693. tag,
  7694. data,
  7695. children,
  7696. normalizationType
  7697. ) {
  7698. if (isDef(data) && isDef((data).__ob__)) {
  7699. true && warn(
  7700. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7701. 'Always create fresh vnode data objects in each render!',
  7702. context
  7703. );
  7704. return createEmptyVNode()
  7705. }
  7706. // object syntax in v-bind
  7707. if (isDef(data) && isDef(data.is)) {
  7708. tag = data.is;
  7709. }
  7710. if (!tag) {
  7711. // in case of component :is set to falsy value
  7712. return createEmptyVNode()
  7713. }
  7714. // warn against non-primitive key
  7715. if ( true &&
  7716. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7717. ) {
  7718. {
  7719. warn(
  7720. 'Avoid using non-primitive value as key, ' +
  7721. 'use string/number value instead.',
  7722. context
  7723. );
  7724. }
  7725. }
  7726. // support single function children as default scoped slot
  7727. if (Array.isArray(children) &&
  7728. typeof children[0] === 'function'
  7729. ) {
  7730. data = data || {};
  7731. data.scopedSlots = { default: children[0] };
  7732. children.length = 0;
  7733. }
  7734. if (normalizationType === ALWAYS_NORMALIZE) {
  7735. children = normalizeChildren(children);
  7736. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7737. children = simpleNormalizeChildren(children);
  7738. }
  7739. var vnode, ns;
  7740. if (typeof tag === 'string') {
  7741. var Ctor;
  7742. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7743. if (config.isReservedTag(tag)) {
  7744. // platform built-in elements
  7745. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7746. warn(
  7747. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7748. context
  7749. );
  7750. }
  7751. vnode = new VNode(
  7752. config.parsePlatformTagName(tag), data, children,
  7753. undefined, undefined, context
  7754. );
  7755. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7756. // component
  7757. vnode = createComponent(Ctor, data, context, children, tag);
  7758. } else {
  7759. // unknown or unlisted namespaced elements
  7760. // check at runtime because it may get assigned a namespace when its
  7761. // parent normalizes children
  7762. vnode = new VNode(
  7763. tag, data, children,
  7764. undefined, undefined, context
  7765. );
  7766. }
  7767. } else {
  7768. // direct component options / constructor
  7769. vnode = createComponent(tag, data, context, children);
  7770. }
  7771. if (Array.isArray(vnode)) {
  7772. return vnode
  7773. } else if (isDef(vnode)) {
  7774. if (isDef(ns)) { applyNS(vnode, ns); }
  7775. if (isDef(data)) { registerDeepBindings(data); }
  7776. return vnode
  7777. } else {
  7778. return createEmptyVNode()
  7779. }
  7780. }
  7781. function applyNS (vnode, ns, force) {
  7782. vnode.ns = ns;
  7783. if (vnode.tag === 'foreignObject') {
  7784. // use default namespace inside foreignObject
  7785. ns = undefined;
  7786. force = true;
  7787. }
  7788. if (isDef(vnode.children)) {
  7789. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7790. var child = vnode.children[i];
  7791. if (isDef(child.tag) && (
  7792. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7793. applyNS(child, ns, force);
  7794. }
  7795. }
  7796. }
  7797. }
  7798. // ref #5318
  7799. // necessary to ensure parent re-render when deep bindings like :style and
  7800. // :class are used on slot nodes
  7801. function registerDeepBindings (data) {
  7802. if (isObject(data.style)) {
  7803. traverse(data.style);
  7804. }
  7805. if (isObject(data.class)) {
  7806. traverse(data.class);
  7807. }
  7808. }
  7809. /* */
  7810. function initRender (vm) {
  7811. vm._vnode = null; // the root of the child tree
  7812. vm._staticTrees = null; // v-once cached trees
  7813. var options = vm.$options;
  7814. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7815. var renderContext = parentVnode && parentVnode.context;
  7816. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7817. vm.$scopedSlots = emptyObject;
  7818. // bind the createElement fn to this instance
  7819. // so that we get proper render context inside it.
  7820. // args order: tag, data, children, normalizationType, alwaysNormalize
  7821. // internal version is used by render functions compiled from templates
  7822. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7823. // normalization is always applied for the public version, used in
  7824. // user-written render functions.
  7825. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7826. // $attrs & $listeners are exposed for easier HOC creation.
  7827. // they need to be reactive so that HOCs using them are always updated
  7828. var parentData = parentVnode && parentVnode.data;
  7829. /* istanbul ignore else */
  7830. if (true) {
  7831. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7832. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7833. }, true);
  7834. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7835. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7836. }, true);
  7837. } else {}
  7838. }
  7839. var currentRenderingInstance = null;
  7840. function renderMixin (Vue) {
  7841. // install runtime convenience helpers
  7842. installRenderHelpers(Vue.prototype);
  7843. Vue.prototype.$nextTick = function (fn) {
  7844. return nextTick(fn, this)
  7845. };
  7846. Vue.prototype._render = function () {
  7847. var vm = this;
  7848. var ref = vm.$options;
  7849. var render = ref.render;
  7850. var _parentVnode = ref._parentVnode;
  7851. if (_parentVnode) {
  7852. vm.$scopedSlots = normalizeScopedSlots(
  7853. _parentVnode.data.scopedSlots,
  7854. vm.$slots,
  7855. vm.$scopedSlots
  7856. );
  7857. }
  7858. // set parent vnode. this allows render functions to have access
  7859. // to the data on the placeholder node.
  7860. vm.$vnode = _parentVnode;
  7861. // render self
  7862. var vnode;
  7863. try {
  7864. // There's no need to maintain a stack because all render fns are called
  7865. // separately from one another. Nested component's render fns are called
  7866. // when parent component is patched.
  7867. currentRenderingInstance = vm;
  7868. vnode = render.call(vm._renderProxy, vm.$createElement);
  7869. } catch (e) {
  7870. handleError(e, vm, "render");
  7871. // return error render result,
  7872. // or previous vnode to prevent render error causing blank component
  7873. /* istanbul ignore else */
  7874. if ( true && vm.$options.renderError) {
  7875. try {
  7876. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7877. } catch (e) {
  7878. handleError(e, vm, "renderError");
  7879. vnode = vm._vnode;
  7880. }
  7881. } else {
  7882. vnode = vm._vnode;
  7883. }
  7884. } finally {
  7885. currentRenderingInstance = null;
  7886. }
  7887. // if the returned array contains only a single node, allow it
  7888. if (Array.isArray(vnode) && vnode.length === 1) {
  7889. vnode = vnode[0];
  7890. }
  7891. // return empty vnode in case the render function errored out
  7892. if (!(vnode instanceof VNode)) {
  7893. if ( true && Array.isArray(vnode)) {
  7894. warn(
  7895. 'Multiple root nodes returned from render function. Render function ' +
  7896. 'should return a single root node.',
  7897. vm
  7898. );
  7899. }
  7900. vnode = createEmptyVNode();
  7901. }
  7902. // set parent
  7903. vnode.parent = _parentVnode;
  7904. return vnode
  7905. };
  7906. }
  7907. /* */
  7908. function ensureCtor (comp, base) {
  7909. if (
  7910. comp.__esModule ||
  7911. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7912. ) {
  7913. comp = comp.default;
  7914. }
  7915. return isObject(comp)
  7916. ? base.extend(comp)
  7917. : comp
  7918. }
  7919. function createAsyncPlaceholder (
  7920. factory,
  7921. data,
  7922. context,
  7923. children,
  7924. tag
  7925. ) {
  7926. var node = createEmptyVNode();
  7927. node.asyncFactory = factory;
  7928. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7929. return node
  7930. }
  7931. function resolveAsyncComponent (
  7932. factory,
  7933. baseCtor
  7934. ) {
  7935. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7936. return factory.errorComp
  7937. }
  7938. if (isDef(factory.resolved)) {
  7939. return factory.resolved
  7940. }
  7941. var owner = currentRenderingInstance;
  7942. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7943. // already pending
  7944. factory.owners.push(owner);
  7945. }
  7946. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7947. return factory.loadingComp
  7948. }
  7949. if (owner && !isDef(factory.owners)) {
  7950. var owners = factory.owners = [owner];
  7951. var sync = true;
  7952. var timerLoading = null;
  7953. var timerTimeout = null
  7954. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7955. var forceRender = function (renderCompleted) {
  7956. for (var i = 0, l = owners.length; i < l; i++) {
  7957. (owners[i]).$forceUpdate();
  7958. }
  7959. if (renderCompleted) {
  7960. owners.length = 0;
  7961. if (timerLoading !== null) {
  7962. clearTimeout(timerLoading);
  7963. timerLoading = null;
  7964. }
  7965. if (timerTimeout !== null) {
  7966. clearTimeout(timerTimeout);
  7967. timerTimeout = null;
  7968. }
  7969. }
  7970. };
  7971. var resolve = once(function (res) {
  7972. // cache resolved
  7973. factory.resolved = ensureCtor(res, baseCtor);
  7974. // invoke callbacks only if this is not a synchronous resolve
  7975. // (async resolves are shimmed as synchronous during SSR)
  7976. if (!sync) {
  7977. forceRender(true);
  7978. } else {
  7979. owners.length = 0;
  7980. }
  7981. });
  7982. var reject = once(function (reason) {
  7983. true && warn(
  7984. "Failed to resolve async component: " + (String(factory)) +
  7985. (reason ? ("\nReason: " + reason) : '')
  7986. );
  7987. if (isDef(factory.errorComp)) {
  7988. factory.error = true;
  7989. forceRender(true);
  7990. }
  7991. });
  7992. var res = factory(resolve, reject);
  7993. if (isObject(res)) {
  7994. if (isPromise(res)) {
  7995. // () => Promise
  7996. if (isUndef(factory.resolved)) {
  7997. res.then(resolve, reject);
  7998. }
  7999. } else if (isPromise(res.component)) {
  8000. res.component.then(resolve, reject);
  8001. if (isDef(res.error)) {
  8002. factory.errorComp = ensureCtor(res.error, baseCtor);
  8003. }
  8004. if (isDef(res.loading)) {
  8005. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  8006. if (res.delay === 0) {
  8007. factory.loading = true;
  8008. } else {
  8009. timerLoading = setTimeout(function () {
  8010. timerLoading = null;
  8011. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  8012. factory.loading = true;
  8013. forceRender(false);
  8014. }
  8015. }, res.delay || 200);
  8016. }
  8017. }
  8018. if (isDef(res.timeout)) {
  8019. timerTimeout = setTimeout(function () {
  8020. timerTimeout = null;
  8021. if (isUndef(factory.resolved)) {
  8022. reject(
  8023. true
  8024. ? ("timeout (" + (res.timeout) + "ms)")
  8025. : undefined
  8026. );
  8027. }
  8028. }, res.timeout);
  8029. }
  8030. }
  8031. }
  8032. sync = false;
  8033. // return in case resolved synchronously
  8034. return factory.loading
  8035. ? factory.loadingComp
  8036. : factory.resolved
  8037. }
  8038. }
  8039. /* */
  8040. function isAsyncPlaceholder (node) {
  8041. return node.isComment && node.asyncFactory
  8042. }
  8043. /* */
  8044. function getFirstComponentChild (children) {
  8045. if (Array.isArray(children)) {
  8046. for (var i = 0; i < children.length; i++) {
  8047. var c = children[i];
  8048. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  8049. return c
  8050. }
  8051. }
  8052. }
  8053. }
  8054. /* */
  8055. /* */
  8056. function initEvents (vm) {
  8057. vm._events = Object.create(null);
  8058. vm._hasHookEvent = false;
  8059. // init parent attached events
  8060. var listeners = vm.$options._parentListeners;
  8061. if (listeners) {
  8062. updateComponentListeners(vm, listeners);
  8063. }
  8064. }
  8065. var target;
  8066. function add (event, fn) {
  8067. target.$on(event, fn);
  8068. }
  8069. function remove$1 (event, fn) {
  8070. target.$off(event, fn);
  8071. }
  8072. function createOnceHandler (event, fn) {
  8073. var _target = target;
  8074. return function onceHandler () {
  8075. var res = fn.apply(null, arguments);
  8076. if (res !== null) {
  8077. _target.$off(event, onceHandler);
  8078. }
  8079. }
  8080. }
  8081. function updateComponentListeners (
  8082. vm,
  8083. listeners,
  8084. oldListeners
  8085. ) {
  8086. target = vm;
  8087. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  8088. target = undefined;
  8089. }
  8090. function eventsMixin (Vue) {
  8091. var hookRE = /^hook:/;
  8092. Vue.prototype.$on = function (event, fn) {
  8093. var vm = this;
  8094. if (Array.isArray(event)) {
  8095. for (var i = 0, l = event.length; i < l; i++) {
  8096. vm.$on(event[i], fn);
  8097. }
  8098. } else {
  8099. (vm._events[event] || (vm._events[event] = [])).push(fn);
  8100. // optimize hook:event cost by using a boolean flag marked at registration
  8101. // instead of a hash lookup
  8102. if (hookRE.test(event)) {
  8103. vm._hasHookEvent = true;
  8104. }
  8105. }
  8106. return vm
  8107. };
  8108. Vue.prototype.$once = function (event, fn) {
  8109. var vm = this;
  8110. function on () {
  8111. vm.$off(event, on);
  8112. fn.apply(vm, arguments);
  8113. }
  8114. on.fn = fn;
  8115. vm.$on(event, on);
  8116. return vm
  8117. };
  8118. Vue.prototype.$off = function (event, fn) {
  8119. var vm = this;
  8120. // all
  8121. if (!arguments.length) {
  8122. vm._events = Object.create(null);
  8123. return vm
  8124. }
  8125. // array of events
  8126. if (Array.isArray(event)) {
  8127. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  8128. vm.$off(event[i$1], fn);
  8129. }
  8130. return vm
  8131. }
  8132. // specific event
  8133. var cbs = vm._events[event];
  8134. if (!cbs) {
  8135. return vm
  8136. }
  8137. if (!fn) {
  8138. vm._events[event] = null;
  8139. return vm
  8140. }
  8141. // specific handler
  8142. var cb;
  8143. var i = cbs.length;
  8144. while (i--) {
  8145. cb = cbs[i];
  8146. if (cb === fn || cb.fn === fn) {
  8147. cbs.splice(i, 1);
  8148. break
  8149. }
  8150. }
  8151. return vm
  8152. };
  8153. Vue.prototype.$emit = function (event) {
  8154. var vm = this;
  8155. if (true) {
  8156. var lowerCaseEvent = event.toLowerCase();
  8157. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  8158. tip(
  8159. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  8160. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  8161. "Note that HTML attributes are case-insensitive and you cannot use " +
  8162. "v-on to listen to camelCase events when using in-DOM templates. " +
  8163. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  8164. );
  8165. }
  8166. }
  8167. var cbs = vm._events[event];
  8168. if (cbs) {
  8169. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  8170. var args = toArray(arguments, 1);
  8171. var info = "event handler for \"" + event + "\"";
  8172. for (var i = 0, l = cbs.length; i < l; i++) {
  8173. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  8174. }
  8175. }
  8176. return vm
  8177. };
  8178. }
  8179. /* */
  8180. var activeInstance = null;
  8181. var isUpdatingChildComponent = false;
  8182. function setActiveInstance(vm) {
  8183. var prevActiveInstance = activeInstance;
  8184. activeInstance = vm;
  8185. return function () {
  8186. activeInstance = prevActiveInstance;
  8187. }
  8188. }
  8189. function initLifecycle (vm) {
  8190. var options = vm.$options;
  8191. // locate first non-abstract parent
  8192. var parent = options.parent;
  8193. if (parent && !options.abstract) {
  8194. while (parent.$options.abstract && parent.$parent) {
  8195. parent = parent.$parent;
  8196. }
  8197. parent.$children.push(vm);
  8198. }
  8199. vm.$parent = parent;
  8200. vm.$root = parent ? parent.$root : vm;
  8201. vm.$children = [];
  8202. vm.$refs = {};
  8203. vm._watcher = null;
  8204. vm._inactive = null;
  8205. vm._directInactive = false;
  8206. vm._isMounted = false;
  8207. vm._isDestroyed = false;
  8208. vm._isBeingDestroyed = false;
  8209. }
  8210. function lifecycleMixin (Vue) {
  8211. Vue.prototype._update = function (vnode, hydrating) {
  8212. var vm = this;
  8213. var prevEl = vm.$el;
  8214. var prevVnode = vm._vnode;
  8215. var restoreActiveInstance = setActiveInstance(vm);
  8216. vm._vnode = vnode;
  8217. // Vue.prototype.__patch__ is injected in entry points
  8218. // based on the rendering backend used.
  8219. if (!prevVnode) {
  8220. // initial render
  8221. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  8222. } else {
  8223. // updates
  8224. vm.$el = vm.__patch__(prevVnode, vnode);
  8225. }
  8226. restoreActiveInstance();
  8227. // update __vue__ reference
  8228. if (prevEl) {
  8229. prevEl.__vue__ = null;
  8230. }
  8231. if (vm.$el) {
  8232. vm.$el.__vue__ = vm;
  8233. }
  8234. // if parent is an HOC, update its $el as well
  8235. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  8236. vm.$parent.$el = vm.$el;
  8237. }
  8238. // updated hook is called by the scheduler to ensure that children are
  8239. // updated in a parent's updated hook.
  8240. };
  8241. Vue.prototype.$forceUpdate = function () {
  8242. var vm = this;
  8243. if (vm._watcher) {
  8244. vm._watcher.update();
  8245. }
  8246. };
  8247. Vue.prototype.$destroy = function () {
  8248. var vm = this;
  8249. if (vm._isBeingDestroyed) {
  8250. return
  8251. }
  8252. callHook(vm, 'beforeDestroy');
  8253. vm._isBeingDestroyed = true;
  8254. // remove self from parent
  8255. var parent = vm.$parent;
  8256. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  8257. remove(parent.$children, vm);
  8258. }
  8259. // teardown watchers
  8260. if (vm._watcher) {
  8261. vm._watcher.teardown();
  8262. }
  8263. var i = vm._watchers.length;
  8264. while (i--) {
  8265. vm._watchers[i].teardown();
  8266. }
  8267. // remove reference from data ob
  8268. // frozen object may not have observer.
  8269. if (vm._data.__ob__) {
  8270. vm._data.__ob__.vmCount--;
  8271. }
  8272. // call the last hook...
  8273. vm._isDestroyed = true;
  8274. // invoke destroy hooks on current rendered tree
  8275. vm.__patch__(vm._vnode, null);
  8276. // fire destroyed hook
  8277. callHook(vm, 'destroyed');
  8278. // turn off all instance listeners.
  8279. vm.$off();
  8280. // remove __vue__ reference
  8281. if (vm.$el) {
  8282. vm.$el.__vue__ = null;
  8283. }
  8284. // release circular reference (#6759)
  8285. if (vm.$vnode) {
  8286. vm.$vnode.parent = null;
  8287. }
  8288. };
  8289. }
  8290. function updateChildComponent (
  8291. vm,
  8292. propsData,
  8293. listeners,
  8294. parentVnode,
  8295. renderChildren
  8296. ) {
  8297. if (true) {
  8298. isUpdatingChildComponent = true;
  8299. }
  8300. // determine whether component has slot children
  8301. // we need to do this before overwriting $options._renderChildren.
  8302. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8303. // dynamic slot names). Static scoped slots compiled from template has the
  8304. // "$stable" marker.
  8305. var newScopedSlots = parentVnode.data.scopedSlots;
  8306. var oldScopedSlots = vm.$scopedSlots;
  8307. var hasDynamicScopedSlot = !!(
  8308. (newScopedSlots && !newScopedSlots.$stable) ||
  8309. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8310. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8311. );
  8312. // Any static slot children from the parent may have changed during parent's
  8313. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8314. // update is necessary to ensure correctness.
  8315. var needsForceUpdate = !!(
  8316. renderChildren || // has new static slots
  8317. vm.$options._renderChildren || // has old static slots
  8318. hasDynamicScopedSlot
  8319. );
  8320. vm.$options._parentVnode = parentVnode;
  8321. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8322. if (vm._vnode) { // update child tree's parent
  8323. vm._vnode.parent = parentVnode;
  8324. }
  8325. vm.$options._renderChildren = renderChildren;
  8326. // update $attrs and $listeners hash
  8327. // these are also reactive so they may trigger child update if the child
  8328. // used them during render
  8329. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8330. vm.$listeners = listeners || emptyObject;
  8331. // update props
  8332. if (propsData && vm.$options.props) {
  8333. toggleObserving(false);
  8334. var props = vm._props;
  8335. var propKeys = vm.$options._propKeys || [];
  8336. for (var i = 0; i < propKeys.length; i++) {
  8337. var key = propKeys[i];
  8338. var propOptions = vm.$options.props; // wtf flow?
  8339. props[key] = validateProp(key, propOptions, propsData, vm);
  8340. }
  8341. toggleObserving(true);
  8342. // keep a copy of raw propsData
  8343. vm.$options.propsData = propsData;
  8344. }
  8345. // fixed by xxxxxx update properties(mp runtime)
  8346. vm._$updateProperties && vm._$updateProperties(vm);
  8347. // update listeners
  8348. listeners = listeners || emptyObject;
  8349. var oldListeners = vm.$options._parentListeners;
  8350. vm.$options._parentListeners = listeners;
  8351. updateComponentListeners(vm, listeners, oldListeners);
  8352. // resolve slots + force update if has children
  8353. if (needsForceUpdate) {
  8354. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8355. vm.$forceUpdate();
  8356. }
  8357. if (true) {
  8358. isUpdatingChildComponent = false;
  8359. }
  8360. }
  8361. function isInInactiveTree (vm) {
  8362. while (vm && (vm = vm.$parent)) {
  8363. if (vm._inactive) { return true }
  8364. }
  8365. return false
  8366. }
  8367. function activateChildComponent (vm, direct) {
  8368. if (direct) {
  8369. vm._directInactive = false;
  8370. if (isInInactiveTree(vm)) {
  8371. return
  8372. }
  8373. } else if (vm._directInactive) {
  8374. return
  8375. }
  8376. if (vm._inactive || vm._inactive === null) {
  8377. vm._inactive = false;
  8378. for (var i = 0; i < vm.$children.length; i++) {
  8379. activateChildComponent(vm.$children[i]);
  8380. }
  8381. callHook(vm, 'activated');
  8382. }
  8383. }
  8384. function deactivateChildComponent (vm, direct) {
  8385. if (direct) {
  8386. vm._directInactive = true;
  8387. if (isInInactiveTree(vm)) {
  8388. return
  8389. }
  8390. }
  8391. if (!vm._inactive) {
  8392. vm._inactive = true;
  8393. for (var i = 0; i < vm.$children.length; i++) {
  8394. deactivateChildComponent(vm.$children[i]);
  8395. }
  8396. callHook(vm, 'deactivated');
  8397. }
  8398. }
  8399. function callHook (vm, hook) {
  8400. // #7573 disable dep collection when invoking lifecycle hooks
  8401. pushTarget();
  8402. var handlers = vm.$options[hook];
  8403. var info = hook + " hook";
  8404. if (handlers) {
  8405. for (var i = 0, j = handlers.length; i < j; i++) {
  8406. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8407. }
  8408. }
  8409. if (vm._hasHookEvent) {
  8410. vm.$emit('hook:' + hook);
  8411. }
  8412. popTarget();
  8413. }
  8414. /* */
  8415. var MAX_UPDATE_COUNT = 100;
  8416. var queue = [];
  8417. var activatedChildren = [];
  8418. var has = {};
  8419. var circular = {};
  8420. var waiting = false;
  8421. var flushing = false;
  8422. var index = 0;
  8423. /**
  8424. * Reset the scheduler's state.
  8425. */
  8426. function resetSchedulerState () {
  8427. index = queue.length = activatedChildren.length = 0;
  8428. has = {};
  8429. if (true) {
  8430. circular = {};
  8431. }
  8432. waiting = flushing = false;
  8433. }
  8434. // Async edge case #6566 requires saving the timestamp when event listeners are
  8435. // attached. However, calling performance.now() has a perf overhead especially
  8436. // if the page has thousands of event listeners. Instead, we take a timestamp
  8437. // every time the scheduler flushes and use that for all event listeners
  8438. // attached during that flush.
  8439. var currentFlushTimestamp = 0;
  8440. // Async edge case fix requires storing an event listener's attach timestamp.
  8441. var getNow = Date.now;
  8442. // Determine what event timestamp the browser is using. Annoyingly, the
  8443. // timestamp can either be hi-res (relative to page load) or low-res
  8444. // (relative to UNIX epoch), so in order to compare time we have to use the
  8445. // same timestamp type when saving the flush timestamp.
  8446. // All IE versions use low-res event timestamps, and have problematic clock
  8447. // implementations (#9632)
  8448. if (inBrowser && !isIE) {
  8449. var performance = window.performance;
  8450. if (
  8451. performance &&
  8452. typeof performance.now === 'function' &&
  8453. getNow() > document.createEvent('Event').timeStamp
  8454. ) {
  8455. // if the event timestamp, although evaluated AFTER the Date.now(), is
  8456. // smaller than it, it means the event is using a hi-res timestamp,
  8457. // and we need to use the hi-res version for event listener timestamps as
  8458. // well.
  8459. getNow = function () { return performance.now(); };
  8460. }
  8461. }
  8462. /**
  8463. * Flush both queues and run the watchers.
  8464. */
  8465. function flushSchedulerQueue () {
  8466. currentFlushTimestamp = getNow();
  8467. flushing = true;
  8468. var watcher, id;
  8469. // Sort queue before flush.
  8470. // This ensures that:
  8471. // 1. Components are updated from parent to child. (because parent is always
  8472. // created before the child)
  8473. // 2. A component's user watchers are run before its render watcher (because
  8474. // user watchers are created before the render watcher)
  8475. // 3. If a component is destroyed during a parent component's watcher run,
  8476. // its watchers can be skipped.
  8477. queue.sort(function (a, b) { return a.id - b.id; });
  8478. // do not cache length because more watchers might be pushed
  8479. // as we run existing watchers
  8480. for (index = 0; index < queue.length; index++) {
  8481. watcher = queue[index];
  8482. if (watcher.before) {
  8483. watcher.before();
  8484. }
  8485. id = watcher.id;
  8486. has[id] = null;
  8487. watcher.run();
  8488. // in dev build, check and stop circular updates.
  8489. if ( true && has[id] != null) {
  8490. circular[id] = (circular[id] || 0) + 1;
  8491. if (circular[id] > MAX_UPDATE_COUNT) {
  8492. warn(
  8493. 'You may have an infinite update loop ' + (
  8494. watcher.user
  8495. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  8496. : "in a component render function."
  8497. ),
  8498. watcher.vm
  8499. );
  8500. break
  8501. }
  8502. }
  8503. }
  8504. // keep copies of post queues before resetting state
  8505. var activatedQueue = activatedChildren.slice();
  8506. var updatedQueue = queue.slice();
  8507. resetSchedulerState();
  8508. // call component updated and activated hooks
  8509. callActivatedHooks(activatedQueue);
  8510. callUpdatedHooks(updatedQueue);
  8511. // devtool hook
  8512. /* istanbul ignore if */
  8513. if (devtools && config.devtools) {
  8514. devtools.emit('flush');
  8515. }
  8516. }
  8517. function callUpdatedHooks (queue) {
  8518. var i = queue.length;
  8519. while (i--) {
  8520. var watcher = queue[i];
  8521. var vm = watcher.vm;
  8522. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8523. callHook(vm, 'updated');
  8524. }
  8525. }
  8526. }
  8527. /**
  8528. * Queue a kept-alive component that was activated during patch.
  8529. * The queue will be processed after the entire tree has been patched.
  8530. */
  8531. function queueActivatedComponent (vm) {
  8532. // setting _inactive to false here so that a render function can
  8533. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8534. vm._inactive = false;
  8535. activatedChildren.push(vm);
  8536. }
  8537. function callActivatedHooks (queue) {
  8538. for (var i = 0; i < queue.length; i++) {
  8539. queue[i]._inactive = true;
  8540. activateChildComponent(queue[i], true /* true */);
  8541. }
  8542. }
  8543. /**
  8544. * Push a watcher into the watcher queue.
  8545. * Jobs with duplicate IDs will be skipped unless it's
  8546. * pushed when the queue is being flushed.
  8547. */
  8548. function queueWatcher (watcher) {
  8549. var id = watcher.id;
  8550. if (has[id] == null) {
  8551. has[id] = true;
  8552. if (!flushing) {
  8553. queue.push(watcher);
  8554. } else {
  8555. // if already flushing, splice the watcher based on its id
  8556. // if already past its id, it will be run next immediately.
  8557. var i = queue.length - 1;
  8558. while (i > index && queue[i].id > watcher.id) {
  8559. i--;
  8560. }
  8561. queue.splice(i + 1, 0, watcher);
  8562. }
  8563. // queue the flush
  8564. if (!waiting) {
  8565. waiting = true;
  8566. if ( true && !config.async) {
  8567. flushSchedulerQueue();
  8568. return
  8569. }
  8570. nextTick(flushSchedulerQueue);
  8571. }
  8572. }
  8573. }
  8574. /* */
  8575. var uid$2 = 0;
  8576. /**
  8577. * A watcher parses an expression, collects dependencies,
  8578. * and fires callback when the expression value changes.
  8579. * This is used for both the $watch() api and directives.
  8580. */
  8581. var Watcher = function Watcher (
  8582. vm,
  8583. expOrFn,
  8584. cb,
  8585. options,
  8586. isRenderWatcher
  8587. ) {
  8588. this.vm = vm;
  8589. if (isRenderWatcher) {
  8590. vm._watcher = this;
  8591. }
  8592. vm._watchers.push(this);
  8593. // options
  8594. if (options) {
  8595. this.deep = !!options.deep;
  8596. this.user = !!options.user;
  8597. this.lazy = !!options.lazy;
  8598. this.sync = !!options.sync;
  8599. this.before = options.before;
  8600. } else {
  8601. this.deep = this.user = this.lazy = this.sync = false;
  8602. }
  8603. this.cb = cb;
  8604. this.id = ++uid$2; // uid for batching
  8605. this.active = true;
  8606. this.dirty = this.lazy; // for lazy watchers
  8607. this.deps = [];
  8608. this.newDeps = [];
  8609. this.depIds = new _Set();
  8610. this.newDepIds = new _Set();
  8611. this.expression = true
  8612. ? expOrFn.toString()
  8613. : undefined;
  8614. // parse expression for getter
  8615. if (typeof expOrFn === 'function') {
  8616. this.getter = expOrFn;
  8617. } else {
  8618. this.getter = parsePath(expOrFn);
  8619. if (!this.getter) {
  8620. this.getter = noop;
  8621. true && warn(
  8622. "Failed watching path: \"" + expOrFn + "\" " +
  8623. 'Watcher only accepts simple dot-delimited paths. ' +
  8624. 'For full control, use a function instead.',
  8625. vm
  8626. );
  8627. }
  8628. }
  8629. this.value = this.lazy
  8630. ? undefined
  8631. : this.get();
  8632. };
  8633. /**
  8634. * Evaluate the getter, and re-collect dependencies.
  8635. */
  8636. Watcher.prototype.get = function get () {
  8637. pushTarget(this);
  8638. var value;
  8639. var vm = this.vm;
  8640. try {
  8641. value = this.getter.call(vm, vm);
  8642. } catch (e) {
  8643. if (this.user) {
  8644. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8645. } else {
  8646. throw e
  8647. }
  8648. } finally {
  8649. // "touch" every property so they are all tracked as
  8650. // dependencies for deep watching
  8651. if (this.deep) {
  8652. traverse(value);
  8653. }
  8654. popTarget();
  8655. this.cleanupDeps();
  8656. }
  8657. return value
  8658. };
  8659. /**
  8660. * Add a dependency to this directive.
  8661. */
  8662. Watcher.prototype.addDep = function addDep (dep) {
  8663. var id = dep.id;
  8664. if (!this.newDepIds.has(id)) {
  8665. this.newDepIds.add(id);
  8666. this.newDeps.push(dep);
  8667. if (!this.depIds.has(id)) {
  8668. dep.addSub(this);
  8669. }
  8670. }
  8671. };
  8672. /**
  8673. * Clean up for dependency collection.
  8674. */
  8675. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8676. var i = this.deps.length;
  8677. while (i--) {
  8678. var dep = this.deps[i];
  8679. if (!this.newDepIds.has(dep.id)) {
  8680. dep.removeSub(this);
  8681. }
  8682. }
  8683. var tmp = this.depIds;
  8684. this.depIds = this.newDepIds;
  8685. this.newDepIds = tmp;
  8686. this.newDepIds.clear();
  8687. tmp = this.deps;
  8688. this.deps = this.newDeps;
  8689. this.newDeps = tmp;
  8690. this.newDeps.length = 0;
  8691. };
  8692. /**
  8693. * Subscriber interface.
  8694. * Will be called when a dependency changes.
  8695. */
  8696. Watcher.prototype.update = function update () {
  8697. /* istanbul ignore else */
  8698. if (this.lazy) {
  8699. this.dirty = true;
  8700. } else if (this.sync) {
  8701. this.run();
  8702. } else {
  8703. queueWatcher(this);
  8704. }
  8705. };
  8706. /**
  8707. * Scheduler job interface.
  8708. * Will be called by the scheduler.
  8709. */
  8710. Watcher.prototype.run = function run () {
  8711. if (this.active) {
  8712. var value = this.get();
  8713. if (
  8714. value !== this.value ||
  8715. // Deep watchers and watchers on Object/Arrays should fire even
  8716. // when the value is the same, because the value may
  8717. // have mutated.
  8718. isObject(value) ||
  8719. this.deep
  8720. ) {
  8721. // set new value
  8722. var oldValue = this.value;
  8723. this.value = value;
  8724. if (this.user) {
  8725. try {
  8726. this.cb.call(this.vm, value, oldValue);
  8727. } catch (e) {
  8728. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8729. }
  8730. } else {
  8731. this.cb.call(this.vm, value, oldValue);
  8732. }
  8733. }
  8734. }
  8735. };
  8736. /**
  8737. * Evaluate the value of the watcher.
  8738. * This only gets called for lazy watchers.
  8739. */
  8740. Watcher.prototype.evaluate = function evaluate () {
  8741. this.value = this.get();
  8742. this.dirty = false;
  8743. };
  8744. /**
  8745. * Depend on all deps collected by this watcher.
  8746. */
  8747. Watcher.prototype.depend = function depend () {
  8748. var i = this.deps.length;
  8749. while (i--) {
  8750. this.deps[i].depend();
  8751. }
  8752. };
  8753. /**
  8754. * Remove self from all dependencies' subscriber list.
  8755. */
  8756. Watcher.prototype.teardown = function teardown () {
  8757. if (this.active) {
  8758. // remove self from vm's watcher list
  8759. // this is a somewhat expensive operation so we skip it
  8760. // if the vm is being destroyed.
  8761. if (!this.vm._isBeingDestroyed) {
  8762. remove(this.vm._watchers, this);
  8763. }
  8764. var i = this.deps.length;
  8765. while (i--) {
  8766. this.deps[i].removeSub(this);
  8767. }
  8768. this.active = false;
  8769. }
  8770. };
  8771. /* */
  8772. var sharedPropertyDefinition = {
  8773. enumerable: true,
  8774. configurable: true,
  8775. get: noop,
  8776. set: noop
  8777. };
  8778. function proxy (target, sourceKey, key) {
  8779. sharedPropertyDefinition.get = function proxyGetter () {
  8780. return this[sourceKey][key]
  8781. };
  8782. sharedPropertyDefinition.set = function proxySetter (val) {
  8783. this[sourceKey][key] = val;
  8784. };
  8785. Object.defineProperty(target, key, sharedPropertyDefinition);
  8786. }
  8787. function initState (vm) {
  8788. vm._watchers = [];
  8789. var opts = vm.$options;
  8790. if (opts.props) { initProps(vm, opts.props); }
  8791. if (opts.methods) { initMethods(vm, opts.methods); }
  8792. if (opts.data) {
  8793. initData(vm);
  8794. } else {
  8795. observe(vm._data = {}, true /* asRootData */);
  8796. }
  8797. if (opts.computed) { initComputed(vm, opts.computed); }
  8798. if (opts.watch && opts.watch !== nativeWatch) {
  8799. initWatch(vm, opts.watch);
  8800. }
  8801. }
  8802. function initProps (vm, propsOptions) {
  8803. var propsData = vm.$options.propsData || {};
  8804. var props = vm._props = {};
  8805. // cache prop keys so that future props updates can iterate using Array
  8806. // instead of dynamic object key enumeration.
  8807. var keys = vm.$options._propKeys = [];
  8808. var isRoot = !vm.$parent;
  8809. // root instance props should be converted
  8810. if (!isRoot) {
  8811. toggleObserving(false);
  8812. }
  8813. var loop = function ( key ) {
  8814. keys.push(key);
  8815. var value = validateProp(key, propsOptions, propsData, vm);
  8816. /* istanbul ignore else */
  8817. if (true) {
  8818. var hyphenatedKey = hyphenate(key);
  8819. if (isReservedAttribute(hyphenatedKey) ||
  8820. config.isReservedAttr(hyphenatedKey)) {
  8821. warn(
  8822. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8823. vm
  8824. );
  8825. }
  8826. defineReactive$$1(props, key, value, function () {
  8827. if (!isRoot && !isUpdatingChildComponent) {
  8828. {
  8829. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  8830. return
  8831. }
  8832. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8833. if(
  8834. key === 'value' &&
  8835. Array.isArray(vm.$options.behaviors) &&
  8836. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8837. ){
  8838. return
  8839. }
  8840. if(vm._getFormData){
  8841. return
  8842. }
  8843. var $parent = vm.$parent;
  8844. while($parent){
  8845. if($parent.__next_tick_pending){
  8846. return
  8847. }
  8848. $parent = $parent.$parent;
  8849. }
  8850. }
  8851. warn(
  8852. "Avoid mutating a prop directly since the value will be " +
  8853. "overwritten whenever the parent component re-renders. " +
  8854. "Instead, use a data or computed property based on the prop's " +
  8855. "value. Prop being mutated: \"" + key + "\"",
  8856. vm
  8857. );
  8858. }
  8859. });
  8860. } else {}
  8861. // static props are already proxied on the component's prototype
  8862. // during Vue.extend(). We only need to proxy props defined at
  8863. // instantiation here.
  8864. if (!(key in vm)) {
  8865. proxy(vm, "_props", key);
  8866. }
  8867. };
  8868. for (var key in propsOptions) loop( key );
  8869. toggleObserving(true);
  8870. }
  8871. function initData (vm) {
  8872. var data = vm.$options.data;
  8873. data = vm._data = typeof data === 'function'
  8874. ? getData(data, vm)
  8875. : data || {};
  8876. if (!isPlainObject(data)) {
  8877. data = {};
  8878. true && warn(
  8879. 'data functions should return an object:\n' +
  8880. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8881. vm
  8882. );
  8883. }
  8884. // proxy data on instance
  8885. var keys = Object.keys(data);
  8886. var props = vm.$options.props;
  8887. var methods = vm.$options.methods;
  8888. var i = keys.length;
  8889. while (i--) {
  8890. var key = keys[i];
  8891. if (true) {
  8892. if (methods && hasOwn(methods, key)) {
  8893. warn(
  8894. ("Method \"" + key + "\" has already been defined as a data property."),
  8895. vm
  8896. );
  8897. }
  8898. }
  8899. if (props && hasOwn(props, key)) {
  8900. true && warn(
  8901. "The data property \"" + key + "\" is already declared as a prop. " +
  8902. "Use prop default value instead.",
  8903. vm
  8904. );
  8905. } else if (!isReserved(key)) {
  8906. proxy(vm, "_data", key);
  8907. }
  8908. }
  8909. // observe data
  8910. observe(data, true /* asRootData */);
  8911. }
  8912. function getData (data, vm) {
  8913. // #7573 disable dep collection when invoking data getters
  8914. pushTarget();
  8915. try {
  8916. return data.call(vm, vm)
  8917. } catch (e) {
  8918. handleError(e, vm, "data()");
  8919. return {}
  8920. } finally {
  8921. popTarget();
  8922. }
  8923. }
  8924. var computedWatcherOptions = { lazy: true };
  8925. function initComputed (vm, computed) {
  8926. // $flow-disable-line
  8927. var watchers = vm._computedWatchers = Object.create(null);
  8928. // computed properties are just getters during SSR
  8929. var isSSR = isServerRendering();
  8930. for (var key in computed) {
  8931. var userDef = computed[key];
  8932. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8933. if ( true && getter == null) {
  8934. warn(
  8935. ("Getter is missing for computed property \"" + key + "\"."),
  8936. vm
  8937. );
  8938. }
  8939. if (!isSSR) {
  8940. // create internal watcher for the computed property.
  8941. watchers[key] = new Watcher(
  8942. vm,
  8943. getter || noop,
  8944. noop,
  8945. computedWatcherOptions
  8946. );
  8947. }
  8948. // component-defined computed properties are already defined on the
  8949. // component prototype. We only need to define computed properties defined
  8950. // at instantiation here.
  8951. if (!(key in vm)) {
  8952. defineComputed(vm, key, userDef);
  8953. } else if (true) {
  8954. if (key in vm.$data) {
  8955. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8956. } else if (vm.$options.props && key in vm.$options.props) {
  8957. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8958. }
  8959. }
  8960. }
  8961. }
  8962. function defineComputed (
  8963. target,
  8964. key,
  8965. userDef
  8966. ) {
  8967. var shouldCache = !isServerRendering();
  8968. if (typeof userDef === 'function') {
  8969. sharedPropertyDefinition.get = shouldCache
  8970. ? createComputedGetter(key)
  8971. : createGetterInvoker(userDef);
  8972. sharedPropertyDefinition.set = noop;
  8973. } else {
  8974. sharedPropertyDefinition.get = userDef.get
  8975. ? shouldCache && userDef.cache !== false
  8976. ? createComputedGetter(key)
  8977. : createGetterInvoker(userDef.get)
  8978. : noop;
  8979. sharedPropertyDefinition.set = userDef.set || noop;
  8980. }
  8981. if ( true &&
  8982. sharedPropertyDefinition.set === noop) {
  8983. sharedPropertyDefinition.set = function () {
  8984. warn(
  8985. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8986. this
  8987. );
  8988. };
  8989. }
  8990. Object.defineProperty(target, key, sharedPropertyDefinition);
  8991. }
  8992. function createComputedGetter (key) {
  8993. return function computedGetter () {
  8994. var watcher = this._computedWatchers && this._computedWatchers[key];
  8995. if (watcher) {
  8996. if (watcher.dirty) {
  8997. watcher.evaluate();
  8998. }
  8999. if (Dep.SharedObject.target) {// fixed by xxxxxx
  9000. watcher.depend();
  9001. }
  9002. return watcher.value
  9003. }
  9004. }
  9005. }
  9006. function createGetterInvoker(fn) {
  9007. return function computedGetter () {
  9008. return fn.call(this, this)
  9009. }
  9010. }
  9011. function initMethods (vm, methods) {
  9012. var props = vm.$options.props;
  9013. for (var key in methods) {
  9014. if (true) {
  9015. if (typeof methods[key] !== 'function') {
  9016. warn(
  9017. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  9018. "Did you reference the function correctly?",
  9019. vm
  9020. );
  9021. }
  9022. if (props && hasOwn(props, key)) {
  9023. warn(
  9024. ("Method \"" + key + "\" has already been defined as a prop."),
  9025. vm
  9026. );
  9027. }
  9028. if ((key in vm) && isReserved(key)) {
  9029. warn(
  9030. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  9031. "Avoid defining component methods that start with _ or $."
  9032. );
  9033. }
  9034. }
  9035. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  9036. }
  9037. }
  9038. function initWatch (vm, watch) {
  9039. for (var key in watch) {
  9040. var handler = watch[key];
  9041. if (Array.isArray(handler)) {
  9042. for (var i = 0; i < handler.length; i++) {
  9043. createWatcher(vm, key, handler[i]);
  9044. }
  9045. } else {
  9046. createWatcher(vm, key, handler);
  9047. }
  9048. }
  9049. }
  9050. function createWatcher (
  9051. vm,
  9052. expOrFn,
  9053. handler,
  9054. options
  9055. ) {
  9056. if (isPlainObject(handler)) {
  9057. options = handler;
  9058. handler = handler.handler;
  9059. }
  9060. if (typeof handler === 'string') {
  9061. handler = vm[handler];
  9062. }
  9063. return vm.$watch(expOrFn, handler, options)
  9064. }
  9065. function stateMixin (Vue) {
  9066. // flow somehow has problems with directly declared definition object
  9067. // when using Object.defineProperty, so we have to procedurally build up
  9068. // the object here.
  9069. var dataDef = {};
  9070. dataDef.get = function () { return this._data };
  9071. var propsDef = {};
  9072. propsDef.get = function () { return this._props };
  9073. if (true) {
  9074. dataDef.set = function () {
  9075. warn(
  9076. 'Avoid replacing instance root $data. ' +
  9077. 'Use nested data properties instead.',
  9078. this
  9079. );
  9080. };
  9081. propsDef.set = function () {
  9082. warn("$props is readonly.", this);
  9083. };
  9084. }
  9085. Object.defineProperty(Vue.prototype, '$data', dataDef);
  9086. Object.defineProperty(Vue.prototype, '$props', propsDef);
  9087. Vue.prototype.$set = set;
  9088. Vue.prototype.$delete = del;
  9089. Vue.prototype.$watch = function (
  9090. expOrFn,
  9091. cb,
  9092. options
  9093. ) {
  9094. var vm = this;
  9095. if (isPlainObject(cb)) {
  9096. return createWatcher(vm, expOrFn, cb, options)
  9097. }
  9098. options = options || {};
  9099. options.user = true;
  9100. var watcher = new Watcher(vm, expOrFn, cb, options);
  9101. if (options.immediate) {
  9102. try {
  9103. cb.call(vm, watcher.value);
  9104. } catch (error) {
  9105. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  9106. }
  9107. }
  9108. return function unwatchFn () {
  9109. watcher.teardown();
  9110. }
  9111. };
  9112. }
  9113. /* */
  9114. var uid$3 = 0;
  9115. function initMixin (Vue) {
  9116. Vue.prototype._init = function (options) {
  9117. var vm = this;
  9118. // a uid
  9119. vm._uid = uid$3++;
  9120. var startTag, endTag;
  9121. /* istanbul ignore if */
  9122. if ( true && config.performance && mark) {
  9123. startTag = "vue-perf-start:" + (vm._uid);
  9124. endTag = "vue-perf-end:" + (vm._uid);
  9125. mark(startTag);
  9126. }
  9127. // a flag to avoid this being observed
  9128. vm._isVue = true;
  9129. // merge options
  9130. if (options && options._isComponent) {
  9131. // optimize internal component instantiation
  9132. // since dynamic options merging is pretty slow, and none of the
  9133. // internal component options needs special treatment.
  9134. initInternalComponent(vm, options);
  9135. } else {
  9136. vm.$options = mergeOptions(
  9137. resolveConstructorOptions(vm.constructor),
  9138. options || {},
  9139. vm
  9140. );
  9141. }
  9142. /* istanbul ignore else */
  9143. if (true) {
  9144. initProxy(vm);
  9145. } else {}
  9146. // expose real self
  9147. vm._self = vm;
  9148. initLifecycle(vm);
  9149. initEvents(vm);
  9150. initRender(vm);
  9151. callHook(vm, 'beforeCreate');
  9152. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  9153. initState(vm);
  9154. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  9155. !vm._$fallback && callHook(vm, 'created');
  9156. /* istanbul ignore if */
  9157. if ( true && config.performance && mark) {
  9158. vm._name = formatComponentName(vm, false);
  9159. mark(endTag);
  9160. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  9161. }
  9162. if (vm.$options.el) {
  9163. vm.$mount(vm.$options.el);
  9164. }
  9165. };
  9166. }
  9167. function initInternalComponent (vm, options) {
  9168. var opts = vm.$options = Object.create(vm.constructor.options);
  9169. // doing this because it's faster than dynamic enumeration.
  9170. var parentVnode = options._parentVnode;
  9171. opts.parent = options.parent;
  9172. opts._parentVnode = parentVnode;
  9173. var vnodeComponentOptions = parentVnode.componentOptions;
  9174. opts.propsData = vnodeComponentOptions.propsData;
  9175. opts._parentListeners = vnodeComponentOptions.listeners;
  9176. opts._renderChildren = vnodeComponentOptions.children;
  9177. opts._componentTag = vnodeComponentOptions.tag;
  9178. if (options.render) {
  9179. opts.render = options.render;
  9180. opts.staticRenderFns = options.staticRenderFns;
  9181. }
  9182. }
  9183. function resolveConstructorOptions (Ctor) {
  9184. var options = Ctor.options;
  9185. if (Ctor.super) {
  9186. var superOptions = resolveConstructorOptions(Ctor.super);
  9187. var cachedSuperOptions = Ctor.superOptions;
  9188. if (superOptions !== cachedSuperOptions) {
  9189. // super option changed,
  9190. // need to resolve new options.
  9191. Ctor.superOptions = superOptions;
  9192. // check if there are any late-modified/attached options (#4976)
  9193. var modifiedOptions = resolveModifiedOptions(Ctor);
  9194. // update base extend options
  9195. if (modifiedOptions) {
  9196. extend(Ctor.extendOptions, modifiedOptions);
  9197. }
  9198. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  9199. if (options.name) {
  9200. options.components[options.name] = Ctor;
  9201. }
  9202. }
  9203. }
  9204. return options
  9205. }
  9206. function resolveModifiedOptions (Ctor) {
  9207. var modified;
  9208. var latest = Ctor.options;
  9209. var sealed = Ctor.sealedOptions;
  9210. for (var key in latest) {
  9211. if (latest[key] !== sealed[key]) {
  9212. if (!modified) { modified = {}; }
  9213. modified[key] = latest[key];
  9214. }
  9215. }
  9216. return modified
  9217. }
  9218. function Vue (options) {
  9219. if ( true &&
  9220. !(this instanceof Vue)
  9221. ) {
  9222. warn('Vue is a constructor and should be called with the `new` keyword');
  9223. }
  9224. this._init(options);
  9225. }
  9226. initMixin(Vue);
  9227. stateMixin(Vue);
  9228. eventsMixin(Vue);
  9229. lifecycleMixin(Vue);
  9230. renderMixin(Vue);
  9231. /* */
  9232. function initUse (Vue) {
  9233. Vue.use = function (plugin) {
  9234. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  9235. if (installedPlugins.indexOf(plugin) > -1) {
  9236. return this
  9237. }
  9238. // additional parameters
  9239. var args = toArray(arguments, 1);
  9240. args.unshift(this);
  9241. if (typeof plugin.install === 'function') {
  9242. plugin.install.apply(plugin, args);
  9243. } else if (typeof plugin === 'function') {
  9244. plugin.apply(null, args);
  9245. }
  9246. installedPlugins.push(plugin);
  9247. return this
  9248. };
  9249. }
  9250. /* */
  9251. function initMixin$1 (Vue) {
  9252. Vue.mixin = function (mixin) {
  9253. this.options = mergeOptions(this.options, mixin);
  9254. return this
  9255. };
  9256. }
  9257. /* */
  9258. function initExtend (Vue) {
  9259. /**
  9260. * Each instance constructor, including Vue, has a unique
  9261. * cid. This enables us to create wrapped "child
  9262. * constructors" for prototypal inheritance and cache them.
  9263. */
  9264. Vue.cid = 0;
  9265. var cid = 1;
  9266. /**
  9267. * Class inheritance
  9268. */
  9269. Vue.extend = function (extendOptions) {
  9270. extendOptions = extendOptions || {};
  9271. var Super = this;
  9272. var SuperId = Super.cid;
  9273. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9274. if (cachedCtors[SuperId]) {
  9275. return cachedCtors[SuperId]
  9276. }
  9277. var name = extendOptions.name || Super.options.name;
  9278. if ( true && name) {
  9279. validateComponentName(name);
  9280. }
  9281. var Sub = function VueComponent (options) {
  9282. this._init(options);
  9283. };
  9284. Sub.prototype = Object.create(Super.prototype);
  9285. Sub.prototype.constructor = Sub;
  9286. Sub.cid = cid++;
  9287. Sub.options = mergeOptions(
  9288. Super.options,
  9289. extendOptions
  9290. );
  9291. Sub['super'] = Super;
  9292. // For props and computed properties, we define the proxy getters on
  9293. // the Vue instances at extension time, on the extended prototype. This
  9294. // avoids Object.defineProperty calls for each instance created.
  9295. if (Sub.options.props) {
  9296. initProps$1(Sub);
  9297. }
  9298. if (Sub.options.computed) {
  9299. initComputed$1(Sub);
  9300. }
  9301. // allow further extension/mixin/plugin usage
  9302. Sub.extend = Super.extend;
  9303. Sub.mixin = Super.mixin;
  9304. Sub.use = Super.use;
  9305. // create asset registers, so extended classes
  9306. // can have their private assets too.
  9307. ASSET_TYPES.forEach(function (type) {
  9308. Sub[type] = Super[type];
  9309. });
  9310. // enable recursive self-lookup
  9311. if (name) {
  9312. Sub.options.components[name] = Sub;
  9313. }
  9314. // keep a reference to the super options at extension time.
  9315. // later at instantiation we can check if Super's options have
  9316. // been updated.
  9317. Sub.superOptions = Super.options;
  9318. Sub.extendOptions = extendOptions;
  9319. Sub.sealedOptions = extend({}, Sub.options);
  9320. // cache constructor
  9321. cachedCtors[SuperId] = Sub;
  9322. return Sub
  9323. };
  9324. }
  9325. function initProps$1 (Comp) {
  9326. var props = Comp.options.props;
  9327. for (var key in props) {
  9328. proxy(Comp.prototype, "_props", key);
  9329. }
  9330. }
  9331. function initComputed$1 (Comp) {
  9332. var computed = Comp.options.computed;
  9333. for (var key in computed) {
  9334. defineComputed(Comp.prototype, key, computed[key]);
  9335. }
  9336. }
  9337. /* */
  9338. function initAssetRegisters (Vue) {
  9339. /**
  9340. * Create asset registration methods.
  9341. */
  9342. ASSET_TYPES.forEach(function (type) {
  9343. Vue[type] = function (
  9344. id,
  9345. definition
  9346. ) {
  9347. if (!definition) {
  9348. return this.options[type + 's'][id]
  9349. } else {
  9350. /* istanbul ignore if */
  9351. if ( true && type === 'component') {
  9352. validateComponentName(id);
  9353. }
  9354. if (type === 'component' && isPlainObject(definition)) {
  9355. definition.name = definition.name || id;
  9356. definition = this.options._base.extend(definition);
  9357. }
  9358. if (type === 'directive' && typeof definition === 'function') {
  9359. definition = { bind: definition, update: definition };
  9360. }
  9361. this.options[type + 's'][id] = definition;
  9362. return definition
  9363. }
  9364. };
  9365. });
  9366. }
  9367. /* */
  9368. function getComponentName (opts) {
  9369. return opts && (opts.Ctor.options.name || opts.tag)
  9370. }
  9371. function matches (pattern, name) {
  9372. if (Array.isArray(pattern)) {
  9373. return pattern.indexOf(name) > -1
  9374. } else if (typeof pattern === 'string') {
  9375. return pattern.split(',').indexOf(name) > -1
  9376. } else if (isRegExp(pattern)) {
  9377. return pattern.test(name)
  9378. }
  9379. /* istanbul ignore next */
  9380. return false
  9381. }
  9382. function pruneCache (keepAliveInstance, filter) {
  9383. var cache = keepAliveInstance.cache;
  9384. var keys = keepAliveInstance.keys;
  9385. var _vnode = keepAliveInstance._vnode;
  9386. for (var key in cache) {
  9387. var cachedNode = cache[key];
  9388. if (cachedNode) {
  9389. var name = getComponentName(cachedNode.componentOptions);
  9390. if (name && !filter(name)) {
  9391. pruneCacheEntry(cache, key, keys, _vnode);
  9392. }
  9393. }
  9394. }
  9395. }
  9396. function pruneCacheEntry (
  9397. cache,
  9398. key,
  9399. keys,
  9400. current
  9401. ) {
  9402. var cached$$1 = cache[key];
  9403. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9404. cached$$1.componentInstance.$destroy();
  9405. }
  9406. cache[key] = null;
  9407. remove(keys, key);
  9408. }
  9409. var patternTypes = [String, RegExp, Array];
  9410. var KeepAlive = {
  9411. name: 'keep-alive',
  9412. abstract: true,
  9413. props: {
  9414. include: patternTypes,
  9415. exclude: patternTypes,
  9416. max: [String, Number]
  9417. },
  9418. created: function created () {
  9419. this.cache = Object.create(null);
  9420. this.keys = [];
  9421. },
  9422. destroyed: function destroyed () {
  9423. for (var key in this.cache) {
  9424. pruneCacheEntry(this.cache, key, this.keys);
  9425. }
  9426. },
  9427. mounted: function mounted () {
  9428. var this$1 = this;
  9429. this.$watch('include', function (val) {
  9430. pruneCache(this$1, function (name) { return matches(val, name); });
  9431. });
  9432. this.$watch('exclude', function (val) {
  9433. pruneCache(this$1, function (name) { return !matches(val, name); });
  9434. });
  9435. },
  9436. render: function render () {
  9437. var slot = this.$slots.default;
  9438. var vnode = getFirstComponentChild(slot);
  9439. var componentOptions = vnode && vnode.componentOptions;
  9440. if (componentOptions) {
  9441. // check pattern
  9442. var name = getComponentName(componentOptions);
  9443. var ref = this;
  9444. var include = ref.include;
  9445. var exclude = ref.exclude;
  9446. if (
  9447. // not included
  9448. (include && (!name || !matches(include, name))) ||
  9449. // excluded
  9450. (exclude && name && matches(exclude, name))
  9451. ) {
  9452. return vnode
  9453. }
  9454. var ref$1 = this;
  9455. var cache = ref$1.cache;
  9456. var keys = ref$1.keys;
  9457. var key = vnode.key == null
  9458. // same constructor may get registered as different local components
  9459. // so cid alone is not enough (#3269)
  9460. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  9461. : vnode.key;
  9462. if (cache[key]) {
  9463. vnode.componentInstance = cache[key].componentInstance;
  9464. // make current key freshest
  9465. remove(keys, key);
  9466. keys.push(key);
  9467. } else {
  9468. cache[key] = vnode;
  9469. keys.push(key);
  9470. // prune oldest entry
  9471. if (this.max && keys.length > parseInt(this.max)) {
  9472. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  9473. }
  9474. }
  9475. vnode.data.keepAlive = true;
  9476. }
  9477. return vnode || (slot && slot[0])
  9478. }
  9479. };
  9480. var builtInComponents = {
  9481. KeepAlive: KeepAlive
  9482. };
  9483. /* */
  9484. function initGlobalAPI (Vue) {
  9485. // config
  9486. var configDef = {};
  9487. configDef.get = function () { return config; };
  9488. if (true) {
  9489. configDef.set = function () {
  9490. warn(
  9491. 'Do not replace the Vue.config object, set individual fields instead.'
  9492. );
  9493. };
  9494. }
  9495. Object.defineProperty(Vue, 'config', configDef);
  9496. // exposed util methods.
  9497. // NOTE: these are not considered part of the public API - avoid relying on
  9498. // them unless you are aware of the risk.
  9499. Vue.util = {
  9500. warn: warn,
  9501. extend: extend,
  9502. mergeOptions: mergeOptions,
  9503. defineReactive: defineReactive$$1
  9504. };
  9505. Vue.set = set;
  9506. Vue.delete = del;
  9507. Vue.nextTick = nextTick;
  9508. // 2.6 explicit observable API
  9509. Vue.observable = function (obj) {
  9510. observe(obj);
  9511. return obj
  9512. };
  9513. Vue.options = Object.create(null);
  9514. ASSET_TYPES.forEach(function (type) {
  9515. Vue.options[type + 's'] = Object.create(null);
  9516. });
  9517. // this is used to identify the "base" constructor to extend all plain-object
  9518. // components with in Weex's multi-instance scenarios.
  9519. Vue.options._base = Vue;
  9520. extend(Vue.options.components, builtInComponents);
  9521. initUse(Vue);
  9522. initMixin$1(Vue);
  9523. initExtend(Vue);
  9524. initAssetRegisters(Vue);
  9525. }
  9526. initGlobalAPI(Vue);
  9527. Object.defineProperty(Vue.prototype, '$isServer', {
  9528. get: isServerRendering
  9529. });
  9530. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9531. get: function get () {
  9532. /* istanbul ignore next */
  9533. return this.$vnode && this.$vnode.ssrContext
  9534. }
  9535. });
  9536. // expose FunctionalRenderContext for ssr runtime helper installation
  9537. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9538. value: FunctionalRenderContext
  9539. });
  9540. Vue.version = '2.6.11';
  9541. /**
  9542. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9543. */
  9544. var ARRAYTYPE = '[object Array]';
  9545. var OBJECTTYPE = '[object Object]';
  9546. // const FUNCTIONTYPE = '[object Function]'
  9547. function diff(current, pre) {
  9548. var result = {};
  9549. syncKeys(current, pre);
  9550. _diff(current, pre, '', result);
  9551. return result
  9552. }
  9553. function syncKeys(current, pre) {
  9554. if (current === pre) { return }
  9555. var rootCurrentType = type(current);
  9556. var rootPreType = type(pre);
  9557. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9558. if(Object.keys(current).length >= Object.keys(pre).length){
  9559. for (var key in pre) {
  9560. var currentValue = current[key];
  9561. if (currentValue === undefined) {
  9562. current[key] = null;
  9563. } else {
  9564. syncKeys(currentValue, pre[key]);
  9565. }
  9566. }
  9567. }
  9568. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9569. if (current.length >= pre.length) {
  9570. pre.forEach(function (item, index) {
  9571. syncKeys(current[index], item);
  9572. });
  9573. }
  9574. }
  9575. }
  9576. function _diff(current, pre, path, result) {
  9577. if (current === pre) { return }
  9578. var rootCurrentType = type(current);
  9579. var rootPreType = type(pre);
  9580. if (rootCurrentType == OBJECTTYPE) {
  9581. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9582. setResult(result, path, current);
  9583. } else {
  9584. var loop = function ( key ) {
  9585. var currentValue = current[key];
  9586. var preValue = pre[key];
  9587. var currentType = type(currentValue);
  9588. var preType = type(preValue);
  9589. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9590. if (currentValue !== pre[key]) {
  9591. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9592. }
  9593. } else if (currentType == ARRAYTYPE) {
  9594. if (preType != ARRAYTYPE) {
  9595. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9596. } else {
  9597. if (currentValue.length < preValue.length) {
  9598. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9599. } else {
  9600. currentValue.forEach(function (item, index) {
  9601. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9602. });
  9603. }
  9604. }
  9605. } else if (currentType == OBJECTTYPE) {
  9606. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9607. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9608. } else {
  9609. for (var subKey in currentValue) {
  9610. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9611. }
  9612. }
  9613. }
  9614. };
  9615. for (var key in current) loop( key );
  9616. }
  9617. } else if (rootCurrentType == ARRAYTYPE) {
  9618. if (rootPreType != ARRAYTYPE) {
  9619. setResult(result, path, current);
  9620. } else {
  9621. if (current.length < pre.length) {
  9622. setResult(result, path, current);
  9623. } else {
  9624. current.forEach(function (item, index) {
  9625. _diff(item, pre[index], path + '[' + index + ']', result);
  9626. });
  9627. }
  9628. }
  9629. } else {
  9630. setResult(result, path, current);
  9631. }
  9632. }
  9633. function setResult(result, k, v) {
  9634. // if (type(v) != FUNCTIONTYPE) {
  9635. result[k] = v;
  9636. // }
  9637. }
  9638. function type(obj) {
  9639. return Object.prototype.toString.call(obj)
  9640. }
  9641. /* */
  9642. function flushCallbacks$1(vm) {
  9643. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9644. if (Object({"VUE_APP_NAME":"台州互联融媒体","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9645. var mpInstance = vm.$scope;
  9646. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9647. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9648. }
  9649. var copies = vm.__next_tick_callbacks.slice(0);
  9650. vm.__next_tick_callbacks.length = 0;
  9651. for (var i = 0; i < copies.length; i++) {
  9652. copies[i]();
  9653. }
  9654. }
  9655. }
  9656. function hasRenderWatcher(vm) {
  9657. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9658. }
  9659. function nextTick$1(vm, cb) {
  9660. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9661. //2.nextTick 之前存在 render watcher
  9662. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9663. if(Object({"VUE_APP_NAME":"台州互联融媒体","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9664. var mpInstance = vm.$scope;
  9665. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9666. ']:nextVueTick');
  9667. }
  9668. return nextTick(cb, vm)
  9669. }else{
  9670. if(Object({"VUE_APP_NAME":"台州互联融媒体","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9671. var mpInstance$1 = vm.$scope;
  9672. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9673. ']:nextMPTick');
  9674. }
  9675. }
  9676. var _resolve;
  9677. if (!vm.__next_tick_callbacks) {
  9678. vm.__next_tick_callbacks = [];
  9679. }
  9680. vm.__next_tick_callbacks.push(function () {
  9681. if (cb) {
  9682. try {
  9683. cb.call(vm);
  9684. } catch (e) {
  9685. handleError(e, vm, 'nextTick');
  9686. }
  9687. } else if (_resolve) {
  9688. _resolve(vm);
  9689. }
  9690. });
  9691. // $flow-disable-line
  9692. if (!cb && typeof Promise !== 'undefined') {
  9693. return new Promise(function (resolve) {
  9694. _resolve = resolve;
  9695. })
  9696. }
  9697. }
  9698. /* */
  9699. function cloneWithData(vm) {
  9700. // 确保当前 vm 所有数据被同步
  9701. var ret = Object.create(null);
  9702. var dataKeys = [].concat(
  9703. Object.keys(vm._data || {}),
  9704. Object.keys(vm._computedWatchers || {}));
  9705. dataKeys.reduce(function(ret, key) {
  9706. ret[key] = vm[key];
  9707. return ret
  9708. }, ret);
  9709. // vue-composition-api
  9710. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9711. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9712. if (rawBindings) {
  9713. Object.keys(rawBindings).forEach(function (key) {
  9714. ret[key] = vm[key];
  9715. });
  9716. }
  9717. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9718. Object.assign(ret, vm.$mp.data || {});
  9719. if (
  9720. Array.isArray(vm.$options.behaviors) &&
  9721. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9722. ) { //form-field
  9723. ret['name'] = vm.name;
  9724. ret['value'] = vm.value;
  9725. }
  9726. return JSON.parse(JSON.stringify(ret))
  9727. }
  9728. var patch = function(oldVnode, vnode) {
  9729. var this$1 = this;
  9730. if (vnode === null) { //destroy
  9731. return
  9732. }
  9733. if (this.mpType === 'page' || this.mpType === 'component') {
  9734. var mpInstance = this.$scope;
  9735. var data = Object.create(null);
  9736. try {
  9737. data = cloneWithData(this);
  9738. } catch (err) {
  9739. console.error(err);
  9740. }
  9741. data.__webviewId__ = mpInstance.data.__webviewId__;
  9742. var mpData = Object.create(null);
  9743. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9744. mpData[key] = mpInstance.data[key];
  9745. });
  9746. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9747. if (Object.keys(diffData).length) {
  9748. if (Object({"VUE_APP_NAME":"台州互联融媒体","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9749. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9750. ']差量更新',
  9751. JSON.stringify(diffData));
  9752. }
  9753. this.__next_tick_pending = true;
  9754. mpInstance.setData(diffData, function () {
  9755. this$1.__next_tick_pending = false;
  9756. flushCallbacks$1(this$1);
  9757. });
  9758. } else {
  9759. flushCallbacks$1(this);
  9760. }
  9761. }
  9762. };
  9763. /* */
  9764. function createEmptyRender() {
  9765. }
  9766. function mountComponent$1(
  9767. vm,
  9768. el,
  9769. hydrating
  9770. ) {
  9771. if (!vm.mpType) {//main.js 中的 new Vue
  9772. return vm
  9773. }
  9774. if (vm.mpType === 'app') {
  9775. vm.$options.render = createEmptyRender;
  9776. }
  9777. if (!vm.$options.render) {
  9778. vm.$options.render = createEmptyRender;
  9779. if (true) {
  9780. /* istanbul ignore if */
  9781. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9782. vm.$options.el || el) {
  9783. warn(
  9784. 'You are using the runtime-only build of Vue where the template ' +
  9785. 'compiler is not available. Either pre-compile the templates into ' +
  9786. 'render functions, or use the compiler-included build.',
  9787. vm
  9788. );
  9789. } else {
  9790. warn(
  9791. 'Failed to mount component: template or render function not defined.',
  9792. vm
  9793. );
  9794. }
  9795. }
  9796. }
  9797. !vm._$fallback && callHook(vm, 'beforeMount');
  9798. var updateComponent = function () {
  9799. vm._update(vm._render(), hydrating);
  9800. };
  9801. // we set this to vm._watcher inside the watcher's constructor
  9802. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9803. // component's mounted hook), which relies on vm._watcher being already defined
  9804. new Watcher(vm, updateComponent, noop, {
  9805. before: function before() {
  9806. if (vm._isMounted && !vm._isDestroyed) {
  9807. callHook(vm, 'beforeUpdate');
  9808. }
  9809. }
  9810. }, true /* isRenderWatcher */);
  9811. hydrating = false;
  9812. return vm
  9813. }
  9814. /* */
  9815. function renderClass (
  9816. staticClass,
  9817. dynamicClass
  9818. ) {
  9819. if (isDef(staticClass) || isDef(dynamicClass)) {
  9820. return concat(staticClass, stringifyClass(dynamicClass))
  9821. }
  9822. /* istanbul ignore next */
  9823. return ''
  9824. }
  9825. function concat (a, b) {
  9826. return a ? b ? (a + ' ' + b) : a : (b || '')
  9827. }
  9828. function stringifyClass (value) {
  9829. if (Array.isArray(value)) {
  9830. return stringifyArray(value)
  9831. }
  9832. if (isObject(value)) {
  9833. return stringifyObject(value)
  9834. }
  9835. if (typeof value === 'string') {
  9836. return value
  9837. }
  9838. /* istanbul ignore next */
  9839. return ''
  9840. }
  9841. function stringifyArray (value) {
  9842. var res = '';
  9843. var stringified;
  9844. for (var i = 0, l = value.length; i < l; i++) {
  9845. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9846. if (res) { res += ' '; }
  9847. res += stringified;
  9848. }
  9849. }
  9850. return res
  9851. }
  9852. function stringifyObject (value) {
  9853. var res = '';
  9854. for (var key in value) {
  9855. if (value[key]) {
  9856. if (res) { res += ' '; }
  9857. res += key;
  9858. }
  9859. }
  9860. return res
  9861. }
  9862. /* */
  9863. var parseStyleText = cached(function (cssText) {
  9864. var res = {};
  9865. var listDelimiter = /;(?![^(]*\))/g;
  9866. var propertyDelimiter = /:(.+)/;
  9867. cssText.split(listDelimiter).forEach(function (item) {
  9868. if (item) {
  9869. var tmp = item.split(propertyDelimiter);
  9870. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9871. }
  9872. });
  9873. return res
  9874. });
  9875. // normalize possible array / string values into Object
  9876. function normalizeStyleBinding (bindingStyle) {
  9877. if (Array.isArray(bindingStyle)) {
  9878. return toObject(bindingStyle)
  9879. }
  9880. if (typeof bindingStyle === 'string') {
  9881. return parseStyleText(bindingStyle)
  9882. }
  9883. return bindingStyle
  9884. }
  9885. /* */
  9886. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9887. function getTarget(obj, path) {
  9888. var parts = path.split('.');
  9889. var key = parts[0];
  9890. if (key.indexOf('__$n') === 0) { //number index
  9891. key = parseInt(key.replace('__$n', ''));
  9892. }
  9893. if (parts.length === 1) {
  9894. return obj[key]
  9895. }
  9896. return getTarget(obj[key], parts.slice(1).join('.'))
  9897. }
  9898. function internalMixin(Vue) {
  9899. Vue.config.errorHandler = function(err, vm, info) {
  9900. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9901. console.error(err);
  9902. /* eslint-disable no-undef */
  9903. var app = typeof getApp === 'function' && getApp();
  9904. if (app && app.onError) {
  9905. app.onError(err);
  9906. }
  9907. };
  9908. var oldEmit = Vue.prototype.$emit;
  9909. Vue.prototype.$emit = function(event) {
  9910. if (this.$scope && event) {
  9911. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  9912. __args__: toArray(arguments, 1)
  9913. });
  9914. }
  9915. return oldEmit.apply(this, arguments)
  9916. };
  9917. Vue.prototype.$nextTick = function(fn) {
  9918. return nextTick$1(this, fn)
  9919. };
  9920. MP_METHODS.forEach(function (method) {
  9921. Vue.prototype[method] = function(args) {
  9922. if (this.$scope && this.$scope[method]) {
  9923. return this.$scope[method](args)
  9924. }
  9925. // mp-alipay
  9926. if (typeof my === 'undefined') {
  9927. return
  9928. }
  9929. if (method === 'createSelectorQuery') {
  9930. /* eslint-disable no-undef */
  9931. return my.createSelectorQuery(args)
  9932. } else if (method === 'createIntersectionObserver') {
  9933. /* eslint-disable no-undef */
  9934. return my.createIntersectionObserver(args)
  9935. }
  9936. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9937. };
  9938. });
  9939. Vue.prototype.__init_provide = initProvide;
  9940. Vue.prototype.__init_injections = initInjections;
  9941. Vue.prototype.__call_hook = function(hook, args) {
  9942. var vm = this;
  9943. // #7573 disable dep collection when invoking lifecycle hooks
  9944. pushTarget();
  9945. var handlers = vm.$options[hook];
  9946. var info = hook + " hook";
  9947. var ret;
  9948. if (handlers) {
  9949. for (var i = 0, j = handlers.length; i < j; i++) {
  9950. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9951. }
  9952. }
  9953. if (vm._hasHookEvent) {
  9954. vm.$emit('hook:' + hook, args);
  9955. }
  9956. popTarget();
  9957. return ret
  9958. };
  9959. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9960. if (Array.isArray(modifiers)) {
  9961. if (modifiers.indexOf('trim') !== -1) {
  9962. value = value.trim();
  9963. }
  9964. if (modifiers.indexOf('number') !== -1) {
  9965. value = this._n(value);
  9966. }
  9967. }
  9968. if (!target) {
  9969. target = this;
  9970. }
  9971. // 解决动态属性添加
  9972. Vue.set(target, key, value);
  9973. };
  9974. Vue.prototype.__set_sync = function(target, key, value) {
  9975. if (!target) {
  9976. target = this;
  9977. }
  9978. // 解决动态属性添加
  9979. Vue.set(target, key, value);
  9980. };
  9981. Vue.prototype.__get_orig = function(item) {
  9982. if (isPlainObject(item)) {
  9983. return item['$orig'] || item
  9984. }
  9985. return item
  9986. };
  9987. Vue.prototype.__get_value = function(dataPath, target) {
  9988. return getTarget(target || this, dataPath)
  9989. };
  9990. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9991. return renderClass(staticClass, dynamicClass)
  9992. };
  9993. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9994. if (!dynamicStyle && !staticStyle) {
  9995. return ''
  9996. }
  9997. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9998. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9999. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  10000. };
  10001. Vue.prototype.__map = function(val, iteratee) {
  10002. //TODO 暂不考虑 string
  10003. var ret, i, l, keys, key;
  10004. if (Array.isArray(val)) {
  10005. ret = new Array(val.length);
  10006. for (i = 0, l = val.length; i < l; i++) {
  10007. ret[i] = iteratee(val[i], i);
  10008. }
  10009. return ret
  10010. } else if (isObject(val)) {
  10011. keys = Object.keys(val);
  10012. ret = Object.create(null);
  10013. for (i = 0, l = keys.length; i < l; i++) {
  10014. key = keys[i];
  10015. ret[key] = iteratee(val[key], key, i);
  10016. }
  10017. return ret
  10018. } else if (typeof val === 'number') {
  10019. ret = new Array(val);
  10020. for (i = 0, l = val; i < l; i++) {
  10021. // 第一个参数暂时仍和小程序一致
  10022. ret[i] = iteratee(i, i);
  10023. }
  10024. return ret
  10025. }
  10026. return []
  10027. };
  10028. }
  10029. /* */
  10030. var LIFECYCLE_HOOKS$1 = [
  10031. //App
  10032. 'onLaunch',
  10033. 'onShow',
  10034. 'onHide',
  10035. 'onUniNViewMessage',
  10036. 'onPageNotFound',
  10037. 'onThemeChange',
  10038. 'onError',
  10039. 'onUnhandledRejection',
  10040. //Page
  10041. 'onInit',
  10042. 'onLoad',
  10043. // 'onShow',
  10044. 'onReady',
  10045. // 'onHide',
  10046. 'onUnload',
  10047. 'onPullDownRefresh',
  10048. 'onReachBottom',
  10049. 'onTabItemTap',
  10050. 'onAddToFavorites',
  10051. 'onShareTimeline',
  10052. 'onShareAppMessage',
  10053. 'onResize',
  10054. 'onPageScroll',
  10055. 'onNavigationBarButtonTap',
  10056. 'onBackPress',
  10057. 'onNavigationBarSearchInputChanged',
  10058. 'onNavigationBarSearchInputConfirmed',
  10059. 'onNavigationBarSearchInputClicked',
  10060. //Component
  10061. // 'onReady', // 兼容旧版本,应该移除该事件
  10062. 'onPageShow',
  10063. 'onPageHide',
  10064. 'onPageResize'
  10065. ];
  10066. function lifecycleMixin$1(Vue) {
  10067. //fixed vue-class-component
  10068. var oldExtend = Vue.extend;
  10069. Vue.extend = function(extendOptions) {
  10070. extendOptions = extendOptions || {};
  10071. var methods = extendOptions.methods;
  10072. if (methods) {
  10073. Object.keys(methods).forEach(function (methodName) {
  10074. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  10075. extendOptions[methodName] = methods[methodName];
  10076. delete methods[methodName];
  10077. }
  10078. });
  10079. }
  10080. return oldExtend.call(this, extendOptions)
  10081. };
  10082. var strategies = Vue.config.optionMergeStrategies;
  10083. var mergeHook = strategies.created;
  10084. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  10085. strategies[hook] = mergeHook;
  10086. });
  10087. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  10088. }
  10089. /* */
  10090. // install platform patch function
  10091. Vue.prototype.__patch__ = patch;
  10092. // public mount method
  10093. Vue.prototype.$mount = function(
  10094. el ,
  10095. hydrating
  10096. ) {
  10097. return mountComponent$1(this, el, hydrating)
  10098. };
  10099. lifecycleMixin$1(Vue);
  10100. internalMixin(Vue);
  10101. /* */
  10102. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  10103. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  10104. /***/ }),
  10105. /***/ 44:
  10106. /*!***********************************************************!*\
  10107. !*** C:/Users/Administrator/Desktop/xmt_new/api/login.js ***!
  10108. \***********************************************************/
  10109. /*! no static exports found */
  10110. /***/ (function(module, exports, __webpack_require__) {
  10111. "use strict";
  10112. Object.defineProperty(exports, "__esModule", { value: true });exports.login = login;exports.register = register;exports.verify = verify;exports.getUserInfo = getUserInfo;exports.loginMobile = loginMobile;exports.bangding = bangding;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10113. // 登录
  10114. function login(data) {
  10115. return (0, _request.default)({
  10116. url: '/api/login',
  10117. method: 'post',
  10118. data: data });
  10119. }
  10120. // 注册
  10121. function register(data) {
  10122. return (0, _request.default)({
  10123. url: '/api/register',
  10124. method: 'post',
  10125. data: data });
  10126. }
  10127. // 验证码
  10128. function verify(data) {
  10129. // type=register为注册
  10130. // type=login为登录
  10131. return (0, _request.default)({
  10132. url: '/api/register/verify',
  10133. method: 'post',
  10134. data: data });
  10135. }
  10136. // 获取用户信息
  10137. function getUserInfo(data) {
  10138. return (0, _request.default)({
  10139. url: '/api/userinfo',
  10140. method: 'get',
  10141. data: data });
  10142. }
  10143. // 短信登录
  10144. function loginMobile(data) {
  10145. return (0, _request.default)({
  10146. url: '/api/login/mobile',
  10147. method: 'post',
  10148. data: data });
  10149. }
  10150. //绑定手机号
  10151. function bangding(data) {
  10152. return (0, _request.default)({
  10153. url: '/api/binding',
  10154. method: 'POST',
  10155. data: data });
  10156. }
  10157. /***/ }),
  10158. /***/ 5:
  10159. /*!*********************************************************!*\
  10160. !*** C:/Users/Administrator/Desktop/xmt_new/pages.json ***!
  10161. \*********************************************************/
  10162. /*! no static exports found */
  10163. /***/ (function(module, exports) {
  10164. /***/ }),
  10165. /***/ 6:
  10166. /*!*************************************************************!*\
  10167. !*** C:/Users/Administrator/Desktop/xmt_new/store/index.js ***!
  10168. \*************************************************************/
  10169. /*! no static exports found */
  10170. /***/ (function(module, exports, __webpack_require__) {
  10171. "use strict";
  10172. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));
  10173. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 7));
  10174. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 8));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10175. _vue.default.use(_vuex.default);
  10176. var store = new _vuex.default.Store({
  10177. namespaced: true,
  10178. state: {
  10179. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  10180. baseURL: '', //请求地址配置
  10181. urlFile: '/index', //项目部署所在文件夹
  10182. userInfo: {}, //登录信息
  10183. loginInterceptor: false, //是否打开强制登录
  10184. weichatInfo: {}, //保存微信注册信息
  10185. weichatObj: '' //微信对象
  10186. },
  10187. mutations: {
  10188. //保存微信信息
  10189. setWeiChatInfo: function setWeiChatInfo(state, provider) {
  10190. state.weichatInfo = provider;
  10191. },
  10192. //保存微信对象
  10193. setWeiChatObj: function setWeiChatObj(state, provider) {
  10194. state.weichatObj = provider;
  10195. },
  10196. setBaseURl: function setBaseURl(state, provider) {
  10197. state.baseURL = provider;
  10198. } },
  10199. modules: {
  10200. user: _user.default },
  10201. actions: {} });var _default =
  10202. store;exports.default = _default;
  10203. /***/ }),
  10204. /***/ 7:
  10205. /*!**************************************************************************************!*\
  10206. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  10207. \**************************************************************************************/
  10208. /*! no static exports found */
  10209. /***/ (function(module, exports, __webpack_require__) {
  10210. "use strict";
  10211. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10212. * vuex v3.6.2
  10213. * (c) 2021 Evan You
  10214. * @license MIT
  10215. */
  10216. function applyMixin (Vue) {
  10217. var version = Number(Vue.version.split('.')[0]);
  10218. if (version >= 2) {
  10219. Vue.mixin({ beforeCreate: vuexInit });
  10220. } else {
  10221. // override init and inject vuex init procedure
  10222. // for 1.x backwards compatibility.
  10223. var _init = Vue.prototype._init;
  10224. Vue.prototype._init = function (options) {
  10225. if ( options === void 0 ) options = {};
  10226. options.init = options.init
  10227. ? [vuexInit].concat(options.init)
  10228. : vuexInit;
  10229. _init.call(this, options);
  10230. };
  10231. }
  10232. /**
  10233. * Vuex init hook, injected into each instances init hooks list.
  10234. */
  10235. function vuexInit () {
  10236. var options = this.$options;
  10237. // store injection
  10238. if (options.store) {
  10239. this.$store = typeof options.store === 'function'
  10240. ? options.store()
  10241. : options.store;
  10242. } else if (options.parent && options.parent.$store) {
  10243. this.$store = options.parent.$store;
  10244. }
  10245. }
  10246. }
  10247. var target = typeof window !== 'undefined'
  10248. ? window
  10249. : typeof global !== 'undefined'
  10250. ? global
  10251. : {};
  10252. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10253. function devtoolPlugin (store) {
  10254. if (!devtoolHook) { return }
  10255. store._devtoolHook = devtoolHook;
  10256. devtoolHook.emit('vuex:init', store);
  10257. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10258. store.replaceState(targetState);
  10259. });
  10260. store.subscribe(function (mutation, state) {
  10261. devtoolHook.emit('vuex:mutation', mutation, state);
  10262. }, { prepend: true });
  10263. store.subscribeAction(function (action, state) {
  10264. devtoolHook.emit('vuex:action', action, state);
  10265. }, { prepend: true });
  10266. }
  10267. /**
  10268. * Get the first item that pass the test
  10269. * by second argument function
  10270. *
  10271. * @param {Array} list
  10272. * @param {Function} f
  10273. * @return {*}
  10274. */
  10275. function find (list, f) {
  10276. return list.filter(f)[0]
  10277. }
  10278. /**
  10279. * Deep copy the given object considering circular structure.
  10280. * This function caches all nested objects and its copies.
  10281. * If it detects circular structure, use cached copy to avoid infinite loop.
  10282. *
  10283. * @param {*} obj
  10284. * @param {Array<Object>} cache
  10285. * @return {*}
  10286. */
  10287. function deepCopy (obj, cache) {
  10288. if ( cache === void 0 ) cache = [];
  10289. // just return if obj is immutable value
  10290. if (obj === null || typeof obj !== 'object') {
  10291. return obj
  10292. }
  10293. // if obj is hit, it is in circular structure
  10294. var hit = find(cache, function (c) { return c.original === obj; });
  10295. if (hit) {
  10296. return hit.copy
  10297. }
  10298. var copy = Array.isArray(obj) ? [] : {};
  10299. // put the copy into cache at first
  10300. // because we want to refer it in recursive deepCopy
  10301. cache.push({
  10302. original: obj,
  10303. copy: copy
  10304. });
  10305. Object.keys(obj).forEach(function (key) {
  10306. copy[key] = deepCopy(obj[key], cache);
  10307. });
  10308. return copy
  10309. }
  10310. /**
  10311. * forEach for object
  10312. */
  10313. function forEachValue (obj, fn) {
  10314. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10315. }
  10316. function isObject (obj) {
  10317. return obj !== null && typeof obj === 'object'
  10318. }
  10319. function isPromise (val) {
  10320. return val && typeof val.then === 'function'
  10321. }
  10322. function assert (condition, msg) {
  10323. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10324. }
  10325. function partial (fn, arg) {
  10326. return function () {
  10327. return fn(arg)
  10328. }
  10329. }
  10330. // Base data struct for store's module, package with some attribute and method
  10331. var Module = function Module (rawModule, runtime) {
  10332. this.runtime = runtime;
  10333. // Store some children item
  10334. this._children = Object.create(null);
  10335. // Store the origin module object which passed by programmer
  10336. this._rawModule = rawModule;
  10337. var rawState = rawModule.state;
  10338. // Store the origin module's state
  10339. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10340. };
  10341. var prototypeAccessors = { namespaced: { configurable: true } };
  10342. prototypeAccessors.namespaced.get = function () {
  10343. return !!this._rawModule.namespaced
  10344. };
  10345. Module.prototype.addChild = function addChild (key, module) {
  10346. this._children[key] = module;
  10347. };
  10348. Module.prototype.removeChild = function removeChild (key) {
  10349. delete this._children[key];
  10350. };
  10351. Module.prototype.getChild = function getChild (key) {
  10352. return this._children[key]
  10353. };
  10354. Module.prototype.hasChild = function hasChild (key) {
  10355. return key in this._children
  10356. };
  10357. Module.prototype.update = function update (rawModule) {
  10358. this._rawModule.namespaced = rawModule.namespaced;
  10359. if (rawModule.actions) {
  10360. this._rawModule.actions = rawModule.actions;
  10361. }
  10362. if (rawModule.mutations) {
  10363. this._rawModule.mutations = rawModule.mutations;
  10364. }
  10365. if (rawModule.getters) {
  10366. this._rawModule.getters = rawModule.getters;
  10367. }
  10368. };
  10369. Module.prototype.forEachChild = function forEachChild (fn) {
  10370. forEachValue(this._children, fn);
  10371. };
  10372. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10373. if (this._rawModule.getters) {
  10374. forEachValue(this._rawModule.getters, fn);
  10375. }
  10376. };
  10377. Module.prototype.forEachAction = function forEachAction (fn) {
  10378. if (this._rawModule.actions) {
  10379. forEachValue(this._rawModule.actions, fn);
  10380. }
  10381. };
  10382. Module.prototype.forEachMutation = function forEachMutation (fn) {
  10383. if (this._rawModule.mutations) {
  10384. forEachValue(this._rawModule.mutations, fn);
  10385. }
  10386. };
  10387. Object.defineProperties( Module.prototype, prototypeAccessors );
  10388. var ModuleCollection = function ModuleCollection (rawRootModule) {
  10389. // register root module (Vuex.Store options)
  10390. this.register([], rawRootModule, false);
  10391. };
  10392. ModuleCollection.prototype.get = function get (path) {
  10393. return path.reduce(function (module, key) {
  10394. return module.getChild(key)
  10395. }, this.root)
  10396. };
  10397. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  10398. var module = this.root;
  10399. return path.reduce(function (namespace, key) {
  10400. module = module.getChild(key);
  10401. return namespace + (module.namespaced ? key + '/' : '')
  10402. }, '')
  10403. };
  10404. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  10405. update([], this.root, rawRootModule);
  10406. };
  10407. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  10408. var this$1 = this;
  10409. if ( runtime === void 0 ) runtime = true;
  10410. if ((true)) {
  10411. assertRawModule(path, rawModule);
  10412. }
  10413. var newModule = new Module(rawModule, runtime);
  10414. if (path.length === 0) {
  10415. this.root = newModule;
  10416. } else {
  10417. var parent = this.get(path.slice(0, -1));
  10418. parent.addChild(path[path.length - 1], newModule);
  10419. }
  10420. // register nested modules
  10421. if (rawModule.modules) {
  10422. forEachValue(rawModule.modules, function (rawChildModule, key) {
  10423. this$1.register(path.concat(key), rawChildModule, runtime);
  10424. });
  10425. }
  10426. };
  10427. ModuleCollection.prototype.unregister = function unregister (path) {
  10428. var parent = this.get(path.slice(0, -1));
  10429. var key = path[path.length - 1];
  10430. var child = parent.getChild(key);
  10431. if (!child) {
  10432. if ((true)) {
  10433. console.warn(
  10434. "[vuex] trying to unregister module '" + key + "', which is " +
  10435. "not registered"
  10436. );
  10437. }
  10438. return
  10439. }
  10440. if (!child.runtime) {
  10441. return
  10442. }
  10443. parent.removeChild(key);
  10444. };
  10445. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  10446. var parent = this.get(path.slice(0, -1));
  10447. var key = path[path.length - 1];
  10448. if (parent) {
  10449. return parent.hasChild(key)
  10450. }
  10451. return false
  10452. };
  10453. function update (path, targetModule, newModule) {
  10454. if ((true)) {
  10455. assertRawModule(path, newModule);
  10456. }
  10457. // update target module
  10458. targetModule.update(newModule);
  10459. // update nested modules
  10460. if (newModule.modules) {
  10461. for (var key in newModule.modules) {
  10462. if (!targetModule.getChild(key)) {
  10463. if ((true)) {
  10464. console.warn(
  10465. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  10466. 'manual reload is needed'
  10467. );
  10468. }
  10469. return
  10470. }
  10471. update(
  10472. path.concat(key),
  10473. targetModule.getChild(key),
  10474. newModule.modules[key]
  10475. );
  10476. }
  10477. }
  10478. }
  10479. var functionAssert = {
  10480. assert: function (value) { return typeof value === 'function'; },
  10481. expected: 'function'
  10482. };
  10483. var objectAssert = {
  10484. assert: function (value) { return typeof value === 'function' ||
  10485. (typeof value === 'object' && typeof value.handler === 'function'); },
  10486. expected: 'function or object with "handler" function'
  10487. };
  10488. var assertTypes = {
  10489. getters: functionAssert,
  10490. mutations: functionAssert,
  10491. actions: objectAssert
  10492. };
  10493. function assertRawModule (path, rawModule) {
  10494. Object.keys(assertTypes).forEach(function (key) {
  10495. if (!rawModule[key]) { return }
  10496. var assertOptions = assertTypes[key];
  10497. forEachValue(rawModule[key], function (value, type) {
  10498. assert(
  10499. assertOptions.assert(value),
  10500. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  10501. );
  10502. });
  10503. });
  10504. }
  10505. function makeAssertionMessage (path, key, type, value, expected) {
  10506. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  10507. if (path.length > 0) {
  10508. buf += " in module \"" + (path.join('.')) + "\"";
  10509. }
  10510. buf += " is " + (JSON.stringify(value)) + ".";
  10511. return buf
  10512. }
  10513. var Vue; // bind on install
  10514. var Store = function Store (options) {
  10515. var this$1 = this;
  10516. if ( options === void 0 ) options = {};
  10517. // Auto install if it is not done yet and `window` has `Vue`.
  10518. // To allow users to avoid auto-installation in some cases,
  10519. // this code should be placed here. See #731
  10520. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  10521. install(window.Vue);
  10522. }
  10523. if ((true)) {
  10524. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  10525. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  10526. assert(this instanceof Store, "store must be called with the new operator.");
  10527. }
  10528. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  10529. var strict = options.strict; if ( strict === void 0 ) strict = false;
  10530. // store internal state
  10531. this._committing = false;
  10532. this._actions = Object.create(null);
  10533. this._actionSubscribers = [];
  10534. this._mutations = Object.create(null);
  10535. this._wrappedGetters = Object.create(null);
  10536. this._modules = new ModuleCollection(options);
  10537. this._modulesNamespaceMap = Object.create(null);
  10538. this._subscribers = [];
  10539. this._watcherVM = new Vue();
  10540. this._makeLocalGettersCache = Object.create(null);
  10541. // bind commit and dispatch to self
  10542. var store = this;
  10543. var ref = this;
  10544. var dispatch = ref.dispatch;
  10545. var commit = ref.commit;
  10546. this.dispatch = function boundDispatch (type, payload) {
  10547. return dispatch.call(store, type, payload)
  10548. };
  10549. this.commit = function boundCommit (type, payload, options) {
  10550. return commit.call(store, type, payload, options)
  10551. };
  10552. // strict mode
  10553. this.strict = strict;
  10554. var state = this._modules.root.state;
  10555. // init root module.
  10556. // this also recursively registers all sub-modules
  10557. // and collects all module getters inside this._wrappedGetters
  10558. installModule(this, state, [], this._modules.root);
  10559. // initialize the store vm, which is responsible for the reactivity
  10560. // (also registers _wrappedGetters as computed properties)
  10561. resetStoreVM(this, state);
  10562. // apply plugins
  10563. plugins.forEach(function (plugin) { return plugin(this$1); });
  10564. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  10565. if (useDevtools) {
  10566. devtoolPlugin(this);
  10567. }
  10568. };
  10569. var prototypeAccessors$1 = { state: { configurable: true } };
  10570. prototypeAccessors$1.state.get = function () {
  10571. return this._vm._data.$$state
  10572. };
  10573. prototypeAccessors$1.state.set = function (v) {
  10574. if ((true)) {
  10575. assert(false, "use store.replaceState() to explicit replace store state.");
  10576. }
  10577. };
  10578. Store.prototype.commit = function commit (_type, _payload, _options) {
  10579. var this$1 = this;
  10580. // check object-style commit
  10581. var ref = unifyObjectStyle(_type, _payload, _options);
  10582. var type = ref.type;
  10583. var payload = ref.payload;
  10584. var options = ref.options;
  10585. var mutation = { type: type, payload: payload };
  10586. var entry = this._mutations[type];
  10587. if (!entry) {
  10588. if ((true)) {
  10589. console.error(("[vuex] unknown mutation type: " + type));
  10590. }
  10591. return
  10592. }
  10593. this._withCommit(function () {
  10594. entry.forEach(function commitIterator (handler) {
  10595. handler(payload);
  10596. });
  10597. });
  10598. this._subscribers
  10599. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10600. .forEach(function (sub) { return sub(mutation, this$1.state); });
  10601. if (
  10602. ( true) &&
  10603. options && options.silent
  10604. ) {
  10605. console.warn(
  10606. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  10607. 'Use the filter functionality in the vue-devtools'
  10608. );
  10609. }
  10610. };
  10611. Store.prototype.dispatch = function dispatch (_type, _payload) {
  10612. var this$1 = this;
  10613. // check object-style dispatch
  10614. var ref = unifyObjectStyle(_type, _payload);
  10615. var type = ref.type;
  10616. var payload = ref.payload;
  10617. var action = { type: type, payload: payload };
  10618. var entry = this._actions[type];
  10619. if (!entry) {
  10620. if ((true)) {
  10621. console.error(("[vuex] unknown action type: " + type));
  10622. }
  10623. return
  10624. }
  10625. try {
  10626. this._actionSubscribers
  10627. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10628. .filter(function (sub) { return sub.before; })
  10629. .forEach(function (sub) { return sub.before(action, this$1.state); });
  10630. } catch (e) {
  10631. if ((true)) {
  10632. console.warn("[vuex] error in before action subscribers: ");
  10633. console.error(e);
  10634. }
  10635. }
  10636. var result = entry.length > 1
  10637. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  10638. : entry[0](payload);
  10639. return new Promise(function (resolve, reject) {
  10640. result.then(function (res) {
  10641. try {
  10642. this$1._actionSubscribers
  10643. .filter(function (sub) { return sub.after; })
  10644. .forEach(function (sub) { return sub.after(action, this$1.state); });
  10645. } catch (e) {
  10646. if ((true)) {
  10647. console.warn("[vuex] error in after action subscribers: ");
  10648. console.error(e);
  10649. }
  10650. }
  10651. resolve(res);
  10652. }, function (error) {
  10653. try {
  10654. this$1._actionSubscribers
  10655. .filter(function (sub) { return sub.error; })
  10656. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  10657. } catch (e) {
  10658. if ((true)) {
  10659. console.warn("[vuex] error in error action subscribers: ");
  10660. console.error(e);
  10661. }
  10662. }
  10663. reject(error);
  10664. });
  10665. })
  10666. };
  10667. Store.prototype.subscribe = function subscribe (fn, options) {
  10668. return genericSubscribe(fn, this._subscribers, options)
  10669. };
  10670. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  10671. var subs = typeof fn === 'function' ? { before: fn } : fn;
  10672. return genericSubscribe(subs, this._actionSubscribers, options)
  10673. };
  10674. Store.prototype.watch = function watch (getter, cb, options) {
  10675. var this$1 = this;
  10676. if ((true)) {
  10677. assert(typeof getter === 'function', "store.watch only accepts a function.");
  10678. }
  10679. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  10680. };
  10681. Store.prototype.replaceState = function replaceState (state) {
  10682. var this$1 = this;
  10683. this._withCommit(function () {
  10684. this$1._vm._data.$$state = state;
  10685. });
  10686. };
  10687. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  10688. if ( options === void 0 ) options = {};
  10689. if (typeof path === 'string') { path = [path]; }
  10690. if ((true)) {
  10691. assert(Array.isArray(path), "module path must be a string or an Array.");
  10692. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  10693. }
  10694. this._modules.register(path, rawModule);
  10695. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  10696. // reset store to update getters...
  10697. resetStoreVM(this, this.state);
  10698. };
  10699. Store.prototype.unregisterModule = function unregisterModule (path) {
  10700. var this$1 = this;
  10701. if (typeof path === 'string') { path = [path]; }
  10702. if ((true)) {
  10703. assert(Array.isArray(path), "module path must be a string or an Array.");
  10704. }
  10705. this._modules.unregister(path);
  10706. this._withCommit(function () {
  10707. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  10708. Vue.delete(parentState, path[path.length - 1]);
  10709. });
  10710. resetStore(this);
  10711. };
  10712. Store.prototype.hasModule = function hasModule (path) {
  10713. if (typeof path === 'string') { path = [path]; }
  10714. if ((true)) {
  10715. assert(Array.isArray(path), "module path must be a string or an Array.");
  10716. }
  10717. return this._modules.isRegistered(path)
  10718. };
  10719. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  10720. this._modules.update(newOptions);
  10721. resetStore(this, true);
  10722. };
  10723. Store.prototype._withCommit = function _withCommit (fn) {
  10724. var committing = this._committing;
  10725. this._committing = true;
  10726. fn();
  10727. this._committing = committing;
  10728. };
  10729. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  10730. function genericSubscribe (fn, subs, options) {
  10731. if (subs.indexOf(fn) < 0) {
  10732. options && options.prepend
  10733. ? subs.unshift(fn)
  10734. : subs.push(fn);
  10735. }
  10736. return function () {
  10737. var i = subs.indexOf(fn);
  10738. if (i > -1) {
  10739. subs.splice(i, 1);
  10740. }
  10741. }
  10742. }
  10743. function resetStore (store, hot) {
  10744. store._actions = Object.create(null);
  10745. store._mutations = Object.create(null);
  10746. store._wrappedGetters = Object.create(null);
  10747. store._modulesNamespaceMap = Object.create(null);
  10748. var state = store.state;
  10749. // init all modules
  10750. installModule(store, state, [], store._modules.root, true);
  10751. // reset vm
  10752. resetStoreVM(store, state, hot);
  10753. }
  10754. function resetStoreVM (store, state, hot) {
  10755. var oldVm = store._vm;
  10756. // bind store public getters
  10757. store.getters = {};
  10758. // reset local getters cache
  10759. store._makeLocalGettersCache = Object.create(null);
  10760. var wrappedGetters = store._wrappedGetters;
  10761. var computed = {};
  10762. forEachValue(wrappedGetters, function (fn, key) {
  10763. // use computed to leverage its lazy-caching mechanism
  10764. // direct inline function use will lead to closure preserving oldVm.
  10765. // using partial to return function with only arguments preserved in closure environment.
  10766. computed[key] = partial(fn, store);
  10767. Object.defineProperty(store.getters, key, {
  10768. get: function () { return store._vm[key]; },
  10769. enumerable: true // for local getters
  10770. });
  10771. });
  10772. // use a Vue instance to store the state tree
  10773. // suppress warnings just in case the user has added
  10774. // some funky global mixins
  10775. var silent = Vue.config.silent;
  10776. Vue.config.silent = true;
  10777. store._vm = new Vue({
  10778. data: {
  10779. $$state: state
  10780. },
  10781. computed: computed
  10782. });
  10783. Vue.config.silent = silent;
  10784. // enable strict mode for new vm
  10785. if (store.strict) {
  10786. enableStrictMode(store);
  10787. }
  10788. if (oldVm) {
  10789. if (hot) {
  10790. // dispatch changes in all subscribed watchers
  10791. // to force getter re-evaluation for hot reloading.
  10792. store._withCommit(function () {
  10793. oldVm._data.$$state = null;
  10794. });
  10795. }
  10796. Vue.nextTick(function () { return oldVm.$destroy(); });
  10797. }
  10798. }
  10799. function installModule (store, rootState, path, module, hot) {
  10800. var isRoot = !path.length;
  10801. var namespace = store._modules.getNamespace(path);
  10802. // register in namespace map
  10803. if (module.namespaced) {
  10804. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  10805. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  10806. }
  10807. store._modulesNamespaceMap[namespace] = module;
  10808. }
  10809. // set state
  10810. if (!isRoot && !hot) {
  10811. var parentState = getNestedState(rootState, path.slice(0, -1));
  10812. var moduleName = path[path.length - 1];
  10813. store._withCommit(function () {
  10814. if ((true)) {
  10815. if (moduleName in parentState) {
  10816. console.warn(
  10817. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  10818. );
  10819. }
  10820. }
  10821. Vue.set(parentState, moduleName, module.state);
  10822. });
  10823. }
  10824. var local = module.context = makeLocalContext(store, namespace, path);
  10825. module.forEachMutation(function (mutation, key) {
  10826. var namespacedType = namespace + key;
  10827. registerMutation(store, namespacedType, mutation, local);
  10828. });
  10829. module.forEachAction(function (action, key) {
  10830. var type = action.root ? key : namespace + key;
  10831. var handler = action.handler || action;
  10832. registerAction(store, type, handler, local);
  10833. });
  10834. module.forEachGetter(function (getter, key) {
  10835. var namespacedType = namespace + key;
  10836. registerGetter(store, namespacedType, getter, local);
  10837. });
  10838. module.forEachChild(function (child, key) {
  10839. installModule(store, rootState, path.concat(key), child, hot);
  10840. });
  10841. }
  10842. /**
  10843. * make localized dispatch, commit, getters and state
  10844. * if there is no namespace, just use root ones
  10845. */
  10846. function makeLocalContext (store, namespace, path) {
  10847. var noNamespace = namespace === '';
  10848. var local = {
  10849. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  10850. var args = unifyObjectStyle(_type, _payload, _options);
  10851. var payload = args.payload;
  10852. var options = args.options;
  10853. var type = args.type;
  10854. if (!options || !options.root) {
  10855. type = namespace + type;
  10856. if (( true) && !store._actions[type]) {
  10857. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  10858. return
  10859. }
  10860. }
  10861. return store.dispatch(type, payload)
  10862. },
  10863. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  10864. var args = unifyObjectStyle(_type, _payload, _options);
  10865. var payload = args.payload;
  10866. var options = args.options;
  10867. var type = args.type;
  10868. if (!options || !options.root) {
  10869. type = namespace + type;
  10870. if (( true) && !store._mutations[type]) {
  10871. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  10872. return
  10873. }
  10874. }
  10875. store.commit(type, payload, options);
  10876. }
  10877. };
  10878. // getters and state object must be gotten lazily
  10879. // because they will be changed by vm update
  10880. Object.defineProperties(local, {
  10881. getters: {
  10882. get: noNamespace
  10883. ? function () { return store.getters; }
  10884. : function () { return makeLocalGetters(store, namespace); }
  10885. },
  10886. state: {
  10887. get: function () { return getNestedState(store.state, path); }
  10888. }
  10889. });
  10890. return local
  10891. }
  10892. function makeLocalGetters (store, namespace) {
  10893. if (!store._makeLocalGettersCache[namespace]) {
  10894. var gettersProxy = {};
  10895. var splitPos = namespace.length;
  10896. Object.keys(store.getters).forEach(function (type) {
  10897. // skip if the target getter is not match this namespace
  10898. if (type.slice(0, splitPos) !== namespace) { return }
  10899. // extract local getter type
  10900. var localType = type.slice(splitPos);
  10901. // Add a port to the getters proxy.
  10902. // Define as getter property because
  10903. // we do not want to evaluate the getters in this time.
  10904. Object.defineProperty(gettersProxy, localType, {
  10905. get: function () { return store.getters[type]; },
  10906. enumerable: true
  10907. });
  10908. });
  10909. store._makeLocalGettersCache[namespace] = gettersProxy;
  10910. }
  10911. return store._makeLocalGettersCache[namespace]
  10912. }
  10913. function registerMutation (store, type, handler, local) {
  10914. var entry = store._mutations[type] || (store._mutations[type] = []);
  10915. entry.push(function wrappedMutationHandler (payload) {
  10916. handler.call(store, local.state, payload);
  10917. });
  10918. }
  10919. function registerAction (store, type, handler, local) {
  10920. var entry = store._actions[type] || (store._actions[type] = []);
  10921. entry.push(function wrappedActionHandler (payload) {
  10922. var res = handler.call(store, {
  10923. dispatch: local.dispatch,
  10924. commit: local.commit,
  10925. getters: local.getters,
  10926. state: local.state,
  10927. rootGetters: store.getters,
  10928. rootState: store.state
  10929. }, payload);
  10930. if (!isPromise(res)) {
  10931. res = Promise.resolve(res);
  10932. }
  10933. if (store._devtoolHook) {
  10934. return res.catch(function (err) {
  10935. store._devtoolHook.emit('vuex:error', err);
  10936. throw err
  10937. })
  10938. } else {
  10939. return res
  10940. }
  10941. });
  10942. }
  10943. function registerGetter (store, type, rawGetter, local) {
  10944. if (store._wrappedGetters[type]) {
  10945. if ((true)) {
  10946. console.error(("[vuex] duplicate getter key: " + type));
  10947. }
  10948. return
  10949. }
  10950. store._wrappedGetters[type] = function wrappedGetter (store) {
  10951. return rawGetter(
  10952. local.state, // local state
  10953. local.getters, // local getters
  10954. store.state, // root state
  10955. store.getters // root getters
  10956. )
  10957. };
  10958. }
  10959. function enableStrictMode (store) {
  10960. store._vm.$watch(function () { return this._data.$$state }, function () {
  10961. if ((true)) {
  10962. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  10963. }
  10964. }, { deep: true, sync: true });
  10965. }
  10966. function getNestedState (state, path) {
  10967. return path.reduce(function (state, key) { return state[key]; }, state)
  10968. }
  10969. function unifyObjectStyle (type, payload, options) {
  10970. if (isObject(type) && type.type) {
  10971. options = payload;
  10972. payload = type;
  10973. type = type.type;
  10974. }
  10975. if ((true)) {
  10976. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10977. }
  10978. return { type: type, payload: payload, options: options }
  10979. }
  10980. function install (_Vue) {
  10981. if (Vue && _Vue === Vue) {
  10982. if ((true)) {
  10983. console.error(
  10984. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10985. );
  10986. }
  10987. return
  10988. }
  10989. Vue = _Vue;
  10990. applyMixin(Vue);
  10991. }
  10992. /**
  10993. * Reduce the code which written in Vue.js for getting the state.
  10994. * @param {String} [namespace] - Module's namespace
  10995. * @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.
  10996. * @param {Object}
  10997. */
  10998. var mapState = normalizeNamespace(function (namespace, states) {
  10999. var res = {};
  11000. if (( true) && !isValidMap(states)) {
  11001. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  11002. }
  11003. normalizeMap(states).forEach(function (ref) {
  11004. var key = ref.key;
  11005. var val = ref.val;
  11006. res[key] = function mappedState () {
  11007. var state = this.$store.state;
  11008. var getters = this.$store.getters;
  11009. if (namespace) {
  11010. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  11011. if (!module) {
  11012. return
  11013. }
  11014. state = module.context.state;
  11015. getters = module.context.getters;
  11016. }
  11017. return typeof val === 'function'
  11018. ? val.call(this, state, getters)
  11019. : state[val]
  11020. };
  11021. // mark vuex getter for devtools
  11022. res[key].vuex = true;
  11023. });
  11024. return res
  11025. });
  11026. /**
  11027. * Reduce the code which written in Vue.js for committing the mutation
  11028. * @param {String} [namespace] - Module's namespace
  11029. * @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.
  11030. * @return {Object}
  11031. */
  11032. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  11033. var res = {};
  11034. if (( true) && !isValidMap(mutations)) {
  11035. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  11036. }
  11037. normalizeMap(mutations).forEach(function (ref) {
  11038. var key = ref.key;
  11039. var val = ref.val;
  11040. res[key] = function mappedMutation () {
  11041. var args = [], len = arguments.length;
  11042. while ( len-- ) args[ len ] = arguments[ len ];
  11043. // Get the commit method from store
  11044. var commit = this.$store.commit;
  11045. if (namespace) {
  11046. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  11047. if (!module) {
  11048. return
  11049. }
  11050. commit = module.context.commit;
  11051. }
  11052. return typeof val === 'function'
  11053. ? val.apply(this, [commit].concat(args))
  11054. : commit.apply(this.$store, [val].concat(args))
  11055. };
  11056. });
  11057. return res
  11058. });
  11059. /**
  11060. * Reduce the code which written in Vue.js for getting the getters
  11061. * @param {String} [namespace] - Module's namespace
  11062. * @param {Object|Array} getters
  11063. * @return {Object}
  11064. */
  11065. var mapGetters = normalizeNamespace(function (namespace, getters) {
  11066. var res = {};
  11067. if (( true) && !isValidMap(getters)) {
  11068. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  11069. }
  11070. normalizeMap(getters).forEach(function (ref) {
  11071. var key = ref.key;
  11072. var val = ref.val;
  11073. // The namespace has been mutated by normalizeNamespace
  11074. val = namespace + val;
  11075. res[key] = function mappedGetter () {
  11076. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  11077. return
  11078. }
  11079. if (( true) && !(val in this.$store.getters)) {
  11080. console.error(("[vuex] unknown getter: " + val));
  11081. return
  11082. }
  11083. return this.$store.getters[val]
  11084. };
  11085. // mark vuex getter for devtools
  11086. res[key].vuex = true;
  11087. });
  11088. return res
  11089. });
  11090. /**
  11091. * Reduce the code which written in Vue.js for dispatch the action
  11092. * @param {String} [namespace] - Module's namespace
  11093. * @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.
  11094. * @return {Object}
  11095. */
  11096. var mapActions = normalizeNamespace(function (namespace, actions) {
  11097. var res = {};
  11098. if (( true) && !isValidMap(actions)) {
  11099. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  11100. }
  11101. normalizeMap(actions).forEach(function (ref) {
  11102. var key = ref.key;
  11103. var val = ref.val;
  11104. res[key] = function mappedAction () {
  11105. var args = [], len = arguments.length;
  11106. while ( len-- ) args[ len ] = arguments[ len ];
  11107. // get dispatch function from store
  11108. var dispatch = this.$store.dispatch;
  11109. if (namespace) {
  11110. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  11111. if (!module) {
  11112. return
  11113. }
  11114. dispatch = module.context.dispatch;
  11115. }
  11116. return typeof val === 'function'
  11117. ? val.apply(this, [dispatch].concat(args))
  11118. : dispatch.apply(this.$store, [val].concat(args))
  11119. };
  11120. });
  11121. return res
  11122. });
  11123. /**
  11124. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  11125. * @param {String} namespace
  11126. * @return {Object}
  11127. */
  11128. var createNamespacedHelpers = function (namespace) { return ({
  11129. mapState: mapState.bind(null, namespace),
  11130. mapGetters: mapGetters.bind(null, namespace),
  11131. mapMutations: mapMutations.bind(null, namespace),
  11132. mapActions: mapActions.bind(null, namespace)
  11133. }); };
  11134. /**
  11135. * Normalize the map
  11136. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  11137. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  11138. * @param {Array|Object} map
  11139. * @return {Object}
  11140. */
  11141. function normalizeMap (map) {
  11142. if (!isValidMap(map)) {
  11143. return []
  11144. }
  11145. return Array.isArray(map)
  11146. ? map.map(function (key) { return ({ key: key, val: key }); })
  11147. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  11148. }
  11149. /**
  11150. * Validate whether given map is valid or not
  11151. * @param {*} map
  11152. * @return {Boolean}
  11153. */
  11154. function isValidMap (map) {
  11155. return Array.isArray(map) || isObject(map)
  11156. }
  11157. /**
  11158. * 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.
  11159. * @param {Function} fn
  11160. * @return {Function}
  11161. */
  11162. function normalizeNamespace (fn) {
  11163. return function (namespace, map) {
  11164. if (typeof namespace !== 'string') {
  11165. map = namespace;
  11166. namespace = '';
  11167. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  11168. namespace += '/';
  11169. }
  11170. return fn(namespace, map)
  11171. }
  11172. }
  11173. /**
  11174. * Search a special module from store by namespace. if module not exist, print error message.
  11175. * @param {Object} store
  11176. * @param {String} helper
  11177. * @param {String} namespace
  11178. * @return {Object}
  11179. */
  11180. function getModuleByNamespace (store, helper, namespace) {
  11181. var module = store._modulesNamespaceMap[namespace];
  11182. if (( true) && !module) {
  11183. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  11184. }
  11185. return module
  11186. }
  11187. // Credits: borrowed code from fcomb/redux-logger
  11188. function createLogger (ref) {
  11189. if ( ref === void 0 ) ref = {};
  11190. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  11191. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  11192. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  11193. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  11194. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  11195. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  11196. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  11197. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  11198. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  11199. return function (store) {
  11200. var prevState = deepCopy(store.state);
  11201. if (typeof logger === 'undefined') {
  11202. return
  11203. }
  11204. if (logMutations) {
  11205. store.subscribe(function (mutation, state) {
  11206. var nextState = deepCopy(state);
  11207. if (filter(mutation, prevState, nextState)) {
  11208. var formattedTime = getFormattedTime();
  11209. var formattedMutation = mutationTransformer(mutation);
  11210. var message = "mutation " + (mutation.type) + formattedTime;
  11211. startMessage(logger, message, collapsed);
  11212. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  11213. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  11214. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  11215. endMessage(logger);
  11216. }
  11217. prevState = nextState;
  11218. });
  11219. }
  11220. if (logActions) {
  11221. store.subscribeAction(function (action, state) {
  11222. if (actionFilter(action, state)) {
  11223. var formattedTime = getFormattedTime();
  11224. var formattedAction = actionTransformer(action);
  11225. var message = "action " + (action.type) + formattedTime;
  11226. startMessage(logger, message, collapsed);
  11227. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  11228. endMessage(logger);
  11229. }
  11230. });
  11231. }
  11232. }
  11233. }
  11234. function startMessage (logger, message, collapsed) {
  11235. var startMessage = collapsed
  11236. ? logger.groupCollapsed
  11237. : logger.group;
  11238. // render
  11239. try {
  11240. startMessage.call(logger, message);
  11241. } catch (e) {
  11242. logger.log(message);
  11243. }
  11244. }
  11245. function endMessage (logger) {
  11246. try {
  11247. logger.groupEnd();
  11248. } catch (e) {
  11249. logger.log('—— log end ——');
  11250. }
  11251. }
  11252. function getFormattedTime () {
  11253. var time = new Date();
  11254. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  11255. }
  11256. function repeat (str, times) {
  11257. return (new Array(times + 1)).join(str)
  11258. }
  11259. function pad (num, maxLength) {
  11260. return repeat('0', maxLength - num.toString().length) + num
  11261. }
  11262. var index_cjs = {
  11263. Store: Store,
  11264. install: install,
  11265. version: '3.6.2',
  11266. mapState: mapState,
  11267. mapMutations: mapMutations,
  11268. mapGetters: mapGetters,
  11269. mapActions: mapActions,
  11270. createNamespacedHelpers: createNamespacedHelpers,
  11271. createLogger: createLogger
  11272. };
  11273. module.exports = index_cjs;
  11274. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  11275. /***/ }),
  11276. /***/ 8:
  11277. /*!******************************************************************!*\
  11278. !*** C:/Users/Administrator/Desktop/xmt_new/store/model/user.js ***!
  11279. \******************************************************************/
  11280. /*! no static exports found */
  11281. /***/ (function(module, exports, __webpack_require__) {
  11282. "use strict";
  11283. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  11284. userInfo: {}, //用户信息
  11285. orderInfo: {
  11286. complete_count: 0, //完成
  11287. received_count: 0, //待收货
  11288. unshipped_count: 0, //待发货
  11289. order_count: 0, //订单总数
  11290. unpaid_count: 0 //待付款
  11291. }, //订单信息
  11292. hasLogin: false //是否登录
  11293. };
  11294. var mutations = {
  11295. // 登录
  11296. login: function login(state) {
  11297. state.hasLogin = true;
  11298. },
  11299. // 退出登录
  11300. logout: function logout(state, provider) {
  11301. state.hasLogin = false;
  11302. // 清空基础信息
  11303. state.userInfo = {};
  11304. state.orderInfo = {
  11305. complete_count: 0, //完成
  11306. received_count: 0, //待收货
  11307. unshipped_count: 0, //待发货
  11308. order_count: 0, //订单总数
  11309. unpaid_count: 0 //待付款
  11310. };
  11311. // 清除缓存用户信息
  11312. uni.removeStorage({
  11313. key: 'userInfo' });
  11314. // 清除缓存token
  11315. uni.removeStorage({
  11316. key: 'token' });
  11317. },
  11318. // 保存用户信息
  11319. setUserInfo: function setUserInfo(state, provider) {
  11320. state.userInfo = provider;
  11321. uni.setStorage({ //缓存用户登陆状态
  11322. key: 'userInfo',
  11323. data: provider });
  11324. },
  11325. // 保存订单信息
  11326. setOrderInfo: function setOrderInfo(state, provider) {
  11327. state.orderInfo = provider;
  11328. } };
  11329. var getters = {};var _default =
  11330. {
  11331. namespaced: true,
  11332. state: state,
  11333. mutations: mutations,
  11334. getters: getters };exports.default = _default;
  11335. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11336. /***/ }),
  11337. /***/ 85:
  11338. /*!*********************************************************!*\
  11339. !*** C:/Users/Administrator/Desktop/xmt_new/api/set.js ***!
  11340. \*********************************************************/
  11341. /*! no static exports found */
  11342. /***/ (function(module, exports, __webpack_require__) {
  11343. "use strict";
  11344. Object.defineProperty(exports, "__esModule", { value: true });exports.userEdit = userEdit;exports.logout = logout;exports.registerReset = registerReset;exports.binding = binding;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  11345. // 修改用户信息
  11346. function userEdit(data) {
  11347. return (0, _request.default)({
  11348. url: '/api/user/edit',
  11349. method: 'post',
  11350. data: data });
  11351. }
  11352. //退出登录
  11353. function logout(data) {
  11354. return (0, _request.default)({
  11355. url: '/api/logout',
  11356. method: 'get',
  11357. data: data });
  11358. }
  11359. //修改密码
  11360. function registerReset(data) {
  11361. return (0, _request.default)({
  11362. url: '/api/register/reset',
  11363. method: 'post',
  11364. data: data });
  11365. }
  11366. //绑定手机
  11367. function binding(data) {
  11368. return (0, _request.default)({
  11369. url: '/api/binding',
  11370. method: 'post',
  11371. data: data });
  11372. }
  11373. /***/ })
  11374. }]);
  11375. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map