vendor.js 398 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  10. var _toString = Object.prototype.toString;
  11. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12. function isFn(fn) {
  13. return typeof fn === 'function';
  14. }
  15. function isStr(str) {
  16. return typeof str === 'string';
  17. }
  18. function isPlainObject(obj) {
  19. return _toString.call(obj) === '[object Object]';
  20. }
  21. function hasOwn(obj, key) {
  22. return hasOwnProperty.call(obj, key);
  23. }
  24. function noop() {}
  25. /**
  26. * Create a cached version of a pure function.
  27. */
  28. function cached(fn) {
  29. var cache = Object.create(null);
  30. return function cachedFn(str) {
  31. var hit = cache[str];
  32. return hit || (cache[str] = fn(str));
  33. };
  34. }
  35. /**
  36. * Camelize a hyphen-delimited string.
  37. */
  38. var camelizeRE = /-(\w)/g;
  39. var camelize = cached(function (str) {
  40. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  41. });
  42. var HOOKS = [
  43. 'invoke',
  44. 'success',
  45. 'fail',
  46. 'complete',
  47. 'returnValue'];
  48. var globalInterceptors = {};
  49. var scopedInterceptors = {};
  50. function mergeHook(parentVal, childVal) {
  51. var res = childVal ?
  52. parentVal ?
  53. parentVal.concat(childVal) :
  54. Array.isArray(childVal) ?
  55. childVal : [childVal] :
  56. parentVal;
  57. return res ?
  58. dedupeHooks(res) :
  59. res;
  60. }
  61. function dedupeHooks(hooks) {
  62. var res = [];
  63. for (var i = 0; i < hooks.length; i++) {
  64. if (res.indexOf(hooks[i]) === -1) {
  65. res.push(hooks[i]);
  66. }
  67. }
  68. return res;
  69. }
  70. function removeHook(hooks, hook) {
  71. var index = hooks.indexOf(hook);
  72. if (index !== -1) {
  73. hooks.splice(index, 1);
  74. }
  75. }
  76. function mergeInterceptorHook(interceptor, option) {
  77. Object.keys(option).forEach(function (hook) {
  78. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  79. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  80. }
  81. });
  82. }
  83. function removeInterceptorHook(interceptor, option) {
  84. if (!interceptor || !option) {
  85. return;
  86. }
  87. Object.keys(option).forEach(function (hook) {
  88. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  89. removeHook(interceptor[hook], option[hook]);
  90. }
  91. });
  92. }
  93. function addInterceptor(method, option) {
  94. if (typeof method === 'string' && isPlainObject(option)) {
  95. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  96. } else if (isPlainObject(method)) {
  97. mergeInterceptorHook(globalInterceptors, method);
  98. }
  99. }
  100. function removeInterceptor(method, option) {
  101. if (typeof method === 'string') {
  102. if (isPlainObject(option)) {
  103. removeInterceptorHook(scopedInterceptors[method], option);
  104. } else {
  105. delete scopedInterceptors[method];
  106. }
  107. } else if (isPlainObject(method)) {
  108. removeInterceptorHook(globalInterceptors, method);
  109. }
  110. }
  111. function wrapperHook(hook) {
  112. return function (data) {
  113. return hook(data) || data;
  114. };
  115. }
  116. function isPromise(obj) {
  117. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  118. }
  119. function queue(hooks, data) {
  120. var promise = false;
  121. for (var i = 0; i < hooks.length; i++) {
  122. var hook = hooks[i];
  123. if (promise) {
  124. promise = Promise.resolve(wrapperHook(hook));
  125. } else {
  126. var res = hook(data);
  127. if (isPromise(res)) {
  128. promise = Promise.resolve(res);
  129. }
  130. if (res === false) {
  131. return {
  132. then: function then() {} };
  133. }
  134. }
  135. }
  136. return promise || {
  137. then: function then(callback) {
  138. return callback(data);
  139. } };
  140. }
  141. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  142. ['success', 'fail', 'complete'].forEach(function (name) {
  143. if (Array.isArray(interceptor[name])) {
  144. var oldCallback = options[name];
  145. options[name] = function callbackInterceptor(res) {
  146. queue(interceptor[name], res).then(function (res) {
  147. /* eslint-disable no-mixed-operators */
  148. return isFn(oldCallback) && oldCallback(res) || res;
  149. });
  150. };
  151. }
  152. });
  153. return options;
  154. }
  155. function wrapperReturnValue(method, returnValue) {
  156. var returnValueHooks = [];
  157. if (Array.isArray(globalInterceptors.returnValue)) {
  158. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  159. }
  160. var interceptor = scopedInterceptors[method];
  161. if (interceptor && Array.isArray(interceptor.returnValue)) {
  162. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  163. }
  164. returnValueHooks.forEach(function (hook) {
  165. returnValue = hook(returnValue) || returnValue;
  166. });
  167. return returnValue;
  168. }
  169. function getApiInterceptorHooks(method) {
  170. var interceptor = Object.create(null);
  171. Object.keys(globalInterceptors).forEach(function (hook) {
  172. if (hook !== 'returnValue') {
  173. interceptor[hook] = globalInterceptors[hook].slice();
  174. }
  175. });
  176. var scopedInterceptor = scopedInterceptors[method];
  177. if (scopedInterceptor) {
  178. Object.keys(scopedInterceptor).forEach(function (hook) {
  179. if (hook !== 'returnValue') {
  180. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  181. }
  182. });
  183. }
  184. return interceptor;
  185. }
  186. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  187. var interceptor = getApiInterceptorHooks(method);
  188. if (interceptor && Object.keys(interceptor).length) {
  189. if (Array.isArray(interceptor.invoke)) {
  190. var res = queue(interceptor.invoke, options);
  191. return res.then(function (options) {
  192. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  193. });
  194. } else {
  195. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  196. }
  197. }
  198. return api.apply(void 0, [options].concat(params));
  199. }
  200. var promiseInterceptor = {
  201. returnValue: function returnValue(res) {
  202. if (!isPromise(res)) {
  203. return res;
  204. }
  205. return res.then(function (res) {
  206. return res[1];
  207. }).catch(function (res) {
  208. return res[0];
  209. });
  210. } };
  211. var SYNC_API_RE =
  212. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  213. var CONTEXT_API_RE = /^create|Manager$/;
  214. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  277. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });
  312. function findExistsPageIndex(url) {
  313. var pages = getCurrentPages();
  314. var len = pages.length;
  315. while (len--) {
  316. var page = pages[len];
  317. if (page.$page && page.$page.fullPath === url) {
  318. return len;
  319. }
  320. }
  321. return -1;
  322. }
  323. var redirectTo = {
  324. name: function name(fromArgs) {
  325. if (fromArgs.exists === 'back' && fromArgs.delta) {
  326. return 'navigateBack';
  327. }
  328. return 'redirectTo';
  329. },
  330. args: function args(fromArgs) {
  331. if (fromArgs.exists === 'back' && fromArgs.url) {
  332. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  333. if (existsPageIndex !== -1) {
  334. var delta = getCurrentPages().length - 1 - existsPageIndex;
  335. if (delta > 0) {
  336. fromArgs.delta = delta;
  337. }
  338. }
  339. }
  340. } };
  341. var previewImage = {
  342. args: function args(fromArgs) {
  343. var currentIndex = parseInt(fromArgs.current);
  344. if (isNaN(currentIndex)) {
  345. return;
  346. }
  347. var urls = fromArgs.urls;
  348. if (!Array.isArray(urls)) {
  349. return;
  350. }
  351. var len = urls.length;
  352. if (!len) {
  353. return;
  354. }
  355. if (currentIndex < 0) {
  356. currentIndex = 0;
  357. } else if (currentIndex >= len) {
  358. currentIndex = len - 1;
  359. }
  360. if (currentIndex > 0) {
  361. fromArgs.current = urls[currentIndex];
  362. fromArgs.urls = urls.filter(
  363. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  364. } else {
  365. fromArgs.current = urls[0];
  366. }
  367. return {
  368. indicator: false,
  369. loop: false };
  370. } };
  371. var UUID_KEY = '__DC_STAT_UUID';
  372. var deviceId;
  373. function addUuid(result) {
  374. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  375. if (!deviceId) {
  376. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  377. wx.setStorage({
  378. key: UUID_KEY,
  379. data: deviceId });
  380. }
  381. result.deviceId = deviceId;
  382. }
  383. function addSafeAreaInsets(result) {
  384. if (result.safeArea) {
  385. var safeArea = result.safeArea;
  386. result.safeAreaInsets = {
  387. top: safeArea.top,
  388. left: safeArea.left,
  389. right: result.windowWidth - safeArea.right,
  390. bottom: result.windowHeight - safeArea.bottom };
  391. }
  392. }
  393. var getSystemInfo = {
  394. returnValue: function returnValue(result) {
  395. addUuid(result);
  396. addSafeAreaInsets(result);
  397. } };
  398. // import navigateTo from 'uni-helpers/navigate-to'
  399. var protocols = {
  400. redirectTo: redirectTo,
  401. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  402. previewImage: previewImage,
  403. getSystemInfo: getSystemInfo,
  404. getSystemInfoSync: getSystemInfo };
  405. var todos = [
  406. 'vibrate',
  407. 'preloadPage',
  408. 'unPreloadPage',
  409. 'loadSubPackage'];
  410. var canIUses = [];
  411. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  412. function processCallback(methodName, method, returnValue) {
  413. return function (res) {
  414. return method(processReturnValue(methodName, res, returnValue));
  415. };
  416. }
  417. 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;
  418. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  419. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  420. if (isFn(argsOption)) {
  421. argsOption = argsOption(fromArgs, toArgs) || {};
  422. }
  423. for (var key in fromArgs) {
  424. if (hasOwn(argsOption, key)) {
  425. var keyOption = argsOption[key];
  426. if (isFn(keyOption)) {
  427. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  428. }
  429. if (!keyOption) {// 不支持的参数
  430. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  431. } else if (isStr(keyOption)) {// 重写参数 key
  432. toArgs[keyOption] = fromArgs[key];
  433. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  434. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  435. }
  436. } else if (CALLBACKS.indexOf(key) !== -1) {
  437. if (isFn(fromArgs[key])) {
  438. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  439. }
  440. } else {
  441. if (!keepFromArgs) {
  442. toArgs[key] = fromArgs[key];
  443. }
  444. }
  445. }
  446. return toArgs;
  447. } else if (isFn(fromArgs)) {
  448. fromArgs = processCallback(methodName, fromArgs, returnValue);
  449. }
  450. return fromArgs;
  451. }
  452. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  453. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  454. res = protocols.returnValue(methodName, res);
  455. }
  456. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  457. }
  458. function wrapper(methodName, method) {
  459. if (hasOwn(protocols, methodName)) {
  460. var protocol = protocols[methodName];
  461. if (!protocol) {// 暂不支持的 api
  462. return function () {
  463. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  464. };
  465. }
  466. return function (arg1, arg2) {// 目前 api 最多两个参数
  467. var options = protocol;
  468. if (isFn(protocol)) {
  469. options = protocol(arg1);
  470. }
  471. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  472. var args = [arg1];
  473. if (typeof arg2 !== 'undefined') {
  474. args.push(arg2);
  475. }
  476. if (isFn(options.name)) {
  477. methodName = options.name(arg1);
  478. } else if (isStr(options.name)) {
  479. methodName = options.name;
  480. }
  481. var returnValue = wx[methodName].apply(wx, args);
  482. if (isSyncApi(methodName)) {// 同步 api
  483. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  484. }
  485. return returnValue;
  486. };
  487. }
  488. return method;
  489. }
  490. var todoApis = Object.create(null);
  491. var TODOS = [
  492. 'onTabBarMidButtonTap',
  493. 'subscribePush',
  494. 'unsubscribePush',
  495. 'onPush',
  496. 'offPush',
  497. 'share'];
  498. function createTodoApi(name) {
  499. return function todoApi(_ref)
  500. {var fail = _ref.fail,complete = _ref.complete;
  501. var res = {
  502. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  503. isFn(fail) && fail(res);
  504. isFn(complete) && complete(res);
  505. };
  506. }
  507. TODOS.forEach(function (name) {
  508. todoApis[name] = createTodoApi(name);
  509. });
  510. var providers = {
  511. oauth: ['weixin'],
  512. share: ['weixin'],
  513. payment: ['wxpay'],
  514. push: ['weixin'] };
  515. function getProvider(_ref2)
  516. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  517. var res = false;
  518. if (providers[service]) {
  519. res = {
  520. errMsg: 'getProvider:ok',
  521. service: service,
  522. provider: providers[service] };
  523. isFn(success) && success(res);
  524. } else {
  525. res = {
  526. errMsg: 'getProvider:fail service not found' };
  527. isFn(fail) && fail(res);
  528. }
  529. isFn(complete) && complete(res);
  530. }
  531. var extraApi = /*#__PURE__*/Object.freeze({
  532. __proto__: null,
  533. getProvider: getProvider });
  534. var getEmitter = function () {
  535. var Emitter;
  536. return function getUniEmitter() {
  537. if (!Emitter) {
  538. Emitter = new _vue.default();
  539. }
  540. return Emitter;
  541. };
  542. }();
  543. function apply(ctx, method, args) {
  544. return ctx[method].apply(ctx, args);
  545. }
  546. function $on() {
  547. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  548. }
  549. function $off() {
  550. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  551. }
  552. function $once() {
  553. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  554. }
  555. function $emit() {
  556. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  557. }
  558. var eventApi = /*#__PURE__*/Object.freeze({
  559. __proto__: null,
  560. $on: $on,
  561. $off: $off,
  562. $once: $once,
  563. $emit: $emit });
  564. var api = /*#__PURE__*/Object.freeze({
  565. __proto__: null });
  566. var MPPage = Page;
  567. var MPComponent = Component;
  568. var customizeRE = /:/g;
  569. var customize = cached(function (str) {
  570. return camelize(str.replace(customizeRE, '-'));
  571. });
  572. function initTriggerEvent(mpInstance) {
  573. {
  574. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  575. return;
  576. }
  577. }
  578. var oldTriggerEvent = mpInstance.triggerEvent;
  579. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  580. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  581. };
  582. }
  583. function initHook(name, options) {
  584. var oldHook = options[name];
  585. if (!oldHook) {
  586. options[name] = function () {
  587. initTriggerEvent(this);
  588. };
  589. } else {
  590. options[name] = function () {
  591. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  592. return oldHook.apply(this, args);
  593. };
  594. }
  595. }
  596. if (!MPPage.__$wrappered) {
  597. MPPage.__$wrappered = true;
  598. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  599. initHook('onLoad', options);
  600. return MPPage(options);
  601. };
  602. Page.after = MPPage.after;
  603. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  604. initHook('created', options);
  605. return MPComponent(options);
  606. };
  607. }
  608. var PAGE_EVENT_HOOKS = [
  609. 'onPullDownRefresh',
  610. 'onReachBottom',
  611. 'onAddToFavorites',
  612. 'onShareTimeline',
  613. 'onShareAppMessage',
  614. 'onPageScroll',
  615. 'onResize',
  616. 'onTabItemTap'];
  617. function initMocks(vm, mocks) {
  618. var mpInstance = vm.$mp[vm.mpType];
  619. mocks.forEach(function (mock) {
  620. if (hasOwn(mpInstance, mock)) {
  621. vm[mock] = mpInstance[mock];
  622. }
  623. });
  624. }
  625. function hasHook(hook, vueOptions) {
  626. if (!vueOptions) {
  627. return true;
  628. }
  629. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  630. return true;
  631. }
  632. vueOptions = vueOptions.default || vueOptions;
  633. if (isFn(vueOptions)) {
  634. if (isFn(vueOptions.extendOptions[hook])) {
  635. return true;
  636. }
  637. if (vueOptions.super &&
  638. vueOptions.super.options &&
  639. Array.isArray(vueOptions.super.options[hook])) {
  640. return true;
  641. }
  642. return false;
  643. }
  644. if (isFn(vueOptions[hook])) {
  645. return true;
  646. }
  647. var mixins = vueOptions.mixins;
  648. if (Array.isArray(mixins)) {
  649. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  650. }
  651. }
  652. function initHooks(mpOptions, hooks, vueOptions) {
  653. hooks.forEach(function (hook) {
  654. if (hasHook(hook, vueOptions)) {
  655. mpOptions[hook] = function (args) {
  656. return this.$vm && this.$vm.__call_hook(hook, args);
  657. };
  658. }
  659. });
  660. }
  661. function initVueComponent(Vue, vueOptions) {
  662. vueOptions = vueOptions.default || vueOptions;
  663. var VueComponent;
  664. if (isFn(vueOptions)) {
  665. VueComponent = vueOptions;
  666. } else {
  667. VueComponent = Vue.extend(vueOptions);
  668. }
  669. vueOptions = VueComponent.options;
  670. return [VueComponent, vueOptions];
  671. }
  672. function initSlots(vm, vueSlots) {
  673. if (Array.isArray(vueSlots) && vueSlots.length) {
  674. var $slots = Object.create(null);
  675. vueSlots.forEach(function (slotName) {
  676. $slots[slotName] = true;
  677. });
  678. vm.$scopedSlots = vm.$slots = $slots;
  679. }
  680. }
  681. function initVueIds(vueIds, mpInstance) {
  682. vueIds = (vueIds || '').split(',');
  683. var len = vueIds.length;
  684. if (len === 1) {
  685. mpInstance._$vueId = vueIds[0];
  686. } else if (len === 2) {
  687. mpInstance._$vueId = vueIds[0];
  688. mpInstance._$vuePid = vueIds[1];
  689. }
  690. }
  691. function initData(vueOptions, context) {
  692. var data = vueOptions.data || {};
  693. var methods = vueOptions.methods || {};
  694. if (typeof data === 'function') {
  695. try {
  696. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  697. } catch (e) {
  698. if (Object({"VUE_APP_NAME":"六牛云矿","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  699. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  700. }
  701. }
  702. } else {
  703. try {
  704. // 对 data 格式化
  705. data = JSON.parse(JSON.stringify(data));
  706. } catch (e) {}
  707. }
  708. if (!isPlainObject(data)) {
  709. data = {};
  710. }
  711. Object.keys(methods).forEach(function (methodName) {
  712. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  713. data[methodName] = methods[methodName];
  714. }
  715. });
  716. return data;
  717. }
  718. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  719. function createObserver(name) {
  720. return function observer(newVal, oldVal) {
  721. if (this.$vm) {
  722. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  723. }
  724. };
  725. }
  726. function initBehaviors(vueOptions, initBehavior) {
  727. var vueBehaviors = vueOptions.behaviors;
  728. var vueExtends = vueOptions.extends;
  729. var vueMixins = vueOptions.mixins;
  730. var vueProps = vueOptions.props;
  731. if (!vueProps) {
  732. vueOptions.props = vueProps = [];
  733. }
  734. var behaviors = [];
  735. if (Array.isArray(vueBehaviors)) {
  736. vueBehaviors.forEach(function (behavior) {
  737. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  738. if (behavior === 'uni://form-field') {
  739. if (Array.isArray(vueProps)) {
  740. vueProps.push('name');
  741. vueProps.push('value');
  742. } else {
  743. vueProps.name = {
  744. type: String,
  745. default: '' };
  746. vueProps.value = {
  747. type: [String, Number, Boolean, Array, Object, Date],
  748. default: '' };
  749. }
  750. }
  751. });
  752. }
  753. if (isPlainObject(vueExtends) && vueExtends.props) {
  754. behaviors.push(
  755. initBehavior({
  756. properties: initProperties(vueExtends.props, true) }));
  757. }
  758. if (Array.isArray(vueMixins)) {
  759. vueMixins.forEach(function (vueMixin) {
  760. if (isPlainObject(vueMixin) && vueMixin.props) {
  761. behaviors.push(
  762. initBehavior({
  763. properties: initProperties(vueMixin.props, true) }));
  764. }
  765. });
  766. }
  767. return behaviors;
  768. }
  769. function parsePropType(key, type, defaultValue, file) {
  770. // [String]=>String
  771. if (Array.isArray(type) && type.length === 1) {
  772. return type[0];
  773. }
  774. return type;
  775. }
  776. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  777. var properties = {};
  778. if (!isBehavior) {
  779. properties.vueId = {
  780. type: String,
  781. value: '' };
  782. // 用于字节跳动小程序模拟抽象节点
  783. properties.generic = {
  784. type: Object,
  785. value: null };
  786. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  787. type: null,
  788. value: [],
  789. observer: function observer(newVal, oldVal) {
  790. var $slots = Object.create(null);
  791. newVal.forEach(function (slotName) {
  792. $slots[slotName] = true;
  793. });
  794. this.setData({
  795. $slots: $slots });
  796. } };
  797. }
  798. if (Array.isArray(props)) {// ['title']
  799. props.forEach(function (key) {
  800. properties[key] = {
  801. type: null,
  802. observer: createObserver(key) };
  803. });
  804. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  805. Object.keys(props).forEach(function (key) {
  806. var opts = props[key];
  807. if (isPlainObject(opts)) {// title:{type:String,default:''}
  808. var value = opts.default;
  809. if (isFn(value)) {
  810. value = value();
  811. }
  812. opts.type = parsePropType(key, opts.type);
  813. properties[key] = {
  814. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  815. value: value,
  816. observer: createObserver(key) };
  817. } else {// content:String
  818. var type = parsePropType(key, opts);
  819. properties[key] = {
  820. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  821. observer: createObserver(key) };
  822. }
  823. });
  824. }
  825. return properties;
  826. }
  827. function wrapper$1(event) {
  828. // TODO 又得兼容 mpvue 的 mp 对象
  829. try {
  830. event.mp = JSON.parse(JSON.stringify(event));
  831. } catch (e) {}
  832. event.stopPropagation = noop;
  833. event.preventDefault = noop;
  834. event.target = event.target || {};
  835. if (!hasOwn(event, 'detail')) {
  836. event.detail = {};
  837. }
  838. if (hasOwn(event, 'markerId')) {
  839. event.detail = typeof event.detail === 'object' ? event.detail : {};
  840. event.detail.markerId = event.markerId;
  841. }
  842. if (isPlainObject(event.detail)) {
  843. event.target = Object.assign({}, event.target, event.detail);
  844. }
  845. return event;
  846. }
  847. function getExtraValue(vm, dataPathsArray) {
  848. var context = vm;
  849. dataPathsArray.forEach(function (dataPathArray) {
  850. var dataPath = dataPathArray[0];
  851. var value = dataPathArray[2];
  852. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  853. var propPath = dataPathArray[1];
  854. var valuePath = dataPathArray[3];
  855. var vFor;
  856. if (Number.isInteger(dataPath)) {
  857. vFor = dataPath;
  858. } else if (!dataPath) {
  859. vFor = context;
  860. } else if (typeof dataPath === 'string' && dataPath) {
  861. if (dataPath.indexOf('#s#') === 0) {
  862. vFor = dataPath.substr(3);
  863. } else {
  864. vFor = vm.__get_value(dataPath, context);
  865. }
  866. }
  867. if (Number.isInteger(vFor)) {
  868. context = value;
  869. } else if (!propPath) {
  870. context = vFor[value];
  871. } else {
  872. if (Array.isArray(vFor)) {
  873. context = vFor.find(function (vForItem) {
  874. return vm.__get_value(propPath, vForItem) === value;
  875. });
  876. } else if (isPlainObject(vFor)) {
  877. context = Object.keys(vFor).find(function (vForKey) {
  878. return vm.__get_value(propPath, vFor[vForKey]) === value;
  879. });
  880. } else {
  881. console.error('v-for 暂不支持循环数据:', vFor);
  882. }
  883. }
  884. if (valuePath) {
  885. context = vm.__get_value(valuePath, context);
  886. }
  887. }
  888. });
  889. return context;
  890. }
  891. function processEventExtra(vm, extra, event) {
  892. var extraObj = {};
  893. if (Array.isArray(extra) && extra.length) {
  894. /**
  895. *[
  896. * ['data.items', 'data.id', item.data.id],
  897. * ['metas', 'id', meta.id]
  898. *],
  899. *[
  900. * ['data.items', 'data.id', item.data.id],
  901. * ['metas', 'id', meta.id]
  902. *],
  903. *'test'
  904. */
  905. extra.forEach(function (dataPath, index) {
  906. if (typeof dataPath === 'string') {
  907. if (!dataPath) {// model,prop.sync
  908. extraObj['$' + index] = vm;
  909. } else {
  910. if (dataPath === '$event') {// $event
  911. extraObj['$' + index] = event;
  912. } else if (dataPath === 'arguments') {
  913. if (event.detail && event.detail.__args__) {
  914. extraObj['$' + index] = event.detail.__args__;
  915. } else {
  916. extraObj['$' + index] = [event];
  917. }
  918. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  919. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  920. } else {
  921. extraObj['$' + index] = vm.__get_value(dataPath);
  922. }
  923. }
  924. } else {
  925. extraObj['$' + index] = getExtraValue(vm, dataPath);
  926. }
  927. });
  928. }
  929. return extraObj;
  930. }
  931. function getObjByArray(arr) {
  932. var obj = {};
  933. for (var i = 1; i < arr.length; i++) {
  934. var element = arr[i];
  935. obj[element[0]] = element[1];
  936. }
  937. return obj;
  938. }
  939. 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;
  940. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  941. if (isCustom) {// 自定义事件
  942. isCustomMPEvent = event.currentTarget &&
  943. event.currentTarget.dataset &&
  944. event.currentTarget.dataset.comType === 'wx';
  945. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  946. if (isCustomMPEvent) {
  947. return [event];
  948. }
  949. return event.detail.__args__ || event.detail;
  950. }
  951. }
  952. var extraObj = processEventExtra(vm, extra, event);
  953. var ret = [];
  954. args.forEach(function (arg) {
  955. if (arg === '$event') {
  956. if (methodName === '__set_model' && !isCustom) {// input v-model value
  957. ret.push(event.target.value);
  958. } else {
  959. if (isCustom && !isCustomMPEvent) {
  960. ret.push(event.detail.__args__[0]);
  961. } else {// wxcomponent 组件或内置组件
  962. ret.push(event);
  963. }
  964. }
  965. } else {
  966. if (Array.isArray(arg) && arg[0] === 'o') {
  967. ret.push(getObjByArray(arg));
  968. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  969. ret.push(extraObj[arg]);
  970. } else {
  971. ret.push(arg);
  972. }
  973. }
  974. });
  975. return ret;
  976. }
  977. var ONCE = '~';
  978. var CUSTOM = '^';
  979. function isMatchEventType(eventType, optType) {
  980. return eventType === optType ||
  981. optType === 'regionchange' && (
  982. eventType === 'begin' ||
  983. eventType === 'end');
  984. }
  985. function getContextVm(vm) {
  986. var $parent = vm.$parent;
  987. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  988. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  989. $parent = $parent.$parent;
  990. }
  991. return $parent && $parent.$parent;
  992. }
  993. function handleEvent(event) {var _this = this;
  994. event = wrapper$1(event);
  995. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  996. var dataset = (event.currentTarget || event.target).dataset;
  997. if (!dataset) {
  998. return console.warn('事件信息不存在');
  999. }
  1000. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1001. if (!eventOpts) {
  1002. return console.warn('事件信息不存在');
  1003. }
  1004. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1005. var eventType = event.type;
  1006. var ret = [];
  1007. eventOpts.forEach(function (eventOpt) {
  1008. var type = eventOpt[0];
  1009. var eventsArray = eventOpt[1];
  1010. var isCustom = type.charAt(0) === CUSTOM;
  1011. type = isCustom ? type.slice(1) : type;
  1012. var isOnce = type.charAt(0) === ONCE;
  1013. type = isOnce ? type.slice(1) : type;
  1014. if (eventsArray && isMatchEventType(eventType, type)) {
  1015. eventsArray.forEach(function (eventArray) {
  1016. var methodName = eventArray[0];
  1017. if (methodName) {
  1018. var handlerCtx = _this.$vm;
  1019. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1020. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1021. }
  1022. if (methodName === '$emit') {
  1023. handlerCtx.$emit.apply(handlerCtx,
  1024. processEventArgs(
  1025. _this.$vm,
  1026. event,
  1027. eventArray[1],
  1028. eventArray[2],
  1029. isCustom,
  1030. methodName));
  1031. return;
  1032. }
  1033. var handler = handlerCtx[methodName];
  1034. if (!isFn(handler)) {
  1035. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1036. }
  1037. if (isOnce) {
  1038. if (handler.once) {
  1039. return;
  1040. }
  1041. handler.once = true;
  1042. }
  1043. var params = processEventArgs(
  1044. _this.$vm,
  1045. event,
  1046. eventArray[1],
  1047. eventArray[2],
  1048. isCustom,
  1049. methodName);
  1050. params = Array.isArray(params) ? params : [];
  1051. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1052. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1053. // eslint-disable-next-line no-sparse-arrays
  1054. params = params.concat([,,,,,,,,,, event]);
  1055. }
  1056. ret.push(handler.apply(handlerCtx, params));
  1057. }
  1058. });
  1059. }
  1060. });
  1061. if (
  1062. eventType === 'input' &&
  1063. ret.length === 1 &&
  1064. typeof ret[0] !== 'undefined')
  1065. {
  1066. return ret[0];
  1067. }
  1068. }
  1069. var eventChannels = {};
  1070. var eventChannelStack = [];
  1071. function getEventChannel(id) {
  1072. if (id) {
  1073. var eventChannel = eventChannels[id];
  1074. delete eventChannels[id];
  1075. return eventChannel;
  1076. }
  1077. return eventChannelStack.shift();
  1078. }
  1079. var hooks = [
  1080. 'onShow',
  1081. 'onHide',
  1082. 'onError',
  1083. 'onPageNotFound',
  1084. 'onThemeChange',
  1085. 'onUnhandledRejection'];
  1086. function initEventChannel() {
  1087. _vue.default.prototype.getOpenerEventChannel = function () {
  1088. // 微信小程序使用自身getOpenerEventChannel
  1089. {
  1090. return this.$scope.getOpenerEventChannel();
  1091. }
  1092. };
  1093. var callHook = _vue.default.prototype.__call_hook;
  1094. _vue.default.prototype.__call_hook = function (hook, args) {
  1095. if (hook === 'onLoad' && args && args.__id__) {
  1096. this.__eventChannel__ = getEventChannel(args.__id__);
  1097. delete args.__id__;
  1098. }
  1099. return callHook.call(this, hook, args);
  1100. };
  1101. }
  1102. function initScopedSlotsParams() {
  1103. var center = {};
  1104. var parents = {};
  1105. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1106. var has = center[vueId];
  1107. if (!has) {
  1108. parents[vueId] = this;
  1109. this.$on('hook:destory', function () {
  1110. delete parents[vueId];
  1111. });
  1112. }
  1113. return has;
  1114. };
  1115. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1116. var data = center[vueId];
  1117. if (data) {
  1118. var object = data[name] || {};
  1119. return key ? object[key] : object;
  1120. } else {
  1121. parents[vueId] = this;
  1122. this.$on('hook:destory', function () {
  1123. delete parents[vueId];
  1124. });
  1125. }
  1126. };
  1127. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1128. var vueId = this.$options.propsData.vueId;
  1129. var object = center[vueId] = center[vueId] || {};
  1130. object[name] = value;
  1131. if (parents[vueId]) {
  1132. parents[vueId].$forceUpdate();
  1133. }
  1134. };
  1135. _vue.default.mixin({
  1136. destroyed: function destroyed() {
  1137. var propsData = this.$options.propsData;
  1138. var vueId = propsData && propsData.vueId;
  1139. if (vueId) {
  1140. delete center[vueId];
  1141. delete parents[vueId];
  1142. }
  1143. } });
  1144. }
  1145. function parseBaseApp(vm, _ref3)
  1146. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1147. initEventChannel();
  1148. {
  1149. initScopedSlotsParams();
  1150. }
  1151. if (vm.$options.store) {
  1152. _vue.default.prototype.$store = vm.$options.store;
  1153. }
  1154. _vue.default.prototype.mpHost = "mp-weixin";
  1155. _vue.default.mixin({
  1156. beforeCreate: function beforeCreate() {
  1157. if (!this.$options.mpType) {
  1158. return;
  1159. }
  1160. this.mpType = this.$options.mpType;
  1161. this.$mp = _defineProperty({
  1162. data: {} },
  1163. this.mpType, this.$options.mpInstance);
  1164. this.$scope = this.$options.mpInstance;
  1165. delete this.$options.mpType;
  1166. delete this.$options.mpInstance;
  1167. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1168. var app = getApp();
  1169. if (app.$vm && app.$vm.$i18n) {
  1170. this._i18n = app.$vm.$i18n;
  1171. }
  1172. }
  1173. if (this.mpType !== 'app') {
  1174. initRefs(this);
  1175. initMocks(this, mocks);
  1176. }
  1177. } });
  1178. var appOptions = {
  1179. onLaunch: function onLaunch(args) {
  1180. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1181. return;
  1182. }
  1183. {
  1184. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1185. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1186. }
  1187. }
  1188. this.$vm = vm;
  1189. this.$vm.$mp = {
  1190. app: this };
  1191. this.$vm.$scope = this;
  1192. // vm 上也挂载 globalData
  1193. this.$vm.globalData = this.globalData;
  1194. this.$vm._isMounted = true;
  1195. this.$vm.__call_hook('mounted', args);
  1196. this.$vm.__call_hook('onLaunch', args);
  1197. } };
  1198. // 兼容旧版本 globalData
  1199. appOptions.globalData = vm.$options.globalData || {};
  1200. // 将 methods 中的方法挂在 getApp() 中
  1201. var methods = vm.$options.methods;
  1202. if (methods) {
  1203. Object.keys(methods).forEach(function (name) {
  1204. appOptions[name] = methods[name];
  1205. });
  1206. }
  1207. initHooks(appOptions, hooks);
  1208. return appOptions;
  1209. }
  1210. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1211. function findVmByVueId(vm, vuePid) {
  1212. var $children = vm.$children;
  1213. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1214. for (var i = $children.length - 1; i >= 0; i--) {
  1215. var childVm = $children[i];
  1216. if (childVm.$scope._$vueId === vuePid) {
  1217. return childVm;
  1218. }
  1219. }
  1220. // 反向递归查找
  1221. var parentVm;
  1222. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1223. parentVm = findVmByVueId($children[_i], vuePid);
  1224. if (parentVm) {
  1225. return parentVm;
  1226. }
  1227. }
  1228. }
  1229. function initBehavior(options) {
  1230. return Behavior(options);
  1231. }
  1232. function isPage() {
  1233. return !!this.route;
  1234. }
  1235. function initRelation(detail) {
  1236. this.triggerEvent('__l', detail);
  1237. }
  1238. function selectAllComponents(mpInstance, selector, $refs) {
  1239. var components = mpInstance.selectAllComponents(selector);
  1240. components.forEach(function (component) {
  1241. var ref = component.dataset.ref;
  1242. $refs[ref] = component.$vm || component;
  1243. {
  1244. if (component.dataset.vueGeneric === 'scoped') {
  1245. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1246. selectAllComponents(scopedComponent, selector, $refs);
  1247. });
  1248. }
  1249. }
  1250. });
  1251. }
  1252. function initRefs(vm) {
  1253. var mpInstance = vm.$scope;
  1254. Object.defineProperty(vm, '$refs', {
  1255. get: function get() {
  1256. var $refs = {};
  1257. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1258. // TODO 暂不考虑 for 中的 scoped
  1259. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1260. forComponents.forEach(function (component) {
  1261. var ref = component.dataset.ref;
  1262. if (!$refs[ref]) {
  1263. $refs[ref] = [];
  1264. }
  1265. $refs[ref].push(component.$vm || component);
  1266. });
  1267. return $refs;
  1268. } });
  1269. }
  1270. function handleLink(event) {var _ref4 =
  1271. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1272. var parentVm;
  1273. if (vuePid) {
  1274. parentVm = findVmByVueId(this.$vm, vuePid);
  1275. }
  1276. if (!parentVm) {
  1277. parentVm = this.$vm;
  1278. }
  1279. vueOptions.parent = parentVm;
  1280. }
  1281. function parseApp(vm) {
  1282. return parseBaseApp(vm, {
  1283. mocks: mocks,
  1284. initRefs: initRefs });
  1285. }
  1286. function createApp(vm) {
  1287. App(parseApp(vm));
  1288. return vm;
  1289. }
  1290. var encodeReserveRE = /[!'()*]/g;
  1291. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1292. var commaRE = /%2C/g;
  1293. // fixed encodeURIComponent which is more conformant to RFC3986:
  1294. // - escapes [!'()*]
  1295. // - preserve commas
  1296. var encode = function encode(str) {return encodeURIComponent(str).
  1297. replace(encodeReserveRE, encodeReserveReplacer).
  1298. replace(commaRE, ',');};
  1299. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1300. var res = obj ? Object.keys(obj).map(function (key) {
  1301. var val = obj[key];
  1302. if (val === undefined) {
  1303. return '';
  1304. }
  1305. if (val === null) {
  1306. return encodeStr(key);
  1307. }
  1308. if (Array.isArray(val)) {
  1309. var result = [];
  1310. val.forEach(function (val2) {
  1311. if (val2 === undefined) {
  1312. return;
  1313. }
  1314. if (val2 === null) {
  1315. result.push(encodeStr(key));
  1316. } else {
  1317. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1318. }
  1319. });
  1320. return result.join('&');
  1321. }
  1322. return encodeStr(key) + '=' + encodeStr(val);
  1323. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1324. return res ? "?".concat(res) : '';
  1325. }
  1326. function parseBaseComponent(vueComponentOptions)
  1327. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1328. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1329. var options = _objectSpread({
  1330. multipleSlots: true,
  1331. addGlobalClass: true },
  1332. vueOptions.options || {});
  1333. {
  1334. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1335. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1336. Object.assign(options, vueOptions['mp-weixin'].options);
  1337. }
  1338. }
  1339. var componentOptions = {
  1340. options: options,
  1341. data: initData(vueOptions, _vue.default.prototype),
  1342. behaviors: initBehaviors(vueOptions, initBehavior),
  1343. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1344. lifetimes: {
  1345. attached: function attached() {
  1346. var properties = this.properties;
  1347. var options = {
  1348. mpType: isPage.call(this) ? 'page' : 'component',
  1349. mpInstance: this,
  1350. propsData: properties };
  1351. initVueIds(properties.vueId, this);
  1352. // 处理父子关系
  1353. initRelation.call(this, {
  1354. vuePid: this._$vuePid,
  1355. vueOptions: options });
  1356. // 初始化 vue 实例
  1357. this.$vm = new VueComponent(options);
  1358. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1359. initSlots(this.$vm, properties.vueSlots);
  1360. // 触发首次 setData
  1361. this.$vm.$mount();
  1362. },
  1363. ready: function ready() {
  1364. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1365. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1366. if (this.$vm) {
  1367. this.$vm._isMounted = true;
  1368. this.$vm.__call_hook('mounted');
  1369. this.$vm.__call_hook('onReady');
  1370. }
  1371. },
  1372. detached: function detached() {
  1373. this.$vm && this.$vm.$destroy();
  1374. } },
  1375. pageLifetimes: {
  1376. show: function show(args) {
  1377. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1378. },
  1379. hide: function hide() {
  1380. this.$vm && this.$vm.__call_hook('onPageHide');
  1381. },
  1382. resize: function resize(size) {
  1383. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1384. } },
  1385. methods: {
  1386. __l: handleLink,
  1387. __e: handleEvent } };
  1388. // externalClasses
  1389. if (vueOptions.externalClasses) {
  1390. componentOptions.externalClasses = vueOptions.externalClasses;
  1391. }
  1392. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1393. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1394. componentOptions.methods[callMethod] = function (args) {
  1395. return this.$vm[callMethod](args);
  1396. };
  1397. });
  1398. }
  1399. if (isPage) {
  1400. return componentOptions;
  1401. }
  1402. return [componentOptions, VueComponent];
  1403. }
  1404. function parseComponent(vueComponentOptions) {
  1405. return parseBaseComponent(vueComponentOptions, {
  1406. isPage: isPage,
  1407. initRelation: initRelation });
  1408. }
  1409. var hooks$1 = [
  1410. 'onShow',
  1411. 'onHide',
  1412. 'onUnload'];
  1413. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1414. function parseBasePage(vuePageOptions, _ref6)
  1415. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1416. var pageOptions = parseComponent(vuePageOptions);
  1417. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1418. pageOptions.methods.onLoad = function (query) {
  1419. this.options = query;
  1420. var copyQuery = Object.assign({}, query);
  1421. delete copyQuery.__id__;
  1422. this.$page = {
  1423. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1424. this.$vm.$mp.query = query; // 兼容 mpvue
  1425. this.$vm.__call_hook('onLoad', query);
  1426. };
  1427. return pageOptions;
  1428. }
  1429. function parsePage(vuePageOptions) {
  1430. return parseBasePage(vuePageOptions, {
  1431. isPage: isPage,
  1432. initRelation: initRelation });
  1433. }
  1434. function createPage(vuePageOptions) {
  1435. {
  1436. return Component(parsePage(vuePageOptions));
  1437. }
  1438. }
  1439. function createComponent(vueOptions) {
  1440. {
  1441. return Component(parseComponent(vueOptions));
  1442. }
  1443. }
  1444. function createSubpackageApp(vm) {
  1445. var appOptions = parseApp(vm);
  1446. var app = getApp({
  1447. allowDefault: true });
  1448. var globalData = app.globalData;
  1449. if (globalData) {
  1450. Object.keys(appOptions.globalData).forEach(function (name) {
  1451. if (!hasOwn(globalData, name)) {
  1452. globalData[name] = appOptions.globalData[name];
  1453. }
  1454. });
  1455. }
  1456. Object.keys(appOptions).forEach(function (name) {
  1457. if (!hasOwn(app, name)) {
  1458. app[name] = appOptions[name];
  1459. }
  1460. });
  1461. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1462. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1463. appOptions.onShow.apply(app, args);
  1464. });
  1465. }
  1466. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1467. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1468. appOptions.onHide.apply(app, args);
  1469. });
  1470. }
  1471. if (isFn(appOptions.onLaunch)) {
  1472. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1473. appOptions.onLaunch.call(app, args);
  1474. }
  1475. return vm;
  1476. }
  1477. function createPlugin(vm) {
  1478. var appOptions = parseApp(vm);
  1479. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1480. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1481. appOptions.onShow.apply(vm, args);
  1482. });
  1483. }
  1484. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1485. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1486. appOptions.onHide.apply(vm, args);
  1487. });
  1488. }
  1489. if (isFn(appOptions.onLaunch)) {
  1490. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1491. appOptions.onLaunch.call(vm, args);
  1492. }
  1493. return vm;
  1494. }
  1495. todos.forEach(function (todoApi) {
  1496. protocols[todoApi] = false;
  1497. });
  1498. canIUses.forEach(function (canIUseApi) {
  1499. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1500. canIUseApi;
  1501. if (!wx.canIUse(apiName)) {
  1502. protocols[canIUseApi] = false;
  1503. }
  1504. });
  1505. var uni = {};
  1506. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1507. uni = new Proxy({}, {
  1508. get: function get(target, name) {
  1509. if (hasOwn(target, name)) {
  1510. return target[name];
  1511. }
  1512. if (baseApi[name]) {
  1513. return baseApi[name];
  1514. }
  1515. if (api[name]) {
  1516. return promisify(name, api[name]);
  1517. }
  1518. {
  1519. if (extraApi[name]) {
  1520. return promisify(name, extraApi[name]);
  1521. }
  1522. if (todoApis[name]) {
  1523. return promisify(name, todoApis[name]);
  1524. }
  1525. }
  1526. if (eventApi[name]) {
  1527. return eventApi[name];
  1528. }
  1529. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1530. return;
  1531. }
  1532. return promisify(name, wrapper(name, wx[name]));
  1533. },
  1534. set: function set(target, name, value) {
  1535. target[name] = value;
  1536. return true;
  1537. } });
  1538. } else {
  1539. Object.keys(baseApi).forEach(function (name) {
  1540. uni[name] = baseApi[name];
  1541. });
  1542. {
  1543. Object.keys(todoApis).forEach(function (name) {
  1544. uni[name] = promisify(name, todoApis[name]);
  1545. });
  1546. Object.keys(extraApi).forEach(function (name) {
  1547. uni[name] = promisify(name, todoApis[name]);
  1548. });
  1549. }
  1550. Object.keys(eventApi).forEach(function (name) {
  1551. uni[name] = eventApi[name];
  1552. });
  1553. Object.keys(api).forEach(function (name) {
  1554. uni[name] = promisify(name, api[name]);
  1555. });
  1556. Object.keys(wx).forEach(function (name) {
  1557. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1558. uni[name] = promisify(name, wrapper(name, wx[name]));
  1559. }
  1560. });
  1561. }
  1562. wx.createApp = createApp;
  1563. wx.createPage = createPage;
  1564. wx.createComponent = createComponent;
  1565. wx.createSubpackageApp = createSubpackageApp;
  1566. wx.createPlugin = createPlugin;
  1567. var uni$1 = uni;var _default =
  1568. uni$1;exports.default = _default;
  1569. /***/ }),
  1570. /***/ 104:
  1571. /*!***************************************!*\
  1572. !*** G:/gsxm/lnyk/api/calculation.js ***!
  1573. \***************************************/
  1574. /*! no static exports found */
  1575. /***/ (function(module, exports, __webpack_require__) {
  1576. "use strict";
  1577. Object.defineProperty(exports, "__esModule", { value: true });exports.mining = mining;exports.buyMining = buyMining;exports.miningIndex = miningIndex;exports.mymining = mymining;exports.calculator = calculator;exports.miningDateils = miningDateils;
  1578. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1579. function mining(data) {
  1580. return (0, _request.default)({
  1581. url: '/api/mining',
  1582. method: 'get',
  1583. data: data });
  1584. }
  1585. function buyMining(data, id) {
  1586. return (0, _request.default)({
  1587. url: '/api/mining/' + id,
  1588. method: 'post',
  1589. data: data });
  1590. }
  1591. function miningIndex(data) {
  1592. return (0, _request.default)({
  1593. url: '/api/mining_index',
  1594. method: 'get',
  1595. data: data });
  1596. }
  1597. function mymining(data) {
  1598. return (0, _request.default)({
  1599. url: '/api/my_mining',
  1600. method: 'get',
  1601. data: data });
  1602. }
  1603. function calculator(data) {
  1604. return (0, _request.default)({
  1605. url: '/api/mining_calculator',
  1606. method: 'get',
  1607. data: data });
  1608. }
  1609. function miningDateils(data, id) {
  1610. return (0, _request.default)({
  1611. url: '/api/mining/' + id,
  1612. method: 'get',
  1613. data: data });
  1614. }
  1615. /***/ }),
  1616. /***/ 11:
  1617. /*!***********************************!*\
  1618. !*** G:/gsxm/lnyk/interceptor.js ***!
  1619. \***********************************/
  1620. /*! no static exports found */
  1621. /***/ (function(module, exports, __webpack_require__) {
  1622. "use strict";
  1623. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 应用打开后拦截
  1624. var loadRouter = function loadRouter() {
  1625. // 获取上个页面
  1626. var pages = getCurrentPages();
  1627. var prePage = pages[pages.length - 2];
  1628. interceptor(page, prePage);
  1629. };
  1630. // 路由拦截
  1631. /**
  1632. * @param {Object} now 当前页面
  1633. * @param {Object} before 上一个页面
  1634. */
  1635. var interceptor = function interceptor(now, before) {
  1636. // 获取用户信息判断是否登录过
  1637. var userInfo = uni.getStorageSync('userInfo') || '';
  1638. // 判断是否需要拦截
  1639. var state = uni.getStorageSync('loginInterceptor');
  1640. // 判断是否需要拦截
  1641. if (state) {
  1642. // 拦截条件
  1643. if (!userInfo.id) {
  1644. uni.navigateTo({
  1645. url: '/pages/public/login' });
  1646. }
  1647. }
  1648. };var _default =
  1649. loadRouter;exports.default = _default;
  1650. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1651. /***/ }),
  1652. /***/ 12:
  1653. /*!********************************!*\
  1654. !*** G:/gsxm/lnyk/api/user.js ***!
  1655. \********************************/
  1656. /*! no static exports found */
  1657. /***/ (function(module, exports, __webpack_require__) {
  1658. "use strict";
  1659. Object.defineProperty(exports, "__esModule", { value: true });exports.getUserInfo = getUserInfo;exports.getUser = getUser;exports.spread_people = spread_people;exports.spread = spread;exports.version = version;exports.uploads = uploads;exports.edit = edit;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 13));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;}
  1660. // 获取用户信息
  1661. function getUserInfo(data) {
  1662. return (0, _request.default)({
  1663. url: '/api/userinfo',
  1664. method: 'get',
  1665. data: data });
  1666. }
  1667. // 获取用户信息
  1668. function getUser(data) {
  1669. return (0, _request.default)({
  1670. url: '/api/user',
  1671. method: 'get',
  1672. data: data });
  1673. }
  1674. //推荐人
  1675. function spread_people(data) {
  1676. return (0, _request.default)({
  1677. url: '/api/spread/people',
  1678. method: 'post',
  1679. data: data });
  1680. }
  1681. //推荐人
  1682. function spread(data) {
  1683. return (0, _request.default)({
  1684. url: '/api/spread/banner',
  1685. method: 'GET',
  1686. data: data });
  1687. }
  1688. //获取版本
  1689. function version(data) {
  1690. return (0, _request.default)({
  1691. url: '/api/version',
  1692. method: 'GET',
  1693. data: data });
  1694. }
  1695. function uploads(data) {
  1696. return (0, _request.upFilse)({
  1697. url: '/api/upload/image',
  1698. method: 'post',
  1699. data: data });
  1700. }
  1701. function edit(data) {
  1702. return (0, _request.default)({
  1703. url: '/api/user/edit',
  1704. method: 'post',
  1705. data: data });
  1706. }
  1707. /***/ }),
  1708. /***/ 121:
  1709. /*!**************************************!*\
  1710. !*** G:/gsxm/lnyk/utils/rocessor.js ***!
  1711. \**************************************/
  1712. /*! no static exports found */
  1713. /***/ (function(module, exports, __webpack_require__) {
  1714. "use strict";
  1715. Object.defineProperty(exports, "__esModule", { value: true });exports.isCardNo = isCardNo;exports.getMoneyStyle = getMoneyStyle;exports.timeComputed = timeComputed;exports.getTime = getTime; //身份证验证
  1716. function isCardNo(card) {
  1717. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  1718. var reg =
  1719. /(^[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}$)/;
  1720. if (reg.test(card) === false) {
  1721. console.log(card);
  1722. return false;
  1723. }
  1724. return true;
  1725. }
  1726. // 金额显示变化
  1727. function getMoneyStyle() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  1728. if (typeof value == 'string') {
  1729. value = (+value).toFixed(2);
  1730. }
  1731. if (typeof value == 'number') {
  1732. value = value.toFixed(2);
  1733. }
  1734. // 将字符串转为数组
  1735. var n = value.split("");
  1736. // 反转数组并复制循环处理
  1737. var arr = n.reverse().map(function (e, ind, ar) {
  1738. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  1739. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  1740. return e + ',';
  1741. } else {
  1742. return e;
  1743. }
  1744. });
  1745. // 反转数组回复原来排序并合并回字符串
  1746. arr = arr.reverse().join('');
  1747. return arr;
  1748. }
  1749. // 倒计时计算
  1750. // 计算倒计时时间
  1751. function timeComputed(time) {
  1752. // 获取当前时间
  1753. var actTime = new Date().getTime();
  1754. // 获取到期时间
  1755. var stopTime = time - actTime;
  1756. // 判断是否小于0
  1757. if (stopTime < 0) {
  1758. stopTime = stopTime * -1;
  1759. }
  1760. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余小时数
  1761. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  1762. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  1763. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  1764. return {
  1765. day: day,
  1766. hours: hours, //倒计时小时数
  1767. minutes: minutes, //倒计时分钟数
  1768. seconds: seconds //倒计时秒数
  1769. };
  1770. }
  1771. //时间戳转换成时间
  1772. function getTime(time) {
  1773. var date = new Date(parseInt(time) * 1000);
  1774. var year = date.getFullYear();
  1775. var mon = date.getMonth() + 1;
  1776. var day = date.getDate();
  1777. var hours = date.getHours();
  1778. var minu = date.getMinutes();
  1779. var sec = date.getSeconds();
  1780. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  1781. }
  1782. /***/ }),
  1783. /***/ 13:
  1784. /*!*************************************!*\
  1785. !*** G:/gsxm/lnyk/utils/request.js ***!
  1786. \*************************************/
  1787. /*! no static exports found */
  1788. /***/ (function(module, exports, __webpack_require__) {
  1789. "use strict";
  1790. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.upFilse = void 0;var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 14));
  1791. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 5));
  1792. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 18);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1793. // 请求完成后拦截
  1794. _newRequest.default.interceptors.response(
  1795. function (response) {
  1796. try {
  1797. var res = response.data;
  1798. // 解析字符串为数字
  1799. if (res.status !== 200) {
  1800. console.log(res.status);
  1801. if (res.status == 410000) {
  1802. // 调用退出登录方法清空用户信息
  1803. _store.default.commit('user/logout');
  1804. (0, _loginUtils.saveUrl)();
  1805. uni.navigateTo({
  1806. url: "/pages/public/login" });
  1807. } else {
  1808. uni.showToast({
  1809. title: res.msg,
  1810. duration: 1500,
  1811. mask: false,
  1812. icon: 'none' });
  1813. }
  1814. return Promise.reject(res);
  1815. } else {
  1816. return res;
  1817. }
  1818. } catch (e) {
  1819. console.log(e);
  1820. }
  1821. },
  1822. function (error) {
  1823. uni.showToast({
  1824. title: "当前用户量过多,请稍后重试",
  1825. duration: 1500,
  1826. mask: false,
  1827. icon: 'none' });
  1828. return Promise.reject(error);
  1829. });
  1830. // 请求前拦截器
  1831. _newRequest.default.interceptors.request(
  1832. function (config) {
  1833. var token = uni.getStorageSync('token') || '';
  1834. // console.log(config);
  1835. if (!config.header) {
  1836. config.header = {
  1837. "Authori-zation": 'Bearer ' + token };
  1838. } else {
  1839. // 添加key请求头
  1840. config.header["Authori-zation"] = 'Bearer ' + token;
  1841. }
  1842. return config;
  1843. },
  1844. function (error) {
  1845. // 错误处理
  1846. console.log(error);
  1847. return Promise.reject(error);
  1848. });
  1849. var upFilse = _newRequest.default.upFilse;exports.upFilse = upFilse;var _default =
  1850. _newRequest.default.open;exports.default = _default;
  1851. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1852. /***/ }),
  1853. /***/ 130:
  1854. /*!***********************************!*\
  1855. !*** G:/gsxm/lnyk/api/finance.js ***!
  1856. \***********************************/
  1857. /*! no static exports found */
  1858. /***/ (function(module, exports, __webpack_require__) {
  1859. "use strict";
  1860. Object.defineProperty(exports, "__esModule", { value: true });exports.recharge = recharge;exports.upload = upload;exports.money = money;exports.wallet = wallet;exports.moneyLog = moneyLog;exports.cash = cash;exports.spread = spread;exports.goPay = goPay;exports.trade = trade;exports.cashmoney_type = cashmoney_type;exports.calculator = calculator;exports.edit = edit;exports.miner = miner;
  1861. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 13));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;}
  1862. function recharge(data) {
  1863. return (0, _request.default)({
  1864. url: '/api/recharge/money',
  1865. method: 'post',
  1866. data: data });
  1867. }
  1868. //上传图片
  1869. function upload(data) {
  1870. return (0, _request.upFilse)({
  1871. url: '/api/upload/image',
  1872. method: 'post',
  1873. data: data });
  1874. }
  1875. function money(data, id) {
  1876. return (0, _request.default)({
  1877. url: '/api/recharge/money/' + id,
  1878. method: 'post',
  1879. data: data });
  1880. }
  1881. function wallet(data) {
  1882. return (0, _request.default)({
  1883. url: '/api/wallet',
  1884. method: 'get',
  1885. data: data });
  1886. }
  1887. function moneyLog(data, code) {
  1888. return (0, _request.default)({
  1889. url: '/api/money/log/' + code,
  1890. method: 'get',
  1891. data: data });
  1892. }
  1893. function cash(data) {
  1894. return (0, _request.default)({
  1895. url: '/api/extract/cash',
  1896. method: 'POST',
  1897. data: data });
  1898. }
  1899. function spread(data) {
  1900. return (0, _request.default)({
  1901. url: '/api/spread/people',
  1902. method: 'POST',
  1903. data: data });
  1904. }
  1905. function goPay(data) {
  1906. return (0, _request.default)({
  1907. url: '/api/trade/go_pay',
  1908. method: 'POST',
  1909. data: data });
  1910. }
  1911. function trade(data) {
  1912. return (0, _request.default)({
  1913. url: '/api/trade/money_type',
  1914. method: 'get',
  1915. data: data });
  1916. }
  1917. function cashmoney_type(data) {
  1918. return (0, _request.default)({
  1919. url: '/api/cash/money_type',
  1920. method: 'get',
  1921. data: data });
  1922. }
  1923. function calculator(data) {
  1924. return (0, _request.default)({
  1925. url: '/api/extract/calculator',
  1926. method: 'post',
  1927. data: data });
  1928. }
  1929. function edit(data, id) {
  1930. return (0, _request.default)({
  1931. url: '/api/wallet/address/edit/' + id,
  1932. method: 'post',
  1933. data: data });
  1934. }
  1935. function miner(data) {
  1936. return (0, _request.default)({
  1937. url: '/api/spread/people/all',
  1938. method: 'post',
  1939. data: data });
  1940. }
  1941. /***/ }),
  1942. /***/ 14:
  1943. /*!****************************************!*\
  1944. !*** G:/gsxm/lnyk/utils/newRequest.js ***!
  1945. \****************************************/
  1946. /*! no static exports found */
  1947. /***/ (function(module, exports, __webpack_require__) {
  1948. "use strict";
  1949. /* 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 */ 15));var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 5));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);});};}
  1950. var service = {
  1951. baseURL: _store.default.state.baseURL, // 请求头
  1952. header: {
  1953. 'Content-Type': "application/x-www-form-urlencoded" },
  1954. // 请求拦截器
  1955. interceptors: {
  1956. // 安装请求前拦截
  1957. request: function request(success, iserror) {
  1958. service.request.success = success;
  1959. service.request.error = iserror;
  1960. },
  1961. // 安装请求完成后拦截
  1962. response: function response(success, iserror) {
  1963. service.response.success = success;
  1964. service.response.error = iserror;
  1965. } },
  1966. // 请求前拦截
  1967. request: {
  1968. // 回调成功执行方法
  1969. success: function success(e) {
  1970. return e;
  1971. },
  1972. // 回调失败
  1973. error: function error(e) {
  1974. return e;
  1975. } },
  1976. // 请求完成后拦截
  1977. response: {
  1978. // 回调成功执行方法
  1979. success: function success(e) {
  1980. return e;
  1981. },
  1982. // 回调失败
  1983. error: function error(e) {
  1984. return e;
  1985. } },
  1986. // 开始请求
  1987. 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 (
  1988. new Promise(function (resolve, reject) {
  1989. var requestData = ''; //保存处理完成后请求数据
  1990. //console.log(data);
  1991. // 请求前数据处理
  1992. requestData = service.request.success(data);
  1993. // 数据复制用于请求
  1994. uni.request({
  1995. url: service.baseURL + requestData.url,
  1996. method: requestData.method || 'GET',
  1997. data: requestData.data,
  1998. header: data.header || service.header,
  1999. success: function success(res) {
  2000. if (res.statusCode == 200) {
  2001. try {
  2002. resolve(service.response.success(res));
  2003. } catch (e) {
  2004. service.response.error(e);
  2005. }
  2006. }
  2007. },
  2008. // 请求失败数据处理
  2009. fail: function fail(err) {
  2010. service.response.error(err);
  2011. } });
  2012. }));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;}(),
  2013. // 上传文件
  2014. 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 (
  2015. new Promise(function (resolve, reject) {
  2016. var requestData = ''; //保存处理完成后请求数据
  2017. try {
  2018. // 请求前数据处理
  2019. requestData = service.request.success(data);
  2020. } catch (e) {
  2021. // 请求报错拦截
  2022. service.request.error(e);
  2023. }
  2024. var config = {
  2025. // 上传图片的API
  2026. upload_img_url: service.baseURL + requestData.url };
  2027. var Uploader = {
  2028. // 选择图片
  2029. choose: function choose(num) {
  2030. return new Promise(function (resolve, reject) {
  2031. uni.chooseImage({
  2032. count: num,
  2033. sourceType: ['album'],
  2034. sizeType: ['compressed'],
  2035. success: function success(res) {
  2036. // console.log(res);
  2037. // 缓存文件路径
  2038. resolve(res.tempFilePaths);
  2039. },
  2040. fail: function fail(err) {
  2041. console.log(err);
  2042. reject(err);
  2043. } });
  2044. });
  2045. },
  2046. // 上传图片
  2047. upload_one: function upload_one(path) {
  2048. return new Promise(function (resolve, reject) {
  2049. uni.showLoading({
  2050. title: '上传中' });
  2051. uni.uploadFile({
  2052. url: config.upload_img_url, //仅为示例,非真实的接口地址
  2053. filePath: path,
  2054. name: 'file',
  2055. header: {
  2056. "Authori-zation": 'Bearer ' + uni.getStorageSync('token') },
  2057. success: function success(uploadFileRes) {
  2058. if ("string" === typeof uploadFileRes.data) {
  2059. resolve(JSON.parse(uploadFileRes.data).data);
  2060. } else {
  2061. resolve(uploadFileRes.data.data);
  2062. }
  2063. },
  2064. complete: function complete() {
  2065. uni.hideLoading();
  2066. } });
  2067. });
  2068. },
  2069. // 上传多个图片
  2070. upload: function upload(path_arr) {var _this = this;
  2071. var num = path_arr.length;
  2072. 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:
  2073. img_urls = [];
  2074. i = 0;case 2:if (!(i < num)) {_context2.next = 10;break;}_context2.next = 5;return (
  2075. _this.upload_one(path_arr[i]));case 5:img_url = _context2.sent;
  2076. img_urls.push(img_url);case 7:i++;_context2.next = 2;break;case 10:
  2077. ;
  2078. resolve(img_urls);case 12:case "end":return _context2.stop();}}}, _callee2);}));return function (_x3, _x4) {return _ref.apply(this, arguments);};}());
  2079. },
  2080. // 触发上传图片事件
  2081. choose_and_upload: function choose_and_upload(num) {var _this2 = this;
  2082. 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 (
  2083. _this2.choose(num));case 2:path_arr = _context3.sent;_context3.next = 5;return (
  2084. _this2.upload(path_arr).then(function (e) {
  2085. resolve(e);
  2086. }).catch(function (e) {
  2087. reject(e);
  2088. }));case 5:case "end":return _context3.stop();}}}, _callee3);}));return function (_x5, _x6) {return _ref2.apply(this, arguments);};}());
  2089. } };
  2090. Uploader.choose_and_upload(1).then(function (e) {
  2091. resolve(e);
  2092. }).catch(function (e) {
  2093. console.log(e);
  2094. });
  2095. }));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 =
  2096. service;exports.default = _default;
  2097. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2098. /***/ }),
  2099. /***/ 15:
  2100. /*!**********************************************************!*\
  2101. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2102. \**********************************************************/
  2103. /*! no static exports found */
  2104. /***/ (function(module, exports, __webpack_require__) {
  2105. module.exports = __webpack_require__(/*! regenerator-runtime */ 16);
  2106. /***/ }),
  2107. /***/ 16:
  2108. /*!************************************************************!*\
  2109. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2110. \************************************************************/
  2111. /*! no static exports found */
  2112. /***/ (function(module, exports, __webpack_require__) {
  2113. /**
  2114. * Copyright (c) 2014-present, Facebook, Inc.
  2115. *
  2116. * This source code is licensed under the MIT license found in the
  2117. * LICENSE file in the root directory of this source tree.
  2118. */
  2119. // This method of obtaining a reference to the global object needs to be
  2120. // kept identical to the way it is obtained in runtime.js
  2121. var g = (function() {
  2122. return this || (typeof self === "object" && self);
  2123. })() || Function("return this")();
  2124. // Use `getOwnPropertyNames` because not all browsers support calling
  2125. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2126. var hadRuntime = g.regeneratorRuntime &&
  2127. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2128. // Save the old regeneratorRuntime in case it needs to be restored later.
  2129. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2130. // Force reevalutation of runtime.js.
  2131. g.regeneratorRuntime = undefined;
  2132. module.exports = __webpack_require__(/*! ./runtime */ 17);
  2133. if (hadRuntime) {
  2134. // Restore the original runtime.
  2135. g.regeneratorRuntime = oldRuntime;
  2136. } else {
  2137. // Remove the global property added by runtime.js.
  2138. try {
  2139. delete g.regeneratorRuntime;
  2140. } catch(e) {
  2141. g.regeneratorRuntime = undefined;
  2142. }
  2143. }
  2144. /***/ }),
  2145. /***/ 17:
  2146. /*!*****************************************************!*\
  2147. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2148. \*****************************************************/
  2149. /*! no static exports found */
  2150. /***/ (function(module, exports) {
  2151. /**
  2152. * Copyright (c) 2014-present, Facebook, Inc.
  2153. *
  2154. * This source code is licensed under the MIT license found in the
  2155. * LICENSE file in the root directory of this source tree.
  2156. */
  2157. !(function(global) {
  2158. "use strict";
  2159. var Op = Object.prototype;
  2160. var hasOwn = Op.hasOwnProperty;
  2161. var undefined; // More compressible than void 0.
  2162. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2163. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2164. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2165. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2166. var inModule = typeof module === "object";
  2167. var runtime = global.regeneratorRuntime;
  2168. if (runtime) {
  2169. if (inModule) {
  2170. // If regeneratorRuntime is defined globally and we're in a module,
  2171. // make the exports object identical to regeneratorRuntime.
  2172. module.exports = runtime;
  2173. }
  2174. // Don't bother evaluating the rest of this file if the runtime was
  2175. // already defined globally.
  2176. return;
  2177. }
  2178. // Define the runtime globally (as expected by generated code) as either
  2179. // module.exports (if we're in a module) or a new, empty object.
  2180. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2181. function wrap(innerFn, outerFn, self, tryLocsList) {
  2182. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2183. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2184. var generator = Object.create(protoGenerator.prototype);
  2185. var context = new Context(tryLocsList || []);
  2186. // The ._invoke method unifies the implementations of the .next,
  2187. // .throw, and .return methods.
  2188. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2189. return generator;
  2190. }
  2191. runtime.wrap = wrap;
  2192. // Try/catch helper to minimize deoptimizations. Returns a completion
  2193. // record like context.tryEntries[i].completion. This interface could
  2194. // have been (and was previously) designed to take a closure to be
  2195. // invoked without arguments, but in all the cases we care about we
  2196. // already have an existing method we want to call, so there's no need
  2197. // to create a new function object. We can even get away with assuming
  2198. // the method takes exactly one argument, since that happens to be true
  2199. // in every case, so we don't have to touch the arguments object. The
  2200. // only additional allocation required is the completion record, which
  2201. // has a stable shape and so hopefully should be cheap to allocate.
  2202. function tryCatch(fn, obj, arg) {
  2203. try {
  2204. return { type: "normal", arg: fn.call(obj, arg) };
  2205. } catch (err) {
  2206. return { type: "throw", arg: err };
  2207. }
  2208. }
  2209. var GenStateSuspendedStart = "suspendedStart";
  2210. var GenStateSuspendedYield = "suspendedYield";
  2211. var GenStateExecuting = "executing";
  2212. var GenStateCompleted = "completed";
  2213. // Returning this object from the innerFn has the same effect as
  2214. // breaking out of the dispatch switch statement.
  2215. var ContinueSentinel = {};
  2216. // Dummy constructor functions that we use as the .constructor and
  2217. // .constructor.prototype properties for functions that return Generator
  2218. // objects. For full spec compliance, you may wish to configure your
  2219. // minifier not to mangle the names of these two functions.
  2220. function Generator() {}
  2221. function GeneratorFunction() {}
  2222. function GeneratorFunctionPrototype() {}
  2223. // This is a polyfill for %IteratorPrototype% for environments that
  2224. // don't natively support it.
  2225. var IteratorPrototype = {};
  2226. IteratorPrototype[iteratorSymbol] = function () {
  2227. return this;
  2228. };
  2229. var getProto = Object.getPrototypeOf;
  2230. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2231. if (NativeIteratorPrototype &&
  2232. NativeIteratorPrototype !== Op &&
  2233. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2234. // This environment has a native %IteratorPrototype%; use it instead
  2235. // of the polyfill.
  2236. IteratorPrototype = NativeIteratorPrototype;
  2237. }
  2238. var Gp = GeneratorFunctionPrototype.prototype =
  2239. Generator.prototype = Object.create(IteratorPrototype);
  2240. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2241. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2242. GeneratorFunctionPrototype[toStringTagSymbol] =
  2243. GeneratorFunction.displayName = "GeneratorFunction";
  2244. // Helper for defining the .next, .throw, and .return methods of the
  2245. // Iterator interface in terms of a single ._invoke method.
  2246. function defineIteratorMethods(prototype) {
  2247. ["next", "throw", "return"].forEach(function(method) {
  2248. prototype[method] = function(arg) {
  2249. return this._invoke(method, arg);
  2250. };
  2251. });
  2252. }
  2253. runtime.isGeneratorFunction = function(genFun) {
  2254. var ctor = typeof genFun === "function" && genFun.constructor;
  2255. return ctor
  2256. ? ctor === GeneratorFunction ||
  2257. // For the native GeneratorFunction constructor, the best we can
  2258. // do is to check its .name property.
  2259. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2260. : false;
  2261. };
  2262. runtime.mark = function(genFun) {
  2263. if (Object.setPrototypeOf) {
  2264. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2265. } else {
  2266. genFun.__proto__ = GeneratorFunctionPrototype;
  2267. if (!(toStringTagSymbol in genFun)) {
  2268. genFun[toStringTagSymbol] = "GeneratorFunction";
  2269. }
  2270. }
  2271. genFun.prototype = Object.create(Gp);
  2272. return genFun;
  2273. };
  2274. // Within the body of any async function, `await x` is transformed to
  2275. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2276. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2277. // meant to be awaited.
  2278. runtime.awrap = function(arg) {
  2279. return { __await: arg };
  2280. };
  2281. function AsyncIterator(generator) {
  2282. function invoke(method, arg, resolve, reject) {
  2283. var record = tryCatch(generator[method], generator, arg);
  2284. if (record.type === "throw") {
  2285. reject(record.arg);
  2286. } else {
  2287. var result = record.arg;
  2288. var value = result.value;
  2289. if (value &&
  2290. typeof value === "object" &&
  2291. hasOwn.call(value, "__await")) {
  2292. return Promise.resolve(value.__await).then(function(value) {
  2293. invoke("next", value, resolve, reject);
  2294. }, function(err) {
  2295. invoke("throw", err, resolve, reject);
  2296. });
  2297. }
  2298. return Promise.resolve(value).then(function(unwrapped) {
  2299. // When a yielded Promise is resolved, its final value becomes
  2300. // the .value of the Promise<{value,done}> result for the
  2301. // current iteration.
  2302. result.value = unwrapped;
  2303. resolve(result);
  2304. }, function(error) {
  2305. // If a rejected Promise was yielded, throw the rejection back
  2306. // into the async generator function so it can be handled there.
  2307. return invoke("throw", error, resolve, reject);
  2308. });
  2309. }
  2310. }
  2311. var previousPromise;
  2312. function enqueue(method, arg) {
  2313. function callInvokeWithMethodAndArg() {
  2314. return new Promise(function(resolve, reject) {
  2315. invoke(method, arg, resolve, reject);
  2316. });
  2317. }
  2318. return previousPromise =
  2319. // If enqueue has been called before, then we want to wait until
  2320. // all previous Promises have been resolved before calling invoke,
  2321. // so that results are always delivered in the correct order. If
  2322. // enqueue has not been called before, then it is important to
  2323. // call invoke immediately, without waiting on a callback to fire,
  2324. // so that the async generator function has the opportunity to do
  2325. // any necessary setup in a predictable way. This predictability
  2326. // is why the Promise constructor synchronously invokes its
  2327. // executor callback, and why async functions synchronously
  2328. // execute code before the first await. Since we implement simple
  2329. // async functions in terms of async generators, it is especially
  2330. // important to get this right, even though it requires care.
  2331. previousPromise ? previousPromise.then(
  2332. callInvokeWithMethodAndArg,
  2333. // Avoid propagating failures to Promises returned by later
  2334. // invocations of the iterator.
  2335. callInvokeWithMethodAndArg
  2336. ) : callInvokeWithMethodAndArg();
  2337. }
  2338. // Define the unified helper method that is used to implement .next,
  2339. // .throw, and .return (see defineIteratorMethods).
  2340. this._invoke = enqueue;
  2341. }
  2342. defineIteratorMethods(AsyncIterator.prototype);
  2343. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2344. return this;
  2345. };
  2346. runtime.AsyncIterator = AsyncIterator;
  2347. // Note that simple async functions are implemented on top of
  2348. // AsyncIterator objects; they just return a Promise for the value of
  2349. // the final result produced by the iterator.
  2350. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2351. var iter = new AsyncIterator(
  2352. wrap(innerFn, outerFn, self, tryLocsList)
  2353. );
  2354. return runtime.isGeneratorFunction(outerFn)
  2355. ? iter // If outerFn is a generator, return the full iterator.
  2356. : iter.next().then(function(result) {
  2357. return result.done ? result.value : iter.next();
  2358. });
  2359. };
  2360. function makeInvokeMethod(innerFn, self, context) {
  2361. var state = GenStateSuspendedStart;
  2362. return function invoke(method, arg) {
  2363. if (state === GenStateExecuting) {
  2364. throw new Error("Generator is already running");
  2365. }
  2366. if (state === GenStateCompleted) {
  2367. if (method === "throw") {
  2368. throw arg;
  2369. }
  2370. // Be forgiving, per 25.3.3.3.3 of the spec:
  2371. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  2372. return doneResult();
  2373. }
  2374. context.method = method;
  2375. context.arg = arg;
  2376. while (true) {
  2377. var delegate = context.delegate;
  2378. if (delegate) {
  2379. var delegateResult = maybeInvokeDelegate(delegate, context);
  2380. if (delegateResult) {
  2381. if (delegateResult === ContinueSentinel) continue;
  2382. return delegateResult;
  2383. }
  2384. }
  2385. if (context.method === "next") {
  2386. // Setting context._sent for legacy support of Babel's
  2387. // function.sent implementation.
  2388. context.sent = context._sent = context.arg;
  2389. } else if (context.method === "throw") {
  2390. if (state === GenStateSuspendedStart) {
  2391. state = GenStateCompleted;
  2392. throw context.arg;
  2393. }
  2394. context.dispatchException(context.arg);
  2395. } else if (context.method === "return") {
  2396. context.abrupt("return", context.arg);
  2397. }
  2398. state = GenStateExecuting;
  2399. var record = tryCatch(innerFn, self, context);
  2400. if (record.type === "normal") {
  2401. // If an exception is thrown from innerFn, we leave state ===
  2402. // GenStateExecuting and loop back for another invocation.
  2403. state = context.done
  2404. ? GenStateCompleted
  2405. : GenStateSuspendedYield;
  2406. if (record.arg === ContinueSentinel) {
  2407. continue;
  2408. }
  2409. return {
  2410. value: record.arg,
  2411. done: context.done
  2412. };
  2413. } else if (record.type === "throw") {
  2414. state = GenStateCompleted;
  2415. // Dispatch the exception by looping back around to the
  2416. // context.dispatchException(context.arg) call above.
  2417. context.method = "throw";
  2418. context.arg = record.arg;
  2419. }
  2420. }
  2421. };
  2422. }
  2423. // Call delegate.iterator[context.method](context.arg) and handle the
  2424. // result, either by returning a { value, done } result from the
  2425. // delegate iterator, or by modifying context.method and context.arg,
  2426. // setting context.delegate to null, and returning the ContinueSentinel.
  2427. function maybeInvokeDelegate(delegate, context) {
  2428. var method = delegate.iterator[context.method];
  2429. if (method === undefined) {
  2430. // A .throw or .return when the delegate iterator has no .throw
  2431. // method always terminates the yield* loop.
  2432. context.delegate = null;
  2433. if (context.method === "throw") {
  2434. if (delegate.iterator.return) {
  2435. // If the delegate iterator has a return method, give it a
  2436. // chance to clean up.
  2437. context.method = "return";
  2438. context.arg = undefined;
  2439. maybeInvokeDelegate(delegate, context);
  2440. if (context.method === "throw") {
  2441. // If maybeInvokeDelegate(context) changed context.method from
  2442. // "return" to "throw", let that override the TypeError below.
  2443. return ContinueSentinel;
  2444. }
  2445. }
  2446. context.method = "throw";
  2447. context.arg = new TypeError(
  2448. "The iterator does not provide a 'throw' method");
  2449. }
  2450. return ContinueSentinel;
  2451. }
  2452. var record = tryCatch(method, delegate.iterator, context.arg);
  2453. if (record.type === "throw") {
  2454. context.method = "throw";
  2455. context.arg = record.arg;
  2456. context.delegate = null;
  2457. return ContinueSentinel;
  2458. }
  2459. var info = record.arg;
  2460. if (! info) {
  2461. context.method = "throw";
  2462. context.arg = new TypeError("iterator result is not an object");
  2463. context.delegate = null;
  2464. return ContinueSentinel;
  2465. }
  2466. if (info.done) {
  2467. // Assign the result of the finished delegate to the temporary
  2468. // variable specified by delegate.resultName (see delegateYield).
  2469. context[delegate.resultName] = info.value;
  2470. // Resume execution at the desired location (see delegateYield).
  2471. context.next = delegate.nextLoc;
  2472. // If context.method was "throw" but the delegate handled the
  2473. // exception, let the outer generator proceed normally. If
  2474. // context.method was "next", forget context.arg since it has been
  2475. // "consumed" by the delegate iterator. If context.method was
  2476. // "return", allow the original .return call to continue in the
  2477. // outer generator.
  2478. if (context.method !== "return") {
  2479. context.method = "next";
  2480. context.arg = undefined;
  2481. }
  2482. } else {
  2483. // Re-yield the result returned by the delegate method.
  2484. return info;
  2485. }
  2486. // The delegate iterator is finished, so forget it and continue with
  2487. // the outer generator.
  2488. context.delegate = null;
  2489. return ContinueSentinel;
  2490. }
  2491. // Define Generator.prototype.{next,throw,return} in terms of the
  2492. // unified ._invoke helper method.
  2493. defineIteratorMethods(Gp);
  2494. Gp[toStringTagSymbol] = "Generator";
  2495. // A Generator should always return itself as the iterator object when the
  2496. // @@iterator function is called on it. Some browsers' implementations of the
  2497. // iterator prototype chain incorrectly implement this, causing the Generator
  2498. // object to not be returned from this call. This ensures that doesn't happen.
  2499. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2500. Gp[iteratorSymbol] = function() {
  2501. return this;
  2502. };
  2503. Gp.toString = function() {
  2504. return "[object Generator]";
  2505. };
  2506. function pushTryEntry(locs) {
  2507. var entry = { tryLoc: locs[0] };
  2508. if (1 in locs) {
  2509. entry.catchLoc = locs[1];
  2510. }
  2511. if (2 in locs) {
  2512. entry.finallyLoc = locs[2];
  2513. entry.afterLoc = locs[3];
  2514. }
  2515. this.tryEntries.push(entry);
  2516. }
  2517. function resetTryEntry(entry) {
  2518. var record = entry.completion || {};
  2519. record.type = "normal";
  2520. delete record.arg;
  2521. entry.completion = record;
  2522. }
  2523. function Context(tryLocsList) {
  2524. // The root entry object (effectively a try statement without a catch
  2525. // or a finally block) gives us a place to store values thrown from
  2526. // locations where there is no enclosing try statement.
  2527. this.tryEntries = [{ tryLoc: "root" }];
  2528. tryLocsList.forEach(pushTryEntry, this);
  2529. this.reset(true);
  2530. }
  2531. runtime.keys = function(object) {
  2532. var keys = [];
  2533. for (var key in object) {
  2534. keys.push(key);
  2535. }
  2536. keys.reverse();
  2537. // Rather than returning an object with a next method, we keep
  2538. // things simple and return the next function itself.
  2539. return function next() {
  2540. while (keys.length) {
  2541. var key = keys.pop();
  2542. if (key in object) {
  2543. next.value = key;
  2544. next.done = false;
  2545. return next;
  2546. }
  2547. }
  2548. // To avoid creating an additional object, we just hang the .value
  2549. // and .done properties off the next function object itself. This
  2550. // also ensures that the minifier will not anonymize the function.
  2551. next.done = true;
  2552. return next;
  2553. };
  2554. };
  2555. function values(iterable) {
  2556. if (iterable) {
  2557. var iteratorMethod = iterable[iteratorSymbol];
  2558. if (iteratorMethod) {
  2559. return iteratorMethod.call(iterable);
  2560. }
  2561. if (typeof iterable.next === "function") {
  2562. return iterable;
  2563. }
  2564. if (!isNaN(iterable.length)) {
  2565. var i = -1, next = function next() {
  2566. while (++i < iterable.length) {
  2567. if (hasOwn.call(iterable, i)) {
  2568. next.value = iterable[i];
  2569. next.done = false;
  2570. return next;
  2571. }
  2572. }
  2573. next.value = undefined;
  2574. next.done = true;
  2575. return next;
  2576. };
  2577. return next.next = next;
  2578. }
  2579. }
  2580. // Return an iterator with no values.
  2581. return { next: doneResult };
  2582. }
  2583. runtime.values = values;
  2584. function doneResult() {
  2585. return { value: undefined, done: true };
  2586. }
  2587. Context.prototype = {
  2588. constructor: Context,
  2589. reset: function(skipTempReset) {
  2590. this.prev = 0;
  2591. this.next = 0;
  2592. // Resetting context._sent for legacy support of Babel's
  2593. // function.sent implementation.
  2594. this.sent = this._sent = undefined;
  2595. this.done = false;
  2596. this.delegate = null;
  2597. this.method = "next";
  2598. this.arg = undefined;
  2599. this.tryEntries.forEach(resetTryEntry);
  2600. if (!skipTempReset) {
  2601. for (var name in this) {
  2602. // Not sure about the optimal order of these conditions:
  2603. if (name.charAt(0) === "t" &&
  2604. hasOwn.call(this, name) &&
  2605. !isNaN(+name.slice(1))) {
  2606. this[name] = undefined;
  2607. }
  2608. }
  2609. }
  2610. },
  2611. stop: function() {
  2612. this.done = true;
  2613. var rootEntry = this.tryEntries[0];
  2614. var rootRecord = rootEntry.completion;
  2615. if (rootRecord.type === "throw") {
  2616. throw rootRecord.arg;
  2617. }
  2618. return this.rval;
  2619. },
  2620. dispatchException: function(exception) {
  2621. if (this.done) {
  2622. throw exception;
  2623. }
  2624. var context = this;
  2625. function handle(loc, caught) {
  2626. record.type = "throw";
  2627. record.arg = exception;
  2628. context.next = loc;
  2629. if (caught) {
  2630. // If the dispatched exception was caught by a catch block,
  2631. // then let that catch block handle the exception normally.
  2632. context.method = "next";
  2633. context.arg = undefined;
  2634. }
  2635. return !! caught;
  2636. }
  2637. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2638. var entry = this.tryEntries[i];
  2639. var record = entry.completion;
  2640. if (entry.tryLoc === "root") {
  2641. // Exception thrown outside of any try block that could handle
  2642. // it, so set the completion value of the entire function to
  2643. // throw the exception.
  2644. return handle("end");
  2645. }
  2646. if (entry.tryLoc <= this.prev) {
  2647. var hasCatch = hasOwn.call(entry, "catchLoc");
  2648. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2649. if (hasCatch && hasFinally) {
  2650. if (this.prev < entry.catchLoc) {
  2651. return handle(entry.catchLoc, true);
  2652. } else if (this.prev < entry.finallyLoc) {
  2653. return handle(entry.finallyLoc);
  2654. }
  2655. } else if (hasCatch) {
  2656. if (this.prev < entry.catchLoc) {
  2657. return handle(entry.catchLoc, true);
  2658. }
  2659. } else if (hasFinally) {
  2660. if (this.prev < entry.finallyLoc) {
  2661. return handle(entry.finallyLoc);
  2662. }
  2663. } else {
  2664. throw new Error("try statement without catch or finally");
  2665. }
  2666. }
  2667. }
  2668. },
  2669. abrupt: function(type, arg) {
  2670. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2671. var entry = this.tryEntries[i];
  2672. if (entry.tryLoc <= this.prev &&
  2673. hasOwn.call(entry, "finallyLoc") &&
  2674. this.prev < entry.finallyLoc) {
  2675. var finallyEntry = entry;
  2676. break;
  2677. }
  2678. }
  2679. if (finallyEntry &&
  2680. (type === "break" ||
  2681. type === "continue") &&
  2682. finallyEntry.tryLoc <= arg &&
  2683. arg <= finallyEntry.finallyLoc) {
  2684. // Ignore the finally entry if control is not jumping to a
  2685. // location outside the try/catch block.
  2686. finallyEntry = null;
  2687. }
  2688. var record = finallyEntry ? finallyEntry.completion : {};
  2689. record.type = type;
  2690. record.arg = arg;
  2691. if (finallyEntry) {
  2692. this.method = "next";
  2693. this.next = finallyEntry.finallyLoc;
  2694. return ContinueSentinel;
  2695. }
  2696. return this.complete(record);
  2697. },
  2698. complete: function(record, afterLoc) {
  2699. if (record.type === "throw") {
  2700. throw record.arg;
  2701. }
  2702. if (record.type === "break" ||
  2703. record.type === "continue") {
  2704. this.next = record.arg;
  2705. } else if (record.type === "return") {
  2706. this.rval = this.arg = record.arg;
  2707. this.method = "return";
  2708. this.next = "end";
  2709. } else if (record.type === "normal" && afterLoc) {
  2710. this.next = afterLoc;
  2711. }
  2712. return ContinueSentinel;
  2713. },
  2714. finish: function(finallyLoc) {
  2715. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2716. var entry = this.tryEntries[i];
  2717. if (entry.finallyLoc === finallyLoc) {
  2718. this.complete(entry.completion, entry.afterLoc);
  2719. resetTryEntry(entry);
  2720. return ContinueSentinel;
  2721. }
  2722. }
  2723. },
  2724. "catch": function(tryLoc) {
  2725. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2726. var entry = this.tryEntries[i];
  2727. if (entry.tryLoc === tryLoc) {
  2728. var record = entry.completion;
  2729. if (record.type === "throw") {
  2730. var thrown = record.arg;
  2731. resetTryEntry(entry);
  2732. }
  2733. return thrown;
  2734. }
  2735. }
  2736. // The context.catch method must only be called with a location
  2737. // argument that corresponds to a known catch block.
  2738. throw new Error("illegal catch attempt");
  2739. },
  2740. delegateYield: function(iterable, resultName, nextLoc) {
  2741. this.delegate = {
  2742. iterator: values(iterable),
  2743. resultName: resultName,
  2744. nextLoc: nextLoc
  2745. };
  2746. if (this.method === "next") {
  2747. // Deliberately forget the last sent value so that we don't
  2748. // accidentally pass it on to the delegate.
  2749. this.arg = undefined;
  2750. }
  2751. return ContinueSentinel;
  2752. }
  2753. };
  2754. })(
  2755. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2756. // Function constructor if we're in global strict mode. That is sadly a form
  2757. // of indirect eval which violates Content Security Policy.
  2758. (function() {
  2759. return this || (typeof self === "object" && self);
  2760. })() || Function("return this")()
  2761. );
  2762. /***/ }),
  2763. /***/ 18:
  2764. /*!****************************************!*\
  2765. !*** G:/gsxm/lnyk/utils/loginUtils.js ***!
  2766. \****************************************/
  2767. /*! no static exports found */
  2768. /***/ (function(module, exports, __webpack_require__) {
  2769. "use strict";
  2770. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getActionPage = getActionPage;exports.interceptor = interceptor;exports.saveUrl = saveUrl;function getActionPage() {
  2771. var pages = getCurrentPages();
  2772. return pages[pages.length - 1];
  2773. }
  2774. //登录拦截
  2775. function interceptor() {
  2776. } // let pages = getActionPage();
  2777. // // 获取当前页面
  2778. // let pageUrl = '/' + pages.route;
  2779. // let url = '/pages/public/login'
  2780. // 保存页面
  2781. function saveUrl() {// 获取当前页面
  2782. var page = getActionPage(); // 获取跳转前路由地址
  2783. var path = '/' + page.route;
  2784. // 保存当前过去页面
  2785. uni.setStorageSync('present', path);
  2786. // 返回是否存储成功
  2787. return true;
  2788. }
  2789. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2790. /***/ }),
  2791. /***/ 195:
  2792. /*!*************************************!*\
  2793. !*** G:/gsxm/lnyk/api/quotation.js ***!
  2794. \*************************************/
  2795. /*! no static exports found */
  2796. /***/ (function(module, exports, __webpack_require__) {
  2797. "use strict";
  2798. Object.defineProperty(exports, "__esModule", { value: true });exports.query = query;exports.order = order;exports.recharge = recharge;exports.getbill = getbill;exports.ustd = ustd;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2799. function query(data) {
  2800. return (0, _request.default)({
  2801. url: '/api/mine/query',
  2802. method: 'get',
  2803. data: data });
  2804. }
  2805. function order(data) {
  2806. return (0, _request.default)({
  2807. url: '/api/mine/order',
  2808. method: 'post',
  2809. data: data });
  2810. }
  2811. function recharge(data) {
  2812. return (0, _request.default)({
  2813. url: '/api/share',
  2814. method: 'get',
  2815. data: data });
  2816. }
  2817. function getbill(data) {
  2818. return (0, _request.default)({
  2819. url: '/api/mine/getbill',
  2820. method: 'post',
  2821. data: data });
  2822. }
  2823. function ustd(data) {
  2824. return (0, _request.default)({
  2825. url: '/api/recharge/ustd',
  2826. method: 'post',
  2827. data: data });
  2828. }
  2829. /***/ }),
  2830. /***/ 2:
  2831. /*!******************************************************************************************!*\
  2832. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2833. \******************************************************************************************/
  2834. /*! exports provided: default */
  2835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2836. "use strict";
  2837. __webpack_require__.r(__webpack_exports__);
  2838. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2839. * Vue.js v2.6.11
  2840. * (c) 2014-2021 Evan You
  2841. * Released under the MIT License.
  2842. */
  2843. /* */
  2844. var emptyObject = Object.freeze({});
  2845. // These helpers produce better VM code in JS engines due to their
  2846. // explicitness and function inlining.
  2847. function isUndef (v) {
  2848. return v === undefined || v === null
  2849. }
  2850. function isDef (v) {
  2851. return v !== undefined && v !== null
  2852. }
  2853. function isTrue (v) {
  2854. return v === true
  2855. }
  2856. function isFalse (v) {
  2857. return v === false
  2858. }
  2859. /**
  2860. * Check if value is primitive.
  2861. */
  2862. function isPrimitive (value) {
  2863. return (
  2864. typeof value === 'string' ||
  2865. typeof value === 'number' ||
  2866. // $flow-disable-line
  2867. typeof value === 'symbol' ||
  2868. typeof value === 'boolean'
  2869. )
  2870. }
  2871. /**
  2872. * Quick object check - this is primarily used to tell
  2873. * Objects from primitive values when we know the value
  2874. * is a JSON-compliant type.
  2875. */
  2876. function isObject (obj) {
  2877. return obj !== null && typeof obj === 'object'
  2878. }
  2879. /**
  2880. * Get the raw type string of a value, e.g., [object Object].
  2881. */
  2882. var _toString = Object.prototype.toString;
  2883. function toRawType (value) {
  2884. return _toString.call(value).slice(8, -1)
  2885. }
  2886. /**
  2887. * Strict object type check. Only returns true
  2888. * for plain JavaScript objects.
  2889. */
  2890. function isPlainObject (obj) {
  2891. return _toString.call(obj) === '[object Object]'
  2892. }
  2893. function isRegExp (v) {
  2894. return _toString.call(v) === '[object RegExp]'
  2895. }
  2896. /**
  2897. * Check if val is a valid array index.
  2898. */
  2899. function isValidArrayIndex (val) {
  2900. var n = parseFloat(String(val));
  2901. return n >= 0 && Math.floor(n) === n && isFinite(val)
  2902. }
  2903. function isPromise (val) {
  2904. return (
  2905. isDef(val) &&
  2906. typeof val.then === 'function' &&
  2907. typeof val.catch === 'function'
  2908. )
  2909. }
  2910. /**
  2911. * Convert a value to a string that is actually rendered.
  2912. */
  2913. function toString (val) {
  2914. return val == null
  2915. ? ''
  2916. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  2917. ? JSON.stringify(val, null, 2)
  2918. : String(val)
  2919. }
  2920. /**
  2921. * Convert an input value to a number for persistence.
  2922. * If the conversion fails, return original string.
  2923. */
  2924. function toNumber (val) {
  2925. var n = parseFloat(val);
  2926. return isNaN(n) ? val : n
  2927. }
  2928. /**
  2929. * Make a map and return a function for checking if a key
  2930. * is in that map.
  2931. */
  2932. function makeMap (
  2933. str,
  2934. expectsLowerCase
  2935. ) {
  2936. var map = Object.create(null);
  2937. var list = str.split(',');
  2938. for (var i = 0; i < list.length; i++) {
  2939. map[list[i]] = true;
  2940. }
  2941. return expectsLowerCase
  2942. ? function (val) { return map[val.toLowerCase()]; }
  2943. : function (val) { return map[val]; }
  2944. }
  2945. /**
  2946. * Check if a tag is a built-in tag.
  2947. */
  2948. var isBuiltInTag = makeMap('slot,component', true);
  2949. /**
  2950. * Check if an attribute is a reserved attribute.
  2951. */
  2952. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  2953. /**
  2954. * Remove an item from an array.
  2955. */
  2956. function remove (arr, item) {
  2957. if (arr.length) {
  2958. var index = arr.indexOf(item);
  2959. if (index > -1) {
  2960. return arr.splice(index, 1)
  2961. }
  2962. }
  2963. }
  2964. /**
  2965. * Check whether an object has the property.
  2966. */
  2967. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2968. function hasOwn (obj, key) {
  2969. return hasOwnProperty.call(obj, key)
  2970. }
  2971. /**
  2972. * Create a cached version of a pure function.
  2973. */
  2974. function cached (fn) {
  2975. var cache = Object.create(null);
  2976. return (function cachedFn (str) {
  2977. var hit = cache[str];
  2978. return hit || (cache[str] = fn(str))
  2979. })
  2980. }
  2981. /**
  2982. * Camelize a hyphen-delimited string.
  2983. */
  2984. var camelizeRE = /-(\w)/g;
  2985. var camelize = cached(function (str) {
  2986. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  2987. });
  2988. /**
  2989. * Capitalize a string.
  2990. */
  2991. var capitalize = cached(function (str) {
  2992. return str.charAt(0).toUpperCase() + str.slice(1)
  2993. });
  2994. /**
  2995. * Hyphenate a camelCase string.
  2996. */
  2997. var hyphenateRE = /\B([A-Z])/g;
  2998. var hyphenate = cached(function (str) {
  2999. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3000. });
  3001. /**
  3002. * Simple bind polyfill for environments that do not support it,
  3003. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3004. * since native bind is now performant enough in most browsers.
  3005. * But removing it would mean breaking code that was able to run in
  3006. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3007. */
  3008. /* istanbul ignore next */
  3009. function polyfillBind (fn, ctx) {
  3010. function boundFn (a) {
  3011. var l = arguments.length;
  3012. return l
  3013. ? l > 1
  3014. ? fn.apply(ctx, arguments)
  3015. : fn.call(ctx, a)
  3016. : fn.call(ctx)
  3017. }
  3018. boundFn._length = fn.length;
  3019. return boundFn
  3020. }
  3021. function nativeBind (fn, ctx) {
  3022. return fn.bind(ctx)
  3023. }
  3024. var bind = Function.prototype.bind
  3025. ? nativeBind
  3026. : polyfillBind;
  3027. /**
  3028. * Convert an Array-like object to a real Array.
  3029. */
  3030. function toArray (list, start) {
  3031. start = start || 0;
  3032. var i = list.length - start;
  3033. var ret = new Array(i);
  3034. while (i--) {
  3035. ret[i] = list[i + start];
  3036. }
  3037. return ret
  3038. }
  3039. /**
  3040. * Mix properties into target object.
  3041. */
  3042. function extend (to, _from) {
  3043. for (var key in _from) {
  3044. to[key] = _from[key];
  3045. }
  3046. return to
  3047. }
  3048. /**
  3049. * Merge an Array of Objects into a single Object.
  3050. */
  3051. function toObject (arr) {
  3052. var res = {};
  3053. for (var i = 0; i < arr.length; i++) {
  3054. if (arr[i]) {
  3055. extend(res, arr[i]);
  3056. }
  3057. }
  3058. return res
  3059. }
  3060. /* eslint-disable no-unused-vars */
  3061. /**
  3062. * Perform no operation.
  3063. * Stubbing args to make Flow happy without leaving useless transpiled code
  3064. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3065. */
  3066. function noop (a, b, c) {}
  3067. /**
  3068. * Always return false.
  3069. */
  3070. var no = function (a, b, c) { return false; };
  3071. /* eslint-enable no-unused-vars */
  3072. /**
  3073. * Return the same value.
  3074. */
  3075. var identity = function (_) { return _; };
  3076. /**
  3077. * Check if two values are loosely equal - that is,
  3078. * if they are plain objects, do they have the same shape?
  3079. */
  3080. function looseEqual (a, b) {
  3081. if (a === b) { return true }
  3082. var isObjectA = isObject(a);
  3083. var isObjectB = isObject(b);
  3084. if (isObjectA && isObjectB) {
  3085. try {
  3086. var isArrayA = Array.isArray(a);
  3087. var isArrayB = Array.isArray(b);
  3088. if (isArrayA && isArrayB) {
  3089. return a.length === b.length && a.every(function (e, i) {
  3090. return looseEqual(e, b[i])
  3091. })
  3092. } else if (a instanceof Date && b instanceof Date) {
  3093. return a.getTime() === b.getTime()
  3094. } else if (!isArrayA && !isArrayB) {
  3095. var keysA = Object.keys(a);
  3096. var keysB = Object.keys(b);
  3097. return keysA.length === keysB.length && keysA.every(function (key) {
  3098. return looseEqual(a[key], b[key])
  3099. })
  3100. } else {
  3101. /* istanbul ignore next */
  3102. return false
  3103. }
  3104. } catch (e) {
  3105. /* istanbul ignore next */
  3106. return false
  3107. }
  3108. } else if (!isObjectA && !isObjectB) {
  3109. return String(a) === String(b)
  3110. } else {
  3111. return false
  3112. }
  3113. }
  3114. /**
  3115. * Return the first index at which a loosely equal value can be
  3116. * found in the array (if value is a plain object, the array must
  3117. * contain an object of the same shape), or -1 if it is not present.
  3118. */
  3119. function looseIndexOf (arr, val) {
  3120. for (var i = 0; i < arr.length; i++) {
  3121. if (looseEqual(arr[i], val)) { return i }
  3122. }
  3123. return -1
  3124. }
  3125. /**
  3126. * Ensure a function is called only once.
  3127. */
  3128. function once (fn) {
  3129. var called = false;
  3130. return function () {
  3131. if (!called) {
  3132. called = true;
  3133. fn.apply(this, arguments);
  3134. }
  3135. }
  3136. }
  3137. var ASSET_TYPES = [
  3138. 'component',
  3139. 'directive',
  3140. 'filter'
  3141. ];
  3142. var LIFECYCLE_HOOKS = [
  3143. 'beforeCreate',
  3144. 'created',
  3145. 'beforeMount',
  3146. 'mounted',
  3147. 'beforeUpdate',
  3148. 'updated',
  3149. 'beforeDestroy',
  3150. 'destroyed',
  3151. 'activated',
  3152. 'deactivated',
  3153. 'errorCaptured',
  3154. 'serverPrefetch'
  3155. ];
  3156. /* */
  3157. var config = ({
  3158. /**
  3159. * Option merge strategies (used in core/util/options)
  3160. */
  3161. // $flow-disable-line
  3162. optionMergeStrategies: Object.create(null),
  3163. /**
  3164. * Whether to suppress warnings.
  3165. */
  3166. silent: false,
  3167. /**
  3168. * Show production mode tip message on boot?
  3169. */
  3170. productionTip: "development" !== 'production',
  3171. /**
  3172. * Whether to enable devtools
  3173. */
  3174. devtools: "development" !== 'production',
  3175. /**
  3176. * Whether to record perf
  3177. */
  3178. performance: false,
  3179. /**
  3180. * Error handler for watcher errors
  3181. */
  3182. errorHandler: null,
  3183. /**
  3184. * Warn handler for watcher warns
  3185. */
  3186. warnHandler: null,
  3187. /**
  3188. * Ignore certain custom elements
  3189. */
  3190. ignoredElements: [],
  3191. /**
  3192. * Custom user key aliases for v-on
  3193. */
  3194. // $flow-disable-line
  3195. keyCodes: Object.create(null),
  3196. /**
  3197. * Check if a tag is reserved so that it cannot be registered as a
  3198. * component. This is platform-dependent and may be overwritten.
  3199. */
  3200. isReservedTag: no,
  3201. /**
  3202. * Check if an attribute is reserved so that it cannot be used as a component
  3203. * prop. This is platform-dependent and may be overwritten.
  3204. */
  3205. isReservedAttr: no,
  3206. /**
  3207. * Check if a tag is an unknown element.
  3208. * Platform-dependent.
  3209. */
  3210. isUnknownElement: no,
  3211. /**
  3212. * Get the namespace of an element
  3213. */
  3214. getTagNamespace: noop,
  3215. /**
  3216. * Parse the real tag name for the specific platform.
  3217. */
  3218. parsePlatformTagName: identity,
  3219. /**
  3220. * Check if an attribute must be bound using property, e.g. value
  3221. * Platform-dependent.
  3222. */
  3223. mustUseProp: no,
  3224. /**
  3225. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3226. * This will significantly reduce performance if set to false.
  3227. */
  3228. async: true,
  3229. /**
  3230. * Exposed for legacy reasons
  3231. */
  3232. _lifecycleHooks: LIFECYCLE_HOOKS
  3233. });
  3234. /* */
  3235. /**
  3236. * unicode letters used for parsing html tags, component names and property paths.
  3237. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3238. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3239. */
  3240. 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/;
  3241. /**
  3242. * Check if a string starts with $ or _
  3243. */
  3244. function isReserved (str) {
  3245. var c = (str + '').charCodeAt(0);
  3246. return c === 0x24 || c === 0x5F
  3247. }
  3248. /**
  3249. * Define a property.
  3250. */
  3251. function def (obj, key, val, enumerable) {
  3252. Object.defineProperty(obj, key, {
  3253. value: val,
  3254. enumerable: !!enumerable,
  3255. writable: true,
  3256. configurable: true
  3257. });
  3258. }
  3259. /**
  3260. * Parse simple path.
  3261. */
  3262. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3263. function parsePath (path) {
  3264. if (bailRE.test(path)) {
  3265. return
  3266. }
  3267. var segments = path.split('.');
  3268. return function (obj) {
  3269. for (var i = 0; i < segments.length; i++) {
  3270. if (!obj) { return }
  3271. obj = obj[segments[i]];
  3272. }
  3273. return obj
  3274. }
  3275. }
  3276. /* */
  3277. // can we use __proto__?
  3278. var hasProto = '__proto__' in {};
  3279. // Browser environment sniffing
  3280. var inBrowser = typeof window !== 'undefined';
  3281. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3282. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3283. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3284. var isIE = UA && /msie|trident/.test(UA);
  3285. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3286. var isEdge = UA && UA.indexOf('edge/') > 0;
  3287. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3288. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3289. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3290. var isPhantomJS = UA && /phantomjs/.test(UA);
  3291. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3292. // Firefox has a "watch" function on Object.prototype...
  3293. var nativeWatch = ({}).watch;
  3294. if (inBrowser) {
  3295. try {
  3296. var opts = {};
  3297. Object.defineProperty(opts, 'passive', ({
  3298. get: function get () {
  3299. }
  3300. })); // https://github.com/facebook/flow/issues/285
  3301. window.addEventListener('test-passive', null, opts);
  3302. } catch (e) {}
  3303. }
  3304. // this needs to be lazy-evaled because vue may be required before
  3305. // vue-server-renderer can set VUE_ENV
  3306. var _isServer;
  3307. var isServerRendering = function () {
  3308. if (_isServer === undefined) {
  3309. /* istanbul ignore if */
  3310. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3311. // detect presence of vue-server-renderer and avoid
  3312. // Webpack shimming the process
  3313. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3314. } else {
  3315. _isServer = false;
  3316. }
  3317. }
  3318. return _isServer
  3319. };
  3320. // detect devtools
  3321. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3322. /* istanbul ignore next */
  3323. function isNative (Ctor) {
  3324. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3325. }
  3326. var hasSymbol =
  3327. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3328. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3329. var _Set;
  3330. /* istanbul ignore if */ // $flow-disable-line
  3331. if (typeof Set !== 'undefined' && isNative(Set)) {
  3332. // use native Set when available.
  3333. _Set = Set;
  3334. } else {
  3335. // a non-standard Set polyfill that only works with primitive keys.
  3336. _Set = /*@__PURE__*/(function () {
  3337. function Set () {
  3338. this.set = Object.create(null);
  3339. }
  3340. Set.prototype.has = function has (key) {
  3341. return this.set[key] === true
  3342. };
  3343. Set.prototype.add = function add (key) {
  3344. this.set[key] = true;
  3345. };
  3346. Set.prototype.clear = function clear () {
  3347. this.set = Object.create(null);
  3348. };
  3349. return Set;
  3350. }());
  3351. }
  3352. /* */
  3353. var warn = noop;
  3354. var tip = noop;
  3355. var generateComponentTrace = (noop); // work around flow check
  3356. var formatComponentName = (noop);
  3357. if (true) {
  3358. var hasConsole = typeof console !== 'undefined';
  3359. var classifyRE = /(?:^|[-_])(\w)/g;
  3360. var classify = function (str) { return str
  3361. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3362. .replace(/[-_]/g, ''); };
  3363. warn = function (msg, vm) {
  3364. var trace = vm ? generateComponentTrace(vm) : '';
  3365. if (config.warnHandler) {
  3366. config.warnHandler.call(null, msg, vm, trace);
  3367. } else if (hasConsole && (!config.silent)) {
  3368. console.error(("[Vue warn]: " + msg + trace));
  3369. }
  3370. };
  3371. tip = function (msg, vm) {
  3372. if (hasConsole && (!config.silent)) {
  3373. console.warn("[Vue tip]: " + msg + (
  3374. vm ? generateComponentTrace(vm) : ''
  3375. ));
  3376. }
  3377. };
  3378. formatComponentName = function (vm, includeFile) {
  3379. if (vm.$root === vm) {
  3380. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3381. return ('') + vm.$options.__file
  3382. }
  3383. return '<Root>'
  3384. }
  3385. var options = typeof vm === 'function' && vm.cid != null
  3386. ? vm.options
  3387. : vm._isVue
  3388. ? vm.$options || vm.constructor.options
  3389. : vm;
  3390. var name = options.name || options._componentTag;
  3391. var file = options.__file;
  3392. if (!name && file) {
  3393. var match = file.match(/([^/\\]+)\.vue$/);
  3394. name = match && match[1];
  3395. }
  3396. return (
  3397. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3398. (file && includeFile !== false ? (" at " + file) : '')
  3399. )
  3400. };
  3401. var repeat = function (str, n) {
  3402. var res = '';
  3403. while (n) {
  3404. if (n % 2 === 1) { res += str; }
  3405. if (n > 1) { str += str; }
  3406. n >>= 1;
  3407. }
  3408. return res
  3409. };
  3410. generateComponentTrace = function (vm) {
  3411. if (vm._isVue && vm.$parent) {
  3412. var tree = [];
  3413. var currentRecursiveSequence = 0;
  3414. while (vm && vm.$options.name !== 'PageBody') {
  3415. if (tree.length > 0) {
  3416. var last = tree[tree.length - 1];
  3417. if (last.constructor === vm.constructor) {
  3418. currentRecursiveSequence++;
  3419. vm = vm.$parent;
  3420. continue
  3421. } else if (currentRecursiveSequence > 0) {
  3422. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3423. currentRecursiveSequence = 0;
  3424. }
  3425. }
  3426. !vm.$options.isReserved && tree.push(vm);
  3427. vm = vm.$parent;
  3428. }
  3429. return '\n\nfound in\n\n' + tree
  3430. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3431. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3432. : formatComponentName(vm))); })
  3433. .join('\n')
  3434. } else {
  3435. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3436. }
  3437. };
  3438. }
  3439. /* */
  3440. var uid = 0;
  3441. /**
  3442. * A dep is an observable that can have multiple
  3443. * directives subscribing to it.
  3444. */
  3445. var Dep = function Dep () {
  3446. this.id = uid++;
  3447. this.subs = [];
  3448. };
  3449. Dep.prototype.addSub = function addSub (sub) {
  3450. this.subs.push(sub);
  3451. };
  3452. Dep.prototype.removeSub = function removeSub (sub) {
  3453. remove(this.subs, sub);
  3454. };
  3455. Dep.prototype.depend = function depend () {
  3456. if (Dep.SharedObject.target) {
  3457. Dep.SharedObject.target.addDep(this);
  3458. }
  3459. };
  3460. Dep.prototype.notify = function notify () {
  3461. // stabilize the subscriber list first
  3462. var subs = this.subs.slice();
  3463. if ( true && !config.async) {
  3464. // subs aren't sorted in scheduler if not running async
  3465. // we need to sort them now to make sure they fire in correct
  3466. // order
  3467. subs.sort(function (a, b) { return a.id - b.id; });
  3468. }
  3469. for (var i = 0, l = subs.length; i < l; i++) {
  3470. subs[i].update();
  3471. }
  3472. };
  3473. // The current target watcher being evaluated.
  3474. // This is globally unique because only one watcher
  3475. // can be evaluated at a time.
  3476. // fixed by xxxxxx (nvue shared vuex)
  3477. /* eslint-disable no-undef */
  3478. Dep.SharedObject = {};
  3479. Dep.SharedObject.target = null;
  3480. Dep.SharedObject.targetStack = [];
  3481. function pushTarget (target) {
  3482. Dep.SharedObject.targetStack.push(target);
  3483. Dep.SharedObject.target = target;
  3484. Dep.target = target;
  3485. }
  3486. function popTarget () {
  3487. Dep.SharedObject.targetStack.pop();
  3488. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3489. Dep.target = Dep.SharedObject.target;
  3490. }
  3491. /* */
  3492. var VNode = function VNode (
  3493. tag,
  3494. data,
  3495. children,
  3496. text,
  3497. elm,
  3498. context,
  3499. componentOptions,
  3500. asyncFactory
  3501. ) {
  3502. this.tag = tag;
  3503. this.data = data;
  3504. this.children = children;
  3505. this.text = text;
  3506. this.elm = elm;
  3507. this.ns = undefined;
  3508. this.context = context;
  3509. this.fnContext = undefined;
  3510. this.fnOptions = undefined;
  3511. this.fnScopeId = undefined;
  3512. this.key = data && data.key;
  3513. this.componentOptions = componentOptions;
  3514. this.componentInstance = undefined;
  3515. this.parent = undefined;
  3516. this.raw = false;
  3517. this.isStatic = false;
  3518. this.isRootInsert = true;
  3519. this.isComment = false;
  3520. this.isCloned = false;
  3521. this.isOnce = false;
  3522. this.asyncFactory = asyncFactory;
  3523. this.asyncMeta = undefined;
  3524. this.isAsyncPlaceholder = false;
  3525. };
  3526. var prototypeAccessors = { child: { configurable: true } };
  3527. // DEPRECATED: alias for componentInstance for backwards compat.
  3528. /* istanbul ignore next */
  3529. prototypeAccessors.child.get = function () {
  3530. return this.componentInstance
  3531. };
  3532. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3533. var createEmptyVNode = function (text) {
  3534. if ( text === void 0 ) text = '';
  3535. var node = new VNode();
  3536. node.text = text;
  3537. node.isComment = true;
  3538. return node
  3539. };
  3540. function createTextVNode (val) {
  3541. return new VNode(undefined, undefined, undefined, String(val))
  3542. }
  3543. // optimized shallow clone
  3544. // used for static nodes and slot nodes because they may be reused across
  3545. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3546. // on their elm reference.
  3547. function cloneVNode (vnode) {
  3548. var cloned = new VNode(
  3549. vnode.tag,
  3550. vnode.data,
  3551. // #7975
  3552. // clone children array to avoid mutating original in case of cloning
  3553. // a child.
  3554. vnode.children && vnode.children.slice(),
  3555. vnode.text,
  3556. vnode.elm,
  3557. vnode.context,
  3558. vnode.componentOptions,
  3559. vnode.asyncFactory
  3560. );
  3561. cloned.ns = vnode.ns;
  3562. cloned.isStatic = vnode.isStatic;
  3563. cloned.key = vnode.key;
  3564. cloned.isComment = vnode.isComment;
  3565. cloned.fnContext = vnode.fnContext;
  3566. cloned.fnOptions = vnode.fnOptions;
  3567. cloned.fnScopeId = vnode.fnScopeId;
  3568. cloned.asyncMeta = vnode.asyncMeta;
  3569. cloned.isCloned = true;
  3570. return cloned
  3571. }
  3572. /*
  3573. * not type checking this file because flow doesn't play well with
  3574. * dynamically accessing methods on Array prototype
  3575. */
  3576. var arrayProto = Array.prototype;
  3577. var arrayMethods = Object.create(arrayProto);
  3578. var methodsToPatch = [
  3579. 'push',
  3580. 'pop',
  3581. 'shift',
  3582. 'unshift',
  3583. 'splice',
  3584. 'sort',
  3585. 'reverse'
  3586. ];
  3587. /**
  3588. * Intercept mutating methods and emit events
  3589. */
  3590. methodsToPatch.forEach(function (method) {
  3591. // cache original method
  3592. var original = arrayProto[method];
  3593. def(arrayMethods, method, function mutator () {
  3594. var args = [], len = arguments.length;
  3595. while ( len-- ) args[ len ] = arguments[ len ];
  3596. var result = original.apply(this, args);
  3597. var ob = this.__ob__;
  3598. var inserted;
  3599. switch (method) {
  3600. case 'push':
  3601. case 'unshift':
  3602. inserted = args;
  3603. break
  3604. case 'splice':
  3605. inserted = args.slice(2);
  3606. break
  3607. }
  3608. if (inserted) { ob.observeArray(inserted); }
  3609. // notify change
  3610. ob.dep.notify();
  3611. return result
  3612. });
  3613. });
  3614. /* */
  3615. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3616. /**
  3617. * In some cases we may want to disable observation inside a component's
  3618. * update computation.
  3619. */
  3620. var shouldObserve = true;
  3621. function toggleObserving (value) {
  3622. shouldObserve = value;
  3623. }
  3624. /**
  3625. * Observer class that is attached to each observed
  3626. * object. Once attached, the observer converts the target
  3627. * object's property keys into getter/setters that
  3628. * collect dependencies and dispatch updates.
  3629. */
  3630. var Observer = function Observer (value) {
  3631. this.value = value;
  3632. this.dep = new Dep();
  3633. this.vmCount = 0;
  3634. def(value, '__ob__', this);
  3635. if (Array.isArray(value)) {
  3636. if (hasProto) {
  3637. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3638. if(value.push !== value.__proto__.push){
  3639. copyAugment(value, arrayMethods, arrayKeys);
  3640. } else {
  3641. protoAugment(value, arrayMethods);
  3642. }
  3643. }
  3644. } else {
  3645. copyAugment(value, arrayMethods, arrayKeys);
  3646. }
  3647. this.observeArray(value);
  3648. } else {
  3649. this.walk(value);
  3650. }
  3651. };
  3652. /**
  3653. * Walk through all properties and convert them into
  3654. * getter/setters. This method should only be called when
  3655. * value type is Object.
  3656. */
  3657. Observer.prototype.walk = function walk (obj) {
  3658. var keys = Object.keys(obj);
  3659. for (var i = 0; i < keys.length; i++) {
  3660. defineReactive$$1(obj, keys[i]);
  3661. }
  3662. };
  3663. /**
  3664. * Observe a list of Array items.
  3665. */
  3666. Observer.prototype.observeArray = function observeArray (items) {
  3667. for (var i = 0, l = items.length; i < l; i++) {
  3668. observe(items[i]);
  3669. }
  3670. };
  3671. // helpers
  3672. /**
  3673. * Augment a target Object or Array by intercepting
  3674. * the prototype chain using __proto__
  3675. */
  3676. function protoAugment (target, src) {
  3677. /* eslint-disable no-proto */
  3678. target.__proto__ = src;
  3679. /* eslint-enable no-proto */
  3680. }
  3681. /**
  3682. * Augment a target Object or Array by defining
  3683. * hidden properties.
  3684. */
  3685. /* istanbul ignore next */
  3686. function copyAugment (target, src, keys) {
  3687. for (var i = 0, l = keys.length; i < l; i++) {
  3688. var key = keys[i];
  3689. def(target, key, src[key]);
  3690. }
  3691. }
  3692. /**
  3693. * Attempt to create an observer instance for a value,
  3694. * returns the new observer if successfully observed,
  3695. * or the existing observer if the value already has one.
  3696. */
  3697. function observe (value, asRootData) {
  3698. if (!isObject(value) || value instanceof VNode) {
  3699. return
  3700. }
  3701. var ob;
  3702. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3703. ob = value.__ob__;
  3704. } else if (
  3705. shouldObserve &&
  3706. !isServerRendering() &&
  3707. (Array.isArray(value) || isPlainObject(value)) &&
  3708. Object.isExtensible(value) &&
  3709. !value._isVue
  3710. ) {
  3711. ob = new Observer(value);
  3712. }
  3713. if (asRootData && ob) {
  3714. ob.vmCount++;
  3715. }
  3716. return ob
  3717. }
  3718. /**
  3719. * Define a reactive property on an Object.
  3720. */
  3721. function defineReactive$$1 (
  3722. obj,
  3723. key,
  3724. val,
  3725. customSetter,
  3726. shallow
  3727. ) {
  3728. var dep = new Dep();
  3729. var property = Object.getOwnPropertyDescriptor(obj, key);
  3730. if (property && property.configurable === false) {
  3731. return
  3732. }
  3733. // cater for pre-defined getter/setters
  3734. var getter = property && property.get;
  3735. var setter = property && property.set;
  3736. if ((!getter || setter) && arguments.length === 2) {
  3737. val = obj[key];
  3738. }
  3739. var childOb = !shallow && observe(val);
  3740. Object.defineProperty(obj, key, {
  3741. enumerable: true,
  3742. configurable: true,
  3743. get: function reactiveGetter () {
  3744. var value = getter ? getter.call(obj) : val;
  3745. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3746. dep.depend();
  3747. if (childOb) {
  3748. childOb.dep.depend();
  3749. if (Array.isArray(value)) {
  3750. dependArray(value);
  3751. }
  3752. }
  3753. }
  3754. return value
  3755. },
  3756. set: function reactiveSetter (newVal) {
  3757. var value = getter ? getter.call(obj) : val;
  3758. /* eslint-disable no-self-compare */
  3759. if (newVal === value || (newVal !== newVal && value !== value)) {
  3760. return
  3761. }
  3762. /* eslint-enable no-self-compare */
  3763. if ( true && customSetter) {
  3764. customSetter();
  3765. }
  3766. // #7981: for accessor properties without setter
  3767. if (getter && !setter) { return }
  3768. if (setter) {
  3769. setter.call(obj, newVal);
  3770. } else {
  3771. val = newVal;
  3772. }
  3773. childOb = !shallow && observe(newVal);
  3774. dep.notify();
  3775. }
  3776. });
  3777. }
  3778. /**
  3779. * Set a property on an object. Adds the new property and
  3780. * triggers change notification if the property doesn't
  3781. * already exist.
  3782. */
  3783. function set (target, key, val) {
  3784. if ( true &&
  3785. (isUndef(target) || isPrimitive(target))
  3786. ) {
  3787. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3788. }
  3789. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3790. target.length = Math.max(target.length, key);
  3791. target.splice(key, 1, val);
  3792. return val
  3793. }
  3794. if (key in target && !(key in Object.prototype)) {
  3795. target[key] = val;
  3796. return val
  3797. }
  3798. var ob = (target).__ob__;
  3799. if (target._isVue || (ob && ob.vmCount)) {
  3800. true && warn(
  3801. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3802. 'at runtime - declare it upfront in the data option.'
  3803. );
  3804. return val
  3805. }
  3806. if (!ob) {
  3807. target[key] = val;
  3808. return val
  3809. }
  3810. defineReactive$$1(ob.value, key, val);
  3811. ob.dep.notify();
  3812. return val
  3813. }
  3814. /**
  3815. * Delete a property and trigger change if necessary.
  3816. */
  3817. function del (target, key) {
  3818. if ( true &&
  3819. (isUndef(target) || isPrimitive(target))
  3820. ) {
  3821. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3822. }
  3823. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3824. target.splice(key, 1);
  3825. return
  3826. }
  3827. var ob = (target).__ob__;
  3828. if (target._isVue || (ob && ob.vmCount)) {
  3829. true && warn(
  3830. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3831. '- just set it to null.'
  3832. );
  3833. return
  3834. }
  3835. if (!hasOwn(target, key)) {
  3836. return
  3837. }
  3838. delete target[key];
  3839. if (!ob) {
  3840. return
  3841. }
  3842. ob.dep.notify();
  3843. }
  3844. /**
  3845. * Collect dependencies on array elements when the array is touched, since
  3846. * we cannot intercept array element access like property getters.
  3847. */
  3848. function dependArray (value) {
  3849. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3850. e = value[i];
  3851. e && e.__ob__ && e.__ob__.dep.depend();
  3852. if (Array.isArray(e)) {
  3853. dependArray(e);
  3854. }
  3855. }
  3856. }
  3857. /* */
  3858. /**
  3859. * Option overwriting strategies are functions that handle
  3860. * how to merge a parent option value and a child option
  3861. * value into the final value.
  3862. */
  3863. var strats = config.optionMergeStrategies;
  3864. /**
  3865. * Options with restrictions
  3866. */
  3867. if (true) {
  3868. strats.el = strats.propsData = function (parent, child, vm, key) {
  3869. if (!vm) {
  3870. warn(
  3871. "option \"" + key + "\" can only be used during instance " +
  3872. 'creation with the `new` keyword.'
  3873. );
  3874. }
  3875. return defaultStrat(parent, child)
  3876. };
  3877. }
  3878. /**
  3879. * Helper that recursively merges two data objects together.
  3880. */
  3881. function mergeData (to, from) {
  3882. if (!from) { return to }
  3883. var key, toVal, fromVal;
  3884. var keys = hasSymbol
  3885. ? Reflect.ownKeys(from)
  3886. : Object.keys(from);
  3887. for (var i = 0; i < keys.length; i++) {
  3888. key = keys[i];
  3889. // in case the object is already observed...
  3890. if (key === '__ob__') { continue }
  3891. toVal = to[key];
  3892. fromVal = from[key];
  3893. if (!hasOwn(to, key)) {
  3894. set(to, key, fromVal);
  3895. } else if (
  3896. toVal !== fromVal &&
  3897. isPlainObject(toVal) &&
  3898. isPlainObject(fromVal)
  3899. ) {
  3900. mergeData(toVal, fromVal);
  3901. }
  3902. }
  3903. return to
  3904. }
  3905. /**
  3906. * Data
  3907. */
  3908. function mergeDataOrFn (
  3909. parentVal,
  3910. childVal,
  3911. vm
  3912. ) {
  3913. if (!vm) {
  3914. // in a Vue.extend merge, both should be functions
  3915. if (!childVal) {
  3916. return parentVal
  3917. }
  3918. if (!parentVal) {
  3919. return childVal
  3920. }
  3921. // when parentVal & childVal are both present,
  3922. // we need to return a function that returns the
  3923. // merged result of both functions... no need to
  3924. // check if parentVal is a function here because
  3925. // it has to be a function to pass previous merges.
  3926. return function mergedDataFn () {
  3927. return mergeData(
  3928. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  3929. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  3930. )
  3931. }
  3932. } else {
  3933. return function mergedInstanceDataFn () {
  3934. // instance merge
  3935. var instanceData = typeof childVal === 'function'
  3936. ? childVal.call(vm, vm)
  3937. : childVal;
  3938. var defaultData = typeof parentVal === 'function'
  3939. ? parentVal.call(vm, vm)
  3940. : parentVal;
  3941. if (instanceData) {
  3942. return mergeData(instanceData, defaultData)
  3943. } else {
  3944. return defaultData
  3945. }
  3946. }
  3947. }
  3948. }
  3949. strats.data = function (
  3950. parentVal,
  3951. childVal,
  3952. vm
  3953. ) {
  3954. if (!vm) {
  3955. if (childVal && typeof childVal !== 'function') {
  3956. true && warn(
  3957. 'The "data" option should be a function ' +
  3958. 'that returns a per-instance value in component ' +
  3959. 'definitions.',
  3960. vm
  3961. );
  3962. return parentVal
  3963. }
  3964. return mergeDataOrFn(parentVal, childVal)
  3965. }
  3966. return mergeDataOrFn(parentVal, childVal, vm)
  3967. };
  3968. /**
  3969. * Hooks and props are merged as arrays.
  3970. */
  3971. function mergeHook (
  3972. parentVal,
  3973. childVal
  3974. ) {
  3975. var res = childVal
  3976. ? parentVal
  3977. ? parentVal.concat(childVal)
  3978. : Array.isArray(childVal)
  3979. ? childVal
  3980. : [childVal]
  3981. : parentVal;
  3982. return res
  3983. ? dedupeHooks(res)
  3984. : res
  3985. }
  3986. function dedupeHooks (hooks) {
  3987. var res = [];
  3988. for (var i = 0; i < hooks.length; i++) {
  3989. if (res.indexOf(hooks[i]) === -1) {
  3990. res.push(hooks[i]);
  3991. }
  3992. }
  3993. return res
  3994. }
  3995. LIFECYCLE_HOOKS.forEach(function (hook) {
  3996. strats[hook] = mergeHook;
  3997. });
  3998. /**
  3999. * Assets
  4000. *
  4001. * When a vm is present (instance creation), we need to do
  4002. * a three-way merge between constructor options, instance
  4003. * options and parent options.
  4004. */
  4005. function mergeAssets (
  4006. parentVal,
  4007. childVal,
  4008. vm,
  4009. key
  4010. ) {
  4011. var res = Object.create(parentVal || null);
  4012. if (childVal) {
  4013. true && assertObjectType(key, childVal, vm);
  4014. return extend(res, childVal)
  4015. } else {
  4016. return res
  4017. }
  4018. }
  4019. ASSET_TYPES.forEach(function (type) {
  4020. strats[type + 's'] = mergeAssets;
  4021. });
  4022. /**
  4023. * Watchers.
  4024. *
  4025. * Watchers hashes should not overwrite one
  4026. * another, so we merge them as arrays.
  4027. */
  4028. strats.watch = function (
  4029. parentVal,
  4030. childVal,
  4031. vm,
  4032. key
  4033. ) {
  4034. // work around Firefox's Object.prototype.watch...
  4035. if (parentVal === nativeWatch) { parentVal = undefined; }
  4036. if (childVal === nativeWatch) { childVal = undefined; }
  4037. /* istanbul ignore if */
  4038. if (!childVal) { return Object.create(parentVal || null) }
  4039. if (true) {
  4040. assertObjectType(key, childVal, vm);
  4041. }
  4042. if (!parentVal) { return childVal }
  4043. var ret = {};
  4044. extend(ret, parentVal);
  4045. for (var key$1 in childVal) {
  4046. var parent = ret[key$1];
  4047. var child = childVal[key$1];
  4048. if (parent && !Array.isArray(parent)) {
  4049. parent = [parent];
  4050. }
  4051. ret[key$1] = parent
  4052. ? parent.concat(child)
  4053. : Array.isArray(child) ? child : [child];
  4054. }
  4055. return ret
  4056. };
  4057. /**
  4058. * Other object hashes.
  4059. */
  4060. strats.props =
  4061. strats.methods =
  4062. strats.inject =
  4063. strats.computed = function (
  4064. parentVal,
  4065. childVal,
  4066. vm,
  4067. key
  4068. ) {
  4069. if (childVal && "development" !== 'production') {
  4070. assertObjectType(key, childVal, vm);
  4071. }
  4072. if (!parentVal) { return childVal }
  4073. var ret = Object.create(null);
  4074. extend(ret, parentVal);
  4075. if (childVal) { extend(ret, childVal); }
  4076. return ret
  4077. };
  4078. strats.provide = mergeDataOrFn;
  4079. /**
  4080. * Default strategy.
  4081. */
  4082. var defaultStrat = function (parentVal, childVal) {
  4083. return childVal === undefined
  4084. ? parentVal
  4085. : childVal
  4086. };
  4087. /**
  4088. * Validate component names
  4089. */
  4090. function checkComponents (options) {
  4091. for (var key in options.components) {
  4092. validateComponentName(key);
  4093. }
  4094. }
  4095. function validateComponentName (name) {
  4096. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4097. warn(
  4098. 'Invalid component name: "' + name + '". Component names ' +
  4099. 'should conform to valid custom element name in html5 specification.'
  4100. );
  4101. }
  4102. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4103. warn(
  4104. 'Do not use built-in or reserved HTML elements as component ' +
  4105. 'id: ' + name
  4106. );
  4107. }
  4108. }
  4109. /**
  4110. * Ensure all props option syntax are normalized into the
  4111. * Object-based format.
  4112. */
  4113. function normalizeProps (options, vm) {
  4114. var props = options.props;
  4115. if (!props) { return }
  4116. var res = {};
  4117. var i, val, name;
  4118. if (Array.isArray(props)) {
  4119. i = props.length;
  4120. while (i--) {
  4121. val = props[i];
  4122. if (typeof val === 'string') {
  4123. name = camelize(val);
  4124. res[name] = { type: null };
  4125. } else if (true) {
  4126. warn('props must be strings when using array syntax.');
  4127. }
  4128. }
  4129. } else if (isPlainObject(props)) {
  4130. for (var key in props) {
  4131. val = props[key];
  4132. name = camelize(key);
  4133. res[name] = isPlainObject(val)
  4134. ? val
  4135. : { type: val };
  4136. }
  4137. } else if (true) {
  4138. warn(
  4139. "Invalid value for option \"props\": expected an Array or an Object, " +
  4140. "but got " + (toRawType(props)) + ".",
  4141. vm
  4142. );
  4143. }
  4144. options.props = res;
  4145. }
  4146. /**
  4147. * Normalize all injections into Object-based format
  4148. */
  4149. function normalizeInject (options, vm) {
  4150. var inject = options.inject;
  4151. if (!inject) { return }
  4152. var normalized = options.inject = {};
  4153. if (Array.isArray(inject)) {
  4154. for (var i = 0; i < inject.length; i++) {
  4155. normalized[inject[i]] = { from: inject[i] };
  4156. }
  4157. } else if (isPlainObject(inject)) {
  4158. for (var key in inject) {
  4159. var val = inject[key];
  4160. normalized[key] = isPlainObject(val)
  4161. ? extend({ from: key }, val)
  4162. : { from: val };
  4163. }
  4164. } else if (true) {
  4165. warn(
  4166. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4167. "but got " + (toRawType(inject)) + ".",
  4168. vm
  4169. );
  4170. }
  4171. }
  4172. /**
  4173. * Normalize raw function directives into object format.
  4174. */
  4175. function normalizeDirectives (options) {
  4176. var dirs = options.directives;
  4177. if (dirs) {
  4178. for (var key in dirs) {
  4179. var def$$1 = dirs[key];
  4180. if (typeof def$$1 === 'function') {
  4181. dirs[key] = { bind: def$$1, update: def$$1 };
  4182. }
  4183. }
  4184. }
  4185. }
  4186. function assertObjectType (name, value, vm) {
  4187. if (!isPlainObject(value)) {
  4188. warn(
  4189. "Invalid value for option \"" + name + "\": expected an Object, " +
  4190. "but got " + (toRawType(value)) + ".",
  4191. vm
  4192. );
  4193. }
  4194. }
  4195. /**
  4196. * Merge two option objects into a new one.
  4197. * Core utility used in both instantiation and inheritance.
  4198. */
  4199. function mergeOptions (
  4200. parent,
  4201. child,
  4202. vm
  4203. ) {
  4204. if (true) {
  4205. checkComponents(child);
  4206. }
  4207. if (typeof child === 'function') {
  4208. child = child.options;
  4209. }
  4210. normalizeProps(child, vm);
  4211. normalizeInject(child, vm);
  4212. normalizeDirectives(child);
  4213. // Apply extends and mixins on the child options,
  4214. // but only if it is a raw options object that isn't
  4215. // the result of another mergeOptions call.
  4216. // Only merged options has the _base property.
  4217. if (!child._base) {
  4218. if (child.extends) {
  4219. parent = mergeOptions(parent, child.extends, vm);
  4220. }
  4221. if (child.mixins) {
  4222. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4223. parent = mergeOptions(parent, child.mixins[i], vm);
  4224. }
  4225. }
  4226. }
  4227. var options = {};
  4228. var key;
  4229. for (key in parent) {
  4230. mergeField(key);
  4231. }
  4232. for (key in child) {
  4233. if (!hasOwn(parent, key)) {
  4234. mergeField(key);
  4235. }
  4236. }
  4237. function mergeField (key) {
  4238. var strat = strats[key] || defaultStrat;
  4239. options[key] = strat(parent[key], child[key], vm, key);
  4240. }
  4241. return options
  4242. }
  4243. /**
  4244. * Resolve an asset.
  4245. * This function is used because child instances need access
  4246. * to assets defined in its ancestor chain.
  4247. */
  4248. function resolveAsset (
  4249. options,
  4250. type,
  4251. id,
  4252. warnMissing
  4253. ) {
  4254. /* istanbul ignore if */
  4255. if (typeof id !== 'string') {
  4256. return
  4257. }
  4258. var assets = options[type];
  4259. // check local registration variations first
  4260. if (hasOwn(assets, id)) { return assets[id] }
  4261. var camelizedId = camelize(id);
  4262. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4263. var PascalCaseId = capitalize(camelizedId);
  4264. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4265. // fallback to prototype chain
  4266. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4267. if ( true && warnMissing && !res) {
  4268. warn(
  4269. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4270. options
  4271. );
  4272. }
  4273. return res
  4274. }
  4275. /* */
  4276. function validateProp (
  4277. key,
  4278. propOptions,
  4279. propsData,
  4280. vm
  4281. ) {
  4282. var prop = propOptions[key];
  4283. var absent = !hasOwn(propsData, key);
  4284. var value = propsData[key];
  4285. // boolean casting
  4286. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4287. if (booleanIndex > -1) {
  4288. if (absent && !hasOwn(prop, 'default')) {
  4289. value = false;
  4290. } else if (value === '' || value === hyphenate(key)) {
  4291. // only cast empty string / same name to boolean if
  4292. // boolean has higher priority
  4293. var stringIndex = getTypeIndex(String, prop.type);
  4294. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4295. value = true;
  4296. }
  4297. }
  4298. }
  4299. // check default value
  4300. if (value === undefined) {
  4301. value = getPropDefaultValue(vm, prop, key);
  4302. // since the default value is a fresh copy,
  4303. // make sure to observe it.
  4304. var prevShouldObserve = shouldObserve;
  4305. toggleObserving(true);
  4306. observe(value);
  4307. toggleObserving(prevShouldObserve);
  4308. }
  4309. if (
  4310. true
  4311. ) {
  4312. assertProp(prop, key, value, vm, absent);
  4313. }
  4314. return value
  4315. }
  4316. /**
  4317. * Get the default value of a prop.
  4318. */
  4319. function getPropDefaultValue (vm, prop, key) {
  4320. // no default, return undefined
  4321. if (!hasOwn(prop, 'default')) {
  4322. return undefined
  4323. }
  4324. var def = prop.default;
  4325. // warn against non-factory defaults for Object & Array
  4326. if ( true && isObject(def)) {
  4327. warn(
  4328. 'Invalid default value for prop "' + key + '": ' +
  4329. 'Props with type Object/Array must use a factory function ' +
  4330. 'to return the default value.',
  4331. vm
  4332. );
  4333. }
  4334. // the raw prop value was also undefined from previous render,
  4335. // return previous default value to avoid unnecessary watcher trigger
  4336. if (vm && vm.$options.propsData &&
  4337. vm.$options.propsData[key] === undefined &&
  4338. vm._props[key] !== undefined
  4339. ) {
  4340. return vm._props[key]
  4341. }
  4342. // call factory function for non-Function types
  4343. // a value is Function if its prototype is function even across different execution context
  4344. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4345. ? def.call(vm)
  4346. : def
  4347. }
  4348. /**
  4349. * Assert whether a prop is valid.
  4350. */
  4351. function assertProp (
  4352. prop,
  4353. name,
  4354. value,
  4355. vm,
  4356. absent
  4357. ) {
  4358. if (prop.required && absent) {
  4359. warn(
  4360. 'Missing required prop: "' + name + '"',
  4361. vm
  4362. );
  4363. return
  4364. }
  4365. if (value == null && !prop.required) {
  4366. return
  4367. }
  4368. var type = prop.type;
  4369. var valid = !type || type === true;
  4370. var expectedTypes = [];
  4371. if (type) {
  4372. if (!Array.isArray(type)) {
  4373. type = [type];
  4374. }
  4375. for (var i = 0; i < type.length && !valid; i++) {
  4376. var assertedType = assertType(value, type[i]);
  4377. expectedTypes.push(assertedType.expectedType || '');
  4378. valid = assertedType.valid;
  4379. }
  4380. }
  4381. if (!valid) {
  4382. warn(
  4383. getInvalidTypeMessage(name, value, expectedTypes),
  4384. vm
  4385. );
  4386. return
  4387. }
  4388. var validator = prop.validator;
  4389. if (validator) {
  4390. if (!validator(value)) {
  4391. warn(
  4392. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4393. vm
  4394. );
  4395. }
  4396. }
  4397. }
  4398. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4399. function assertType (value, type) {
  4400. var valid;
  4401. var expectedType = getType(type);
  4402. if (simpleCheckRE.test(expectedType)) {
  4403. var t = typeof value;
  4404. valid = t === expectedType.toLowerCase();
  4405. // for primitive wrapper objects
  4406. if (!valid && t === 'object') {
  4407. valid = value instanceof type;
  4408. }
  4409. } else if (expectedType === 'Object') {
  4410. valid = isPlainObject(value);
  4411. } else if (expectedType === 'Array') {
  4412. valid = Array.isArray(value);
  4413. } else {
  4414. valid = value instanceof type;
  4415. }
  4416. return {
  4417. valid: valid,
  4418. expectedType: expectedType
  4419. }
  4420. }
  4421. /**
  4422. * Use function string name to check built-in types,
  4423. * because a simple equality check will fail when running
  4424. * across different vms / iframes.
  4425. */
  4426. function getType (fn) {
  4427. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4428. return match ? match[1] : ''
  4429. }
  4430. function isSameType (a, b) {
  4431. return getType(a) === getType(b)
  4432. }
  4433. function getTypeIndex (type, expectedTypes) {
  4434. if (!Array.isArray(expectedTypes)) {
  4435. return isSameType(expectedTypes, type) ? 0 : -1
  4436. }
  4437. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4438. if (isSameType(expectedTypes[i], type)) {
  4439. return i
  4440. }
  4441. }
  4442. return -1
  4443. }
  4444. function getInvalidTypeMessage (name, value, expectedTypes) {
  4445. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4446. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4447. var expectedType = expectedTypes[0];
  4448. var receivedType = toRawType(value);
  4449. var expectedValue = styleValue(value, expectedType);
  4450. var receivedValue = styleValue(value, receivedType);
  4451. // check if we need to specify expected value
  4452. if (expectedTypes.length === 1 &&
  4453. isExplicable(expectedType) &&
  4454. !isBoolean(expectedType, receivedType)) {
  4455. message += " with value " + expectedValue;
  4456. }
  4457. message += ", got " + receivedType + " ";
  4458. // check if we need to specify received value
  4459. if (isExplicable(receivedType)) {
  4460. message += "with value " + receivedValue + ".";
  4461. }
  4462. return message
  4463. }
  4464. function styleValue (value, type) {
  4465. if (type === 'String') {
  4466. return ("\"" + value + "\"")
  4467. } else if (type === 'Number') {
  4468. return ("" + (Number(value)))
  4469. } else {
  4470. return ("" + value)
  4471. }
  4472. }
  4473. function isExplicable (value) {
  4474. var explicitTypes = ['string', 'number', 'boolean'];
  4475. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4476. }
  4477. function isBoolean () {
  4478. var args = [], len = arguments.length;
  4479. while ( len-- ) args[ len ] = arguments[ len ];
  4480. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4481. }
  4482. /* */
  4483. function handleError (err, vm, info) {
  4484. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4485. // See: https://github.com/vuejs/vuex/issues/1505
  4486. pushTarget();
  4487. try {
  4488. if (vm) {
  4489. var cur = vm;
  4490. while ((cur = cur.$parent)) {
  4491. var hooks = cur.$options.errorCaptured;
  4492. if (hooks) {
  4493. for (var i = 0; i < hooks.length; i++) {
  4494. try {
  4495. var capture = hooks[i].call(cur, err, vm, info) === false;
  4496. if (capture) { return }
  4497. } catch (e) {
  4498. globalHandleError(e, cur, 'errorCaptured hook');
  4499. }
  4500. }
  4501. }
  4502. }
  4503. }
  4504. globalHandleError(err, vm, info);
  4505. } finally {
  4506. popTarget();
  4507. }
  4508. }
  4509. function invokeWithErrorHandling (
  4510. handler,
  4511. context,
  4512. args,
  4513. vm,
  4514. info
  4515. ) {
  4516. var res;
  4517. try {
  4518. res = args ? handler.apply(context, args) : handler.call(context);
  4519. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4520. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4521. // issue #9511
  4522. // avoid catch triggering multiple times when nested calls
  4523. res._handled = true;
  4524. }
  4525. } catch (e) {
  4526. handleError(e, vm, info);
  4527. }
  4528. return res
  4529. }
  4530. function globalHandleError (err, vm, info) {
  4531. if (config.errorHandler) {
  4532. try {
  4533. return config.errorHandler.call(null, err, vm, info)
  4534. } catch (e) {
  4535. // if the user intentionally throws the original error in the handler,
  4536. // do not log it twice
  4537. if (e !== err) {
  4538. logError(e, null, 'config.errorHandler');
  4539. }
  4540. }
  4541. }
  4542. logError(err, vm, info);
  4543. }
  4544. function logError (err, vm, info) {
  4545. if (true) {
  4546. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4547. }
  4548. /* istanbul ignore else */
  4549. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4550. console.error(err);
  4551. } else {
  4552. throw err
  4553. }
  4554. }
  4555. /* */
  4556. var callbacks = [];
  4557. var pending = false;
  4558. function flushCallbacks () {
  4559. pending = false;
  4560. var copies = callbacks.slice(0);
  4561. callbacks.length = 0;
  4562. for (var i = 0; i < copies.length; i++) {
  4563. copies[i]();
  4564. }
  4565. }
  4566. // Here we have async deferring wrappers using microtasks.
  4567. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4568. // However, it has subtle problems when state is changed right before repaint
  4569. // (e.g. #6813, out-in transitions).
  4570. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4571. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4572. // So we now use microtasks everywhere, again.
  4573. // A major drawback of this tradeoff is that there are some scenarios
  4574. // where microtasks have too high a priority and fire in between supposedly
  4575. // sequential events (e.g. #4521, #6690, which have workarounds)
  4576. // or even between bubbling of the same event (#6566).
  4577. var timerFunc;
  4578. // The nextTick behavior leverages the microtask queue, which can be accessed
  4579. // via either native Promise.then or MutationObserver.
  4580. // MutationObserver has wider support, however it is seriously bugged in
  4581. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4582. // completely stops working after triggering a few times... so, if native
  4583. // Promise is available, we will use it:
  4584. /* istanbul ignore next, $flow-disable-line */
  4585. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4586. var p = Promise.resolve();
  4587. timerFunc = function () {
  4588. p.then(flushCallbacks);
  4589. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4590. // it can get stuck in a weird state where callbacks are pushed into the
  4591. // microtask queue but the queue isn't being flushed, until the browser
  4592. // needs to do some other work, e.g. handle a timer. Therefore we can
  4593. // "force" the microtask queue to be flushed by adding an empty timer.
  4594. if (isIOS) { setTimeout(noop); }
  4595. };
  4596. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4597. isNative(MutationObserver) ||
  4598. // PhantomJS and iOS 7.x
  4599. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4600. )) {
  4601. // Use MutationObserver where native Promise is not available,
  4602. // e.g. PhantomJS, iOS7, Android 4.4
  4603. // (#6466 MutationObserver is unreliable in IE11)
  4604. var counter = 1;
  4605. var observer = new MutationObserver(flushCallbacks);
  4606. var textNode = document.createTextNode(String(counter));
  4607. observer.observe(textNode, {
  4608. characterData: true
  4609. });
  4610. timerFunc = function () {
  4611. counter = (counter + 1) % 2;
  4612. textNode.data = String(counter);
  4613. };
  4614. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4615. // Fallback to setImmediate.
  4616. // Technically it leverages the (macro) task queue,
  4617. // but it is still a better choice than setTimeout.
  4618. timerFunc = function () {
  4619. setImmediate(flushCallbacks);
  4620. };
  4621. } else {
  4622. // Fallback to setTimeout.
  4623. timerFunc = function () {
  4624. setTimeout(flushCallbacks, 0);
  4625. };
  4626. }
  4627. function nextTick (cb, ctx) {
  4628. var _resolve;
  4629. callbacks.push(function () {
  4630. if (cb) {
  4631. try {
  4632. cb.call(ctx);
  4633. } catch (e) {
  4634. handleError(e, ctx, 'nextTick');
  4635. }
  4636. } else if (_resolve) {
  4637. _resolve(ctx);
  4638. }
  4639. });
  4640. if (!pending) {
  4641. pending = true;
  4642. timerFunc();
  4643. }
  4644. // $flow-disable-line
  4645. if (!cb && typeof Promise !== 'undefined') {
  4646. return new Promise(function (resolve) {
  4647. _resolve = resolve;
  4648. })
  4649. }
  4650. }
  4651. /* */
  4652. /* not type checking this file because flow doesn't play well with Proxy */
  4653. var initProxy;
  4654. if (true) {
  4655. var allowedGlobals = makeMap(
  4656. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4657. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4658. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4659. 'require' // for Webpack/Browserify
  4660. );
  4661. var warnNonPresent = function (target, key) {
  4662. warn(
  4663. "Property or method \"" + key + "\" is not defined on the instance but " +
  4664. 'referenced during render. Make sure that this property is reactive, ' +
  4665. 'either in the data option, or for class-based components, by ' +
  4666. 'initializing the property. ' +
  4667. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4668. target
  4669. );
  4670. };
  4671. var warnReservedPrefix = function (target, key) {
  4672. warn(
  4673. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4674. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4675. 'prevent conflicts with Vue internals. ' +
  4676. 'See: https://vuejs.org/v2/api/#data',
  4677. target
  4678. );
  4679. };
  4680. var hasProxy =
  4681. typeof Proxy !== 'undefined' && isNative(Proxy);
  4682. if (hasProxy) {
  4683. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4684. config.keyCodes = new Proxy(config.keyCodes, {
  4685. set: function set (target, key, value) {
  4686. if (isBuiltInModifier(key)) {
  4687. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4688. return false
  4689. } else {
  4690. target[key] = value;
  4691. return true
  4692. }
  4693. }
  4694. });
  4695. }
  4696. var hasHandler = {
  4697. has: function has (target, key) {
  4698. var has = key in target;
  4699. var isAllowed = allowedGlobals(key) ||
  4700. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4701. if (!has && !isAllowed) {
  4702. if (key in target.$data) { warnReservedPrefix(target, key); }
  4703. else { warnNonPresent(target, key); }
  4704. }
  4705. return has || !isAllowed
  4706. }
  4707. };
  4708. var getHandler = {
  4709. get: function get (target, key) {
  4710. if (typeof key === 'string' && !(key in target)) {
  4711. if (key in target.$data) { warnReservedPrefix(target, key); }
  4712. else { warnNonPresent(target, key); }
  4713. }
  4714. return target[key]
  4715. }
  4716. };
  4717. initProxy = function initProxy (vm) {
  4718. if (hasProxy) {
  4719. // determine which proxy handler to use
  4720. var options = vm.$options;
  4721. var handlers = options.render && options.render._withStripped
  4722. ? getHandler
  4723. : hasHandler;
  4724. vm._renderProxy = new Proxy(vm, handlers);
  4725. } else {
  4726. vm._renderProxy = vm;
  4727. }
  4728. };
  4729. }
  4730. /* */
  4731. var seenObjects = new _Set();
  4732. /**
  4733. * Recursively traverse an object to evoke all converted
  4734. * getters, so that every nested property inside the object
  4735. * is collected as a "deep" dependency.
  4736. */
  4737. function traverse (val) {
  4738. _traverse(val, seenObjects);
  4739. seenObjects.clear();
  4740. }
  4741. function _traverse (val, seen) {
  4742. var i, keys;
  4743. var isA = Array.isArray(val);
  4744. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4745. return
  4746. }
  4747. if (val.__ob__) {
  4748. var depId = val.__ob__.dep.id;
  4749. if (seen.has(depId)) {
  4750. return
  4751. }
  4752. seen.add(depId);
  4753. }
  4754. if (isA) {
  4755. i = val.length;
  4756. while (i--) { _traverse(val[i], seen); }
  4757. } else {
  4758. keys = Object.keys(val);
  4759. i = keys.length;
  4760. while (i--) { _traverse(val[keys[i]], seen); }
  4761. }
  4762. }
  4763. var mark;
  4764. var measure;
  4765. if (true) {
  4766. var perf = inBrowser && window.performance;
  4767. /* istanbul ignore if */
  4768. if (
  4769. perf &&
  4770. perf.mark &&
  4771. perf.measure &&
  4772. perf.clearMarks &&
  4773. perf.clearMeasures
  4774. ) {
  4775. mark = function (tag) { return perf.mark(tag); };
  4776. measure = function (name, startTag, endTag) {
  4777. perf.measure(name, startTag, endTag);
  4778. perf.clearMarks(startTag);
  4779. perf.clearMarks(endTag);
  4780. // perf.clearMeasures(name)
  4781. };
  4782. }
  4783. }
  4784. /* */
  4785. var normalizeEvent = cached(function (name) {
  4786. var passive = name.charAt(0) === '&';
  4787. name = passive ? name.slice(1) : name;
  4788. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4789. name = once$$1 ? name.slice(1) : name;
  4790. var capture = name.charAt(0) === '!';
  4791. name = capture ? name.slice(1) : name;
  4792. return {
  4793. name: name,
  4794. once: once$$1,
  4795. capture: capture,
  4796. passive: passive
  4797. }
  4798. });
  4799. function createFnInvoker (fns, vm) {
  4800. function invoker () {
  4801. var arguments$1 = arguments;
  4802. var fns = invoker.fns;
  4803. if (Array.isArray(fns)) {
  4804. var cloned = fns.slice();
  4805. for (var i = 0; i < cloned.length; i++) {
  4806. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4807. }
  4808. } else {
  4809. // return handler return value for single handlers
  4810. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4811. }
  4812. }
  4813. invoker.fns = fns;
  4814. return invoker
  4815. }
  4816. function updateListeners (
  4817. on,
  4818. oldOn,
  4819. add,
  4820. remove$$1,
  4821. createOnceHandler,
  4822. vm
  4823. ) {
  4824. var name, def$$1, cur, old, event;
  4825. for (name in on) {
  4826. def$$1 = cur = on[name];
  4827. old = oldOn[name];
  4828. event = normalizeEvent(name);
  4829. if (isUndef(cur)) {
  4830. true && warn(
  4831. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4832. vm
  4833. );
  4834. } else if (isUndef(old)) {
  4835. if (isUndef(cur.fns)) {
  4836. cur = on[name] = createFnInvoker(cur, vm);
  4837. }
  4838. if (isTrue(event.once)) {
  4839. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4840. }
  4841. add(event.name, cur, event.capture, event.passive, event.params);
  4842. } else if (cur !== old) {
  4843. old.fns = cur;
  4844. on[name] = old;
  4845. }
  4846. }
  4847. for (name in oldOn) {
  4848. if (isUndef(on[name])) {
  4849. event = normalizeEvent(name);
  4850. remove$$1(event.name, oldOn[name], event.capture);
  4851. }
  4852. }
  4853. }
  4854. /* */
  4855. /* */
  4856. // fixed by xxxxxx (mp properties)
  4857. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4858. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4859. if (isUndef(propOptions)) {
  4860. return res
  4861. }
  4862. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4863. var attrs = data.attrs;
  4864. var props = data.props;
  4865. if (isDef(attrs) || isDef(props)) {
  4866. for (var key in propOptions) {
  4867. var altKey = hyphenate(key);
  4868. var result = checkProp(res, props, key, altKey, true) ||
  4869. checkProp(res, attrs, key, altKey, false);
  4870. // externalClass
  4871. if (
  4872. result &&
  4873. res[key] &&
  4874. externalClasses.indexOf(altKey) !== -1 &&
  4875. context[camelize(res[key])]
  4876. ) {
  4877. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4878. res[key] = context[camelize(res[key])];
  4879. }
  4880. }
  4881. }
  4882. return res
  4883. }
  4884. function extractPropsFromVNodeData (
  4885. data,
  4886. Ctor,
  4887. tag,
  4888. context// fixed by xxxxxx
  4889. ) {
  4890. // we are only extracting raw values here.
  4891. // validation and default values are handled in the child
  4892. // component itself.
  4893. var propOptions = Ctor.options.props;
  4894. if (isUndef(propOptions)) {
  4895. // fixed by xxxxxx
  4896. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  4897. }
  4898. var res = {};
  4899. var attrs = data.attrs;
  4900. var props = data.props;
  4901. if (isDef(attrs) || isDef(props)) {
  4902. for (var key in propOptions) {
  4903. var altKey = hyphenate(key);
  4904. if (true) {
  4905. var keyInLowerCase = key.toLowerCase();
  4906. if (
  4907. key !== keyInLowerCase &&
  4908. attrs && hasOwn(attrs, keyInLowerCase)
  4909. ) {
  4910. tip(
  4911. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  4912. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  4913. " \"" + key + "\". " +
  4914. "Note that HTML attributes are case-insensitive and camelCased " +
  4915. "props need to use their kebab-case equivalents when using in-DOM " +
  4916. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  4917. );
  4918. }
  4919. }
  4920. checkProp(res, props, key, altKey, true) ||
  4921. checkProp(res, attrs, key, altKey, false);
  4922. }
  4923. }
  4924. // fixed by xxxxxx
  4925. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  4926. }
  4927. function checkProp (
  4928. res,
  4929. hash,
  4930. key,
  4931. altKey,
  4932. preserve
  4933. ) {
  4934. if (isDef(hash)) {
  4935. if (hasOwn(hash, key)) {
  4936. res[key] = hash[key];
  4937. if (!preserve) {
  4938. delete hash[key];
  4939. }
  4940. return true
  4941. } else if (hasOwn(hash, altKey)) {
  4942. res[key] = hash[altKey];
  4943. if (!preserve) {
  4944. delete hash[altKey];
  4945. }
  4946. return true
  4947. }
  4948. }
  4949. return false
  4950. }
  4951. /* */
  4952. // The template compiler attempts to minimize the need for normalization by
  4953. // statically analyzing the template at compile time.
  4954. //
  4955. // For plain HTML markup, normalization can be completely skipped because the
  4956. // generated render function is guaranteed to return Array<VNode>. There are
  4957. // two cases where extra normalization is needed:
  4958. // 1. When the children contains components - because a functional component
  4959. // may return an Array instead of a single root. In this case, just a simple
  4960. // normalization is needed - if any child is an Array, we flatten the whole
  4961. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  4962. // because functional components already normalize their own children.
  4963. function simpleNormalizeChildren (children) {
  4964. for (var i = 0; i < children.length; i++) {
  4965. if (Array.isArray(children[i])) {
  4966. return Array.prototype.concat.apply([], children)
  4967. }
  4968. }
  4969. return children
  4970. }
  4971. // 2. When the children contains constructs that always generated nested Arrays,
  4972. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  4973. // with hand-written render functions / JSX. In such cases a full normalization
  4974. // is needed to cater to all possible types of children values.
  4975. function normalizeChildren (children) {
  4976. return isPrimitive(children)
  4977. ? [createTextVNode(children)]
  4978. : Array.isArray(children)
  4979. ? normalizeArrayChildren(children)
  4980. : undefined
  4981. }
  4982. function isTextNode (node) {
  4983. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  4984. }
  4985. function normalizeArrayChildren (children, nestedIndex) {
  4986. var res = [];
  4987. var i, c, lastIndex, last;
  4988. for (i = 0; i < children.length; i++) {
  4989. c = children[i];
  4990. if (isUndef(c) || typeof c === 'boolean') { continue }
  4991. lastIndex = res.length - 1;
  4992. last = res[lastIndex];
  4993. // nested
  4994. if (Array.isArray(c)) {
  4995. if (c.length > 0) {
  4996. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  4997. // merge adjacent text nodes
  4998. if (isTextNode(c[0]) && isTextNode(last)) {
  4999. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5000. c.shift();
  5001. }
  5002. res.push.apply(res, c);
  5003. }
  5004. } else if (isPrimitive(c)) {
  5005. if (isTextNode(last)) {
  5006. // merge adjacent text nodes
  5007. // this is necessary for SSR hydration because text nodes are
  5008. // essentially merged when rendered to HTML strings
  5009. res[lastIndex] = createTextVNode(last.text + c);
  5010. } else if (c !== '') {
  5011. // convert primitive to vnode
  5012. res.push(createTextVNode(c));
  5013. }
  5014. } else {
  5015. if (isTextNode(c) && isTextNode(last)) {
  5016. // merge adjacent text nodes
  5017. res[lastIndex] = createTextVNode(last.text + c.text);
  5018. } else {
  5019. // default key for nested array children (likely generated by v-for)
  5020. if (isTrue(children._isVList) &&
  5021. isDef(c.tag) &&
  5022. isUndef(c.key) &&
  5023. isDef(nestedIndex)) {
  5024. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5025. }
  5026. res.push(c);
  5027. }
  5028. }
  5029. }
  5030. return res
  5031. }
  5032. /* */
  5033. function initProvide (vm) {
  5034. var provide = vm.$options.provide;
  5035. if (provide) {
  5036. vm._provided = typeof provide === 'function'
  5037. ? provide.call(vm)
  5038. : provide;
  5039. }
  5040. }
  5041. function initInjections (vm) {
  5042. var result = resolveInject(vm.$options.inject, vm);
  5043. if (result) {
  5044. toggleObserving(false);
  5045. Object.keys(result).forEach(function (key) {
  5046. /* istanbul ignore else */
  5047. if (true) {
  5048. defineReactive$$1(vm, key, result[key], function () {
  5049. warn(
  5050. "Avoid mutating an injected value directly since the changes will be " +
  5051. "overwritten whenever the provided component re-renders. " +
  5052. "injection being mutated: \"" + key + "\"",
  5053. vm
  5054. );
  5055. });
  5056. } else {}
  5057. });
  5058. toggleObserving(true);
  5059. }
  5060. }
  5061. function resolveInject (inject, vm) {
  5062. if (inject) {
  5063. // inject is :any because flow is not smart enough to figure out cached
  5064. var result = Object.create(null);
  5065. var keys = hasSymbol
  5066. ? Reflect.ownKeys(inject)
  5067. : Object.keys(inject);
  5068. for (var i = 0; i < keys.length; i++) {
  5069. var key = keys[i];
  5070. // #6574 in case the inject object is observed...
  5071. if (key === '__ob__') { continue }
  5072. var provideKey = inject[key].from;
  5073. var source = vm;
  5074. while (source) {
  5075. if (source._provided && hasOwn(source._provided, provideKey)) {
  5076. result[key] = source._provided[provideKey];
  5077. break
  5078. }
  5079. source = source.$parent;
  5080. }
  5081. if (!source) {
  5082. if ('default' in inject[key]) {
  5083. var provideDefault = inject[key].default;
  5084. result[key] = typeof provideDefault === 'function'
  5085. ? provideDefault.call(vm)
  5086. : provideDefault;
  5087. } else if (true) {
  5088. warn(("Injection \"" + key + "\" not found"), vm);
  5089. }
  5090. }
  5091. }
  5092. return result
  5093. }
  5094. }
  5095. /* */
  5096. /**
  5097. * Runtime helper for resolving raw children VNodes into a slot object.
  5098. */
  5099. function resolveSlots (
  5100. children,
  5101. context
  5102. ) {
  5103. if (!children || !children.length) {
  5104. return {}
  5105. }
  5106. var slots = {};
  5107. for (var i = 0, l = children.length; i < l; i++) {
  5108. var child = children[i];
  5109. var data = child.data;
  5110. // remove slot attribute if the node is resolved as a Vue slot node
  5111. if (data && data.attrs && data.attrs.slot) {
  5112. delete data.attrs.slot;
  5113. }
  5114. // named slots should only be respected if the vnode was rendered in the
  5115. // same context.
  5116. if ((child.context === context || child.fnContext === context) &&
  5117. data && data.slot != null
  5118. ) {
  5119. var name = data.slot;
  5120. var slot = (slots[name] || (slots[name] = []));
  5121. if (child.tag === 'template') {
  5122. slot.push.apply(slot, child.children || []);
  5123. } else {
  5124. slot.push(child);
  5125. }
  5126. } else {
  5127. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5128. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5129. (slots['page'] || (slots['page'] = [])).push(child);
  5130. }else{
  5131. (slots.default || (slots.default = [])).push(child);
  5132. }
  5133. }
  5134. }
  5135. // ignore slots that contains only whitespace
  5136. for (var name$1 in slots) {
  5137. if (slots[name$1].every(isWhitespace)) {
  5138. delete slots[name$1];
  5139. }
  5140. }
  5141. return slots
  5142. }
  5143. function isWhitespace (node) {
  5144. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5145. }
  5146. /* */
  5147. function normalizeScopedSlots (
  5148. slots,
  5149. normalSlots,
  5150. prevSlots
  5151. ) {
  5152. var res;
  5153. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5154. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5155. var key = slots && slots.$key;
  5156. if (!slots) {
  5157. res = {};
  5158. } else if (slots._normalized) {
  5159. // fast path 1: child component re-render only, parent did not change
  5160. return slots._normalized
  5161. } else if (
  5162. isStable &&
  5163. prevSlots &&
  5164. prevSlots !== emptyObject &&
  5165. key === prevSlots.$key &&
  5166. !hasNormalSlots &&
  5167. !prevSlots.$hasNormal
  5168. ) {
  5169. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5170. // only need to normalize once
  5171. return prevSlots
  5172. } else {
  5173. res = {};
  5174. for (var key$1 in slots) {
  5175. if (slots[key$1] && key$1[0] !== '$') {
  5176. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5177. }
  5178. }
  5179. }
  5180. // expose normal slots on scopedSlots
  5181. for (var key$2 in normalSlots) {
  5182. if (!(key$2 in res)) {
  5183. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5184. }
  5185. }
  5186. // avoriaz seems to mock a non-extensible $scopedSlots object
  5187. // and when that is passed down this would cause an error
  5188. if (slots && Object.isExtensible(slots)) {
  5189. (slots)._normalized = res;
  5190. }
  5191. def(res, '$stable', isStable);
  5192. def(res, '$key', key);
  5193. def(res, '$hasNormal', hasNormalSlots);
  5194. return res
  5195. }
  5196. function normalizeScopedSlot(normalSlots, key, fn) {
  5197. var normalized = function () {
  5198. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5199. res = res && typeof res === 'object' && !Array.isArray(res)
  5200. ? [res] // single vnode
  5201. : normalizeChildren(res);
  5202. return res && (
  5203. res.length === 0 ||
  5204. (res.length === 1 && res[0].isComment) // #9658
  5205. ) ? undefined
  5206. : res
  5207. };
  5208. // this is a slot using the new v-slot syntax without scope. although it is
  5209. // compiled as a scoped slot, render fn users would expect it to be present
  5210. // on this.$slots because the usage is semantically a normal slot.
  5211. if (fn.proxy) {
  5212. Object.defineProperty(normalSlots, key, {
  5213. get: normalized,
  5214. enumerable: true,
  5215. configurable: true
  5216. });
  5217. }
  5218. return normalized
  5219. }
  5220. function proxyNormalSlot(slots, key) {
  5221. return function () { return slots[key]; }
  5222. }
  5223. /* */
  5224. /**
  5225. * Runtime helper for rendering v-for lists.
  5226. */
  5227. function renderList (
  5228. val,
  5229. render
  5230. ) {
  5231. var ret, i, l, keys, key;
  5232. if (Array.isArray(val) || typeof val === 'string') {
  5233. ret = new Array(val.length);
  5234. for (i = 0, l = val.length; i < l; i++) {
  5235. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5236. }
  5237. } else if (typeof val === 'number') {
  5238. ret = new Array(val);
  5239. for (i = 0; i < val; i++) {
  5240. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5241. }
  5242. } else if (isObject(val)) {
  5243. if (hasSymbol && val[Symbol.iterator]) {
  5244. ret = [];
  5245. var iterator = val[Symbol.iterator]();
  5246. var result = iterator.next();
  5247. while (!result.done) {
  5248. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5249. result = iterator.next();
  5250. }
  5251. } else {
  5252. keys = Object.keys(val);
  5253. ret = new Array(keys.length);
  5254. for (i = 0, l = keys.length; i < l; i++) {
  5255. key = keys[i];
  5256. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5257. }
  5258. }
  5259. }
  5260. if (!isDef(ret)) {
  5261. ret = [];
  5262. }
  5263. (ret)._isVList = true;
  5264. return ret
  5265. }
  5266. /* */
  5267. /**
  5268. * Runtime helper for rendering <slot>
  5269. */
  5270. function renderSlot (
  5271. name,
  5272. fallback,
  5273. props,
  5274. bindObject
  5275. ) {
  5276. var scopedSlotFn = this.$scopedSlots[name];
  5277. var nodes;
  5278. if (scopedSlotFn) { // scoped slot
  5279. props = props || {};
  5280. if (bindObject) {
  5281. if ( true && !isObject(bindObject)) {
  5282. warn(
  5283. 'slot v-bind without argument expects an Object',
  5284. this
  5285. );
  5286. }
  5287. props = extend(extend({}, bindObject), props);
  5288. }
  5289. // fixed by xxxxxx app-plus scopedSlot
  5290. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5291. } else {
  5292. nodes = this.$slots[name] || fallback;
  5293. }
  5294. var target = props && props.slot;
  5295. if (target) {
  5296. return this.$createElement('template', { slot: target }, nodes)
  5297. } else {
  5298. return nodes
  5299. }
  5300. }
  5301. /* */
  5302. /**
  5303. * Runtime helper for resolving filters
  5304. */
  5305. function resolveFilter (id) {
  5306. return resolveAsset(this.$options, 'filters', id, true) || identity
  5307. }
  5308. /* */
  5309. function isKeyNotMatch (expect, actual) {
  5310. if (Array.isArray(expect)) {
  5311. return expect.indexOf(actual) === -1
  5312. } else {
  5313. return expect !== actual
  5314. }
  5315. }
  5316. /**
  5317. * Runtime helper for checking keyCodes from config.
  5318. * exposed as Vue.prototype._k
  5319. * passing in eventKeyName as last argument separately for backwards compat
  5320. */
  5321. function checkKeyCodes (
  5322. eventKeyCode,
  5323. key,
  5324. builtInKeyCode,
  5325. eventKeyName,
  5326. builtInKeyName
  5327. ) {
  5328. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5329. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5330. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5331. } else if (mappedKeyCode) {
  5332. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5333. } else if (eventKeyName) {
  5334. return hyphenate(eventKeyName) !== key
  5335. }
  5336. }
  5337. /* */
  5338. /**
  5339. * Runtime helper for merging v-bind="object" into a VNode's data.
  5340. */
  5341. function bindObjectProps (
  5342. data,
  5343. tag,
  5344. value,
  5345. asProp,
  5346. isSync
  5347. ) {
  5348. if (value) {
  5349. if (!isObject(value)) {
  5350. true && warn(
  5351. 'v-bind without argument expects an Object or Array value',
  5352. this
  5353. );
  5354. } else {
  5355. if (Array.isArray(value)) {
  5356. value = toObject(value);
  5357. }
  5358. var hash;
  5359. var loop = function ( key ) {
  5360. if (
  5361. key === 'class' ||
  5362. key === 'style' ||
  5363. isReservedAttribute(key)
  5364. ) {
  5365. hash = data;
  5366. } else {
  5367. var type = data.attrs && data.attrs.type;
  5368. hash = asProp || config.mustUseProp(tag, type, key)
  5369. ? data.domProps || (data.domProps = {})
  5370. : data.attrs || (data.attrs = {});
  5371. }
  5372. var camelizedKey = camelize(key);
  5373. var hyphenatedKey = hyphenate(key);
  5374. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5375. hash[key] = value[key];
  5376. if (isSync) {
  5377. var on = data.on || (data.on = {});
  5378. on[("update:" + key)] = function ($event) {
  5379. value[key] = $event;
  5380. };
  5381. }
  5382. }
  5383. };
  5384. for (var key in value) loop( key );
  5385. }
  5386. }
  5387. return data
  5388. }
  5389. /* */
  5390. /**
  5391. * Runtime helper for rendering static trees.
  5392. */
  5393. function renderStatic (
  5394. index,
  5395. isInFor
  5396. ) {
  5397. var cached = this._staticTrees || (this._staticTrees = []);
  5398. var tree = cached[index];
  5399. // if has already-rendered static tree and not inside v-for,
  5400. // we can reuse the same tree.
  5401. if (tree && !isInFor) {
  5402. return tree
  5403. }
  5404. // otherwise, render a fresh tree.
  5405. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5406. this._renderProxy,
  5407. null,
  5408. this // for render fns generated for functional component templates
  5409. );
  5410. markStatic(tree, ("__static__" + index), false);
  5411. return tree
  5412. }
  5413. /**
  5414. * Runtime helper for v-once.
  5415. * Effectively it means marking the node as static with a unique key.
  5416. */
  5417. function markOnce (
  5418. tree,
  5419. index,
  5420. key
  5421. ) {
  5422. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5423. return tree
  5424. }
  5425. function markStatic (
  5426. tree,
  5427. key,
  5428. isOnce
  5429. ) {
  5430. if (Array.isArray(tree)) {
  5431. for (var i = 0; i < tree.length; i++) {
  5432. if (tree[i] && typeof tree[i] !== 'string') {
  5433. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5434. }
  5435. }
  5436. } else {
  5437. markStaticNode(tree, key, isOnce);
  5438. }
  5439. }
  5440. function markStaticNode (node, key, isOnce) {
  5441. node.isStatic = true;
  5442. node.key = key;
  5443. node.isOnce = isOnce;
  5444. }
  5445. /* */
  5446. function bindObjectListeners (data, value) {
  5447. if (value) {
  5448. if (!isPlainObject(value)) {
  5449. true && warn(
  5450. 'v-on without argument expects an Object value',
  5451. this
  5452. );
  5453. } else {
  5454. var on = data.on = data.on ? extend({}, data.on) : {};
  5455. for (var key in value) {
  5456. var existing = on[key];
  5457. var ours = value[key];
  5458. on[key] = existing ? [].concat(existing, ours) : ours;
  5459. }
  5460. }
  5461. }
  5462. return data
  5463. }
  5464. /* */
  5465. function resolveScopedSlots (
  5466. fns, // see flow/vnode
  5467. res,
  5468. // the following are added in 2.6
  5469. hasDynamicKeys,
  5470. contentHashKey
  5471. ) {
  5472. res = res || { $stable: !hasDynamicKeys };
  5473. for (var i = 0; i < fns.length; i++) {
  5474. var slot = fns[i];
  5475. if (Array.isArray(slot)) {
  5476. resolveScopedSlots(slot, res, hasDynamicKeys);
  5477. } else if (slot) {
  5478. // marker for reverse proxying v-slot without scope on this.$slots
  5479. if (slot.proxy) {
  5480. slot.fn.proxy = true;
  5481. }
  5482. res[slot.key] = slot.fn;
  5483. }
  5484. }
  5485. if (contentHashKey) {
  5486. (res).$key = contentHashKey;
  5487. }
  5488. return res
  5489. }
  5490. /* */
  5491. function bindDynamicKeys (baseObj, values) {
  5492. for (var i = 0; i < values.length; i += 2) {
  5493. var key = values[i];
  5494. if (typeof key === 'string' && key) {
  5495. baseObj[values[i]] = values[i + 1];
  5496. } else if ( true && key !== '' && key !== null) {
  5497. // null is a special value for explicitly removing a binding
  5498. warn(
  5499. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5500. this
  5501. );
  5502. }
  5503. }
  5504. return baseObj
  5505. }
  5506. // helper to dynamically append modifier runtime markers to event names.
  5507. // ensure only append when value is already string, otherwise it will be cast
  5508. // to string and cause the type check to miss.
  5509. function prependModifier (value, symbol) {
  5510. return typeof value === 'string' ? symbol + value : value
  5511. }
  5512. /* */
  5513. function installRenderHelpers (target) {
  5514. target._o = markOnce;
  5515. target._n = toNumber;
  5516. target._s = toString;
  5517. target._l = renderList;
  5518. target._t = renderSlot;
  5519. target._q = looseEqual;
  5520. target._i = looseIndexOf;
  5521. target._m = renderStatic;
  5522. target._f = resolveFilter;
  5523. target._k = checkKeyCodes;
  5524. target._b = bindObjectProps;
  5525. target._v = createTextVNode;
  5526. target._e = createEmptyVNode;
  5527. target._u = resolveScopedSlots;
  5528. target._g = bindObjectListeners;
  5529. target._d = bindDynamicKeys;
  5530. target._p = prependModifier;
  5531. }
  5532. /* */
  5533. function FunctionalRenderContext (
  5534. data,
  5535. props,
  5536. children,
  5537. parent,
  5538. Ctor
  5539. ) {
  5540. var this$1 = this;
  5541. var options = Ctor.options;
  5542. // ensure the createElement function in functional components
  5543. // gets a unique context - this is necessary for correct named slot check
  5544. var contextVm;
  5545. if (hasOwn(parent, '_uid')) {
  5546. contextVm = Object.create(parent);
  5547. // $flow-disable-line
  5548. contextVm._original = parent;
  5549. } else {
  5550. // the context vm passed in is a functional context as well.
  5551. // in this case we want to make sure we are able to get a hold to the
  5552. // real context instance.
  5553. contextVm = parent;
  5554. // $flow-disable-line
  5555. parent = parent._original;
  5556. }
  5557. var isCompiled = isTrue(options._compiled);
  5558. var needNormalization = !isCompiled;
  5559. this.data = data;
  5560. this.props = props;
  5561. this.children = children;
  5562. this.parent = parent;
  5563. this.listeners = data.on || emptyObject;
  5564. this.injections = resolveInject(options.inject, parent);
  5565. this.slots = function () {
  5566. if (!this$1.$slots) {
  5567. normalizeScopedSlots(
  5568. data.scopedSlots,
  5569. this$1.$slots = resolveSlots(children, parent)
  5570. );
  5571. }
  5572. return this$1.$slots
  5573. };
  5574. Object.defineProperty(this, 'scopedSlots', ({
  5575. enumerable: true,
  5576. get: function get () {
  5577. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5578. }
  5579. }));
  5580. // support for compiled functional template
  5581. if (isCompiled) {
  5582. // exposing $options for renderStatic()
  5583. this.$options = options;
  5584. // pre-resolve slots for renderSlot()
  5585. this.$slots = this.slots();
  5586. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5587. }
  5588. if (options._scopeId) {
  5589. this._c = function (a, b, c, d) {
  5590. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5591. if (vnode && !Array.isArray(vnode)) {
  5592. vnode.fnScopeId = options._scopeId;
  5593. vnode.fnContext = parent;
  5594. }
  5595. return vnode
  5596. };
  5597. } else {
  5598. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5599. }
  5600. }
  5601. installRenderHelpers(FunctionalRenderContext.prototype);
  5602. function createFunctionalComponent (
  5603. Ctor,
  5604. propsData,
  5605. data,
  5606. contextVm,
  5607. children
  5608. ) {
  5609. var options = Ctor.options;
  5610. var props = {};
  5611. var propOptions = options.props;
  5612. if (isDef(propOptions)) {
  5613. for (var key in propOptions) {
  5614. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5615. }
  5616. } else {
  5617. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5618. if (isDef(data.props)) { mergeProps(props, data.props); }
  5619. }
  5620. var renderContext = new FunctionalRenderContext(
  5621. data,
  5622. props,
  5623. children,
  5624. contextVm,
  5625. Ctor
  5626. );
  5627. var vnode = options.render.call(null, renderContext._c, renderContext);
  5628. if (vnode instanceof VNode) {
  5629. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5630. } else if (Array.isArray(vnode)) {
  5631. var vnodes = normalizeChildren(vnode) || [];
  5632. var res = new Array(vnodes.length);
  5633. for (var i = 0; i < vnodes.length; i++) {
  5634. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5635. }
  5636. return res
  5637. }
  5638. }
  5639. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5640. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5641. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5642. // that should not be matched to match.
  5643. var clone = cloneVNode(vnode);
  5644. clone.fnContext = contextVm;
  5645. clone.fnOptions = options;
  5646. if (true) {
  5647. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5648. }
  5649. if (data.slot) {
  5650. (clone.data || (clone.data = {})).slot = data.slot;
  5651. }
  5652. return clone
  5653. }
  5654. function mergeProps (to, from) {
  5655. for (var key in from) {
  5656. to[camelize(key)] = from[key];
  5657. }
  5658. }
  5659. /* */
  5660. /* */
  5661. /* */
  5662. /* */
  5663. // inline hooks to be invoked on component VNodes during patch
  5664. var componentVNodeHooks = {
  5665. init: function init (vnode, hydrating) {
  5666. if (
  5667. vnode.componentInstance &&
  5668. !vnode.componentInstance._isDestroyed &&
  5669. vnode.data.keepAlive
  5670. ) {
  5671. // kept-alive components, treat as a patch
  5672. var mountedNode = vnode; // work around flow
  5673. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5674. } else {
  5675. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5676. vnode,
  5677. activeInstance
  5678. );
  5679. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5680. }
  5681. },
  5682. prepatch: function prepatch (oldVnode, vnode) {
  5683. var options = vnode.componentOptions;
  5684. var child = vnode.componentInstance = oldVnode.componentInstance;
  5685. updateChildComponent(
  5686. child,
  5687. options.propsData, // updated props
  5688. options.listeners, // updated listeners
  5689. vnode, // new parent vnode
  5690. options.children // new children
  5691. );
  5692. },
  5693. insert: function insert (vnode) {
  5694. var context = vnode.context;
  5695. var componentInstance = vnode.componentInstance;
  5696. if (!componentInstance._isMounted) {
  5697. callHook(componentInstance, 'onServiceCreated');
  5698. callHook(componentInstance, 'onServiceAttached');
  5699. componentInstance._isMounted = true;
  5700. callHook(componentInstance, 'mounted');
  5701. }
  5702. if (vnode.data.keepAlive) {
  5703. if (context._isMounted) {
  5704. // vue-router#1212
  5705. // During updates, a kept-alive component's child components may
  5706. // change, so directly walking the tree here may call activated hooks
  5707. // on incorrect children. Instead we push them into a queue which will
  5708. // be processed after the whole patch process ended.
  5709. queueActivatedComponent(componentInstance);
  5710. } else {
  5711. activateChildComponent(componentInstance, true /* direct */);
  5712. }
  5713. }
  5714. },
  5715. destroy: function destroy (vnode) {
  5716. var componentInstance = vnode.componentInstance;
  5717. if (!componentInstance._isDestroyed) {
  5718. if (!vnode.data.keepAlive) {
  5719. componentInstance.$destroy();
  5720. } else {
  5721. deactivateChildComponent(componentInstance, true /* direct */);
  5722. }
  5723. }
  5724. }
  5725. };
  5726. var hooksToMerge = Object.keys(componentVNodeHooks);
  5727. function createComponent (
  5728. Ctor,
  5729. data,
  5730. context,
  5731. children,
  5732. tag
  5733. ) {
  5734. if (isUndef(Ctor)) {
  5735. return
  5736. }
  5737. var baseCtor = context.$options._base;
  5738. // plain options object: turn it into a constructor
  5739. if (isObject(Ctor)) {
  5740. Ctor = baseCtor.extend(Ctor);
  5741. }
  5742. // if at this stage it's not a constructor or an async component factory,
  5743. // reject.
  5744. if (typeof Ctor !== 'function') {
  5745. if (true) {
  5746. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5747. }
  5748. return
  5749. }
  5750. // async component
  5751. var asyncFactory;
  5752. if (isUndef(Ctor.cid)) {
  5753. asyncFactory = Ctor;
  5754. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5755. if (Ctor === undefined) {
  5756. // return a placeholder node for async component, which is rendered
  5757. // as a comment node but preserves all the raw information for the node.
  5758. // the information will be used for async server-rendering and hydration.
  5759. return createAsyncPlaceholder(
  5760. asyncFactory,
  5761. data,
  5762. context,
  5763. children,
  5764. tag
  5765. )
  5766. }
  5767. }
  5768. data = data || {};
  5769. // resolve constructor options in case global mixins are applied after
  5770. // component constructor creation
  5771. resolveConstructorOptions(Ctor);
  5772. // transform component v-model data into props & events
  5773. if (isDef(data.model)) {
  5774. transformModel(Ctor.options, data);
  5775. }
  5776. // extract props
  5777. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5778. // functional component
  5779. if (isTrue(Ctor.options.functional)) {
  5780. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5781. }
  5782. // extract listeners, since these needs to be treated as
  5783. // child component listeners instead of DOM listeners
  5784. var listeners = data.on;
  5785. // replace with listeners with .native modifier
  5786. // so it gets processed during parent component patch.
  5787. data.on = data.nativeOn;
  5788. if (isTrue(Ctor.options.abstract)) {
  5789. // abstract components do not keep anything
  5790. // other than props & listeners & slot
  5791. // work around flow
  5792. var slot = data.slot;
  5793. data = {};
  5794. if (slot) {
  5795. data.slot = slot;
  5796. }
  5797. }
  5798. // install component management hooks onto the placeholder node
  5799. installComponentHooks(data);
  5800. // return a placeholder vnode
  5801. var name = Ctor.options.name || tag;
  5802. var vnode = new VNode(
  5803. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5804. data, undefined, undefined, undefined, context,
  5805. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5806. asyncFactory
  5807. );
  5808. return vnode
  5809. }
  5810. function createComponentInstanceForVnode (
  5811. vnode, // we know it's MountedComponentVNode but flow doesn't
  5812. parent // activeInstance in lifecycle state
  5813. ) {
  5814. var options = {
  5815. _isComponent: true,
  5816. _parentVnode: vnode,
  5817. parent: parent
  5818. };
  5819. // check inline-template render functions
  5820. var inlineTemplate = vnode.data.inlineTemplate;
  5821. if (isDef(inlineTemplate)) {
  5822. options.render = inlineTemplate.render;
  5823. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5824. }
  5825. return new vnode.componentOptions.Ctor(options)
  5826. }
  5827. function installComponentHooks (data) {
  5828. var hooks = data.hook || (data.hook = {});
  5829. for (var i = 0; i < hooksToMerge.length; i++) {
  5830. var key = hooksToMerge[i];
  5831. var existing = hooks[key];
  5832. var toMerge = componentVNodeHooks[key];
  5833. if (existing !== toMerge && !(existing && existing._merged)) {
  5834. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5835. }
  5836. }
  5837. }
  5838. function mergeHook$1 (f1, f2) {
  5839. var merged = function (a, b) {
  5840. // flow complains about extra args which is why we use any
  5841. f1(a, b);
  5842. f2(a, b);
  5843. };
  5844. merged._merged = true;
  5845. return merged
  5846. }
  5847. // transform component v-model info (value and callback) into
  5848. // prop and event handler respectively.
  5849. function transformModel (options, data) {
  5850. var prop = (options.model && options.model.prop) || 'value';
  5851. var event = (options.model && options.model.event) || 'input'
  5852. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5853. var on = data.on || (data.on = {});
  5854. var existing = on[event];
  5855. var callback = data.model.callback;
  5856. if (isDef(existing)) {
  5857. if (
  5858. Array.isArray(existing)
  5859. ? existing.indexOf(callback) === -1
  5860. : existing !== callback
  5861. ) {
  5862. on[event] = [callback].concat(existing);
  5863. }
  5864. } else {
  5865. on[event] = callback;
  5866. }
  5867. }
  5868. /* */
  5869. var SIMPLE_NORMALIZE = 1;
  5870. var ALWAYS_NORMALIZE = 2;
  5871. // wrapper function for providing a more flexible interface
  5872. // without getting yelled at by flow
  5873. function createElement (
  5874. context,
  5875. tag,
  5876. data,
  5877. children,
  5878. normalizationType,
  5879. alwaysNormalize
  5880. ) {
  5881. if (Array.isArray(data) || isPrimitive(data)) {
  5882. normalizationType = children;
  5883. children = data;
  5884. data = undefined;
  5885. }
  5886. if (isTrue(alwaysNormalize)) {
  5887. normalizationType = ALWAYS_NORMALIZE;
  5888. }
  5889. return _createElement(context, tag, data, children, normalizationType)
  5890. }
  5891. function _createElement (
  5892. context,
  5893. tag,
  5894. data,
  5895. children,
  5896. normalizationType
  5897. ) {
  5898. if (isDef(data) && isDef((data).__ob__)) {
  5899. true && warn(
  5900. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5901. 'Always create fresh vnode data objects in each render!',
  5902. context
  5903. );
  5904. return createEmptyVNode()
  5905. }
  5906. // object syntax in v-bind
  5907. if (isDef(data) && isDef(data.is)) {
  5908. tag = data.is;
  5909. }
  5910. if (!tag) {
  5911. // in case of component :is set to falsy value
  5912. return createEmptyVNode()
  5913. }
  5914. // warn against non-primitive key
  5915. if ( true &&
  5916. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  5917. ) {
  5918. {
  5919. warn(
  5920. 'Avoid using non-primitive value as key, ' +
  5921. 'use string/number value instead.',
  5922. context
  5923. );
  5924. }
  5925. }
  5926. // support single function children as default scoped slot
  5927. if (Array.isArray(children) &&
  5928. typeof children[0] === 'function'
  5929. ) {
  5930. data = data || {};
  5931. data.scopedSlots = { default: children[0] };
  5932. children.length = 0;
  5933. }
  5934. if (normalizationType === ALWAYS_NORMALIZE) {
  5935. children = normalizeChildren(children);
  5936. } else if (normalizationType === SIMPLE_NORMALIZE) {
  5937. children = simpleNormalizeChildren(children);
  5938. }
  5939. var vnode, ns;
  5940. if (typeof tag === 'string') {
  5941. var Ctor;
  5942. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  5943. if (config.isReservedTag(tag)) {
  5944. // platform built-in elements
  5945. if ( true && isDef(data) && isDef(data.nativeOn)) {
  5946. warn(
  5947. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  5948. context
  5949. );
  5950. }
  5951. vnode = new VNode(
  5952. config.parsePlatformTagName(tag), data, children,
  5953. undefined, undefined, context
  5954. );
  5955. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  5956. // component
  5957. vnode = createComponent(Ctor, data, context, children, tag);
  5958. } else {
  5959. // unknown or unlisted namespaced elements
  5960. // check at runtime because it may get assigned a namespace when its
  5961. // parent normalizes children
  5962. vnode = new VNode(
  5963. tag, data, children,
  5964. undefined, undefined, context
  5965. );
  5966. }
  5967. } else {
  5968. // direct component options / constructor
  5969. vnode = createComponent(tag, data, context, children);
  5970. }
  5971. if (Array.isArray(vnode)) {
  5972. return vnode
  5973. } else if (isDef(vnode)) {
  5974. if (isDef(ns)) { applyNS(vnode, ns); }
  5975. if (isDef(data)) { registerDeepBindings(data); }
  5976. return vnode
  5977. } else {
  5978. return createEmptyVNode()
  5979. }
  5980. }
  5981. function applyNS (vnode, ns, force) {
  5982. vnode.ns = ns;
  5983. if (vnode.tag === 'foreignObject') {
  5984. // use default namespace inside foreignObject
  5985. ns = undefined;
  5986. force = true;
  5987. }
  5988. if (isDef(vnode.children)) {
  5989. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5990. var child = vnode.children[i];
  5991. if (isDef(child.tag) && (
  5992. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  5993. applyNS(child, ns, force);
  5994. }
  5995. }
  5996. }
  5997. }
  5998. // ref #5318
  5999. // necessary to ensure parent re-render when deep bindings like :style and
  6000. // :class are used on slot nodes
  6001. function registerDeepBindings (data) {
  6002. if (isObject(data.style)) {
  6003. traverse(data.style);
  6004. }
  6005. if (isObject(data.class)) {
  6006. traverse(data.class);
  6007. }
  6008. }
  6009. /* */
  6010. function initRender (vm) {
  6011. vm._vnode = null; // the root of the child tree
  6012. vm._staticTrees = null; // v-once cached trees
  6013. var options = vm.$options;
  6014. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6015. var renderContext = parentVnode && parentVnode.context;
  6016. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6017. vm.$scopedSlots = emptyObject;
  6018. // bind the createElement fn to this instance
  6019. // so that we get proper render context inside it.
  6020. // args order: tag, data, children, normalizationType, alwaysNormalize
  6021. // internal version is used by render functions compiled from templates
  6022. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6023. // normalization is always applied for the public version, used in
  6024. // user-written render functions.
  6025. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6026. // $attrs & $listeners are exposed for easier HOC creation.
  6027. // they need to be reactive so that HOCs using them are always updated
  6028. var parentData = parentVnode && parentVnode.data;
  6029. /* istanbul ignore else */
  6030. if (true) {
  6031. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6032. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6033. }, true);
  6034. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6035. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6036. }, true);
  6037. } else {}
  6038. }
  6039. var currentRenderingInstance = null;
  6040. function renderMixin (Vue) {
  6041. // install runtime convenience helpers
  6042. installRenderHelpers(Vue.prototype);
  6043. Vue.prototype.$nextTick = function (fn) {
  6044. return nextTick(fn, this)
  6045. };
  6046. Vue.prototype._render = function () {
  6047. var vm = this;
  6048. var ref = vm.$options;
  6049. var render = ref.render;
  6050. var _parentVnode = ref._parentVnode;
  6051. if (_parentVnode) {
  6052. vm.$scopedSlots = normalizeScopedSlots(
  6053. _parentVnode.data.scopedSlots,
  6054. vm.$slots,
  6055. vm.$scopedSlots
  6056. );
  6057. }
  6058. // set parent vnode. this allows render functions to have access
  6059. // to the data on the placeholder node.
  6060. vm.$vnode = _parentVnode;
  6061. // render self
  6062. var vnode;
  6063. try {
  6064. // There's no need to maintain a stack because all render fns are called
  6065. // separately from one another. Nested component's render fns are called
  6066. // when parent component is patched.
  6067. currentRenderingInstance = vm;
  6068. vnode = render.call(vm._renderProxy, vm.$createElement);
  6069. } catch (e) {
  6070. handleError(e, vm, "render");
  6071. // return error render result,
  6072. // or previous vnode to prevent render error causing blank component
  6073. /* istanbul ignore else */
  6074. if ( true && vm.$options.renderError) {
  6075. try {
  6076. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6077. } catch (e) {
  6078. handleError(e, vm, "renderError");
  6079. vnode = vm._vnode;
  6080. }
  6081. } else {
  6082. vnode = vm._vnode;
  6083. }
  6084. } finally {
  6085. currentRenderingInstance = null;
  6086. }
  6087. // if the returned array contains only a single node, allow it
  6088. if (Array.isArray(vnode) && vnode.length === 1) {
  6089. vnode = vnode[0];
  6090. }
  6091. // return empty vnode in case the render function errored out
  6092. if (!(vnode instanceof VNode)) {
  6093. if ( true && Array.isArray(vnode)) {
  6094. warn(
  6095. 'Multiple root nodes returned from render function. Render function ' +
  6096. 'should return a single root node.',
  6097. vm
  6098. );
  6099. }
  6100. vnode = createEmptyVNode();
  6101. }
  6102. // set parent
  6103. vnode.parent = _parentVnode;
  6104. return vnode
  6105. };
  6106. }
  6107. /* */
  6108. function ensureCtor (comp, base) {
  6109. if (
  6110. comp.__esModule ||
  6111. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6112. ) {
  6113. comp = comp.default;
  6114. }
  6115. return isObject(comp)
  6116. ? base.extend(comp)
  6117. : comp
  6118. }
  6119. function createAsyncPlaceholder (
  6120. factory,
  6121. data,
  6122. context,
  6123. children,
  6124. tag
  6125. ) {
  6126. var node = createEmptyVNode();
  6127. node.asyncFactory = factory;
  6128. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6129. return node
  6130. }
  6131. function resolveAsyncComponent (
  6132. factory,
  6133. baseCtor
  6134. ) {
  6135. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6136. return factory.errorComp
  6137. }
  6138. if (isDef(factory.resolved)) {
  6139. return factory.resolved
  6140. }
  6141. var owner = currentRenderingInstance;
  6142. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6143. // already pending
  6144. factory.owners.push(owner);
  6145. }
  6146. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6147. return factory.loadingComp
  6148. }
  6149. if (owner && !isDef(factory.owners)) {
  6150. var owners = factory.owners = [owner];
  6151. var sync = true;
  6152. var timerLoading = null;
  6153. var timerTimeout = null
  6154. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6155. var forceRender = function (renderCompleted) {
  6156. for (var i = 0, l = owners.length; i < l; i++) {
  6157. (owners[i]).$forceUpdate();
  6158. }
  6159. if (renderCompleted) {
  6160. owners.length = 0;
  6161. if (timerLoading !== null) {
  6162. clearTimeout(timerLoading);
  6163. timerLoading = null;
  6164. }
  6165. if (timerTimeout !== null) {
  6166. clearTimeout(timerTimeout);
  6167. timerTimeout = null;
  6168. }
  6169. }
  6170. };
  6171. var resolve = once(function (res) {
  6172. // cache resolved
  6173. factory.resolved = ensureCtor(res, baseCtor);
  6174. // invoke callbacks only if this is not a synchronous resolve
  6175. // (async resolves are shimmed as synchronous during SSR)
  6176. if (!sync) {
  6177. forceRender(true);
  6178. } else {
  6179. owners.length = 0;
  6180. }
  6181. });
  6182. var reject = once(function (reason) {
  6183. true && warn(
  6184. "Failed to resolve async component: " + (String(factory)) +
  6185. (reason ? ("\nReason: " + reason) : '')
  6186. );
  6187. if (isDef(factory.errorComp)) {
  6188. factory.error = true;
  6189. forceRender(true);
  6190. }
  6191. });
  6192. var res = factory(resolve, reject);
  6193. if (isObject(res)) {
  6194. if (isPromise(res)) {
  6195. // () => Promise
  6196. if (isUndef(factory.resolved)) {
  6197. res.then(resolve, reject);
  6198. }
  6199. } else if (isPromise(res.component)) {
  6200. res.component.then(resolve, reject);
  6201. if (isDef(res.error)) {
  6202. factory.errorComp = ensureCtor(res.error, baseCtor);
  6203. }
  6204. if (isDef(res.loading)) {
  6205. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6206. if (res.delay === 0) {
  6207. factory.loading = true;
  6208. } else {
  6209. timerLoading = setTimeout(function () {
  6210. timerLoading = null;
  6211. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6212. factory.loading = true;
  6213. forceRender(false);
  6214. }
  6215. }, res.delay || 200);
  6216. }
  6217. }
  6218. if (isDef(res.timeout)) {
  6219. timerTimeout = setTimeout(function () {
  6220. timerTimeout = null;
  6221. if (isUndef(factory.resolved)) {
  6222. reject(
  6223. true
  6224. ? ("timeout (" + (res.timeout) + "ms)")
  6225. : undefined
  6226. );
  6227. }
  6228. }, res.timeout);
  6229. }
  6230. }
  6231. }
  6232. sync = false;
  6233. // return in case resolved synchronously
  6234. return factory.loading
  6235. ? factory.loadingComp
  6236. : factory.resolved
  6237. }
  6238. }
  6239. /* */
  6240. function isAsyncPlaceholder (node) {
  6241. return node.isComment && node.asyncFactory
  6242. }
  6243. /* */
  6244. function getFirstComponentChild (children) {
  6245. if (Array.isArray(children)) {
  6246. for (var i = 0; i < children.length; i++) {
  6247. var c = children[i];
  6248. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6249. return c
  6250. }
  6251. }
  6252. }
  6253. }
  6254. /* */
  6255. /* */
  6256. function initEvents (vm) {
  6257. vm._events = Object.create(null);
  6258. vm._hasHookEvent = false;
  6259. // init parent attached events
  6260. var listeners = vm.$options._parentListeners;
  6261. if (listeners) {
  6262. updateComponentListeners(vm, listeners);
  6263. }
  6264. }
  6265. var target;
  6266. function add (event, fn) {
  6267. target.$on(event, fn);
  6268. }
  6269. function remove$1 (event, fn) {
  6270. target.$off(event, fn);
  6271. }
  6272. function createOnceHandler (event, fn) {
  6273. var _target = target;
  6274. return function onceHandler () {
  6275. var res = fn.apply(null, arguments);
  6276. if (res !== null) {
  6277. _target.$off(event, onceHandler);
  6278. }
  6279. }
  6280. }
  6281. function updateComponentListeners (
  6282. vm,
  6283. listeners,
  6284. oldListeners
  6285. ) {
  6286. target = vm;
  6287. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6288. target = undefined;
  6289. }
  6290. function eventsMixin (Vue) {
  6291. var hookRE = /^hook:/;
  6292. Vue.prototype.$on = function (event, fn) {
  6293. var vm = this;
  6294. if (Array.isArray(event)) {
  6295. for (var i = 0, l = event.length; i < l; i++) {
  6296. vm.$on(event[i], fn);
  6297. }
  6298. } else {
  6299. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6300. // optimize hook:event cost by using a boolean flag marked at registration
  6301. // instead of a hash lookup
  6302. if (hookRE.test(event)) {
  6303. vm._hasHookEvent = true;
  6304. }
  6305. }
  6306. return vm
  6307. };
  6308. Vue.prototype.$once = function (event, fn) {
  6309. var vm = this;
  6310. function on () {
  6311. vm.$off(event, on);
  6312. fn.apply(vm, arguments);
  6313. }
  6314. on.fn = fn;
  6315. vm.$on(event, on);
  6316. return vm
  6317. };
  6318. Vue.prototype.$off = function (event, fn) {
  6319. var vm = this;
  6320. // all
  6321. if (!arguments.length) {
  6322. vm._events = Object.create(null);
  6323. return vm
  6324. }
  6325. // array of events
  6326. if (Array.isArray(event)) {
  6327. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6328. vm.$off(event[i$1], fn);
  6329. }
  6330. return vm
  6331. }
  6332. // specific event
  6333. var cbs = vm._events[event];
  6334. if (!cbs) {
  6335. return vm
  6336. }
  6337. if (!fn) {
  6338. vm._events[event] = null;
  6339. return vm
  6340. }
  6341. // specific handler
  6342. var cb;
  6343. var i = cbs.length;
  6344. while (i--) {
  6345. cb = cbs[i];
  6346. if (cb === fn || cb.fn === fn) {
  6347. cbs.splice(i, 1);
  6348. break
  6349. }
  6350. }
  6351. return vm
  6352. };
  6353. Vue.prototype.$emit = function (event) {
  6354. var vm = this;
  6355. if (true) {
  6356. var lowerCaseEvent = event.toLowerCase();
  6357. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6358. tip(
  6359. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6360. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6361. "Note that HTML attributes are case-insensitive and you cannot use " +
  6362. "v-on to listen to camelCase events when using in-DOM templates. " +
  6363. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6364. );
  6365. }
  6366. }
  6367. var cbs = vm._events[event];
  6368. if (cbs) {
  6369. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6370. var args = toArray(arguments, 1);
  6371. var info = "event handler for \"" + event + "\"";
  6372. for (var i = 0, l = cbs.length; i < l; i++) {
  6373. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6374. }
  6375. }
  6376. return vm
  6377. };
  6378. }
  6379. /* */
  6380. var activeInstance = null;
  6381. var isUpdatingChildComponent = false;
  6382. function setActiveInstance(vm) {
  6383. var prevActiveInstance = activeInstance;
  6384. activeInstance = vm;
  6385. return function () {
  6386. activeInstance = prevActiveInstance;
  6387. }
  6388. }
  6389. function initLifecycle (vm) {
  6390. var options = vm.$options;
  6391. // locate first non-abstract parent
  6392. var parent = options.parent;
  6393. if (parent && !options.abstract) {
  6394. while (parent.$options.abstract && parent.$parent) {
  6395. parent = parent.$parent;
  6396. }
  6397. parent.$children.push(vm);
  6398. }
  6399. vm.$parent = parent;
  6400. vm.$root = parent ? parent.$root : vm;
  6401. vm.$children = [];
  6402. vm.$refs = {};
  6403. vm._watcher = null;
  6404. vm._inactive = null;
  6405. vm._directInactive = false;
  6406. vm._isMounted = false;
  6407. vm._isDestroyed = false;
  6408. vm._isBeingDestroyed = false;
  6409. }
  6410. function lifecycleMixin (Vue) {
  6411. Vue.prototype._update = function (vnode, hydrating) {
  6412. var vm = this;
  6413. var prevEl = vm.$el;
  6414. var prevVnode = vm._vnode;
  6415. var restoreActiveInstance = setActiveInstance(vm);
  6416. vm._vnode = vnode;
  6417. // Vue.prototype.__patch__ is injected in entry points
  6418. // based on the rendering backend used.
  6419. if (!prevVnode) {
  6420. // initial render
  6421. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6422. } else {
  6423. // updates
  6424. vm.$el = vm.__patch__(prevVnode, vnode);
  6425. }
  6426. restoreActiveInstance();
  6427. // update __vue__ reference
  6428. if (prevEl) {
  6429. prevEl.__vue__ = null;
  6430. }
  6431. if (vm.$el) {
  6432. vm.$el.__vue__ = vm;
  6433. }
  6434. // if parent is an HOC, update its $el as well
  6435. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6436. vm.$parent.$el = vm.$el;
  6437. }
  6438. // updated hook is called by the scheduler to ensure that children are
  6439. // updated in a parent's updated hook.
  6440. };
  6441. Vue.prototype.$forceUpdate = function () {
  6442. var vm = this;
  6443. if (vm._watcher) {
  6444. vm._watcher.update();
  6445. }
  6446. };
  6447. Vue.prototype.$destroy = function () {
  6448. var vm = this;
  6449. if (vm._isBeingDestroyed) {
  6450. return
  6451. }
  6452. callHook(vm, 'beforeDestroy');
  6453. vm._isBeingDestroyed = true;
  6454. // remove self from parent
  6455. var parent = vm.$parent;
  6456. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6457. remove(parent.$children, vm);
  6458. }
  6459. // teardown watchers
  6460. if (vm._watcher) {
  6461. vm._watcher.teardown();
  6462. }
  6463. var i = vm._watchers.length;
  6464. while (i--) {
  6465. vm._watchers[i].teardown();
  6466. }
  6467. // remove reference from data ob
  6468. // frozen object may not have observer.
  6469. if (vm._data.__ob__) {
  6470. vm._data.__ob__.vmCount--;
  6471. }
  6472. // call the last hook...
  6473. vm._isDestroyed = true;
  6474. // invoke destroy hooks on current rendered tree
  6475. vm.__patch__(vm._vnode, null);
  6476. // fire destroyed hook
  6477. callHook(vm, 'destroyed');
  6478. // turn off all instance listeners.
  6479. vm.$off();
  6480. // remove __vue__ reference
  6481. if (vm.$el) {
  6482. vm.$el.__vue__ = null;
  6483. }
  6484. // release circular reference (#6759)
  6485. if (vm.$vnode) {
  6486. vm.$vnode.parent = null;
  6487. }
  6488. };
  6489. }
  6490. function updateChildComponent (
  6491. vm,
  6492. propsData,
  6493. listeners,
  6494. parentVnode,
  6495. renderChildren
  6496. ) {
  6497. if (true) {
  6498. isUpdatingChildComponent = true;
  6499. }
  6500. // determine whether component has slot children
  6501. // we need to do this before overwriting $options._renderChildren.
  6502. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6503. // dynamic slot names). Static scoped slots compiled from template has the
  6504. // "$stable" marker.
  6505. var newScopedSlots = parentVnode.data.scopedSlots;
  6506. var oldScopedSlots = vm.$scopedSlots;
  6507. var hasDynamicScopedSlot = !!(
  6508. (newScopedSlots && !newScopedSlots.$stable) ||
  6509. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6510. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6511. );
  6512. // Any static slot children from the parent may have changed during parent's
  6513. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6514. // update is necessary to ensure correctness.
  6515. var needsForceUpdate = !!(
  6516. renderChildren || // has new static slots
  6517. vm.$options._renderChildren || // has old static slots
  6518. hasDynamicScopedSlot
  6519. );
  6520. vm.$options._parentVnode = parentVnode;
  6521. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6522. if (vm._vnode) { // update child tree's parent
  6523. vm._vnode.parent = parentVnode;
  6524. }
  6525. vm.$options._renderChildren = renderChildren;
  6526. // update $attrs and $listeners hash
  6527. // these are also reactive so they may trigger child update if the child
  6528. // used them during render
  6529. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6530. vm.$listeners = listeners || emptyObject;
  6531. // update props
  6532. if (propsData && vm.$options.props) {
  6533. toggleObserving(false);
  6534. var props = vm._props;
  6535. var propKeys = vm.$options._propKeys || [];
  6536. for (var i = 0; i < propKeys.length; i++) {
  6537. var key = propKeys[i];
  6538. var propOptions = vm.$options.props; // wtf flow?
  6539. props[key] = validateProp(key, propOptions, propsData, vm);
  6540. }
  6541. toggleObserving(true);
  6542. // keep a copy of raw propsData
  6543. vm.$options.propsData = propsData;
  6544. }
  6545. // fixed by xxxxxx update properties(mp runtime)
  6546. vm._$updateProperties && vm._$updateProperties(vm);
  6547. // update listeners
  6548. listeners = listeners || emptyObject;
  6549. var oldListeners = vm.$options._parentListeners;
  6550. vm.$options._parentListeners = listeners;
  6551. updateComponentListeners(vm, listeners, oldListeners);
  6552. // resolve slots + force update if has children
  6553. if (needsForceUpdate) {
  6554. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6555. vm.$forceUpdate();
  6556. }
  6557. if (true) {
  6558. isUpdatingChildComponent = false;
  6559. }
  6560. }
  6561. function isInInactiveTree (vm) {
  6562. while (vm && (vm = vm.$parent)) {
  6563. if (vm._inactive) { return true }
  6564. }
  6565. return false
  6566. }
  6567. function activateChildComponent (vm, direct) {
  6568. if (direct) {
  6569. vm._directInactive = false;
  6570. if (isInInactiveTree(vm)) {
  6571. return
  6572. }
  6573. } else if (vm._directInactive) {
  6574. return
  6575. }
  6576. if (vm._inactive || vm._inactive === null) {
  6577. vm._inactive = false;
  6578. for (var i = 0; i < vm.$children.length; i++) {
  6579. activateChildComponent(vm.$children[i]);
  6580. }
  6581. callHook(vm, 'activated');
  6582. }
  6583. }
  6584. function deactivateChildComponent (vm, direct) {
  6585. if (direct) {
  6586. vm._directInactive = true;
  6587. if (isInInactiveTree(vm)) {
  6588. return
  6589. }
  6590. }
  6591. if (!vm._inactive) {
  6592. vm._inactive = true;
  6593. for (var i = 0; i < vm.$children.length; i++) {
  6594. deactivateChildComponent(vm.$children[i]);
  6595. }
  6596. callHook(vm, 'deactivated');
  6597. }
  6598. }
  6599. function callHook (vm, hook) {
  6600. // #7573 disable dep collection when invoking lifecycle hooks
  6601. pushTarget();
  6602. var handlers = vm.$options[hook];
  6603. var info = hook + " hook";
  6604. if (handlers) {
  6605. for (var i = 0, j = handlers.length; i < j; i++) {
  6606. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6607. }
  6608. }
  6609. if (vm._hasHookEvent) {
  6610. vm.$emit('hook:' + hook);
  6611. }
  6612. popTarget();
  6613. }
  6614. /* */
  6615. var MAX_UPDATE_COUNT = 100;
  6616. var queue = [];
  6617. var activatedChildren = [];
  6618. var has = {};
  6619. var circular = {};
  6620. var waiting = false;
  6621. var flushing = false;
  6622. var index = 0;
  6623. /**
  6624. * Reset the scheduler's state.
  6625. */
  6626. function resetSchedulerState () {
  6627. index = queue.length = activatedChildren.length = 0;
  6628. has = {};
  6629. if (true) {
  6630. circular = {};
  6631. }
  6632. waiting = flushing = false;
  6633. }
  6634. // Async edge case #6566 requires saving the timestamp when event listeners are
  6635. // attached. However, calling performance.now() has a perf overhead especially
  6636. // if the page has thousands of event listeners. Instead, we take a timestamp
  6637. // every time the scheduler flushes and use that for all event listeners
  6638. // attached during that flush.
  6639. var currentFlushTimestamp = 0;
  6640. // Async edge case fix requires storing an event listener's attach timestamp.
  6641. var getNow = Date.now;
  6642. // Determine what event timestamp the browser is using. Annoyingly, the
  6643. // timestamp can either be hi-res (relative to page load) or low-res
  6644. // (relative to UNIX epoch), so in order to compare time we have to use the
  6645. // same timestamp type when saving the flush timestamp.
  6646. // All IE versions use low-res event timestamps, and have problematic clock
  6647. // implementations (#9632)
  6648. if (inBrowser && !isIE) {
  6649. var performance = window.performance;
  6650. if (
  6651. performance &&
  6652. typeof performance.now === 'function' &&
  6653. getNow() > document.createEvent('Event').timeStamp
  6654. ) {
  6655. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6656. // smaller than it, it means the event is using a hi-res timestamp,
  6657. // and we need to use the hi-res version for event listener timestamps as
  6658. // well.
  6659. getNow = function () { return performance.now(); };
  6660. }
  6661. }
  6662. /**
  6663. * Flush both queues and run the watchers.
  6664. */
  6665. function flushSchedulerQueue () {
  6666. currentFlushTimestamp = getNow();
  6667. flushing = true;
  6668. var watcher, id;
  6669. // Sort queue before flush.
  6670. // This ensures that:
  6671. // 1. Components are updated from parent to child. (because parent is always
  6672. // created before the child)
  6673. // 2. A component's user watchers are run before its render watcher (because
  6674. // user watchers are created before the render watcher)
  6675. // 3. If a component is destroyed during a parent component's watcher run,
  6676. // its watchers can be skipped.
  6677. queue.sort(function (a, b) { return a.id - b.id; });
  6678. // do not cache length because more watchers might be pushed
  6679. // as we run existing watchers
  6680. for (index = 0; index < queue.length; index++) {
  6681. watcher = queue[index];
  6682. if (watcher.before) {
  6683. watcher.before();
  6684. }
  6685. id = watcher.id;
  6686. has[id] = null;
  6687. watcher.run();
  6688. // in dev build, check and stop circular updates.
  6689. if ( true && has[id] != null) {
  6690. circular[id] = (circular[id] || 0) + 1;
  6691. if (circular[id] > MAX_UPDATE_COUNT) {
  6692. warn(
  6693. 'You may have an infinite update loop ' + (
  6694. watcher.user
  6695. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6696. : "in a component render function."
  6697. ),
  6698. watcher.vm
  6699. );
  6700. break
  6701. }
  6702. }
  6703. }
  6704. // keep copies of post queues before resetting state
  6705. var activatedQueue = activatedChildren.slice();
  6706. var updatedQueue = queue.slice();
  6707. resetSchedulerState();
  6708. // call component updated and activated hooks
  6709. callActivatedHooks(activatedQueue);
  6710. callUpdatedHooks(updatedQueue);
  6711. // devtool hook
  6712. /* istanbul ignore if */
  6713. if (devtools && config.devtools) {
  6714. devtools.emit('flush');
  6715. }
  6716. }
  6717. function callUpdatedHooks (queue) {
  6718. var i = queue.length;
  6719. while (i--) {
  6720. var watcher = queue[i];
  6721. var vm = watcher.vm;
  6722. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6723. callHook(vm, 'updated');
  6724. }
  6725. }
  6726. }
  6727. /**
  6728. * Queue a kept-alive component that was activated during patch.
  6729. * The queue will be processed after the entire tree has been patched.
  6730. */
  6731. function queueActivatedComponent (vm) {
  6732. // setting _inactive to false here so that a render function can
  6733. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6734. vm._inactive = false;
  6735. activatedChildren.push(vm);
  6736. }
  6737. function callActivatedHooks (queue) {
  6738. for (var i = 0; i < queue.length; i++) {
  6739. queue[i]._inactive = true;
  6740. activateChildComponent(queue[i], true /* true */);
  6741. }
  6742. }
  6743. /**
  6744. * Push a watcher into the watcher queue.
  6745. * Jobs with duplicate IDs will be skipped unless it's
  6746. * pushed when the queue is being flushed.
  6747. */
  6748. function queueWatcher (watcher) {
  6749. var id = watcher.id;
  6750. if (has[id] == null) {
  6751. has[id] = true;
  6752. if (!flushing) {
  6753. queue.push(watcher);
  6754. } else {
  6755. // if already flushing, splice the watcher based on its id
  6756. // if already past its id, it will be run next immediately.
  6757. var i = queue.length - 1;
  6758. while (i > index && queue[i].id > watcher.id) {
  6759. i--;
  6760. }
  6761. queue.splice(i + 1, 0, watcher);
  6762. }
  6763. // queue the flush
  6764. if (!waiting) {
  6765. waiting = true;
  6766. if ( true && !config.async) {
  6767. flushSchedulerQueue();
  6768. return
  6769. }
  6770. nextTick(flushSchedulerQueue);
  6771. }
  6772. }
  6773. }
  6774. /* */
  6775. var uid$2 = 0;
  6776. /**
  6777. * A watcher parses an expression, collects dependencies,
  6778. * and fires callback when the expression value changes.
  6779. * This is used for both the $watch() api and directives.
  6780. */
  6781. var Watcher = function Watcher (
  6782. vm,
  6783. expOrFn,
  6784. cb,
  6785. options,
  6786. isRenderWatcher
  6787. ) {
  6788. this.vm = vm;
  6789. if (isRenderWatcher) {
  6790. vm._watcher = this;
  6791. }
  6792. vm._watchers.push(this);
  6793. // options
  6794. if (options) {
  6795. this.deep = !!options.deep;
  6796. this.user = !!options.user;
  6797. this.lazy = !!options.lazy;
  6798. this.sync = !!options.sync;
  6799. this.before = options.before;
  6800. } else {
  6801. this.deep = this.user = this.lazy = this.sync = false;
  6802. }
  6803. this.cb = cb;
  6804. this.id = ++uid$2; // uid for batching
  6805. this.active = true;
  6806. this.dirty = this.lazy; // for lazy watchers
  6807. this.deps = [];
  6808. this.newDeps = [];
  6809. this.depIds = new _Set();
  6810. this.newDepIds = new _Set();
  6811. this.expression = true
  6812. ? expOrFn.toString()
  6813. : undefined;
  6814. // parse expression for getter
  6815. if (typeof expOrFn === 'function') {
  6816. this.getter = expOrFn;
  6817. } else {
  6818. this.getter = parsePath(expOrFn);
  6819. if (!this.getter) {
  6820. this.getter = noop;
  6821. true && warn(
  6822. "Failed watching path: \"" + expOrFn + "\" " +
  6823. 'Watcher only accepts simple dot-delimited paths. ' +
  6824. 'For full control, use a function instead.',
  6825. vm
  6826. );
  6827. }
  6828. }
  6829. this.value = this.lazy
  6830. ? undefined
  6831. : this.get();
  6832. };
  6833. /**
  6834. * Evaluate the getter, and re-collect dependencies.
  6835. */
  6836. Watcher.prototype.get = function get () {
  6837. pushTarget(this);
  6838. var value;
  6839. var vm = this.vm;
  6840. try {
  6841. value = this.getter.call(vm, vm);
  6842. } catch (e) {
  6843. if (this.user) {
  6844. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6845. } else {
  6846. throw e
  6847. }
  6848. } finally {
  6849. // "touch" every property so they are all tracked as
  6850. // dependencies for deep watching
  6851. if (this.deep) {
  6852. traverse(value);
  6853. }
  6854. popTarget();
  6855. this.cleanupDeps();
  6856. }
  6857. return value
  6858. };
  6859. /**
  6860. * Add a dependency to this directive.
  6861. */
  6862. Watcher.prototype.addDep = function addDep (dep) {
  6863. var id = dep.id;
  6864. if (!this.newDepIds.has(id)) {
  6865. this.newDepIds.add(id);
  6866. this.newDeps.push(dep);
  6867. if (!this.depIds.has(id)) {
  6868. dep.addSub(this);
  6869. }
  6870. }
  6871. };
  6872. /**
  6873. * Clean up for dependency collection.
  6874. */
  6875. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6876. var i = this.deps.length;
  6877. while (i--) {
  6878. var dep = this.deps[i];
  6879. if (!this.newDepIds.has(dep.id)) {
  6880. dep.removeSub(this);
  6881. }
  6882. }
  6883. var tmp = this.depIds;
  6884. this.depIds = this.newDepIds;
  6885. this.newDepIds = tmp;
  6886. this.newDepIds.clear();
  6887. tmp = this.deps;
  6888. this.deps = this.newDeps;
  6889. this.newDeps = tmp;
  6890. this.newDeps.length = 0;
  6891. };
  6892. /**
  6893. * Subscriber interface.
  6894. * Will be called when a dependency changes.
  6895. */
  6896. Watcher.prototype.update = function update () {
  6897. /* istanbul ignore else */
  6898. if (this.lazy) {
  6899. this.dirty = true;
  6900. } else if (this.sync) {
  6901. this.run();
  6902. } else {
  6903. queueWatcher(this);
  6904. }
  6905. };
  6906. /**
  6907. * Scheduler job interface.
  6908. * Will be called by the scheduler.
  6909. */
  6910. Watcher.prototype.run = function run () {
  6911. if (this.active) {
  6912. var value = this.get();
  6913. if (
  6914. value !== this.value ||
  6915. // Deep watchers and watchers on Object/Arrays should fire even
  6916. // when the value is the same, because the value may
  6917. // have mutated.
  6918. isObject(value) ||
  6919. this.deep
  6920. ) {
  6921. // set new value
  6922. var oldValue = this.value;
  6923. this.value = value;
  6924. if (this.user) {
  6925. try {
  6926. this.cb.call(this.vm, value, oldValue);
  6927. } catch (e) {
  6928. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  6929. }
  6930. } else {
  6931. this.cb.call(this.vm, value, oldValue);
  6932. }
  6933. }
  6934. }
  6935. };
  6936. /**
  6937. * Evaluate the value of the watcher.
  6938. * This only gets called for lazy watchers.
  6939. */
  6940. Watcher.prototype.evaluate = function evaluate () {
  6941. this.value = this.get();
  6942. this.dirty = false;
  6943. };
  6944. /**
  6945. * Depend on all deps collected by this watcher.
  6946. */
  6947. Watcher.prototype.depend = function depend () {
  6948. var i = this.deps.length;
  6949. while (i--) {
  6950. this.deps[i].depend();
  6951. }
  6952. };
  6953. /**
  6954. * Remove self from all dependencies' subscriber list.
  6955. */
  6956. Watcher.prototype.teardown = function teardown () {
  6957. if (this.active) {
  6958. // remove self from vm's watcher list
  6959. // this is a somewhat expensive operation so we skip it
  6960. // if the vm is being destroyed.
  6961. if (!this.vm._isBeingDestroyed) {
  6962. remove(this.vm._watchers, this);
  6963. }
  6964. var i = this.deps.length;
  6965. while (i--) {
  6966. this.deps[i].removeSub(this);
  6967. }
  6968. this.active = false;
  6969. }
  6970. };
  6971. /* */
  6972. var sharedPropertyDefinition = {
  6973. enumerable: true,
  6974. configurable: true,
  6975. get: noop,
  6976. set: noop
  6977. };
  6978. function proxy (target, sourceKey, key) {
  6979. sharedPropertyDefinition.get = function proxyGetter () {
  6980. return this[sourceKey][key]
  6981. };
  6982. sharedPropertyDefinition.set = function proxySetter (val) {
  6983. this[sourceKey][key] = val;
  6984. };
  6985. Object.defineProperty(target, key, sharedPropertyDefinition);
  6986. }
  6987. function initState (vm) {
  6988. vm._watchers = [];
  6989. var opts = vm.$options;
  6990. if (opts.props) { initProps(vm, opts.props); }
  6991. if (opts.methods) { initMethods(vm, opts.methods); }
  6992. if (opts.data) {
  6993. initData(vm);
  6994. } else {
  6995. observe(vm._data = {}, true /* asRootData */);
  6996. }
  6997. if (opts.computed) { initComputed(vm, opts.computed); }
  6998. if (opts.watch && opts.watch !== nativeWatch) {
  6999. initWatch(vm, opts.watch);
  7000. }
  7001. }
  7002. function initProps (vm, propsOptions) {
  7003. var propsData = vm.$options.propsData || {};
  7004. var props = vm._props = {};
  7005. // cache prop keys so that future props updates can iterate using Array
  7006. // instead of dynamic object key enumeration.
  7007. var keys = vm.$options._propKeys = [];
  7008. var isRoot = !vm.$parent;
  7009. // root instance props should be converted
  7010. if (!isRoot) {
  7011. toggleObserving(false);
  7012. }
  7013. var loop = function ( key ) {
  7014. keys.push(key);
  7015. var value = validateProp(key, propsOptions, propsData, vm);
  7016. /* istanbul ignore else */
  7017. if (true) {
  7018. var hyphenatedKey = hyphenate(key);
  7019. if (isReservedAttribute(hyphenatedKey) ||
  7020. config.isReservedAttr(hyphenatedKey)) {
  7021. warn(
  7022. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7023. vm
  7024. );
  7025. }
  7026. defineReactive$$1(props, key, value, function () {
  7027. if (!isRoot && !isUpdatingChildComponent) {
  7028. {
  7029. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  7030. return
  7031. }
  7032. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7033. if(
  7034. key === 'value' &&
  7035. Array.isArray(vm.$options.behaviors) &&
  7036. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7037. ){
  7038. return
  7039. }
  7040. if(vm._getFormData){
  7041. return
  7042. }
  7043. var $parent = vm.$parent;
  7044. while($parent){
  7045. if($parent.__next_tick_pending){
  7046. return
  7047. }
  7048. $parent = $parent.$parent;
  7049. }
  7050. }
  7051. warn(
  7052. "Avoid mutating a prop directly since the value will be " +
  7053. "overwritten whenever the parent component re-renders. " +
  7054. "Instead, use a data or computed property based on the prop's " +
  7055. "value. Prop being mutated: \"" + key + "\"",
  7056. vm
  7057. );
  7058. }
  7059. });
  7060. } else {}
  7061. // static props are already proxied on the component's prototype
  7062. // during Vue.extend(). We only need to proxy props defined at
  7063. // instantiation here.
  7064. if (!(key in vm)) {
  7065. proxy(vm, "_props", key);
  7066. }
  7067. };
  7068. for (var key in propsOptions) loop( key );
  7069. toggleObserving(true);
  7070. }
  7071. function initData (vm) {
  7072. var data = vm.$options.data;
  7073. data = vm._data = typeof data === 'function'
  7074. ? getData(data, vm)
  7075. : data || {};
  7076. if (!isPlainObject(data)) {
  7077. data = {};
  7078. true && warn(
  7079. 'data functions should return an object:\n' +
  7080. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7081. vm
  7082. );
  7083. }
  7084. // proxy data on instance
  7085. var keys = Object.keys(data);
  7086. var props = vm.$options.props;
  7087. var methods = vm.$options.methods;
  7088. var i = keys.length;
  7089. while (i--) {
  7090. var key = keys[i];
  7091. if (true) {
  7092. if (methods && hasOwn(methods, key)) {
  7093. warn(
  7094. ("Method \"" + key + "\" has already been defined as a data property."),
  7095. vm
  7096. );
  7097. }
  7098. }
  7099. if (props && hasOwn(props, key)) {
  7100. true && warn(
  7101. "The data property \"" + key + "\" is already declared as a prop. " +
  7102. "Use prop default value instead.",
  7103. vm
  7104. );
  7105. } else if (!isReserved(key)) {
  7106. proxy(vm, "_data", key);
  7107. }
  7108. }
  7109. // observe data
  7110. observe(data, true /* asRootData */);
  7111. }
  7112. function getData (data, vm) {
  7113. // #7573 disable dep collection when invoking data getters
  7114. pushTarget();
  7115. try {
  7116. return data.call(vm, vm)
  7117. } catch (e) {
  7118. handleError(e, vm, "data()");
  7119. return {}
  7120. } finally {
  7121. popTarget();
  7122. }
  7123. }
  7124. var computedWatcherOptions = { lazy: true };
  7125. function initComputed (vm, computed) {
  7126. // $flow-disable-line
  7127. var watchers = vm._computedWatchers = Object.create(null);
  7128. // computed properties are just getters during SSR
  7129. var isSSR = isServerRendering();
  7130. for (var key in computed) {
  7131. var userDef = computed[key];
  7132. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7133. if ( true && getter == null) {
  7134. warn(
  7135. ("Getter is missing for computed property \"" + key + "\"."),
  7136. vm
  7137. );
  7138. }
  7139. if (!isSSR) {
  7140. // create internal watcher for the computed property.
  7141. watchers[key] = new Watcher(
  7142. vm,
  7143. getter || noop,
  7144. noop,
  7145. computedWatcherOptions
  7146. );
  7147. }
  7148. // component-defined computed properties are already defined on the
  7149. // component prototype. We only need to define computed properties defined
  7150. // at instantiation here.
  7151. if (!(key in vm)) {
  7152. defineComputed(vm, key, userDef);
  7153. } else if (true) {
  7154. if (key in vm.$data) {
  7155. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7156. } else if (vm.$options.props && key in vm.$options.props) {
  7157. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7158. }
  7159. }
  7160. }
  7161. }
  7162. function defineComputed (
  7163. target,
  7164. key,
  7165. userDef
  7166. ) {
  7167. var shouldCache = !isServerRendering();
  7168. if (typeof userDef === 'function') {
  7169. sharedPropertyDefinition.get = shouldCache
  7170. ? createComputedGetter(key)
  7171. : createGetterInvoker(userDef);
  7172. sharedPropertyDefinition.set = noop;
  7173. } else {
  7174. sharedPropertyDefinition.get = userDef.get
  7175. ? shouldCache && userDef.cache !== false
  7176. ? createComputedGetter(key)
  7177. : createGetterInvoker(userDef.get)
  7178. : noop;
  7179. sharedPropertyDefinition.set = userDef.set || noop;
  7180. }
  7181. if ( true &&
  7182. sharedPropertyDefinition.set === noop) {
  7183. sharedPropertyDefinition.set = function () {
  7184. warn(
  7185. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7186. this
  7187. );
  7188. };
  7189. }
  7190. Object.defineProperty(target, key, sharedPropertyDefinition);
  7191. }
  7192. function createComputedGetter (key) {
  7193. return function computedGetter () {
  7194. var watcher = this._computedWatchers && this._computedWatchers[key];
  7195. if (watcher) {
  7196. if (watcher.dirty) {
  7197. watcher.evaluate();
  7198. }
  7199. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7200. watcher.depend();
  7201. }
  7202. return watcher.value
  7203. }
  7204. }
  7205. }
  7206. function createGetterInvoker(fn) {
  7207. return function computedGetter () {
  7208. return fn.call(this, this)
  7209. }
  7210. }
  7211. function initMethods (vm, methods) {
  7212. var props = vm.$options.props;
  7213. for (var key in methods) {
  7214. if (true) {
  7215. if (typeof methods[key] !== 'function') {
  7216. warn(
  7217. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7218. "Did you reference the function correctly?",
  7219. vm
  7220. );
  7221. }
  7222. if (props && hasOwn(props, key)) {
  7223. warn(
  7224. ("Method \"" + key + "\" has already been defined as a prop."),
  7225. vm
  7226. );
  7227. }
  7228. if ((key in vm) && isReserved(key)) {
  7229. warn(
  7230. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7231. "Avoid defining component methods that start with _ or $."
  7232. );
  7233. }
  7234. }
  7235. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7236. }
  7237. }
  7238. function initWatch (vm, watch) {
  7239. for (var key in watch) {
  7240. var handler = watch[key];
  7241. if (Array.isArray(handler)) {
  7242. for (var i = 0; i < handler.length; i++) {
  7243. createWatcher(vm, key, handler[i]);
  7244. }
  7245. } else {
  7246. createWatcher(vm, key, handler);
  7247. }
  7248. }
  7249. }
  7250. function createWatcher (
  7251. vm,
  7252. expOrFn,
  7253. handler,
  7254. options
  7255. ) {
  7256. if (isPlainObject(handler)) {
  7257. options = handler;
  7258. handler = handler.handler;
  7259. }
  7260. if (typeof handler === 'string') {
  7261. handler = vm[handler];
  7262. }
  7263. return vm.$watch(expOrFn, handler, options)
  7264. }
  7265. function stateMixin (Vue) {
  7266. // flow somehow has problems with directly declared definition object
  7267. // when using Object.defineProperty, so we have to procedurally build up
  7268. // the object here.
  7269. var dataDef = {};
  7270. dataDef.get = function () { return this._data };
  7271. var propsDef = {};
  7272. propsDef.get = function () { return this._props };
  7273. if (true) {
  7274. dataDef.set = function () {
  7275. warn(
  7276. 'Avoid replacing instance root $data. ' +
  7277. 'Use nested data properties instead.',
  7278. this
  7279. );
  7280. };
  7281. propsDef.set = function () {
  7282. warn("$props is readonly.", this);
  7283. };
  7284. }
  7285. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7286. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7287. Vue.prototype.$set = set;
  7288. Vue.prototype.$delete = del;
  7289. Vue.prototype.$watch = function (
  7290. expOrFn,
  7291. cb,
  7292. options
  7293. ) {
  7294. var vm = this;
  7295. if (isPlainObject(cb)) {
  7296. return createWatcher(vm, expOrFn, cb, options)
  7297. }
  7298. options = options || {};
  7299. options.user = true;
  7300. var watcher = new Watcher(vm, expOrFn, cb, options);
  7301. if (options.immediate) {
  7302. try {
  7303. cb.call(vm, watcher.value);
  7304. } catch (error) {
  7305. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7306. }
  7307. }
  7308. return function unwatchFn () {
  7309. watcher.teardown();
  7310. }
  7311. };
  7312. }
  7313. /* */
  7314. var uid$3 = 0;
  7315. function initMixin (Vue) {
  7316. Vue.prototype._init = function (options) {
  7317. var vm = this;
  7318. // a uid
  7319. vm._uid = uid$3++;
  7320. var startTag, endTag;
  7321. /* istanbul ignore if */
  7322. if ( true && config.performance && mark) {
  7323. startTag = "vue-perf-start:" + (vm._uid);
  7324. endTag = "vue-perf-end:" + (vm._uid);
  7325. mark(startTag);
  7326. }
  7327. // a flag to avoid this being observed
  7328. vm._isVue = true;
  7329. // merge options
  7330. if (options && options._isComponent) {
  7331. // optimize internal component instantiation
  7332. // since dynamic options merging is pretty slow, and none of the
  7333. // internal component options needs special treatment.
  7334. initInternalComponent(vm, options);
  7335. } else {
  7336. vm.$options = mergeOptions(
  7337. resolveConstructorOptions(vm.constructor),
  7338. options || {},
  7339. vm
  7340. );
  7341. }
  7342. /* istanbul ignore else */
  7343. if (true) {
  7344. initProxy(vm);
  7345. } else {}
  7346. // expose real self
  7347. vm._self = vm;
  7348. initLifecycle(vm);
  7349. initEvents(vm);
  7350. initRender(vm);
  7351. callHook(vm, 'beforeCreate');
  7352. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7353. initState(vm);
  7354. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7355. !vm._$fallback && callHook(vm, 'created');
  7356. /* istanbul ignore if */
  7357. if ( true && config.performance && mark) {
  7358. vm._name = formatComponentName(vm, false);
  7359. mark(endTag);
  7360. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7361. }
  7362. if (vm.$options.el) {
  7363. vm.$mount(vm.$options.el);
  7364. }
  7365. };
  7366. }
  7367. function initInternalComponent (vm, options) {
  7368. var opts = vm.$options = Object.create(vm.constructor.options);
  7369. // doing this because it's faster than dynamic enumeration.
  7370. var parentVnode = options._parentVnode;
  7371. opts.parent = options.parent;
  7372. opts._parentVnode = parentVnode;
  7373. var vnodeComponentOptions = parentVnode.componentOptions;
  7374. opts.propsData = vnodeComponentOptions.propsData;
  7375. opts._parentListeners = vnodeComponentOptions.listeners;
  7376. opts._renderChildren = vnodeComponentOptions.children;
  7377. opts._componentTag = vnodeComponentOptions.tag;
  7378. if (options.render) {
  7379. opts.render = options.render;
  7380. opts.staticRenderFns = options.staticRenderFns;
  7381. }
  7382. }
  7383. function resolveConstructorOptions (Ctor) {
  7384. var options = Ctor.options;
  7385. if (Ctor.super) {
  7386. var superOptions = resolveConstructorOptions(Ctor.super);
  7387. var cachedSuperOptions = Ctor.superOptions;
  7388. if (superOptions !== cachedSuperOptions) {
  7389. // super option changed,
  7390. // need to resolve new options.
  7391. Ctor.superOptions = superOptions;
  7392. // check if there are any late-modified/attached options (#4976)
  7393. var modifiedOptions = resolveModifiedOptions(Ctor);
  7394. // update base extend options
  7395. if (modifiedOptions) {
  7396. extend(Ctor.extendOptions, modifiedOptions);
  7397. }
  7398. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7399. if (options.name) {
  7400. options.components[options.name] = Ctor;
  7401. }
  7402. }
  7403. }
  7404. return options
  7405. }
  7406. function resolveModifiedOptions (Ctor) {
  7407. var modified;
  7408. var latest = Ctor.options;
  7409. var sealed = Ctor.sealedOptions;
  7410. for (var key in latest) {
  7411. if (latest[key] !== sealed[key]) {
  7412. if (!modified) { modified = {}; }
  7413. modified[key] = latest[key];
  7414. }
  7415. }
  7416. return modified
  7417. }
  7418. function Vue (options) {
  7419. if ( true &&
  7420. !(this instanceof Vue)
  7421. ) {
  7422. warn('Vue is a constructor and should be called with the `new` keyword');
  7423. }
  7424. this._init(options);
  7425. }
  7426. initMixin(Vue);
  7427. stateMixin(Vue);
  7428. eventsMixin(Vue);
  7429. lifecycleMixin(Vue);
  7430. renderMixin(Vue);
  7431. /* */
  7432. function initUse (Vue) {
  7433. Vue.use = function (plugin) {
  7434. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7435. if (installedPlugins.indexOf(plugin) > -1) {
  7436. return this
  7437. }
  7438. // additional parameters
  7439. var args = toArray(arguments, 1);
  7440. args.unshift(this);
  7441. if (typeof plugin.install === 'function') {
  7442. plugin.install.apply(plugin, args);
  7443. } else if (typeof plugin === 'function') {
  7444. plugin.apply(null, args);
  7445. }
  7446. installedPlugins.push(plugin);
  7447. return this
  7448. };
  7449. }
  7450. /* */
  7451. function initMixin$1 (Vue) {
  7452. Vue.mixin = function (mixin) {
  7453. this.options = mergeOptions(this.options, mixin);
  7454. return this
  7455. };
  7456. }
  7457. /* */
  7458. function initExtend (Vue) {
  7459. /**
  7460. * Each instance constructor, including Vue, has a unique
  7461. * cid. This enables us to create wrapped "child
  7462. * constructors" for prototypal inheritance and cache them.
  7463. */
  7464. Vue.cid = 0;
  7465. var cid = 1;
  7466. /**
  7467. * Class inheritance
  7468. */
  7469. Vue.extend = function (extendOptions) {
  7470. extendOptions = extendOptions || {};
  7471. var Super = this;
  7472. var SuperId = Super.cid;
  7473. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7474. if (cachedCtors[SuperId]) {
  7475. return cachedCtors[SuperId]
  7476. }
  7477. var name = extendOptions.name || Super.options.name;
  7478. if ( true && name) {
  7479. validateComponentName(name);
  7480. }
  7481. var Sub = function VueComponent (options) {
  7482. this._init(options);
  7483. };
  7484. Sub.prototype = Object.create(Super.prototype);
  7485. Sub.prototype.constructor = Sub;
  7486. Sub.cid = cid++;
  7487. Sub.options = mergeOptions(
  7488. Super.options,
  7489. extendOptions
  7490. );
  7491. Sub['super'] = Super;
  7492. // For props and computed properties, we define the proxy getters on
  7493. // the Vue instances at extension time, on the extended prototype. This
  7494. // avoids Object.defineProperty calls for each instance created.
  7495. if (Sub.options.props) {
  7496. initProps$1(Sub);
  7497. }
  7498. if (Sub.options.computed) {
  7499. initComputed$1(Sub);
  7500. }
  7501. // allow further extension/mixin/plugin usage
  7502. Sub.extend = Super.extend;
  7503. Sub.mixin = Super.mixin;
  7504. Sub.use = Super.use;
  7505. // create asset registers, so extended classes
  7506. // can have their private assets too.
  7507. ASSET_TYPES.forEach(function (type) {
  7508. Sub[type] = Super[type];
  7509. });
  7510. // enable recursive self-lookup
  7511. if (name) {
  7512. Sub.options.components[name] = Sub;
  7513. }
  7514. // keep a reference to the super options at extension time.
  7515. // later at instantiation we can check if Super's options have
  7516. // been updated.
  7517. Sub.superOptions = Super.options;
  7518. Sub.extendOptions = extendOptions;
  7519. Sub.sealedOptions = extend({}, Sub.options);
  7520. // cache constructor
  7521. cachedCtors[SuperId] = Sub;
  7522. return Sub
  7523. };
  7524. }
  7525. function initProps$1 (Comp) {
  7526. var props = Comp.options.props;
  7527. for (var key in props) {
  7528. proxy(Comp.prototype, "_props", key);
  7529. }
  7530. }
  7531. function initComputed$1 (Comp) {
  7532. var computed = Comp.options.computed;
  7533. for (var key in computed) {
  7534. defineComputed(Comp.prototype, key, computed[key]);
  7535. }
  7536. }
  7537. /* */
  7538. function initAssetRegisters (Vue) {
  7539. /**
  7540. * Create asset registration methods.
  7541. */
  7542. ASSET_TYPES.forEach(function (type) {
  7543. Vue[type] = function (
  7544. id,
  7545. definition
  7546. ) {
  7547. if (!definition) {
  7548. return this.options[type + 's'][id]
  7549. } else {
  7550. /* istanbul ignore if */
  7551. if ( true && type === 'component') {
  7552. validateComponentName(id);
  7553. }
  7554. if (type === 'component' && isPlainObject(definition)) {
  7555. definition.name = definition.name || id;
  7556. definition = this.options._base.extend(definition);
  7557. }
  7558. if (type === 'directive' && typeof definition === 'function') {
  7559. definition = { bind: definition, update: definition };
  7560. }
  7561. this.options[type + 's'][id] = definition;
  7562. return definition
  7563. }
  7564. };
  7565. });
  7566. }
  7567. /* */
  7568. function getComponentName (opts) {
  7569. return opts && (opts.Ctor.options.name || opts.tag)
  7570. }
  7571. function matches (pattern, name) {
  7572. if (Array.isArray(pattern)) {
  7573. return pattern.indexOf(name) > -1
  7574. } else if (typeof pattern === 'string') {
  7575. return pattern.split(',').indexOf(name) > -1
  7576. } else if (isRegExp(pattern)) {
  7577. return pattern.test(name)
  7578. }
  7579. /* istanbul ignore next */
  7580. return false
  7581. }
  7582. function pruneCache (keepAliveInstance, filter) {
  7583. var cache = keepAliveInstance.cache;
  7584. var keys = keepAliveInstance.keys;
  7585. var _vnode = keepAliveInstance._vnode;
  7586. for (var key in cache) {
  7587. var cachedNode = cache[key];
  7588. if (cachedNode) {
  7589. var name = getComponentName(cachedNode.componentOptions);
  7590. if (name && !filter(name)) {
  7591. pruneCacheEntry(cache, key, keys, _vnode);
  7592. }
  7593. }
  7594. }
  7595. }
  7596. function pruneCacheEntry (
  7597. cache,
  7598. key,
  7599. keys,
  7600. current
  7601. ) {
  7602. var cached$$1 = cache[key];
  7603. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7604. cached$$1.componentInstance.$destroy();
  7605. }
  7606. cache[key] = null;
  7607. remove(keys, key);
  7608. }
  7609. var patternTypes = [String, RegExp, Array];
  7610. var KeepAlive = {
  7611. name: 'keep-alive',
  7612. abstract: true,
  7613. props: {
  7614. include: patternTypes,
  7615. exclude: patternTypes,
  7616. max: [String, Number]
  7617. },
  7618. created: function created () {
  7619. this.cache = Object.create(null);
  7620. this.keys = [];
  7621. },
  7622. destroyed: function destroyed () {
  7623. for (var key in this.cache) {
  7624. pruneCacheEntry(this.cache, key, this.keys);
  7625. }
  7626. },
  7627. mounted: function mounted () {
  7628. var this$1 = this;
  7629. this.$watch('include', function (val) {
  7630. pruneCache(this$1, function (name) { return matches(val, name); });
  7631. });
  7632. this.$watch('exclude', function (val) {
  7633. pruneCache(this$1, function (name) { return !matches(val, name); });
  7634. });
  7635. },
  7636. render: function render () {
  7637. var slot = this.$slots.default;
  7638. var vnode = getFirstComponentChild(slot);
  7639. var componentOptions = vnode && vnode.componentOptions;
  7640. if (componentOptions) {
  7641. // check pattern
  7642. var name = getComponentName(componentOptions);
  7643. var ref = this;
  7644. var include = ref.include;
  7645. var exclude = ref.exclude;
  7646. if (
  7647. // not included
  7648. (include && (!name || !matches(include, name))) ||
  7649. // excluded
  7650. (exclude && name && matches(exclude, name))
  7651. ) {
  7652. return vnode
  7653. }
  7654. var ref$1 = this;
  7655. var cache = ref$1.cache;
  7656. var keys = ref$1.keys;
  7657. var key = vnode.key == null
  7658. // same constructor may get registered as different local components
  7659. // so cid alone is not enough (#3269)
  7660. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7661. : vnode.key;
  7662. if (cache[key]) {
  7663. vnode.componentInstance = cache[key].componentInstance;
  7664. // make current key freshest
  7665. remove(keys, key);
  7666. keys.push(key);
  7667. } else {
  7668. cache[key] = vnode;
  7669. keys.push(key);
  7670. // prune oldest entry
  7671. if (this.max && keys.length > parseInt(this.max)) {
  7672. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7673. }
  7674. }
  7675. vnode.data.keepAlive = true;
  7676. }
  7677. return vnode || (slot && slot[0])
  7678. }
  7679. };
  7680. var builtInComponents = {
  7681. KeepAlive: KeepAlive
  7682. };
  7683. /* */
  7684. function initGlobalAPI (Vue) {
  7685. // config
  7686. var configDef = {};
  7687. configDef.get = function () { return config; };
  7688. if (true) {
  7689. configDef.set = function () {
  7690. warn(
  7691. 'Do not replace the Vue.config object, set individual fields instead.'
  7692. );
  7693. };
  7694. }
  7695. Object.defineProperty(Vue, 'config', configDef);
  7696. // exposed util methods.
  7697. // NOTE: these are not considered part of the public API - avoid relying on
  7698. // them unless you are aware of the risk.
  7699. Vue.util = {
  7700. warn: warn,
  7701. extend: extend,
  7702. mergeOptions: mergeOptions,
  7703. defineReactive: defineReactive$$1
  7704. };
  7705. Vue.set = set;
  7706. Vue.delete = del;
  7707. Vue.nextTick = nextTick;
  7708. // 2.6 explicit observable API
  7709. Vue.observable = function (obj) {
  7710. observe(obj);
  7711. return obj
  7712. };
  7713. Vue.options = Object.create(null);
  7714. ASSET_TYPES.forEach(function (type) {
  7715. Vue.options[type + 's'] = Object.create(null);
  7716. });
  7717. // this is used to identify the "base" constructor to extend all plain-object
  7718. // components with in Weex's multi-instance scenarios.
  7719. Vue.options._base = Vue;
  7720. extend(Vue.options.components, builtInComponents);
  7721. initUse(Vue);
  7722. initMixin$1(Vue);
  7723. initExtend(Vue);
  7724. initAssetRegisters(Vue);
  7725. }
  7726. initGlobalAPI(Vue);
  7727. Object.defineProperty(Vue.prototype, '$isServer', {
  7728. get: isServerRendering
  7729. });
  7730. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7731. get: function get () {
  7732. /* istanbul ignore next */
  7733. return this.$vnode && this.$vnode.ssrContext
  7734. }
  7735. });
  7736. // expose FunctionalRenderContext for ssr runtime helper installation
  7737. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7738. value: FunctionalRenderContext
  7739. });
  7740. Vue.version = '2.6.11';
  7741. /**
  7742. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7743. */
  7744. var ARRAYTYPE = '[object Array]';
  7745. var OBJECTTYPE = '[object Object]';
  7746. // const FUNCTIONTYPE = '[object Function]'
  7747. function diff(current, pre) {
  7748. var result = {};
  7749. syncKeys(current, pre);
  7750. _diff(current, pre, '', result);
  7751. return result
  7752. }
  7753. function syncKeys(current, pre) {
  7754. if (current === pre) { return }
  7755. var rootCurrentType = type(current);
  7756. var rootPreType = type(pre);
  7757. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7758. if(Object.keys(current).length >= Object.keys(pre).length){
  7759. for (var key in pre) {
  7760. var currentValue = current[key];
  7761. if (currentValue === undefined) {
  7762. current[key] = null;
  7763. } else {
  7764. syncKeys(currentValue, pre[key]);
  7765. }
  7766. }
  7767. }
  7768. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7769. if (current.length >= pre.length) {
  7770. pre.forEach(function (item, index) {
  7771. syncKeys(current[index], item);
  7772. });
  7773. }
  7774. }
  7775. }
  7776. function _diff(current, pre, path, result) {
  7777. if (current === pre) { return }
  7778. var rootCurrentType = type(current);
  7779. var rootPreType = type(pre);
  7780. if (rootCurrentType == OBJECTTYPE) {
  7781. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7782. setResult(result, path, current);
  7783. } else {
  7784. var loop = function ( key ) {
  7785. var currentValue = current[key];
  7786. var preValue = pre[key];
  7787. var currentType = type(currentValue);
  7788. var preType = type(preValue);
  7789. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7790. if (currentValue != pre[key]) {
  7791. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7792. }
  7793. } else if (currentType == ARRAYTYPE) {
  7794. if (preType != ARRAYTYPE) {
  7795. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7796. } else {
  7797. if (currentValue.length < preValue.length) {
  7798. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7799. } else {
  7800. currentValue.forEach(function (item, index) {
  7801. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7802. });
  7803. }
  7804. }
  7805. } else if (currentType == OBJECTTYPE) {
  7806. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7807. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7808. } else {
  7809. for (var subKey in currentValue) {
  7810. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7811. }
  7812. }
  7813. }
  7814. };
  7815. for (var key in current) loop( key );
  7816. }
  7817. } else if (rootCurrentType == ARRAYTYPE) {
  7818. if (rootPreType != ARRAYTYPE) {
  7819. setResult(result, path, current);
  7820. } else {
  7821. if (current.length < pre.length) {
  7822. setResult(result, path, current);
  7823. } else {
  7824. current.forEach(function (item, index) {
  7825. _diff(item, pre[index], path + '[' + index + ']', result);
  7826. });
  7827. }
  7828. }
  7829. } else {
  7830. setResult(result, path, current);
  7831. }
  7832. }
  7833. function setResult(result, k, v) {
  7834. // if (type(v) != FUNCTIONTYPE) {
  7835. result[k] = v;
  7836. // }
  7837. }
  7838. function type(obj) {
  7839. return Object.prototype.toString.call(obj)
  7840. }
  7841. /* */
  7842. function flushCallbacks$1(vm) {
  7843. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7844. if (Object({"VUE_APP_NAME":"六牛云矿","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7845. var mpInstance = vm.$scope;
  7846. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7847. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7848. }
  7849. var copies = vm.__next_tick_callbacks.slice(0);
  7850. vm.__next_tick_callbacks.length = 0;
  7851. for (var i = 0; i < copies.length; i++) {
  7852. copies[i]();
  7853. }
  7854. }
  7855. }
  7856. function hasRenderWatcher(vm) {
  7857. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7858. }
  7859. function nextTick$1(vm, cb) {
  7860. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7861. //2.nextTick 之前存在 render watcher
  7862. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7863. if(Object({"VUE_APP_NAME":"六牛云矿","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  7864. var mpInstance = vm.$scope;
  7865. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7866. ']:nextVueTick');
  7867. }
  7868. return nextTick(cb, vm)
  7869. }else{
  7870. if(Object({"VUE_APP_NAME":"六牛云矿","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  7871. var mpInstance$1 = vm.$scope;
  7872. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7873. ']:nextMPTick');
  7874. }
  7875. }
  7876. var _resolve;
  7877. if (!vm.__next_tick_callbacks) {
  7878. vm.__next_tick_callbacks = [];
  7879. }
  7880. vm.__next_tick_callbacks.push(function () {
  7881. if (cb) {
  7882. try {
  7883. cb.call(vm);
  7884. } catch (e) {
  7885. handleError(e, vm, 'nextTick');
  7886. }
  7887. } else if (_resolve) {
  7888. _resolve(vm);
  7889. }
  7890. });
  7891. // $flow-disable-line
  7892. if (!cb && typeof Promise !== 'undefined') {
  7893. return new Promise(function (resolve) {
  7894. _resolve = resolve;
  7895. })
  7896. }
  7897. }
  7898. /* */
  7899. function cloneWithData(vm) {
  7900. // 确保当前 vm 所有数据被同步
  7901. var ret = Object.create(null);
  7902. var dataKeys = [].concat(
  7903. Object.keys(vm._data || {}),
  7904. Object.keys(vm._computedWatchers || {}));
  7905. dataKeys.reduce(function(ret, key) {
  7906. ret[key] = vm[key];
  7907. return ret
  7908. }, ret);
  7909. // vue-composition-api
  7910. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  7911. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  7912. if (rawBindings) {
  7913. Object.keys(rawBindings).forEach(function (key) {
  7914. ret[key] = vm[key];
  7915. });
  7916. }
  7917. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  7918. Object.assign(ret, vm.$mp.data || {});
  7919. if (
  7920. Array.isArray(vm.$options.behaviors) &&
  7921. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7922. ) { //form-field
  7923. ret['name'] = vm.name;
  7924. ret['value'] = vm.value;
  7925. }
  7926. return JSON.parse(JSON.stringify(ret))
  7927. }
  7928. var patch = function(oldVnode, vnode) {
  7929. var this$1 = this;
  7930. if (vnode === null) { //destroy
  7931. return
  7932. }
  7933. if (this.mpType === 'page' || this.mpType === 'component') {
  7934. var mpInstance = this.$scope;
  7935. var data = Object.create(null);
  7936. try {
  7937. data = cloneWithData(this);
  7938. } catch (err) {
  7939. console.error(err);
  7940. }
  7941. data.__webviewId__ = mpInstance.data.__webviewId__;
  7942. var mpData = Object.create(null);
  7943. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  7944. mpData[key] = mpInstance.data[key];
  7945. });
  7946. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  7947. if (Object.keys(diffData).length) {
  7948. if (Object({"VUE_APP_NAME":"六牛云矿","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7949. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  7950. ']差量更新',
  7951. JSON.stringify(diffData));
  7952. }
  7953. this.__next_tick_pending = true;
  7954. mpInstance.setData(diffData, function () {
  7955. this$1.__next_tick_pending = false;
  7956. flushCallbacks$1(this$1);
  7957. });
  7958. } else {
  7959. flushCallbacks$1(this);
  7960. }
  7961. }
  7962. };
  7963. /* */
  7964. function createEmptyRender() {
  7965. }
  7966. function mountComponent$1(
  7967. vm,
  7968. el,
  7969. hydrating
  7970. ) {
  7971. if (!vm.mpType) {//main.js 中的 new Vue
  7972. return vm
  7973. }
  7974. if (vm.mpType === 'app') {
  7975. vm.$options.render = createEmptyRender;
  7976. }
  7977. if (!vm.$options.render) {
  7978. vm.$options.render = createEmptyRender;
  7979. if (true) {
  7980. /* istanbul ignore if */
  7981. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  7982. vm.$options.el || el) {
  7983. warn(
  7984. 'You are using the runtime-only build of Vue where the template ' +
  7985. 'compiler is not available. Either pre-compile the templates into ' +
  7986. 'render functions, or use the compiler-included build.',
  7987. vm
  7988. );
  7989. } else {
  7990. warn(
  7991. 'Failed to mount component: template or render function not defined.',
  7992. vm
  7993. );
  7994. }
  7995. }
  7996. }
  7997. !vm._$fallback && callHook(vm, 'beforeMount');
  7998. var updateComponent = function () {
  7999. vm._update(vm._render(), hydrating);
  8000. };
  8001. // we set this to vm._watcher inside the watcher's constructor
  8002. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8003. // component's mounted hook), which relies on vm._watcher being already defined
  8004. new Watcher(vm, updateComponent, noop, {
  8005. before: function before() {
  8006. if (vm._isMounted && !vm._isDestroyed) {
  8007. callHook(vm, 'beforeUpdate');
  8008. }
  8009. }
  8010. }, true /* isRenderWatcher */);
  8011. hydrating = false;
  8012. return vm
  8013. }
  8014. /* */
  8015. function renderClass (
  8016. staticClass,
  8017. dynamicClass
  8018. ) {
  8019. if (isDef(staticClass) || isDef(dynamicClass)) {
  8020. return concat(staticClass, stringifyClass(dynamicClass))
  8021. }
  8022. /* istanbul ignore next */
  8023. return ''
  8024. }
  8025. function concat (a, b) {
  8026. return a ? b ? (a + ' ' + b) : a : (b || '')
  8027. }
  8028. function stringifyClass (value) {
  8029. if (Array.isArray(value)) {
  8030. return stringifyArray(value)
  8031. }
  8032. if (isObject(value)) {
  8033. return stringifyObject(value)
  8034. }
  8035. if (typeof value === 'string') {
  8036. return value
  8037. }
  8038. /* istanbul ignore next */
  8039. return ''
  8040. }
  8041. function stringifyArray (value) {
  8042. var res = '';
  8043. var stringified;
  8044. for (var i = 0, l = value.length; i < l; i++) {
  8045. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8046. if (res) { res += ' '; }
  8047. res += stringified;
  8048. }
  8049. }
  8050. return res
  8051. }
  8052. function stringifyObject (value) {
  8053. var res = '';
  8054. for (var key in value) {
  8055. if (value[key]) {
  8056. if (res) { res += ' '; }
  8057. res += key;
  8058. }
  8059. }
  8060. return res
  8061. }
  8062. /* */
  8063. var parseStyleText = cached(function (cssText) {
  8064. var res = {};
  8065. var listDelimiter = /;(?![^(]*\))/g;
  8066. var propertyDelimiter = /:(.+)/;
  8067. cssText.split(listDelimiter).forEach(function (item) {
  8068. if (item) {
  8069. var tmp = item.split(propertyDelimiter);
  8070. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8071. }
  8072. });
  8073. return res
  8074. });
  8075. // normalize possible array / string values into Object
  8076. function normalizeStyleBinding (bindingStyle) {
  8077. if (Array.isArray(bindingStyle)) {
  8078. return toObject(bindingStyle)
  8079. }
  8080. if (typeof bindingStyle === 'string') {
  8081. return parseStyleText(bindingStyle)
  8082. }
  8083. return bindingStyle
  8084. }
  8085. /* */
  8086. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8087. function getTarget(obj, path) {
  8088. var parts = path.split('.');
  8089. var key = parts[0];
  8090. if (key.indexOf('__$n') === 0) { //number index
  8091. key = parseInt(key.replace('__$n', ''));
  8092. }
  8093. if (parts.length === 1) {
  8094. return obj[key]
  8095. }
  8096. return getTarget(obj[key], parts.slice(1).join('.'))
  8097. }
  8098. function internalMixin(Vue) {
  8099. Vue.config.errorHandler = function(err, vm, info) {
  8100. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8101. console.error(err);
  8102. /* eslint-disable no-undef */
  8103. var app = typeof getApp === 'function' && getApp();
  8104. if (app && app.onError) {
  8105. app.onError(err);
  8106. }
  8107. };
  8108. var oldEmit = Vue.prototype.$emit;
  8109. Vue.prototype.$emit = function(event) {
  8110. if (this.$scope && event) {
  8111. this.$scope['triggerEvent'](event, {
  8112. __args__: toArray(arguments, 1)
  8113. });
  8114. }
  8115. return oldEmit.apply(this, arguments)
  8116. };
  8117. Vue.prototype.$nextTick = function(fn) {
  8118. return nextTick$1(this, fn)
  8119. };
  8120. MP_METHODS.forEach(function (method) {
  8121. Vue.prototype[method] = function(args) {
  8122. if (this.$scope && this.$scope[method]) {
  8123. return this.$scope[method](args)
  8124. }
  8125. // mp-alipay
  8126. if (typeof my === 'undefined') {
  8127. return
  8128. }
  8129. if (method === 'createSelectorQuery') {
  8130. /* eslint-disable no-undef */
  8131. return my.createSelectorQuery(args)
  8132. } else if (method === 'createIntersectionObserver') {
  8133. /* eslint-disable no-undef */
  8134. return my.createIntersectionObserver(args)
  8135. }
  8136. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8137. };
  8138. });
  8139. Vue.prototype.__init_provide = initProvide;
  8140. Vue.prototype.__init_injections = initInjections;
  8141. Vue.prototype.__call_hook = function(hook, args) {
  8142. var vm = this;
  8143. // #7573 disable dep collection when invoking lifecycle hooks
  8144. pushTarget();
  8145. var handlers = vm.$options[hook];
  8146. var info = hook + " hook";
  8147. var ret;
  8148. if (handlers) {
  8149. for (var i = 0, j = handlers.length; i < j; i++) {
  8150. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8151. }
  8152. }
  8153. if (vm._hasHookEvent) {
  8154. vm.$emit('hook:' + hook, args);
  8155. }
  8156. popTarget();
  8157. return ret
  8158. };
  8159. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8160. if (Array.isArray(modifiers)) {
  8161. if (modifiers.indexOf('trim') !== -1) {
  8162. value = value.trim();
  8163. }
  8164. if (modifiers.indexOf('number') !== -1) {
  8165. value = this._n(value);
  8166. }
  8167. }
  8168. if (!target) {
  8169. target = this;
  8170. }
  8171. target[key] = value;
  8172. };
  8173. Vue.prototype.__set_sync = function(target, key, value) {
  8174. if (!target) {
  8175. target = this;
  8176. }
  8177. target[key] = value;
  8178. };
  8179. Vue.prototype.__get_orig = function(item) {
  8180. if (isPlainObject(item)) {
  8181. return item['$orig'] || item
  8182. }
  8183. return item
  8184. };
  8185. Vue.prototype.__get_value = function(dataPath, target) {
  8186. return getTarget(target || this, dataPath)
  8187. };
  8188. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8189. return renderClass(staticClass, dynamicClass)
  8190. };
  8191. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8192. if (!dynamicStyle && !staticStyle) {
  8193. return ''
  8194. }
  8195. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8196. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8197. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8198. };
  8199. Vue.prototype.__map = function(val, iteratee) {
  8200. //TODO 暂不考虑 string
  8201. var ret, i, l, keys, key;
  8202. if (Array.isArray(val)) {
  8203. ret = new Array(val.length);
  8204. for (i = 0, l = val.length; i < l; i++) {
  8205. ret[i] = iteratee(val[i], i);
  8206. }
  8207. return ret
  8208. } else if (isObject(val)) {
  8209. keys = Object.keys(val);
  8210. ret = Object.create(null);
  8211. for (i = 0, l = keys.length; i < l; i++) {
  8212. key = keys[i];
  8213. ret[key] = iteratee(val[key], key, i);
  8214. }
  8215. return ret
  8216. } else if (typeof val === 'number') {
  8217. ret = new Array(val);
  8218. for (i = 0, l = val; i < l; i++) {
  8219. // 第一个参数暂时仍和小程序一致
  8220. ret[i] = iteratee(i, i);
  8221. }
  8222. return ret
  8223. }
  8224. return []
  8225. };
  8226. }
  8227. /* */
  8228. var LIFECYCLE_HOOKS$1 = [
  8229. //App
  8230. 'onLaunch',
  8231. 'onShow',
  8232. 'onHide',
  8233. 'onUniNViewMessage',
  8234. 'onPageNotFound',
  8235. 'onThemeChange',
  8236. 'onError',
  8237. 'onUnhandledRejection',
  8238. //Page
  8239. 'onInit',
  8240. 'onLoad',
  8241. // 'onShow',
  8242. 'onReady',
  8243. // 'onHide',
  8244. 'onUnload',
  8245. 'onPullDownRefresh',
  8246. 'onReachBottom',
  8247. 'onTabItemTap',
  8248. 'onAddToFavorites',
  8249. 'onShareTimeline',
  8250. 'onShareAppMessage',
  8251. 'onResize',
  8252. 'onPageScroll',
  8253. 'onNavigationBarButtonTap',
  8254. 'onBackPress',
  8255. 'onNavigationBarSearchInputChanged',
  8256. 'onNavigationBarSearchInputConfirmed',
  8257. 'onNavigationBarSearchInputClicked',
  8258. //Component
  8259. // 'onReady', // 兼容旧版本,应该移除该事件
  8260. 'onPageShow',
  8261. 'onPageHide',
  8262. 'onPageResize'
  8263. ];
  8264. function lifecycleMixin$1(Vue) {
  8265. //fixed vue-class-component
  8266. var oldExtend = Vue.extend;
  8267. Vue.extend = function(extendOptions) {
  8268. extendOptions = extendOptions || {};
  8269. var methods = extendOptions.methods;
  8270. if (methods) {
  8271. Object.keys(methods).forEach(function (methodName) {
  8272. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8273. extendOptions[methodName] = methods[methodName];
  8274. delete methods[methodName];
  8275. }
  8276. });
  8277. }
  8278. return oldExtend.call(this, extendOptions)
  8279. };
  8280. var strategies = Vue.config.optionMergeStrategies;
  8281. var mergeHook = strategies.created;
  8282. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8283. strategies[hook] = mergeHook;
  8284. });
  8285. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8286. }
  8287. /* */
  8288. // install platform patch function
  8289. Vue.prototype.__patch__ = patch;
  8290. // public mount method
  8291. Vue.prototype.$mount = function(
  8292. el ,
  8293. hydrating
  8294. ) {
  8295. return mountComponent$1(this, el, hydrating)
  8296. };
  8297. lifecycleMixin$1(Vue);
  8298. internalMixin(Vue);
  8299. /* */
  8300. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8301. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8302. /***/ }),
  8303. /***/ 204:
  8304. /*!***********************************************!*\
  8305. !*** G:/gsxm/lnyk/js_sdk/xb-copy/uni-copy.js ***!
  8306. \***********************************************/
  8307. /*! no static exports found */
  8308. /***/ (function(module, exports, __webpack_require__) {
  8309. "use strict";
  8310. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = uniCopy;function uniCopy(content) {
  8311. /**
  8312. * 小程序端 和 app端的复制逻辑
  8313. */
  8314. uni.setClipboardData({
  8315. data: content,
  8316. success: function success() {
  8317. console.log('success');
  8318. return true;
  8319. } });
  8320. /**
  8321. * H5端的复制逻辑
  8322. */
  8323. }
  8324. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8325. /***/ }),
  8326. /***/ 21:
  8327. /*!**********************************************************************************************************!*\
  8328. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8329. \**********************************************************************************************************/
  8330. /*! exports provided: default */
  8331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8332. "use strict";
  8333. __webpack_require__.r(__webpack_exports__);
  8334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8335. /* globals __VUE_SSR_CONTEXT__ */
  8336. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8337. // This module is a runtime utility for cleaner component module output and will
  8338. // be included in the final webpack user bundle.
  8339. function normalizeComponent (
  8340. scriptExports,
  8341. render,
  8342. staticRenderFns,
  8343. functionalTemplate,
  8344. injectStyles,
  8345. scopeId,
  8346. moduleIdentifier, /* server only */
  8347. shadowMode, /* vue-cli only */
  8348. components, // fixed by xxxxxx auto components
  8349. renderjs // fixed by xxxxxx renderjs
  8350. ) {
  8351. // Vue.extend constructor export interop
  8352. var options = typeof scriptExports === 'function'
  8353. ? scriptExports.options
  8354. : scriptExports
  8355. // fixed by xxxxxx auto components
  8356. if (components) {
  8357. if (!options.components) {
  8358. options.components = {}
  8359. }
  8360. var hasOwn = Object.prototype.hasOwnProperty
  8361. for (var name in components) {
  8362. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8363. options.components[name] = components[name]
  8364. }
  8365. }
  8366. }
  8367. // fixed by xxxxxx renderjs
  8368. if (renderjs) {
  8369. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8370. this[renderjs.__module] = this
  8371. });
  8372. (options.mixins || (options.mixins = [])).push(renderjs)
  8373. }
  8374. // render functions
  8375. if (render) {
  8376. options.render = render
  8377. options.staticRenderFns = staticRenderFns
  8378. options._compiled = true
  8379. }
  8380. // functional template
  8381. if (functionalTemplate) {
  8382. options.functional = true
  8383. }
  8384. // scopedId
  8385. if (scopeId) {
  8386. options._scopeId = 'data-v-' + scopeId
  8387. }
  8388. var hook
  8389. if (moduleIdentifier) { // server build
  8390. hook = function (context) {
  8391. // 2.3 injection
  8392. context =
  8393. context || // cached call
  8394. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8395. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8396. // 2.2 with runInNewContext: true
  8397. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8398. context = __VUE_SSR_CONTEXT__
  8399. }
  8400. // inject component styles
  8401. if (injectStyles) {
  8402. injectStyles.call(this, context)
  8403. }
  8404. // register component module identifier for async chunk inferrence
  8405. if (context && context._registeredComponents) {
  8406. context._registeredComponents.add(moduleIdentifier)
  8407. }
  8408. }
  8409. // used by ssr in case component is cached and beforeCreate
  8410. // never gets called
  8411. options._ssrRegister = hook
  8412. } else if (injectStyles) {
  8413. hook = shadowMode
  8414. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8415. : injectStyles
  8416. }
  8417. if (hook) {
  8418. if (options.functional) {
  8419. // for template-only hot-reload because in that case the render fn doesn't
  8420. // go through the normalizer
  8421. options._injectStyles = hook
  8422. // register for functioal component in vue file
  8423. var originalRender = options.render
  8424. options.render = function renderWithStyleInjection (h, context) {
  8425. hook.call(context)
  8426. return originalRender(h, context)
  8427. }
  8428. } else {
  8429. // inject component registration as beforeCreate hook
  8430. var existing = options.beforeCreate
  8431. options.beforeCreate = existing
  8432. ? [].concat(existing, hook)
  8433. : [hook]
  8434. }
  8435. }
  8436. return {
  8437. exports: scriptExports,
  8438. options: options
  8439. }
  8440. }
  8441. /***/ }),
  8442. /***/ 28:
  8443. /*!*********************************!*\
  8444. !*** G:/gsxm/lnyk/api/login.js ***!
  8445. \*********************************/
  8446. /*! no static exports found */
  8447. /***/ (function(module, exports, __webpack_require__) {
  8448. "use strict";
  8449. Object.defineProperty(exports, "__esModule", { value: true });exports.login = login;exports.register = register;exports.verify = verify;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8450. // 登录
  8451. function login(data) {
  8452. return (0, _request.default)({
  8453. url: '/api/login',
  8454. method: 'post',
  8455. data: data });
  8456. }
  8457. // 注册
  8458. function register(data) {
  8459. return (0, _request.default)({
  8460. url: '/api/register',
  8461. method: 'post',
  8462. data: data });
  8463. }
  8464. // 验证码
  8465. function verify(data) {
  8466. // type=register为注册
  8467. // type=login为登录
  8468. return (0, _request.default)({
  8469. url: '/api/register/verify',
  8470. method: 'post',
  8471. data: data });
  8472. }
  8473. /***/ }),
  8474. /***/ 285:
  8475. /*!******************************************!*\
  8476. !*** G:/gsxm/lnyk/utils/wxMinProgram.js ***!
  8477. \******************************************/
  8478. /*! no static exports found */
  8479. /***/ (function(module, exports, __webpack_require__) {
  8480. "use strict";
  8481. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.loginWinxinMp = loginWinxinMp;var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 5));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8482. //微信登录
  8483. /**
  8484. * @param {string} 当前页面地址信息
  8485. */
  8486. function loginWinxinMp() {
  8487. var pages = getCurrentPages();
  8488. // 获取跳转前页面
  8489. var page = pages[pages.length - 2];
  8490. var queryUrl = '';
  8491. for (var key in page.options) {
  8492. queryUrl += key + '=' + page.options[key] + "&";
  8493. }
  8494. // 获取当页面路由地址
  8495. var path = '/' + page.route + '?' + queryUrl;
  8496. // 保存跳转前页面
  8497. uni.setStorageSync('present', path);
  8498. return new Promise(function (resolve, reject) {
  8499. wx.login({
  8500. success: function success(e) {
  8501. console.log(e);
  8502. resolve(e);
  8503. },
  8504. fill: function fill(e) {
  8505. reject(e);
  8506. } });
  8507. });
  8508. };
  8509. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8510. /***/ }),
  8511. /***/ 294:
  8512. /*!******************************!*\
  8513. !*** G:/gsxm/lnyk/api/wx.js ***!
  8514. \******************************/
  8515. /*! no static exports found */
  8516. /***/ (function(module, exports, __webpack_require__) {
  8517. "use strict";
  8518. Object.defineProperty(exports, "__esModule", { value: true });exports.wechatMpAuth = wechatMpAuth;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8519. // 微信code地址
  8520. function wechatMpAuth(data) {
  8521. return (0, _request.default)({
  8522. url: '/api/wechat/mp_auth',
  8523. method: 'post',
  8524. data: data });
  8525. }
  8526. /***/ }),
  8527. /***/ 3:
  8528. /*!***********************************!*\
  8529. !*** (webpack)/buildin/global.js ***!
  8530. \***********************************/
  8531. /*! no static exports found */
  8532. /***/ (function(module, exports) {
  8533. var g;
  8534. // This works in non-strict mode
  8535. g = (function() {
  8536. return this;
  8537. })();
  8538. try {
  8539. // This works if eval is allowed (see CSP)
  8540. g = g || new Function("return this")();
  8541. } catch (e) {
  8542. // This works if the window reference is available
  8543. if (typeof window === "object") g = window;
  8544. }
  8545. // g can still be undefined, but nothing to do about it...
  8546. // We return undefined, instead of nothing here, so it's
  8547. // easier to handle this case. if(!global) { ...}
  8548. module.exports = g;
  8549. /***/ }),
  8550. /***/ 342:
  8551. /*!****************************************************!*\
  8552. !*** G:/gsxm/lnyk/components/tki-qrcode/qrcode.js ***!
  8553. \****************************************************/
  8554. /*! no static exports found */
  8555. /***/ (function(module, exports, __webpack_require__) {
  8556. "use strict";
  8557. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var QRCode = {};
  8558. (function () {
  8559. /**
  8560. * 获取单个字符的utf8编码
  8561. * unicode BMP平面约65535个字符
  8562. * @param {num} code
  8563. * return {array}
  8564. */
  8565. function unicodeFormat8(code) {
  8566. // 1 byte
  8567. var c0, c1, c2;
  8568. if (code < 128) {
  8569. return [code];
  8570. // 2 bytes
  8571. } else if (code < 2048) {
  8572. c0 = 192 + (code >> 6);
  8573. c1 = 128 + (code & 63);
  8574. return [c0, c1];
  8575. // 3 bytes
  8576. } else {
  8577. c0 = 224 + (code >> 12);
  8578. c1 = 128 + (code >> 6 & 63);
  8579. c2 = 128 + (code & 63);
  8580. return [c0, c1, c2];
  8581. }
  8582. }
  8583. /**
  8584. * 获取字符串的utf8编码字节串
  8585. * @param {string} string
  8586. * @return {array}
  8587. */
  8588. function getUTF8Bytes(string) {
  8589. var utf8codes = [];
  8590. for (var i = 0; i < string.length; i++) {
  8591. var code = string.charCodeAt(i);
  8592. var utf8 = unicodeFormat8(code);
  8593. for (var j = 0; j < utf8.length; j++) {
  8594. utf8codes.push(utf8[j]);
  8595. }
  8596. }
  8597. return utf8codes;
  8598. }
  8599. /**
  8600. * 二维码算法实现
  8601. * @param {string} data 要编码的信息字符串
  8602. * @param {num} errorCorrectLevel 纠错等级
  8603. */
  8604. function QRCodeAlg(data, errorCorrectLevel) {
  8605. this.typeNumber = -1; //版本
  8606. this.errorCorrectLevel = errorCorrectLevel;
  8607. this.modules = null; //二维矩阵,存放最终结果
  8608. this.moduleCount = 0; //矩阵大小
  8609. this.dataCache = null; //数据缓存
  8610. this.rsBlocks = null; //版本数据信息
  8611. this.totalDataCount = -1; //可使用的数据量
  8612. this.data = data;
  8613. this.utf8bytes = getUTF8Bytes(data);
  8614. this.make();
  8615. }
  8616. QRCodeAlg.prototype = {
  8617. constructor: QRCodeAlg,
  8618. /**
  8619. * 获取二维码矩阵大小
  8620. * @return {num} 矩阵大小
  8621. */
  8622. getModuleCount: function getModuleCount() {
  8623. return this.moduleCount;
  8624. },
  8625. /**
  8626. * 编码
  8627. */
  8628. make: function make() {
  8629. this.getRightType();
  8630. this.dataCache = this.createData();
  8631. this.createQrcode();
  8632. },
  8633. /**
  8634. * 设置二位矩阵功能图形
  8635. * @param {bool} test 表示是否在寻找最好掩膜阶段
  8636. * @param {num} maskPattern 掩膜的版本
  8637. */
  8638. makeImpl: function makeImpl(maskPattern) {
  8639. this.moduleCount = this.typeNumber * 4 + 17;
  8640. this.modules = new Array(this.moduleCount);
  8641. for (var row = 0; row < this.moduleCount; row++) {
  8642. this.modules[row] = new Array(this.moduleCount);
  8643. }
  8644. this.setupPositionProbePattern(0, 0);
  8645. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  8646. this.setupPositionProbePattern(0, this.moduleCount - 7);
  8647. this.setupPositionAdjustPattern();
  8648. this.setupTimingPattern();
  8649. this.setupTypeInfo(true, maskPattern);
  8650. if (this.typeNumber >= 7) {
  8651. this.setupTypeNumber(true);
  8652. }
  8653. this.mapData(this.dataCache, maskPattern);
  8654. },
  8655. /**
  8656. * 设置二维码的位置探测图形
  8657. * @param {num} row 探测图形的中心横坐标
  8658. * @param {num} col 探测图形的中心纵坐标
  8659. */
  8660. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  8661. for (var r = -1; r <= 7; r++) {
  8662. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  8663. for (var c = -1; c <= 7; c++) {
  8664. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  8665. if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  8666. this.modules[row + r][col + c] = true;
  8667. } else {
  8668. this.modules[row + r][col + c] = false;
  8669. }
  8670. }
  8671. }
  8672. },
  8673. /**
  8674. * 创建二维码
  8675. * @return {[type]} [description]
  8676. */
  8677. createQrcode: function createQrcode() {
  8678. var minLostPoint = 0;
  8679. var pattern = 0;
  8680. var bestModules = null;
  8681. for (var i = 0; i < 8; i++) {
  8682. this.makeImpl(i);
  8683. var lostPoint = QRUtil.getLostPoint(this);
  8684. if (i == 0 || minLostPoint > lostPoint) {
  8685. minLostPoint = lostPoint;
  8686. pattern = i;
  8687. bestModules = this.modules;
  8688. }
  8689. }
  8690. this.modules = bestModules;
  8691. this.setupTypeInfo(false, pattern);
  8692. if (this.typeNumber >= 7) {
  8693. this.setupTypeNumber(false);
  8694. }
  8695. },
  8696. /**
  8697. * 设置定位图形
  8698. * @return {[type]} [description]
  8699. */
  8700. setupTimingPattern: function setupTimingPattern() {
  8701. for (var r = 8; r < this.moduleCount - 8; r++) {
  8702. if (this.modules[r][6] != null) {
  8703. continue;
  8704. }
  8705. this.modules[r][6] = r % 2 == 0;
  8706. if (this.modules[6][r] != null) {
  8707. continue;
  8708. }
  8709. this.modules[6][r] = r % 2 == 0;
  8710. }
  8711. },
  8712. /**
  8713. * 设置矫正图形
  8714. * @return {[type]} [description]
  8715. */
  8716. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  8717. var pos = QRUtil.getPatternPosition(this.typeNumber);
  8718. for (var i = 0; i < pos.length; i++) {
  8719. for (var j = 0; j < pos.length; j++) {
  8720. var row = pos[i];
  8721. var col = pos[j];
  8722. if (this.modules[row][col] != null) {
  8723. continue;
  8724. }
  8725. for (var r = -2; r <= 2; r++) {
  8726. for (var c = -2; c <= 2; c++) {
  8727. if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
  8728. this.modules[row + r][col + c] = true;
  8729. } else {
  8730. this.modules[row + r][col + c] = false;
  8731. }
  8732. }
  8733. }
  8734. }
  8735. }
  8736. },
  8737. /**
  8738. * 设置版本信息(7以上版本才有)
  8739. * @param {bool} test 是否处于判断最佳掩膜阶段
  8740. * @return {[type]} [description]
  8741. */
  8742. setupTypeNumber: function setupTypeNumber(test) {
  8743. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  8744. for (var i = 0; i < 18; i++) {
  8745. var mod = !test && (bits >> i & 1) == 1;
  8746. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  8747. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  8748. }
  8749. },
  8750. /**
  8751. * 设置格式信息(纠错等级和掩膜版本)
  8752. * @param {bool} test
  8753. * @param {num} maskPattern 掩膜版本
  8754. * @return {}
  8755. */
  8756. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  8757. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  8758. var bits = QRUtil.getBCHTypeInfo(data);
  8759. // vertical
  8760. for (var i = 0; i < 15; i++) {
  8761. var mod = !test && (bits >> i & 1) == 1;
  8762. if (i < 6) {
  8763. this.modules[i][8] = mod;
  8764. } else if (i < 8) {
  8765. this.modules[i + 1][8] = mod;
  8766. } else {
  8767. this.modules[this.moduleCount - 15 + i][8] = mod;
  8768. }
  8769. // horizontal
  8770. var mod = !test && (bits >> i & 1) == 1;
  8771. if (i < 8) {
  8772. this.modules[8][this.moduleCount - i - 1] = mod;
  8773. } else if (i < 9) {
  8774. this.modules[8][15 - i - 1 + 1] = mod;
  8775. } else {
  8776. this.modules[8][15 - i - 1] = mod;
  8777. }
  8778. }
  8779. // fixed module
  8780. this.modules[this.moduleCount - 8][8] = !test;
  8781. },
  8782. /**
  8783. * 数据编码
  8784. * @return {[type]} [description]
  8785. */
  8786. createData: function createData() {
  8787. var buffer = new QRBitBuffer();
  8788. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  8789. buffer.put(4, 4); //添加模式
  8790. buffer.put(this.utf8bytes.length, lengthBits);
  8791. for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
  8792. buffer.put(this.utf8bytes[i], 8);
  8793. }
  8794. if (buffer.length + 4 <= this.totalDataCount * 8) {
  8795. buffer.put(0, 4);
  8796. }
  8797. // padding
  8798. while (buffer.length % 8 != 0) {
  8799. buffer.putBit(false);
  8800. }
  8801. // padding
  8802. while (true) {
  8803. if (buffer.length >= this.totalDataCount * 8) {
  8804. break;
  8805. }
  8806. buffer.put(QRCodeAlg.PAD0, 8);
  8807. if (buffer.length >= this.totalDataCount * 8) {
  8808. break;
  8809. }
  8810. buffer.put(QRCodeAlg.PAD1, 8);
  8811. }
  8812. return this.createBytes(buffer);
  8813. },
  8814. /**
  8815. * 纠错码编码
  8816. * @param {buffer} buffer 数据编码
  8817. * @return {[type]}
  8818. */
  8819. createBytes: function createBytes(buffer) {
  8820. var offset = 0;
  8821. var maxDcCount = 0;
  8822. var maxEcCount = 0;
  8823. var length = this.rsBlock.length / 3;
  8824. var rsBlocks = new Array();
  8825. for (var i = 0; i < length; i++) {
  8826. var count = this.rsBlock[i * 3 + 0];
  8827. var totalCount = this.rsBlock[i * 3 + 1];
  8828. var dataCount = this.rsBlock[i * 3 + 2];
  8829. for (var j = 0; j < count; j++) {
  8830. rsBlocks.push([dataCount, totalCount]);
  8831. }
  8832. }
  8833. var dcdata = new Array(rsBlocks.length);
  8834. var ecdata = new Array(rsBlocks.length);
  8835. for (var r = 0; r < rsBlocks.length; r++) {
  8836. var dcCount = rsBlocks[r][0];
  8837. var ecCount = rsBlocks[r][1] - dcCount;
  8838. maxDcCount = Math.max(maxDcCount, dcCount);
  8839. maxEcCount = Math.max(maxEcCount, ecCount);
  8840. dcdata[r] = new Array(dcCount);
  8841. for (var i = 0; i < dcdata[r].length; i++) {
  8842. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  8843. }
  8844. offset += dcCount;
  8845. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  8846. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  8847. var modPoly = rawPoly.mod(rsPoly);
  8848. ecdata[r] = new Array(rsPoly.getLength() - 1);
  8849. for (var i = 0; i < ecdata[r].length; i++) {
  8850. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  8851. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  8852. }
  8853. }
  8854. var data = new Array(this.totalDataCount);
  8855. var index = 0;
  8856. for (var i = 0; i < maxDcCount; i++) {
  8857. for (var r = 0; r < rsBlocks.length; r++) {
  8858. if (i < dcdata[r].length) {
  8859. data[index++] = dcdata[r][i];
  8860. }
  8861. }
  8862. }
  8863. for (var i = 0; i < maxEcCount; i++) {
  8864. for (var r = 0; r < rsBlocks.length; r++) {
  8865. if (i < ecdata[r].length) {
  8866. data[index++] = ecdata[r][i];
  8867. }
  8868. }
  8869. }
  8870. return data;
  8871. },
  8872. /**
  8873. * 布置模块,构建最终信息
  8874. * @param {} data
  8875. * @param {} maskPattern
  8876. * @return {}
  8877. */
  8878. mapData: function mapData(data, maskPattern) {
  8879. var inc = -1;
  8880. var row = this.moduleCount - 1;
  8881. var bitIndex = 7;
  8882. var byteIndex = 0;
  8883. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  8884. if (col == 6) col--;
  8885. while (true) {
  8886. for (var c = 0; c < 2; c++) {
  8887. if (this.modules[row][col - c] == null) {
  8888. var dark = false;
  8889. if (byteIndex < data.length) {
  8890. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  8891. }
  8892. var mask = QRUtil.getMask(maskPattern, row, col - c);
  8893. if (mask) {
  8894. dark = !dark;
  8895. }
  8896. this.modules[row][col - c] = dark;
  8897. bitIndex--;
  8898. if (bitIndex == -1) {
  8899. byteIndex++;
  8900. bitIndex = 7;
  8901. }
  8902. }
  8903. }
  8904. row += inc;
  8905. if (row < 0 || this.moduleCount <= row) {
  8906. row -= inc;
  8907. inc = -inc;
  8908. break;
  8909. }
  8910. }
  8911. }
  8912. } };
  8913. /**
  8914. * 填充字段
  8915. */
  8916. QRCodeAlg.PAD0 = 0xEC;
  8917. QRCodeAlg.PAD1 = 0x11;
  8918. //---------------------------------------------------------------------
  8919. // 纠错等级对应的编码
  8920. //---------------------------------------------------------------------
  8921. var QRErrorCorrectLevel = [1, 0, 3, 2];
  8922. //---------------------------------------------------------------------
  8923. // 掩膜版本
  8924. //---------------------------------------------------------------------
  8925. var QRMaskPattern = {
  8926. PATTERN000: 0,
  8927. PATTERN001: 1,
  8928. PATTERN010: 2,
  8929. PATTERN011: 3,
  8930. PATTERN100: 4,
  8931. PATTERN101: 5,
  8932. PATTERN110: 6,
  8933. PATTERN111: 7 };
  8934. //---------------------------------------------------------------------
  8935. // 工具类
  8936. //---------------------------------------------------------------------
  8937. var QRUtil = {
  8938. /*
  8939. 每个版本矫正图形的位置
  8940. */
  8941. PATTERN_POSITION_TABLE: [
  8942. [],
  8943. [6, 18],
  8944. [6, 22],
  8945. [6, 26],
  8946. [6, 30],
  8947. [6, 34],
  8948. [6, 22, 38],
  8949. [6, 24, 42],
  8950. [6, 26, 46],
  8951. [6, 28, 50],
  8952. [6, 30, 54],
  8953. [6, 32, 58],
  8954. [6, 34, 62],
  8955. [6, 26, 46, 66],
  8956. [6, 26, 48, 70],
  8957. [6, 26, 50, 74],
  8958. [6, 30, 54, 78],
  8959. [6, 30, 56, 82],
  8960. [6, 30, 58, 86],
  8961. [6, 34, 62, 90],
  8962. [6, 28, 50, 72, 94],
  8963. [6, 26, 50, 74, 98],
  8964. [6, 30, 54, 78, 102],
  8965. [6, 28, 54, 80, 106],
  8966. [6, 32, 58, 84, 110],
  8967. [6, 30, 58, 86, 114],
  8968. [6, 34, 62, 90, 118],
  8969. [6, 26, 50, 74, 98, 122],
  8970. [6, 30, 54, 78, 102, 126],
  8971. [6, 26, 52, 78, 104, 130],
  8972. [6, 30, 56, 82, 108, 134],
  8973. [6, 34, 60, 86, 112, 138],
  8974. [6, 30, 58, 86, 114, 142],
  8975. [6, 34, 62, 90, 118, 146],
  8976. [6, 30, 54, 78, 102, 126, 150],
  8977. [6, 24, 50, 76, 102, 128, 154],
  8978. [6, 28, 54, 80, 106, 132, 158],
  8979. [6, 32, 58, 84, 110, 136, 162],
  8980. [6, 26, 54, 82, 110, 138, 166],
  8981. [6, 30, 58, 86, 114, 142, 170]],
  8982. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  8983. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  8984. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  8985. /*
  8986. BCH编码格式信息
  8987. */
  8988. getBCHTypeInfo: function getBCHTypeInfo(data) {
  8989. var d = data << 10;
  8990. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  8991. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  8992. }
  8993. return (data << 10 | d) ^ QRUtil.G15_MASK;
  8994. },
  8995. /*
  8996. BCH编码版本信息
  8997. */
  8998. getBCHTypeNumber: function getBCHTypeNumber(data) {
  8999. var d = data << 12;
  9000. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  9001. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  9002. }
  9003. return data << 12 | d;
  9004. },
  9005. /*
  9006. 获取BCH位信息
  9007. */
  9008. getBCHDigit: function getBCHDigit(data) {
  9009. var digit = 0;
  9010. while (data != 0) {
  9011. digit++;
  9012. data >>>= 1;
  9013. }
  9014. return digit;
  9015. },
  9016. /*
  9017. 获取版本对应的矫正图形位置
  9018. */
  9019. getPatternPosition: function getPatternPosition(typeNumber) {
  9020. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  9021. },
  9022. /*
  9023. 掩膜算法
  9024. */
  9025. getMask: function getMask(maskPattern, i, j) {
  9026. switch (maskPattern) {
  9027. case QRMaskPattern.PATTERN000:
  9028. return (i + j) % 2 == 0;
  9029. case QRMaskPattern.PATTERN001:
  9030. return i % 2 == 0;
  9031. case QRMaskPattern.PATTERN010:
  9032. return j % 3 == 0;
  9033. case QRMaskPattern.PATTERN011:
  9034. return (i + j) % 3 == 0;
  9035. case QRMaskPattern.PATTERN100:
  9036. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  9037. case QRMaskPattern.PATTERN101:
  9038. return i * j % 2 + i * j % 3 == 0;
  9039. case QRMaskPattern.PATTERN110:
  9040. return (i * j % 2 + i * j % 3) % 2 == 0;
  9041. case QRMaskPattern.PATTERN111:
  9042. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  9043. default:
  9044. throw new Error("bad maskPattern:" + maskPattern);}
  9045. },
  9046. /*
  9047. 获取RS的纠错多项式
  9048. */
  9049. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  9050. var a = new QRPolynomial([1], 0);
  9051. for (var i = 0; i < errorCorrectLength; i++) {
  9052. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  9053. }
  9054. return a;
  9055. },
  9056. /*
  9057. 获取评价
  9058. */
  9059. getLostPoint: function getLostPoint(qrCode) {
  9060. var moduleCount = qrCode.getModuleCount(),
  9061. lostPoint = 0,
  9062. darkCount = 0;
  9063. for (var row = 0; row < moduleCount; row++) {
  9064. var sameCount = 0;
  9065. var head = qrCode.modules[row][0];
  9066. for (var col = 0; col < moduleCount; col++) {
  9067. var current = qrCode.modules[row][col];
  9068. //level 3 评价
  9069. if (col < moduleCount - 6) {
  9070. if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
  9071. if (col < moduleCount - 10) {
  9072. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  9073. lostPoint += 40;
  9074. }
  9075. } else if (col > 3) {
  9076. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  9077. lostPoint += 40;
  9078. }
  9079. }
  9080. }
  9081. }
  9082. //level 2 评价
  9083. if (row < moduleCount - 1 && col < moduleCount - 1) {
  9084. var count = 0;
  9085. if (current) count++;
  9086. if (qrCode.modules[row + 1][col]) count++;
  9087. if (qrCode.modules[row][col + 1]) count++;
  9088. if (qrCode.modules[row + 1][col + 1]) count++;
  9089. if (count == 0 || count == 4) {
  9090. lostPoint += 3;
  9091. }
  9092. }
  9093. //level 1 评价
  9094. if (head ^ current) {
  9095. sameCount++;
  9096. } else {
  9097. head = current;
  9098. if (sameCount >= 5) {
  9099. lostPoint += 3 + sameCount - 5;
  9100. }
  9101. sameCount = 1;
  9102. }
  9103. //level 4 评价
  9104. if (current) {
  9105. darkCount++;
  9106. }
  9107. }
  9108. }
  9109. for (var col = 0; col < moduleCount; col++) {
  9110. var sameCount = 0;
  9111. var head = qrCode.modules[0][col];
  9112. for (var row = 0; row < moduleCount; row++) {
  9113. var current = qrCode.modules[row][col];
  9114. //level 3 评价
  9115. if (row < moduleCount - 6) {
  9116. if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
  9117. if (row < moduleCount - 10) {
  9118. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  9119. lostPoint += 40;
  9120. }
  9121. } else if (row > 3) {
  9122. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  9123. lostPoint += 40;
  9124. }
  9125. }
  9126. }
  9127. }
  9128. //level 1 评价
  9129. if (head ^ current) {
  9130. sameCount++;
  9131. } else {
  9132. head = current;
  9133. if (sameCount >= 5) {
  9134. lostPoint += 3 + sameCount - 5;
  9135. }
  9136. sameCount = 1;
  9137. }
  9138. }
  9139. }
  9140. // LEVEL4
  9141. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  9142. lostPoint += ratio * 10;
  9143. return lostPoint;
  9144. } };
  9145. //---------------------------------------------------------------------
  9146. // QRMath使用的数学工具
  9147. //---------------------------------------------------------------------
  9148. var QRMath = {
  9149. /*
  9150. 将n转化为a^m
  9151. */
  9152. glog: function glog(n) {
  9153. if (n < 1) {
  9154. throw new Error("glog(" + n + ")");
  9155. }
  9156. return QRMath.LOG_TABLE[n];
  9157. },
  9158. /*
  9159. 将a^m转化为n
  9160. */
  9161. gexp: function gexp(n) {
  9162. while (n < 0) {
  9163. n += 255;
  9164. }
  9165. while (n >= 256) {
  9166. n -= 255;
  9167. }
  9168. return QRMath.EXP_TABLE[n];
  9169. },
  9170. EXP_TABLE: new Array(256),
  9171. LOG_TABLE: new Array(256) };
  9172. for (var i = 0; i < 8; i++) {
  9173. QRMath.EXP_TABLE[i] = 1 << i;
  9174. }
  9175. for (var i = 8; i < 256; i++) {
  9176. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
  9177. }
  9178. for (var i = 0; i < 255; i++) {
  9179. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  9180. }
  9181. //---------------------------------------------------------------------
  9182. // QRPolynomial 多项式
  9183. //---------------------------------------------------------------------
  9184. /**
  9185. * 多项式类
  9186. * @param {Array} num 系数
  9187. * @param {num} shift a^shift
  9188. */
  9189. function QRPolynomial(num, shift) {
  9190. if (num.length == undefined) {
  9191. throw new Error(num.length + "/" + shift);
  9192. }
  9193. var offset = 0;
  9194. while (offset < num.length && num[offset] == 0) {
  9195. offset++;
  9196. }
  9197. this.num = new Array(num.length - offset + shift);
  9198. for (var i = 0; i < num.length - offset; i++) {
  9199. this.num[i] = num[i + offset];
  9200. }
  9201. }
  9202. QRPolynomial.prototype = {
  9203. get: function get(index) {
  9204. return this.num[index];
  9205. },
  9206. getLength: function getLength() {
  9207. return this.num.length;
  9208. },
  9209. /**
  9210. * 多项式乘法
  9211. * @param {QRPolynomial} e 被乘多项式
  9212. * @return {[type]} [description]
  9213. */
  9214. multiply: function multiply(e) {
  9215. var num = new Array(this.getLength() + e.getLength() - 1);
  9216. for (var i = 0; i < this.getLength(); i++) {
  9217. for (var j = 0; j < e.getLength(); j++) {
  9218. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  9219. }
  9220. }
  9221. return new QRPolynomial(num, 0);
  9222. },
  9223. /**
  9224. * 多项式模运算
  9225. * @param {QRPolynomial} e 模多项式
  9226. * @return {}
  9227. */
  9228. mod: function mod(e) {
  9229. var tl = this.getLength(),
  9230. el = e.getLength();
  9231. if (tl - el < 0) {
  9232. return this;
  9233. }
  9234. var num = new Array(tl);
  9235. for (var i = 0; i < tl; i++) {
  9236. num[i] = this.get(i);
  9237. }
  9238. while (num.length >= el) {
  9239. var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
  9240. for (var i = 0; i < e.getLength(); i++) {
  9241. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  9242. }
  9243. while (num[0] == 0) {
  9244. num.shift();
  9245. }
  9246. }
  9247. return new QRPolynomial(num, 0);
  9248. } };
  9249. //---------------------------------------------------------------------
  9250. // RS_BLOCK_TABLE
  9251. //---------------------------------------------------------------------
  9252. /*
  9253. 二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
  9254. */
  9255. var RS_BLOCK_TABLE = [
  9256. // L
  9257. // M
  9258. // Q
  9259. // H
  9260. // 1
  9261. [1, 26, 19],
  9262. [1, 26, 16],
  9263. [1, 26, 13],
  9264. [1, 26, 9],
  9265. // 2
  9266. [1, 44, 34],
  9267. [1, 44, 28],
  9268. [1, 44, 22],
  9269. [1, 44, 16],
  9270. // 3
  9271. [1, 70, 55],
  9272. [1, 70, 44],
  9273. [2, 35, 17],
  9274. [2, 35, 13],
  9275. // 4
  9276. [1, 100, 80],
  9277. [2, 50, 32],
  9278. [2, 50, 24],
  9279. [4, 25, 9],
  9280. // 5
  9281. [1, 134, 108],
  9282. [2, 67, 43],
  9283. [2, 33, 15, 2, 34, 16],
  9284. [2, 33, 11, 2, 34, 12],
  9285. // 6
  9286. [2, 86, 68],
  9287. [4, 43, 27],
  9288. [4, 43, 19],
  9289. [4, 43, 15],
  9290. // 7
  9291. [2, 98, 78],
  9292. [4, 49, 31],
  9293. [2, 32, 14, 4, 33, 15],
  9294. [4, 39, 13, 1, 40, 14],
  9295. // 8
  9296. [2, 121, 97],
  9297. [2, 60, 38, 2, 61, 39],
  9298. [4, 40, 18, 2, 41, 19],
  9299. [4, 40, 14, 2, 41, 15],
  9300. // 9
  9301. [2, 146, 116],
  9302. [3, 58, 36, 2, 59, 37],
  9303. [4, 36, 16, 4, 37, 17],
  9304. [4, 36, 12, 4, 37, 13],
  9305. // 10
  9306. [2, 86, 68, 2, 87, 69],
  9307. [4, 69, 43, 1, 70, 44],
  9308. [6, 43, 19, 2, 44, 20],
  9309. [6, 43, 15, 2, 44, 16],
  9310. // 11
  9311. [4, 101, 81],
  9312. [1, 80, 50, 4, 81, 51],
  9313. [4, 50, 22, 4, 51, 23],
  9314. [3, 36, 12, 8, 37, 13],
  9315. // 12
  9316. [2, 116, 92, 2, 117, 93],
  9317. [6, 58, 36, 2, 59, 37],
  9318. [4, 46, 20, 6, 47, 21],
  9319. [7, 42, 14, 4, 43, 15],
  9320. // 13
  9321. [4, 133, 107],
  9322. [8, 59, 37, 1, 60, 38],
  9323. [8, 44, 20, 4, 45, 21],
  9324. [12, 33, 11, 4, 34, 12],
  9325. // 14
  9326. [3, 145, 115, 1, 146, 116],
  9327. [4, 64, 40, 5, 65, 41],
  9328. [11, 36, 16, 5, 37, 17],
  9329. [11, 36, 12, 5, 37, 13],
  9330. // 15
  9331. [5, 109, 87, 1, 110, 88],
  9332. [5, 65, 41, 5, 66, 42],
  9333. [5, 54, 24, 7, 55, 25],
  9334. [11, 36, 12],
  9335. // 16
  9336. [5, 122, 98, 1, 123, 99],
  9337. [7, 73, 45, 3, 74, 46],
  9338. [15, 43, 19, 2, 44, 20],
  9339. [3, 45, 15, 13, 46, 16],
  9340. // 17
  9341. [1, 135, 107, 5, 136, 108],
  9342. [10, 74, 46, 1, 75, 47],
  9343. [1, 50, 22, 15, 51, 23],
  9344. [2, 42, 14, 17, 43, 15],
  9345. // 18
  9346. [5, 150, 120, 1, 151, 121],
  9347. [9, 69, 43, 4, 70, 44],
  9348. [17, 50, 22, 1, 51, 23],
  9349. [2, 42, 14, 19, 43, 15],
  9350. // 19
  9351. [3, 141, 113, 4, 142, 114],
  9352. [3, 70, 44, 11, 71, 45],
  9353. [17, 47, 21, 4, 48, 22],
  9354. [9, 39, 13, 16, 40, 14],
  9355. // 20
  9356. [3, 135, 107, 5, 136, 108],
  9357. [3, 67, 41, 13, 68, 42],
  9358. [15, 54, 24, 5, 55, 25],
  9359. [15, 43, 15, 10, 44, 16],
  9360. // 21
  9361. [4, 144, 116, 4, 145, 117],
  9362. [17, 68, 42],
  9363. [17, 50, 22, 6, 51, 23],
  9364. [19, 46, 16, 6, 47, 17],
  9365. // 22
  9366. [2, 139, 111, 7, 140, 112],
  9367. [17, 74, 46],
  9368. [7, 54, 24, 16, 55, 25],
  9369. [34, 37, 13],
  9370. // 23
  9371. [4, 151, 121, 5, 152, 122],
  9372. [4, 75, 47, 14, 76, 48],
  9373. [11, 54, 24, 14, 55, 25],
  9374. [16, 45, 15, 14, 46, 16],
  9375. // 24
  9376. [6, 147, 117, 4, 148, 118],
  9377. [6, 73, 45, 14, 74, 46],
  9378. [11, 54, 24, 16, 55, 25],
  9379. [30, 46, 16, 2, 47, 17],
  9380. // 25
  9381. [8, 132, 106, 4, 133, 107],
  9382. [8, 75, 47, 13, 76, 48],
  9383. [7, 54, 24, 22, 55, 25],
  9384. [22, 45, 15, 13, 46, 16],
  9385. // 26
  9386. [10, 142, 114, 2, 143, 115],
  9387. [19, 74, 46, 4, 75, 47],
  9388. [28, 50, 22, 6, 51, 23],
  9389. [33, 46, 16, 4, 47, 17],
  9390. // 27
  9391. [8, 152, 122, 4, 153, 123],
  9392. [22, 73, 45, 3, 74, 46],
  9393. [8, 53, 23, 26, 54, 24],
  9394. [12, 45, 15, 28, 46, 16],
  9395. // 28
  9396. [3, 147, 117, 10, 148, 118],
  9397. [3, 73, 45, 23, 74, 46],
  9398. [4, 54, 24, 31, 55, 25],
  9399. [11, 45, 15, 31, 46, 16],
  9400. // 29
  9401. [7, 146, 116, 7, 147, 117],
  9402. [21, 73, 45, 7, 74, 46],
  9403. [1, 53, 23, 37, 54, 24],
  9404. [19, 45, 15, 26, 46, 16],
  9405. // 30
  9406. [5, 145, 115, 10, 146, 116],
  9407. [19, 75, 47, 10, 76, 48],
  9408. [15, 54, 24, 25, 55, 25],
  9409. [23, 45, 15, 25, 46, 16],
  9410. // 31
  9411. [13, 145, 115, 3, 146, 116],
  9412. [2, 74, 46, 29, 75, 47],
  9413. [42, 54, 24, 1, 55, 25],
  9414. [23, 45, 15, 28, 46, 16],
  9415. // 32
  9416. [17, 145, 115],
  9417. [10, 74, 46, 23, 75, 47],
  9418. [10, 54, 24, 35, 55, 25],
  9419. [19, 45, 15, 35, 46, 16],
  9420. // 33
  9421. [17, 145, 115, 1, 146, 116],
  9422. [14, 74, 46, 21, 75, 47],
  9423. [29, 54, 24, 19, 55, 25],
  9424. [11, 45, 15, 46, 46, 16],
  9425. // 34
  9426. [13, 145, 115, 6, 146, 116],
  9427. [14, 74, 46, 23, 75, 47],
  9428. [44, 54, 24, 7, 55, 25],
  9429. [59, 46, 16, 1, 47, 17],
  9430. // 35
  9431. [12, 151, 121, 7, 152, 122],
  9432. [12, 75, 47, 26, 76, 48],
  9433. [39, 54, 24, 14, 55, 25],
  9434. [22, 45, 15, 41, 46, 16],
  9435. // 36
  9436. [6, 151, 121, 14, 152, 122],
  9437. [6, 75, 47, 34, 76, 48],
  9438. [46, 54, 24, 10, 55, 25],
  9439. [2, 45, 15, 64, 46, 16],
  9440. // 37
  9441. [17, 152, 122, 4, 153, 123],
  9442. [29, 74, 46, 14, 75, 47],
  9443. [49, 54, 24, 10, 55, 25],
  9444. [24, 45, 15, 46, 46, 16],
  9445. // 38
  9446. [4, 152, 122, 18, 153, 123],
  9447. [13, 74, 46, 32, 75, 47],
  9448. [48, 54, 24, 14, 55, 25],
  9449. [42, 45, 15, 32, 46, 16],
  9450. // 39
  9451. [20, 147, 117, 4, 148, 118],
  9452. [40, 75, 47, 7, 76, 48],
  9453. [43, 54, 24, 22, 55, 25],
  9454. [10, 45, 15, 67, 46, 16],
  9455. // 40
  9456. [19, 148, 118, 6, 149, 119],
  9457. [18, 75, 47, 31, 76, 48],
  9458. [34, 54, 24, 34, 55, 25],
  9459. [20, 45, 15, 61, 46, 16]];
  9460. /**
  9461. * 根据数据获取对应版本
  9462. * @return {[type]} [description]
  9463. */
  9464. QRCodeAlg.prototype.getRightType = function () {
  9465. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  9466. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  9467. if (rsBlock == undefined) {
  9468. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  9469. }
  9470. var length = rsBlock.length / 3;
  9471. var totalDataCount = 0;
  9472. for (var i = 0; i < length; i++) {
  9473. var count = rsBlock[i * 3 + 0];
  9474. var dataCount = rsBlock[i * 3 + 2];
  9475. totalDataCount += dataCount * count;
  9476. }
  9477. var lengthBytes = typeNumber > 9 ? 2 : 1;
  9478. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  9479. this.typeNumber = typeNumber;
  9480. this.rsBlock = rsBlock;
  9481. this.totalDataCount = totalDataCount;
  9482. break;
  9483. }
  9484. }
  9485. };
  9486. //---------------------------------------------------------------------
  9487. // QRBitBuffer
  9488. //---------------------------------------------------------------------
  9489. function QRBitBuffer() {
  9490. this.buffer = new Array();
  9491. this.length = 0;
  9492. }
  9493. QRBitBuffer.prototype = {
  9494. get: function get(index) {
  9495. var bufIndex = Math.floor(index / 8);
  9496. return this.buffer[bufIndex] >>> 7 - index % 8 & 1;
  9497. },
  9498. put: function put(num, length) {
  9499. for (var i = 0; i < length; i++) {
  9500. this.putBit(num >>> length - i - 1 & 1);
  9501. }
  9502. },
  9503. putBit: function putBit(bit) {
  9504. var bufIndex = Math.floor(this.length / 8);
  9505. if (this.buffer.length <= bufIndex) {
  9506. this.buffer.push(0);
  9507. }
  9508. if (bit) {
  9509. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  9510. }
  9511. this.length++;
  9512. } };
  9513. // xzedit
  9514. var qrcodeAlgObjCache = [];
  9515. /**
  9516. * 二维码构造函数,主要用于绘制
  9517. * @param {参数列表} opt 传递参数
  9518. * @return {}
  9519. */
  9520. QRCode = function QRCode(opt) {
  9521. //设置默认参数
  9522. this.options = {
  9523. text: '',
  9524. size: 256,
  9525. correctLevel: 3,
  9526. background: '#ffffff',
  9527. foreground: '#000000',
  9528. pdground: '#000000',
  9529. image: '',
  9530. imageSize: 30,
  9531. canvasId: opt.canvasId,
  9532. context: opt.context,
  9533. usingComponents: opt.usingComponents,
  9534. showLoading: opt.showLoading,
  9535. loadingText: opt.loadingText };
  9536. if (typeof opt === 'string') {// 只编码ASCII字符串
  9537. opt = {
  9538. text: opt };
  9539. }
  9540. if (opt) {
  9541. for (var i in opt) {
  9542. this.options[i] = opt[i];
  9543. }
  9544. }
  9545. //使用QRCodeAlg创建二维码结构
  9546. var qrCodeAlg = null;
  9547. for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
  9548. if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
  9549. qrCodeAlg = qrcodeAlgObjCache[i].obj;
  9550. break;
  9551. }
  9552. }
  9553. if (i == l) {
  9554. qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
  9555. qrcodeAlgObjCache.push({
  9556. text: this.options.text,
  9557. correctLevel: this.options.correctLevel,
  9558. obj: qrCodeAlg });
  9559. }
  9560. /**
  9561. * 计算矩阵点的前景色
  9562. * @param {Obj} config
  9563. * @param {Number} config.row 点x坐标
  9564. * @param {Number} config.col 点y坐标
  9565. * @param {Number} config.count 矩阵大小
  9566. * @param {Number} config.options 组件的options
  9567. * @return {String}
  9568. */
  9569. var getForeGround = function getForeGround(config) {
  9570. var options = config.options;
  9571. if (options.pdground && (
  9572. config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 ||
  9573. config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 ||
  9574. config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2))
  9575. {
  9576. return options.pdground;
  9577. }
  9578. return options.foreground;
  9579. };
  9580. // 创建canvas
  9581. var createCanvas = function createCanvas(options) {
  9582. if (options.showLoading) {
  9583. uni.showLoading({
  9584. title: options.loadingText,
  9585. mask: true });
  9586. }
  9587. var ctx = uni.createCanvasContext(options.canvasId, options.context);
  9588. var count = qrCodeAlg.getModuleCount();
  9589. var ratioSize = options.size;
  9590. var ratioImgSize = options.imageSize;
  9591. //计算每个点的长宽
  9592. var tileW = (ratioSize / count).toPrecision(4);
  9593. var tileH = (ratioSize / count).toPrecision(4);
  9594. //绘制
  9595. for (var row = 0; row < count; row++) {
  9596. for (var col = 0; col < count; col++) {
  9597. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  9598. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  9599. var foreground = getForeGround({
  9600. row: row,
  9601. col: col,
  9602. count: count,
  9603. options: options });
  9604. ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
  9605. ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
  9606. }
  9607. }
  9608. if (options.image) {
  9609. // 画圆角矩形
  9610. var drawRoundedRect = function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
  9611. ctxi.setLineWidth(lineWidth);
  9612. ctxi.setFillStyle(options.background);
  9613. ctxi.setStrokeStyle(options.background);
  9614. ctxi.beginPath(); // draw top and top right corner
  9615. ctxi.moveTo(x + r, y);
  9616. ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
  9617. ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
  9618. ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
  9619. ctxi.arcTo(x, y, x + r, y, r);
  9620. ctxi.closePath();
  9621. if (fill) {
  9622. ctxi.fill();
  9623. }
  9624. if (stroke) {
  9625. ctxi.stroke();
  9626. }
  9627. };var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true);ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
  9628. }
  9629. setTimeout(function () {
  9630. ctx.draw(true, function () {
  9631. // 保存到临时区域
  9632. setTimeout(function () {
  9633. uni.canvasToTempFilePath({
  9634. width: options.width,
  9635. height: options.height,
  9636. destWidth: options.width,
  9637. destHeight: options.height,
  9638. canvasId: options.canvasId,
  9639. quality: Number(1),
  9640. success: function success(res) {
  9641. if (options.cbResult) {
  9642. options.cbResult(res.tempFilePath);
  9643. }
  9644. },
  9645. fail: function fail(res) {
  9646. if (options.cbResult) {
  9647. options.cbResult(res);
  9648. }
  9649. },
  9650. complete: function complete() {
  9651. if (options.showLoading) {
  9652. uni.hideLoading();
  9653. }
  9654. } },
  9655. options.context);
  9656. }, options.text.length + 100);
  9657. });
  9658. }, options.usingComponents ? 0 : 150);
  9659. };
  9660. createCanvas(this.options);
  9661. // 空判定
  9662. var empty = function empty(v) {
  9663. var tp = typeof v,
  9664. rt = false;
  9665. if (tp == "number" && String(v) == "") {
  9666. rt = true;
  9667. } else if (tp == "undefined") {
  9668. rt = true;
  9669. } else if (tp == "object") {
  9670. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true;
  9671. } else if (tp == "string") {
  9672. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true;
  9673. } else if (tp == "function") {
  9674. rt = false;
  9675. }
  9676. return rt;
  9677. };
  9678. };
  9679. QRCode.prototype.clear = function (fn) {
  9680. var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context);
  9681. ctx.clearRect(0, 0, this.options.size, this.options.size);
  9682. ctx.draw(false, function () {
  9683. if (fn) {
  9684. fn();
  9685. }
  9686. });
  9687. };
  9688. })();var _default =
  9689. QRCode;exports.default = _default;
  9690. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9691. /***/ }),
  9692. /***/ 357:
  9693. /*!**************************************************!*\
  9694. !*** G:/gsxm/lnyk/components/lb-picker/utils.js ***!
  9695. \**************************************************/
  9696. /*! no static exports found */
  9697. /***/ (function(module, exports, __webpack_require__) {
  9698. "use strict";
  9699. Object.defineProperty(exports, "__esModule", { value: true });exports.isObject = isObject;exports.isFunction = isFunction;exports.getColumns = getColumns; /**
  9700. * 判断是否是对象
  9701. *
  9702. * @export
  9703. * @param {*} val
  9704. * @returns true/false
  9705. */
  9706. function isObject(val) {
  9707. return Object.prototype.toString.call(val) === '[object Object]';
  9708. }
  9709. /**
  9710. * 判断是否是Function
  9711. *
  9712. * @export
  9713. * @param {*} val
  9714. * @returns true/false
  9715. */
  9716. function isFunction(val) {
  9717. return Object.prototype.toString.call(val) === '[object Function]';
  9718. }
  9719. /**
  9720. * 根据value获取columns信息
  9721. *
  9722. * @export
  9723. * @param {*} { value, list, mode, props, level }
  9724. * @param {number} [type=2] 查询不到value数据返回数据类型 1空值null 2默认第一个选项
  9725. * @returns
  9726. */
  9727. function getColumns(_ref) {var value = _ref.value,list = _ref.list,mode = _ref.mode,props = _ref.props,level = _ref.level;var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  9728. var pickerValue = [];
  9729. var pickerColumns = [];
  9730. var selectValue = [];
  9731. var selectItem = [];
  9732. var columnsInfo = null;
  9733. switch (mode) {
  9734. case 'selector':
  9735. var index = list.findIndex(function (item) {
  9736. return isObject(item) ? item[props.value] === value : item === value;
  9737. });
  9738. if (index === -1 && type === 1) {
  9739. columnsInfo = null;
  9740. } else {
  9741. index = index > -1 ? index : 0;
  9742. selectItem = list[index];
  9743. selectValue = isObject(selectItem) ?
  9744. selectItem[props.value] :
  9745. selectItem;
  9746. pickerColumns = list;
  9747. pickerValue = [index];
  9748. columnsInfo = {
  9749. index: pickerValue,
  9750. value: selectValue,
  9751. item: selectItem,
  9752. columns: pickerColumns };
  9753. }
  9754. break;
  9755. case 'multiSelector':
  9756. var setPickerItems = function setPickerItems() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9757. if (!data.length) return;
  9758. var defaultValue = value || [];
  9759. if (index < level) {
  9760. var _value = defaultValue[index] || '';
  9761. var i = data.findIndex(function (item) {return item[props.value] === _value;});
  9762. if (i === -1 && type === 1) return;
  9763. i = i > -1 ? i : 0;
  9764. pickerValue[index] = i;
  9765. pickerColumns[index] = data;
  9766. if (data[i]) {
  9767. selectValue[index] = data[i][props.value];
  9768. selectItem[index] = data[i];
  9769. setPickerItems(data[i][props.children] || [], index + 1);
  9770. }
  9771. }
  9772. };
  9773. setPickerItems(list);
  9774. if (!selectValue.length && type === 1) {
  9775. columnsInfo = null;
  9776. } else {
  9777. columnsInfo = {
  9778. index: pickerValue,
  9779. value: selectValue,
  9780. item: selectItem,
  9781. columns: pickerColumns };
  9782. }
  9783. break;
  9784. case 'unlinkedSelector':
  9785. list.forEach(function (item, i) {
  9786. var index = item.findIndex(function (item) {
  9787. return isObject(item) ?
  9788. item[props.value] === value[i] :
  9789. item === value[i];
  9790. });
  9791. if (index === -1 && type === 1) return;
  9792. index = index > -1 ? index : 0;
  9793. var columnItem = list[i][index];
  9794. var valueItem = isObject(columnItem) ?
  9795. columnItem[props.value] :
  9796. columnItem;
  9797. pickerValue[i] = index;
  9798. selectValue[i] = valueItem;
  9799. selectItem[i] = columnItem;
  9800. });
  9801. pickerColumns = list;
  9802. if (!selectValue.length && type === 1) {
  9803. columnsInfo = null;
  9804. } else {
  9805. columnsInfo = {
  9806. index: pickerValue,
  9807. value: selectValue,
  9808. item: selectItem,
  9809. columns: pickerColumns };
  9810. }
  9811. break;}
  9812. return columnsInfo;
  9813. }
  9814. /***/ }),
  9815. /***/ 386:
  9816. /*!*********************************************************!*\
  9817. !*** G:/gsxm/lnyk/components/lb-picker/mixins/index.js ***!
  9818. \*********************************************************/
  9819. /*! no static exports found */
  9820. /***/ (function(module, exports, __webpack_require__) {
  9821. "use strict";
  9822. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.commonMixin = void 0;var _utils = __webpack_require__(/*! ../utils */ 357);
  9823. var commonMixin = {
  9824. data: function data() {
  9825. return {
  9826. isConfirmChange: false,
  9827. indicatorStyle: "height: 34px",
  9828. pressTimeout: null };
  9829. },
  9830. created: function created() {
  9831. this.init('init');
  9832. },
  9833. methods: {
  9834. init: function init(changeType) {
  9835. if (this.list && this.list.length) {
  9836. var column = (0, _utils.getColumns)({
  9837. value: this.value,
  9838. list: this.list,
  9839. mode: this.mode,
  9840. props: this.props,
  9841. level: this.level });var
  9842. columns = column.columns,value = column.value,item = column.item,index = column.index;
  9843. this.selectValue = value;
  9844. this.selectItem = item;
  9845. this.pickerColumns = columns;
  9846. this.pickerValue = index;
  9847. this.$emit('change', {
  9848. value: this.selectValue,
  9849. item: this.selectItem,
  9850. index: this.pickerValue,
  9851. change: changeType });
  9852. }
  9853. },
  9854. touchstart: function touchstart(e) {var _this = this;
  9855. if (!this.pressEnable) return;
  9856. clearTimeout(this.pressTimeout);
  9857. this.pressTimeout = setTimeout(function () {
  9858. var item = {};
  9859. var toastTitle = '';
  9860. item = e.currentTarget.dataset.item;
  9861. toastTitle = item[_this.props.label] || item;
  9862. uni.showToast({
  9863. title: toastTitle,
  9864. icon: 'none' });
  9865. }, this.pressTime);
  9866. },
  9867. touchmove: function touchmove() {
  9868. if (!this.pressEnable) return;
  9869. clearTimeout(this.pressTimeout);
  9870. },
  9871. touchend: function touchend() {
  9872. if (!this.pressEnable) return;
  9873. clearTimeout(this.pressTimeout);
  9874. },
  9875. getLabel: function getLabel(item, rowIndex, columnIndex) {
  9876. if (this.formatter && (0, _utils.isFunction)(this.formatter)) {
  9877. return this.formatter({ item: item, rowIndex: rowIndex, columnIndex: columnIndex });
  9878. } else {
  9879. return item[this.props.label] || item;
  9880. }
  9881. } },
  9882. watch: {
  9883. value: function value() {
  9884. if (!this.isConfirmChange) {
  9885. this.init('value');
  9886. }
  9887. },
  9888. list: function list() {
  9889. this.init('list');
  9890. } } };exports.commonMixin = commonMixin;
  9891. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9892. /***/ }),
  9893. /***/ 4:
  9894. /*!*******************************!*\
  9895. !*** G:/gsxm/lnyk/pages.json ***!
  9896. \*******************************/
  9897. /*! no static exports found */
  9898. /***/ (function(module, exports) {
  9899. /***/ }),
  9900. /***/ 408:
  9901. /*!**********************************************************!*\
  9902. !*** G:/gsxm/lnyk/components/lb-picker/lib/dayjs.min.js ***!
  9903. \**********************************************************/
  9904. /*! no static exports found */
  9905. /***/ (function(module, exports, __webpack_require__) {
  9906. !function (t, e) { true ? module.exports = e() : undefined;}(this, function () {"use strict";var t = "millisecond",e = "second",n = "minute",r = "hour",i = "day",s = "week",u = "month",a = "quarter",o = "year",f = "date",h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/,c = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") },$ = function $(t, e, n) {var r = String(t);return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;},l = { s: $, z: function z(t) {var e = -t.utcOffset(),n = Math.abs(e),r = Math.floor(n / 60),i = n % 60;return (e <= 0 ? "+" : "-") + $(r, 2, "0") + ":" + $(i, 2, "0");}, m: function t(e, n) {if (e.date() < n.date()) return -t(n, e);var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),i = e.clone().add(r, u),s = n - i < 0,a = e.clone().add(r + (s ? -1 : 1), u);return +(-(r + (n - i) / (s ? i - a : a - i)) || 0);}, a: function a(t) {return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);}, p: function p(h) {return { M: u, y: o, w: s, d: i, D: f, h: r, m: n, s: e, ms: t, Q: a }[h] || String(h || "").toLowerCase().replace(/s$/, "");}, u: function u(t) {return void 0 === t;} },y = "en",M = {};M[y] = d;var m = function m(t) {return t instanceof S;},D = function D(t, e, n) {var r;if (!t) return y;if ("string" == typeof t) M[t] && (r = t), e && (M[t] = e, r = t);else {var i = t.name;M[i] = t, r = i;}return !n && r && (y = r), r || !n && y;},v = function v(t, e) {if (m(t)) return t.clone();var n = "object" == typeof e ? e : {};return n.date = t, n.args = arguments, new S(n);},g = l;g.l = D, g.i = m, g.w = function (t, e) {return v(t, { locale: e.$L, utc: e.$u, x: e.$x, $offset: e.$offset });};var S = function () {function d(t) {this.$L = D(t.locale, null, !0), this.parse(t);}var $ = d.prototype;return $.parse = function (t) {this.$d = function (t) {var e = t.date,n = t.utc;if (null === e) return new Date(NaN);if (g.u(e)) return new Date();if (e instanceof Date) return new Date(e);if ("string" == typeof e && !/Z$/i.test(e)) {var r = e.match(h);if (r) {var i = r[2] - 1 || 0,s = (r[7] || "0").substring(0, 3);return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);}}return new Date(e);}(t), this.$x = t.x || {}, this.init();}, $.init = function () {var t = this.$d;this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();}, $.$utils = function () {return g;}, $.isValid = function () {return !("Invalid Date" === this.$d.toString());}, $.isSame = function (t, e) {var n = v(t);return this.startOf(e) <= n && n <= this.endOf(e);}, $.isAfter = function (t, e) {return v(t) < this.startOf(e);}, $.isBefore = function (t, e) {return this.endOf(e) < v(t);}, $.$g = function (t, e, n) {return g.u(t) ? this[e] : this.set(n, t);}, $.unix = function () {return Math.floor(this.valueOf() / 1e3);}, $.valueOf = function () {return this.$d.getTime();}, $.startOf = function (t, a) {var h = this,c = !!g.u(a) || a,d = g.p(t),$ = function $(t, e) {var n = g.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h);return c ? n : n.endOf(i);},l = function l(t, e) {return g.w(h.toDate()[t].apply(h.toDate("s"), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h);},y = this.$W,M = this.$M,m = this.$D,D = "set" + (this.$u ? "UTC" : "");switch (d) {case o:return c ? $(1, 0) : $(31, 11);case u:return c ? $(1, M) : $(0, M + 1);case s:var v = this.$locale().weekStart || 0,S = (y < v ? y + 7 : y) - v;return $(c ? m - S : m + (6 - S), M);case i:case f:return l(D + "Hours", 0);case r:return l(D + "Minutes", 1);case n:return l(D + "Seconds", 2);case e:return l(D + "Milliseconds", 3);default:return this.clone();}}, $.endOf = function (t) {return this.startOf(t, !1);}, $.$set = function (s, a) {var h,c = g.p(s),d = "set" + (this.$u ? "UTC" : ""),$ = (h = {}, h[i] = d + "Date", h[f] = d + "Date", h[u] = d + "Month", h[o] = d + "FullYear", h[r] = d + "Hours", h[n] = d + "Minutes", h[e] = d + "Seconds", h[t] = d + "Milliseconds", h)[c],l = c === i ? this.$D + (a - this.$W) : a;if (c === u || c === o) {var y = this.clone().set(f, 1);y.$d[$](l), y.init(), this.$d = y.set(f, Math.min(this.$D, y.daysInMonth())).$d;} else $ && this.$d[$](l);return this.init(), this;}, $.set = function (t, e) {return this.clone().$set(t, e);}, $.get = function (t) {return this[g.p(t)]();}, $.add = function (t, a) {var f,h = this;t = Number(t);var c = g.p(a),d = function d(e) {var n = v(h);return g.w(n.date(n.date() + Math.round(e * t)), h);};if (c === u) return this.set(u, this.$M + t);if (c === o) return this.set(o, this.$y + t);if (c === i) return d(1);if (c === s) return d(7);var $ = (f = {}, f[n] = 6e4, f[r] = 36e5, f[e] = 1e3, f)[c] || 1,l = this.$d.getTime() + t * $;return g.w(l, this);}, $.subtract = function (t, e) {return this.add(-1 * t, e);}, $.format = function (t) {var e = this;if (!this.isValid()) return "Invalid Date";var n = t || "YYYY-MM-DDTHH:mm:ssZ",r = g.z(this),i = this.$locale(),s = this.$H,u = this.$m,a = this.$M,o = i.weekdays,f = i.months,h = function h(t, r, i, s) {return t && (t[r] || t(e, n)) || i[r].substr(0, s);},d = function d(t) {return g.s(s % 12 || 12, t, "0");},$ = i.meridiem || function (t, e, n) {var r = t < 12 ? "AM" : "PM";return n ? r.toLowerCase() : r;},l = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a + 1, MM: g.s(a + 1, 2, "0"), MMM: h(i.monthsShort, a, f, 3), MMMM: h(f, a), D: this.$D, DD: g.s(this.$D, 2, "0"), d: String(this.$W), dd: h(i.weekdaysMin, this.$W, o, 2), ddd: h(i.weekdaysShort, this.$W, o, 3), dddd: o[this.$W], H: String(s), HH: g.s(s, 2, "0"), h: d(1), hh: d(2), a: $(s, u, !0), A: $(s, u, !1), m: String(u), mm: g.s(u, 2, "0"), s: String(this.$s), ss: g.s(this.$s, 2, "0"), SSS: g.s(this.$ms, 3, "0"), Z: r };return n.replace(c, function (t, e) {return e || l[t] || r.replace(":", "");});}, $.utcOffset = function () {return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);}, $.diff = function (t, f, h) {var c,d = g.p(f),$ = v(t),l = 6e4 * ($.utcOffset() - this.utcOffset()),y = this - $,M = g.m(this, $);return M = (c = {}, c[o] = M / 12, c[u] = M, c[a] = M / 3, c[s] = (y - l) / 6048e5, c[i] = (y - l) / 864e5, c[r] = y / 36e5, c[n] = y / 6e4, c[e] = y / 1e3, c)[d] || y, h ? M : g.a(M);}, $.daysInMonth = function () {return this.endOf(u).$D;}, $.$locale = function () {return M[this.$L];}, $.locale = function (t, e) {if (!t) return this.$L;var n = this.clone(),r = D(t, e, !0);return r && (n.$L = r), n;}, $.clone = function () {return g.w(this.$d, this);}, $.toDate = function () {return new Date(this.valueOf());}, $.toJSON = function () {return this.isValid() ? this.toISOString() : null;}, $.toISOString = function () {return this.$d.toISOString();}, $.toString = function () {return this.$d.toUTCString();}, d;}(),p = S.prototype;return v.prototype = p, [["$ms", t], ["$s", e], ["$m", n], ["$H", r], ["$W", i], ["$M", u], ["$y", o], ["$D", f]].forEach(function (t) {p[t[1]] = function (e) {return this.$g(e, t[0], t[1]);};}), v.extend = function (t, e) {return t.$i || (t(e, S, v), t.$i = !0), v;}, v.locale = D, v.isDayjs = m, v.unix = function (t) {return v(1e3 * t);}, v.en = M[y], v.Ls = M, v.p = {}, v;});
  9907. /***/ }),
  9908. /***/ 409:
  9909. /*!*******************************************************************!*\
  9910. !*** G:/gsxm/lnyk/components/lb-picker/lib/object-support.min.js ***!
  9911. \*******************************************************************/
  9912. /*! no static exports found */
  9913. /***/ (function(module, exports, __webpack_require__) {
  9914. !function (t, n) { true ? module.exports = n() : undefined;}(this, function () {"use strict";return function (t, n, e) {var i = n.prototype,r = function r(t) {var n,r = t.date,o = t.utc,a = {};if (!((n = r) instanceof Date) && !(n instanceof Array) && n instanceof Object) {if (!Object.keys(r).length) return new Date();var u = o ? e.utc() : e();Object.keys(r).forEach(function (t) {var n, e;a[(n = t, e = i.$utils().p(n), "date" === e ? "day" : e)] = r[t];});var c = a.day || (a.year || a.month >= 0 ? 1 : u.date()),d = a.year || u.year(),f = a.month >= 0 ? a.month : a.year || a.day ? 0 : u.month(),s = a.hour || 0,h = a.minute || 0,b = a.second || 0,y = a.millisecond || 0;return o ? new Date(Date.UTC(d, f, c, s, h, b, y)) : new Date(d, f, c, s, h, b, y);}return r;},o = i.parse;i.parse = function (t) {t.date = r.bind(this)(t), o.bind(this)(t);};var a = i.set,u = i.add,c = function c(t, n, e, i) {if (void 0 === i && (i = 1), n instanceof Object) {var r = this;return Object.keys(n).forEach(function (e) {r = t.bind(r)(n[e] * i, e);}), r;}return t.bind(this)(n * i, e);};i.set = function (t, n) {return n = void 0 === n ? t : n, c.bind(this)(function (t, n) {return a.bind(this)(n, t);}, n, t);}, i.add = function (t, n) {return c.bind(this)(u, t, n);}, i.subtract = function (t, n) {return c.bind(this)(u, t, n, -1);};};});
  9915. /***/ }),
  9916. /***/ 410:
  9917. /*!************************************************************************!*\
  9918. !*** G:/gsxm/lnyk/components/lb-picker/lib/custom-parse-format.min.js ***!
  9919. \************************************************************************/
  9920. /*! no static exports found */
  9921. /***/ (function(module, exports, __webpack_require__) {
  9922. !function (t, e) { true ? module.exports = e() : undefined;}(this, function () {"use strict";var t,e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" },n = function n(t, _n) {return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (t, r, i) {var o = i && i.toUpperCase();return r || _n[i] || e[i] || _n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (t, e, n) {return e || n.slice(1);});});},r = /(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i = /\d\d/,o = /\d\d?/,s = /\d*[^\s\d-:/()]+/;var a = function a(t) {return function (e) {this[t] = +e;};},f = [/[+-]\d\d:?(\d\d)?/, function (t) {(this.zone || (this.zone = {})).offset = function (t) {if (!t) return 0;var e = t.match(/([+-]|\d\d)/g),n = 60 * e[1] + (+e[2] || 0);return 0 === n ? 0 : "+" === e[0] ? -n : n;}(t);}],u = function u(e) {var n = t[e];return n && (n.indexOf ? n : n.s.concat(n.f));},h = function h(e, n) {var r,i = t.meridiem;if (i) {for (var o = 1; o <= 24; o += 1) {if (e.indexOf(i(o, 0, n)) > -1) {r = o > 12;break;}}} else r = e === (n ? "pm" : "PM");return r;},d = { A: [s, function (t) {this.afternoon = h(t, !1);}], a: [s, function (t) {this.afternoon = h(t, !0);}], S: [/\d/, function (t) {this.milliseconds = 100 * +t;}], SS: [i, function (t) {this.milliseconds = 10 * +t;}], SSS: [/\d{3}/, function (t) {this.milliseconds = +t;}], s: [o, a("seconds")], ss: [o, a("seconds")], m: [o, a("minutes")], mm: [o, a("minutes")], H: [o, a("hours")], h: [o, a("hours")], HH: [o, a("hours")], hh: [o, a("hours")], D: [o, a("day")], DD: [i, a("day")], Do: [s, function (e) {var n = t.ordinal,r = e.match(/\d+/);if (this.day = r[0], n) for (var i = 1; i <= 31; i += 1) {n(i).replace(/\[|\]/g, "") === e && (this.day = i);}}], M: [o, a("month")], MM: [i, a("month")], MMM: [s, function (t) {var e = u("months"),n = (u("monthsShort") || e.map(function (t) {return t.substr(0, 3);})).indexOf(t) + 1;if (n < 1) throw new Error();this.month = n % 12 || n;}], MMMM: [s, function (t) {var e = u("months").indexOf(t) + 1;if (e < 1) throw new Error();this.month = e % 12 || e;}], Y: [/[+-]?\d+/, a("year")], YY: [i, function (t) {t = +t, this.year = t + (t > 68 ? 1900 : 2e3);}], YYYY: [/\d{4}/, a("year")], Z: f, ZZ: f };var c = function c(e, i, o) {try {var s = function (e) {for (var i = (e = n(e, t && t.formats)).match(r), o = i.length, s = 0; s < o; s += 1) {var a = i[s],f = d[a],u = f && f[0],h = f && f[1];i[s] = h ? { regex: u, parser: h } : a.replace(/^\[|\]$/g, "");}return function (t) {for (var e = {}, n = 0, r = 0; n < o; n += 1) {var s = i[n];if ("string" == typeof s) r += s.length;else {var a = s.regex,f = s.parser,u = t.substr(r),h = a.exec(u)[0];f.call(e, h), t = t.replace(h, "");}}return function (t) {var e = t.afternoon;if (void 0 !== e) {var n = t.hours;e ? n < 12 && (t.hours += 12) : 12 === n && (t.hours = 0), delete t.afternoon;}}(e), e;};}(i)(e),a = s.year,f = s.month,u = s.day,h = s.hours,c = s.minutes,m = s.seconds,l = s.milliseconds,M = s.zone,Y = new Date(),v = u || (a || f ? 1 : Y.getDate()),p = a || Y.getFullYear(),D = 0;a && !f || (D = f > 0 ? f - 1 : Y.getMonth());var y = h || 0,L = c || 0,g = m || 0,$ = l || 0;return M ? new Date(Date.UTC(p, D, v, y, L, g, $ + 60 * M.offset * 1e3)) : o ? new Date(Date.UTC(p, D, v, y, L, g, $)) : new Date(p, D, v, y, L, g, $);} catch (t) {return new Date("");}};return function (e, n, r) {r.p.customParseFormat = !0;var i = n.prototype,o = i.parse;i.parse = function (e) {var n = e.date,i = e.utc,s = e.args;this.$u = i;var a = s[1];if ("string" == typeof a) {var f = !0 === s[2],u = !0 === s[3],h = f || u,d = s[2];u && (d = s[2]), f || (t = d ? r.Ls[d] : this.$locale()), this.$d = c(n, a, i), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), h && n !== this.format(a) && (this.$d = new Date("")), t = void 0;} else if (a instanceof Array) for (var m = a.length, l = 1; l <= m; l += 1) {s[1] = a[l - 1];var M = r.apply(this, s);if (M.isValid()) {this.$d = M.$d, this.$L = M.$L, this.init();break;}l === m && (this.$d = new Date(""));} else o.call(this, e);};};});
  9923. /***/ }),
  9924. /***/ 418:
  9925. /*!**************************************************!*\
  9926. !*** G:/gsxm/lnyk/components/uni-icons/icons.js ***!
  9927. \**************************************************/
  9928. /*! no static exports found */
  9929. /***/ (function(module, exports, __webpack_require__) {
  9930. "use strict";
  9931. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  9932. 'contact': "\uE100",
  9933. 'person': "\uE101",
  9934. 'personadd': "\uE102",
  9935. 'contact-filled': "\uE130",
  9936. 'person-filled': "\uE131",
  9937. 'personadd-filled': "\uE132",
  9938. 'phone': "\uE200",
  9939. 'email': "\uE201",
  9940. 'chatbubble': "\uE202",
  9941. 'chatboxes': "\uE203",
  9942. 'phone-filled': "\uE230",
  9943. 'email-filled': "\uE231",
  9944. 'chatbubble-filled': "\uE232",
  9945. 'chatboxes-filled': "\uE233",
  9946. 'weibo': "\uE260",
  9947. 'weixin': "\uE261",
  9948. 'pengyouquan': "\uE262",
  9949. 'chat': "\uE263",
  9950. 'qq': "\uE264",
  9951. 'videocam': "\uE300",
  9952. 'camera': "\uE301",
  9953. 'mic': "\uE302",
  9954. 'location': "\uE303",
  9955. 'mic-filled': "\uE332",
  9956. 'speech': "\uE332",
  9957. 'location-filled': "\uE333",
  9958. 'micoff': "\uE360",
  9959. 'image': "\uE363",
  9960. 'map': "\uE364",
  9961. 'compose': "\uE400",
  9962. 'trash': "\uE401",
  9963. 'upload': "\uE402",
  9964. 'download': "\uE403",
  9965. 'close': "\uE404",
  9966. 'redo': "\uE405",
  9967. 'undo': "\uE406",
  9968. 'refresh': "\uE407",
  9969. 'star': "\uE408",
  9970. 'plus': "\uE409",
  9971. 'minus': "\uE410",
  9972. 'circle': "\uE411",
  9973. 'checkbox': "\uE411",
  9974. 'close-filled': "\uE434",
  9975. 'clear': "\uE434",
  9976. 'refresh-filled': "\uE437",
  9977. 'star-filled': "\uE438",
  9978. 'plus-filled': "\uE439",
  9979. 'minus-filled': "\uE440",
  9980. 'circle-filled': "\uE441",
  9981. 'checkbox-filled': "\uE442",
  9982. 'closeempty': "\uE460",
  9983. 'refreshempty': "\uE461",
  9984. 'reload': "\uE462",
  9985. 'starhalf': "\uE463",
  9986. 'spinner': "\uE464",
  9987. 'spinner-cycle': "\uE465",
  9988. 'search': "\uE466",
  9989. 'plusempty': "\uE468",
  9990. 'forward': "\uE470",
  9991. 'back': "\uE471",
  9992. 'left-nav': "\uE471",
  9993. 'checkmarkempty': "\uE472",
  9994. 'home': "\uE500",
  9995. 'navigate': "\uE501",
  9996. 'gear': "\uE502",
  9997. 'paperplane': "\uE503",
  9998. 'info': "\uE504",
  9999. 'help': "\uE505",
  10000. 'locked': "\uE506",
  10001. 'more': "\uE507",
  10002. 'flag': "\uE508",
  10003. 'home-filled': "\uE530",
  10004. 'gear-filled': "\uE532",
  10005. 'info-filled': "\uE534",
  10006. 'help-filled': "\uE535",
  10007. 'more-filled': "\uE537",
  10008. 'settings': "\uE560",
  10009. 'list': "\uE562",
  10010. 'bars': "\uE563",
  10011. 'loop': "\uE565",
  10012. 'paperclip': "\uE567",
  10013. 'eye': "\uE568",
  10014. 'arrowup': "\uE580",
  10015. 'arrowdown': "\uE581",
  10016. 'arrowleft': "\uE582",
  10017. 'arrowright': "\uE583",
  10018. 'arrowthinup': "\uE584",
  10019. 'arrowthindown': "\uE585",
  10020. 'arrowthinleft': "\uE586",
  10021. 'arrowthinright': "\uE587",
  10022. 'pulldown': "\uE588",
  10023. 'closefill': "\uE589",
  10024. 'sound': "\uE590",
  10025. 'scan': "\uE612" };exports.default = _default;
  10026. /***/ }),
  10027. /***/ 45:
  10028. /*!*******************************!*\
  10029. !*** G:/gsxm/lnyk/api/set.js ***!
  10030. \*******************************/
  10031. /*! no static exports found */
  10032. /***/ (function(module, exports, __webpack_require__) {
  10033. "use strict";
  10034. Object.defineProperty(exports, "__esModule", { value: true });exports.userEdit = userEdit;exports.logout = logout;exports.updatalogin = updatalogin;exports.updatatran = updatatran;exports.addmsg = addmsg;exports.upload = upload;exports.mymsg = mymsg;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 13));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;}
  10035. // 修改用户信息
  10036. function userEdit(data) {
  10037. return (0, _request.default)({
  10038. url: '/api/user/edit',
  10039. method: 'post',
  10040. data: data });
  10041. }
  10042. //退出登录
  10043. function logout(data) {
  10044. return (0, _request.default)({
  10045. url: '/api/logout',
  10046. method: 'get',
  10047. data: data });
  10048. }
  10049. //修改登录密码
  10050. function updatalogin(data) {
  10051. return (0, _request.default)({
  10052. url: '/api/register/reset',
  10053. method: 'post',
  10054. data: data });
  10055. }
  10056. //修改交易密码
  10057. function updatatran(data) {
  10058. return (0, _request.default)({
  10059. url: '/api/register/tradereset',
  10060. method: 'post',
  10061. data: data });
  10062. }
  10063. function addmsg(data) {
  10064. return (0, _request.default)({
  10065. url: '/api/mine/addmsg',
  10066. method: 'post',
  10067. data: data });
  10068. }
  10069. //上传图片
  10070. function upload(data) {
  10071. return (0, _request.upFilse)({
  10072. url: '/api/upload/image',
  10073. method: 'post',
  10074. data: data });
  10075. }
  10076. //上传图片
  10077. function mymsg(data) {
  10078. return (0, _request.default)({
  10079. url: '/api/mine/mymsg',
  10080. method: 'post',
  10081. data: data });
  10082. }
  10083. /***/ }),
  10084. /***/ 5:
  10085. /*!***********************************!*\
  10086. !*** G:/gsxm/lnyk/store/index.js ***!
  10087. \***********************************/
  10088. /*! no static exports found */
  10089. /***/ (function(module, exports, __webpack_require__) {
  10090. "use strict";
  10091. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  10092. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 6));
  10093. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 7));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10094. _vue.default.use(_vuex.default);
  10095. var store = new _vuex.default.Store({
  10096. state: {
  10097. baseURL: 'http://kp.liuniu946.com', //请求地址配置
  10098. homeURL: 'http://kp.liuniu946.com', //h5页面域名
  10099. urlFile: '/index', //项目部署所在文件夹
  10100. loginInterceptor: false //是否打开强制登录
  10101. },
  10102. mutations: {},
  10103. modules: {
  10104. user: _user.default },
  10105. actions: {} });var _default =
  10106. store;exports.default = _default;
  10107. /***/ }),
  10108. /***/ 54:
  10109. /*!*********************************!*\
  10110. !*** G:/gsxm/lnyk/api/index.js ***!
  10111. \*********************************/
  10112. /*! no static exports found */
  10113. /***/ (function(module, exports, __webpack_require__) {
  10114. "use strict";
  10115. Object.defineProperty(exports, "__esModule", { value: true });exports.loadIndexs = loadIndexs;exports.moneyType = moneyType;exports.article = article;exports.details = details;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10116. // 获取首页信息
  10117. function loadIndexs(data) {
  10118. return (0, _request.default)({
  10119. url: '/api/index',
  10120. method: 'get',
  10121. data: data });
  10122. }
  10123. function moneyType(data) {
  10124. return (0, _request.default)({
  10125. url: '/api/all/money_type',
  10126. method: 'get',
  10127. data: data });
  10128. }
  10129. function article(data, cid) {
  10130. return (0, _request.default)({
  10131. url: '/api/article/list/' + cid,
  10132. method: 'GET',
  10133. data: data });
  10134. }
  10135. function details(data, id) {
  10136. return (0, _request.default)({
  10137. url: '/api/article/details/' + id,
  10138. method: 'GET',
  10139. data: data });
  10140. }
  10141. /***/ }),
  10142. /***/ 6:
  10143. /*!********************************************!*\
  10144. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  10145. \********************************************/
  10146. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  10147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10148. "use strict";
  10149. __webpack_require__.r(__webpack_exports__);
  10150. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  10151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  10152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  10153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  10154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  10155. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  10156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  10157. /*!
  10158. * vuex v3.4.0
  10159. * (c) 2020 Evan You
  10160. * @license MIT
  10161. */
  10162. function applyMixin (Vue) {
  10163. var version = Number(Vue.version.split('.')[0]);
  10164. if (version >= 2) {
  10165. Vue.mixin({ beforeCreate: vuexInit });
  10166. } else {
  10167. // override init and inject vuex init procedure
  10168. // for 1.x backwards compatibility.
  10169. var _init = Vue.prototype._init;
  10170. Vue.prototype._init = function (options) {
  10171. if ( options === void 0 ) options = {};
  10172. options.init = options.init
  10173. ? [vuexInit].concat(options.init)
  10174. : vuexInit;
  10175. _init.call(this, options);
  10176. };
  10177. }
  10178. /**
  10179. * Vuex init hook, injected into each instances init hooks list.
  10180. */
  10181. function vuexInit () {
  10182. var options = this.$options;
  10183. // store injection
  10184. if (options.store) {
  10185. this.$store = typeof options.store === 'function'
  10186. ? options.store()
  10187. : options.store;
  10188. } else if (options.parent && options.parent.$store) {
  10189. this.$store = options.parent.$store;
  10190. }
  10191. }
  10192. }
  10193. var target = typeof window !== 'undefined'
  10194. ? window
  10195. : typeof global !== 'undefined'
  10196. ? global
  10197. : {};
  10198. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10199. function devtoolPlugin (store) {
  10200. if (!devtoolHook) { return }
  10201. store._devtoolHook = devtoolHook;
  10202. devtoolHook.emit('vuex:init', store);
  10203. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10204. store.replaceState(targetState);
  10205. });
  10206. store.subscribe(function (mutation, state) {
  10207. devtoolHook.emit('vuex:mutation', mutation, state);
  10208. }, { prepend: true });
  10209. store.subscribeAction(function (action, state) {
  10210. devtoolHook.emit('vuex:action', action, state);
  10211. }, { prepend: true });
  10212. }
  10213. /**
  10214. * Get the first item that pass the test
  10215. * by second argument function
  10216. *
  10217. * @param {Array} list
  10218. * @param {Function} f
  10219. * @return {*}
  10220. */
  10221. /**
  10222. * forEach for object
  10223. */
  10224. function forEachValue (obj, fn) {
  10225. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10226. }
  10227. function isObject (obj) {
  10228. return obj !== null && typeof obj === 'object'
  10229. }
  10230. function isPromise (val) {
  10231. return val && typeof val.then === 'function'
  10232. }
  10233. function assert (condition, msg) {
  10234. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10235. }
  10236. function partial (fn, arg) {
  10237. return function () {
  10238. return fn(arg)
  10239. }
  10240. }
  10241. // Base data struct for store's module, package with some attribute and method
  10242. var Module = function Module (rawModule, runtime) {
  10243. this.runtime = runtime;
  10244. // Store some children item
  10245. this._children = Object.create(null);
  10246. // Store the origin module object which passed by programmer
  10247. this._rawModule = rawModule;
  10248. var rawState = rawModule.state;
  10249. // Store the origin module's state
  10250. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10251. };
  10252. var prototypeAccessors = { namespaced: { configurable: true } };
  10253. prototypeAccessors.namespaced.get = function () {
  10254. return !!this._rawModule.namespaced
  10255. };
  10256. Module.prototype.addChild = function addChild (key, module) {
  10257. this._children[key] = module;
  10258. };
  10259. Module.prototype.removeChild = function removeChild (key) {
  10260. delete this._children[key];
  10261. };
  10262. Module.prototype.getChild = function getChild (key) {
  10263. return this._children[key]
  10264. };
  10265. Module.prototype.hasChild = function hasChild (key) {
  10266. return key in this._children
  10267. };
  10268. Module.prototype.update = function update (rawModule) {
  10269. this._rawModule.namespaced = rawModule.namespaced;
  10270. if (rawModule.actions) {
  10271. this._rawModule.actions = rawModule.actions;
  10272. }
  10273. if (rawModule.mutations) {
  10274. this._rawModule.mutations = rawModule.mutations;
  10275. }
  10276. if (rawModule.getters) {
  10277. this._rawModule.getters = rawModule.getters;
  10278. }
  10279. };
  10280. Module.prototype.forEachChild = function forEachChild (fn) {
  10281. forEachValue(this._children, fn);
  10282. };
  10283. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10284. if (this._rawModule.getters) {
  10285. forEachValue(this._rawModule.getters, fn);
  10286. }
  10287. };
  10288. Module.prototype.forEachAction = function forEachAction (fn) {
  10289. if (this._rawModule.actions) {
  10290. forEachValue(this._rawModule.actions, fn);
  10291. }
  10292. };
  10293. Module.prototype.forEachMutation = function forEachMutation (fn) {
  10294. if (this._rawModule.mutations) {
  10295. forEachValue(this._rawModule.mutations, fn);
  10296. }
  10297. };
  10298. Object.defineProperties( Module.prototype, prototypeAccessors );
  10299. var ModuleCollection = function ModuleCollection (rawRootModule) {
  10300. // register root module (Vuex.Store options)
  10301. this.register([], rawRootModule, false);
  10302. };
  10303. ModuleCollection.prototype.get = function get (path) {
  10304. return path.reduce(function (module, key) {
  10305. return module.getChild(key)
  10306. }, this.root)
  10307. };
  10308. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  10309. var module = this.root;
  10310. return path.reduce(function (namespace, key) {
  10311. module = module.getChild(key);
  10312. return namespace + (module.namespaced ? key + '/' : '')
  10313. }, '')
  10314. };
  10315. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  10316. update([], this.root, rawRootModule);
  10317. };
  10318. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  10319. var this$1 = this;
  10320. if ( runtime === void 0 ) runtime = true;
  10321. if ((true)) {
  10322. assertRawModule(path, rawModule);
  10323. }
  10324. var newModule = new Module(rawModule, runtime);
  10325. if (path.length === 0) {
  10326. this.root = newModule;
  10327. } else {
  10328. var parent = this.get(path.slice(0, -1));
  10329. parent.addChild(path[path.length - 1], newModule);
  10330. }
  10331. // register nested modules
  10332. if (rawModule.modules) {
  10333. forEachValue(rawModule.modules, function (rawChildModule, key) {
  10334. this$1.register(path.concat(key), rawChildModule, runtime);
  10335. });
  10336. }
  10337. };
  10338. ModuleCollection.prototype.unregister = function unregister (path) {
  10339. var parent = this.get(path.slice(0, -1));
  10340. var key = path[path.length - 1];
  10341. if (!parent.getChild(key).runtime) { return }
  10342. parent.removeChild(key);
  10343. };
  10344. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  10345. var parent = this.get(path.slice(0, -1));
  10346. var key = path[path.length - 1];
  10347. return parent.hasChild(key)
  10348. };
  10349. function update (path, targetModule, newModule) {
  10350. if ((true)) {
  10351. assertRawModule(path, newModule);
  10352. }
  10353. // update target module
  10354. targetModule.update(newModule);
  10355. // update nested modules
  10356. if (newModule.modules) {
  10357. for (var key in newModule.modules) {
  10358. if (!targetModule.getChild(key)) {
  10359. if ((true)) {
  10360. console.warn(
  10361. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  10362. 'manual reload is needed'
  10363. );
  10364. }
  10365. return
  10366. }
  10367. update(
  10368. path.concat(key),
  10369. targetModule.getChild(key),
  10370. newModule.modules[key]
  10371. );
  10372. }
  10373. }
  10374. }
  10375. var functionAssert = {
  10376. assert: function (value) { return typeof value === 'function'; },
  10377. expected: 'function'
  10378. };
  10379. var objectAssert = {
  10380. assert: function (value) { return typeof value === 'function' ||
  10381. (typeof value === 'object' && typeof value.handler === 'function'); },
  10382. expected: 'function or object with "handler" function'
  10383. };
  10384. var assertTypes = {
  10385. getters: functionAssert,
  10386. mutations: functionAssert,
  10387. actions: objectAssert
  10388. };
  10389. function assertRawModule (path, rawModule) {
  10390. Object.keys(assertTypes).forEach(function (key) {
  10391. if (!rawModule[key]) { return }
  10392. var assertOptions = assertTypes[key];
  10393. forEachValue(rawModule[key], function (value, type) {
  10394. assert(
  10395. assertOptions.assert(value),
  10396. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  10397. );
  10398. });
  10399. });
  10400. }
  10401. function makeAssertionMessage (path, key, type, value, expected) {
  10402. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  10403. if (path.length > 0) {
  10404. buf += " in module \"" + (path.join('.')) + "\"";
  10405. }
  10406. buf += " is " + (JSON.stringify(value)) + ".";
  10407. return buf
  10408. }
  10409. var Vue; // bind on install
  10410. var Store = function Store (options) {
  10411. var this$1 = this;
  10412. if ( options === void 0 ) options = {};
  10413. // Auto install if it is not done yet and `window` has `Vue`.
  10414. // To allow users to avoid auto-installation in some cases,
  10415. // this code should be placed here. See #731
  10416. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  10417. install(window.Vue);
  10418. }
  10419. if ((true)) {
  10420. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  10421. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  10422. assert(this instanceof Store, "store must be called with the new operator.");
  10423. }
  10424. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  10425. var strict = options.strict; if ( strict === void 0 ) strict = false;
  10426. // store internal state
  10427. this._committing = false;
  10428. this._actions = Object.create(null);
  10429. this._actionSubscribers = [];
  10430. this._mutations = Object.create(null);
  10431. this._wrappedGetters = Object.create(null);
  10432. this._modules = new ModuleCollection(options);
  10433. this._modulesNamespaceMap = Object.create(null);
  10434. this._subscribers = [];
  10435. this._watcherVM = new Vue();
  10436. this._makeLocalGettersCache = Object.create(null);
  10437. // bind commit and dispatch to self
  10438. var store = this;
  10439. var ref = this;
  10440. var dispatch = ref.dispatch;
  10441. var commit = ref.commit;
  10442. this.dispatch = function boundDispatch (type, payload) {
  10443. return dispatch.call(store, type, payload)
  10444. };
  10445. this.commit = function boundCommit (type, payload, options) {
  10446. return commit.call(store, type, payload, options)
  10447. };
  10448. // strict mode
  10449. this.strict = strict;
  10450. var state = this._modules.root.state;
  10451. // init root module.
  10452. // this also recursively registers all sub-modules
  10453. // and collects all module getters inside this._wrappedGetters
  10454. installModule(this, state, [], this._modules.root);
  10455. // initialize the store vm, which is responsible for the reactivity
  10456. // (also registers _wrappedGetters as computed properties)
  10457. resetStoreVM(this, state);
  10458. // apply plugins
  10459. plugins.forEach(function (plugin) { return plugin(this$1); });
  10460. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  10461. if (useDevtools) {
  10462. devtoolPlugin(this);
  10463. }
  10464. };
  10465. var prototypeAccessors$1 = { state: { configurable: true } };
  10466. prototypeAccessors$1.state.get = function () {
  10467. return this._vm._data.$$state
  10468. };
  10469. prototypeAccessors$1.state.set = function (v) {
  10470. if ((true)) {
  10471. assert(false, "use store.replaceState() to explicit replace store state.");
  10472. }
  10473. };
  10474. Store.prototype.commit = function commit (_type, _payload, _options) {
  10475. var this$1 = this;
  10476. // check object-style commit
  10477. var ref = unifyObjectStyle(_type, _payload, _options);
  10478. var type = ref.type;
  10479. var payload = ref.payload;
  10480. var options = ref.options;
  10481. var mutation = { type: type, payload: payload };
  10482. var entry = this._mutations[type];
  10483. if (!entry) {
  10484. if ((true)) {
  10485. console.error(("[vuex] unknown mutation type: " + type));
  10486. }
  10487. return
  10488. }
  10489. this._withCommit(function () {
  10490. entry.forEach(function commitIterator (handler) {
  10491. handler(payload);
  10492. });
  10493. });
  10494. this._subscribers
  10495. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10496. .forEach(function (sub) { return sub(mutation, this$1.state); });
  10497. if (
  10498. ( true) &&
  10499. options && options.silent
  10500. ) {
  10501. console.warn(
  10502. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  10503. 'Use the filter functionality in the vue-devtools'
  10504. );
  10505. }
  10506. };
  10507. Store.prototype.dispatch = function dispatch (_type, _payload) {
  10508. var this$1 = this;
  10509. // check object-style dispatch
  10510. var ref = unifyObjectStyle(_type, _payload);
  10511. var type = ref.type;
  10512. var payload = ref.payload;
  10513. var action = { type: type, payload: payload };
  10514. var entry = this._actions[type];
  10515. if (!entry) {
  10516. if ((true)) {
  10517. console.error(("[vuex] unknown action type: " + type));
  10518. }
  10519. return
  10520. }
  10521. try {
  10522. this._actionSubscribers
  10523. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10524. .filter(function (sub) { return sub.before; })
  10525. .forEach(function (sub) { return sub.before(action, this$1.state); });
  10526. } catch (e) {
  10527. if ((true)) {
  10528. console.warn("[vuex] error in before action subscribers: ");
  10529. console.error(e);
  10530. }
  10531. }
  10532. var result = entry.length > 1
  10533. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  10534. : entry[0](payload);
  10535. return new Promise(function (resolve, reject) {
  10536. result.then(function (res) {
  10537. try {
  10538. this$1._actionSubscribers
  10539. .filter(function (sub) { return sub.after; })
  10540. .forEach(function (sub) { return sub.after(action, this$1.state); });
  10541. } catch (e) {
  10542. if ((true)) {
  10543. console.warn("[vuex] error in after action subscribers: ");
  10544. console.error(e);
  10545. }
  10546. }
  10547. resolve(res);
  10548. }, function (error) {
  10549. try {
  10550. this$1._actionSubscribers
  10551. .filter(function (sub) { return sub.error; })
  10552. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  10553. } catch (e) {
  10554. if ((true)) {
  10555. console.warn("[vuex] error in error action subscribers: ");
  10556. console.error(e);
  10557. }
  10558. }
  10559. reject(error);
  10560. });
  10561. })
  10562. };
  10563. Store.prototype.subscribe = function subscribe (fn, options) {
  10564. return genericSubscribe(fn, this._subscribers, options)
  10565. };
  10566. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  10567. var subs = typeof fn === 'function' ? { before: fn } : fn;
  10568. return genericSubscribe(subs, this._actionSubscribers, options)
  10569. };
  10570. Store.prototype.watch = function watch (getter, cb, options) {
  10571. var this$1 = this;
  10572. if ((true)) {
  10573. assert(typeof getter === 'function', "store.watch only accepts a function.");
  10574. }
  10575. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  10576. };
  10577. Store.prototype.replaceState = function replaceState (state) {
  10578. var this$1 = this;
  10579. this._withCommit(function () {
  10580. this$1._vm._data.$$state = state;
  10581. });
  10582. };
  10583. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  10584. if ( options === void 0 ) options = {};
  10585. if (typeof path === 'string') { path = [path]; }
  10586. if ((true)) {
  10587. assert(Array.isArray(path), "module path must be a string or an Array.");
  10588. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  10589. }
  10590. this._modules.register(path, rawModule);
  10591. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  10592. // reset store to update getters...
  10593. resetStoreVM(this, this.state);
  10594. };
  10595. Store.prototype.unregisterModule = function unregisterModule (path) {
  10596. var this$1 = this;
  10597. if (typeof path === 'string') { path = [path]; }
  10598. if ((true)) {
  10599. assert(Array.isArray(path), "module path must be a string or an Array.");
  10600. }
  10601. this._modules.unregister(path);
  10602. this._withCommit(function () {
  10603. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  10604. Vue.delete(parentState, path[path.length - 1]);
  10605. });
  10606. resetStore(this);
  10607. };
  10608. Store.prototype.hasModule = function hasModule (path) {
  10609. if (typeof path === 'string') { path = [path]; }
  10610. if ((true)) {
  10611. assert(Array.isArray(path), "module path must be a string or an Array.");
  10612. }
  10613. return this._modules.isRegistered(path)
  10614. };
  10615. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  10616. this._modules.update(newOptions);
  10617. resetStore(this, true);
  10618. };
  10619. Store.prototype._withCommit = function _withCommit (fn) {
  10620. var committing = this._committing;
  10621. this._committing = true;
  10622. fn();
  10623. this._committing = committing;
  10624. };
  10625. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  10626. function genericSubscribe (fn, subs, options) {
  10627. if (subs.indexOf(fn) < 0) {
  10628. options && options.prepend
  10629. ? subs.unshift(fn)
  10630. : subs.push(fn);
  10631. }
  10632. return function () {
  10633. var i = subs.indexOf(fn);
  10634. if (i > -1) {
  10635. subs.splice(i, 1);
  10636. }
  10637. }
  10638. }
  10639. function resetStore (store, hot) {
  10640. store._actions = Object.create(null);
  10641. store._mutations = Object.create(null);
  10642. store._wrappedGetters = Object.create(null);
  10643. store._modulesNamespaceMap = Object.create(null);
  10644. var state = store.state;
  10645. // init all modules
  10646. installModule(store, state, [], store._modules.root, true);
  10647. // reset vm
  10648. resetStoreVM(store, state, hot);
  10649. }
  10650. function resetStoreVM (store, state, hot) {
  10651. var oldVm = store._vm;
  10652. // bind store public getters
  10653. store.getters = {};
  10654. // reset local getters cache
  10655. store._makeLocalGettersCache = Object.create(null);
  10656. var wrappedGetters = store._wrappedGetters;
  10657. var computed = {};
  10658. forEachValue(wrappedGetters, function (fn, key) {
  10659. // use computed to leverage its lazy-caching mechanism
  10660. // direct inline function use will lead to closure preserving oldVm.
  10661. // using partial to return function with only arguments preserved in closure environment.
  10662. computed[key] = partial(fn, store);
  10663. Object.defineProperty(store.getters, key, {
  10664. get: function () { return store._vm[key]; },
  10665. enumerable: true // for local getters
  10666. });
  10667. });
  10668. // use a Vue instance to store the state tree
  10669. // suppress warnings just in case the user has added
  10670. // some funky global mixins
  10671. var silent = Vue.config.silent;
  10672. Vue.config.silent = true;
  10673. store._vm = new Vue({
  10674. data: {
  10675. $$state: state
  10676. },
  10677. computed: computed
  10678. });
  10679. Vue.config.silent = silent;
  10680. // enable strict mode for new vm
  10681. if (store.strict) {
  10682. enableStrictMode(store);
  10683. }
  10684. if (oldVm) {
  10685. if (hot) {
  10686. // dispatch changes in all subscribed watchers
  10687. // to force getter re-evaluation for hot reloading.
  10688. store._withCommit(function () {
  10689. oldVm._data.$$state = null;
  10690. });
  10691. }
  10692. Vue.nextTick(function () { return oldVm.$destroy(); });
  10693. }
  10694. }
  10695. function installModule (store, rootState, path, module, hot) {
  10696. var isRoot = !path.length;
  10697. var namespace = store._modules.getNamespace(path);
  10698. // register in namespace map
  10699. if (module.namespaced) {
  10700. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  10701. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  10702. }
  10703. store._modulesNamespaceMap[namespace] = module;
  10704. }
  10705. // set state
  10706. if (!isRoot && !hot) {
  10707. var parentState = getNestedState(rootState, path.slice(0, -1));
  10708. var moduleName = path[path.length - 1];
  10709. store._withCommit(function () {
  10710. if ((true)) {
  10711. if (moduleName in parentState) {
  10712. console.warn(
  10713. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  10714. );
  10715. }
  10716. }
  10717. Vue.set(parentState, moduleName, module.state);
  10718. });
  10719. }
  10720. var local = module.context = makeLocalContext(store, namespace, path);
  10721. module.forEachMutation(function (mutation, key) {
  10722. var namespacedType = namespace + key;
  10723. registerMutation(store, namespacedType, mutation, local);
  10724. });
  10725. module.forEachAction(function (action, key) {
  10726. var type = action.root ? key : namespace + key;
  10727. var handler = action.handler || action;
  10728. registerAction(store, type, handler, local);
  10729. });
  10730. module.forEachGetter(function (getter, key) {
  10731. var namespacedType = namespace + key;
  10732. registerGetter(store, namespacedType, getter, local);
  10733. });
  10734. module.forEachChild(function (child, key) {
  10735. installModule(store, rootState, path.concat(key), child, hot);
  10736. });
  10737. }
  10738. /**
  10739. * make localized dispatch, commit, getters and state
  10740. * if there is no namespace, just use root ones
  10741. */
  10742. function makeLocalContext (store, namespace, path) {
  10743. var noNamespace = namespace === '';
  10744. var local = {
  10745. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  10746. var args = unifyObjectStyle(_type, _payload, _options);
  10747. var payload = args.payload;
  10748. var options = args.options;
  10749. var type = args.type;
  10750. if (!options || !options.root) {
  10751. type = namespace + type;
  10752. if (( true) && !store._actions[type]) {
  10753. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  10754. return
  10755. }
  10756. }
  10757. return store.dispatch(type, payload)
  10758. },
  10759. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  10760. var args = unifyObjectStyle(_type, _payload, _options);
  10761. var payload = args.payload;
  10762. var options = args.options;
  10763. var type = args.type;
  10764. if (!options || !options.root) {
  10765. type = namespace + type;
  10766. if (( true) && !store._mutations[type]) {
  10767. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  10768. return
  10769. }
  10770. }
  10771. store.commit(type, payload, options);
  10772. }
  10773. };
  10774. // getters and state object must be gotten lazily
  10775. // because they will be changed by vm update
  10776. Object.defineProperties(local, {
  10777. getters: {
  10778. get: noNamespace
  10779. ? function () { return store.getters; }
  10780. : function () { return makeLocalGetters(store, namespace); }
  10781. },
  10782. state: {
  10783. get: function () { return getNestedState(store.state, path); }
  10784. }
  10785. });
  10786. return local
  10787. }
  10788. function makeLocalGetters (store, namespace) {
  10789. if (!store._makeLocalGettersCache[namespace]) {
  10790. var gettersProxy = {};
  10791. var splitPos = namespace.length;
  10792. Object.keys(store.getters).forEach(function (type) {
  10793. // skip if the target getter is not match this namespace
  10794. if (type.slice(0, splitPos) !== namespace) { return }
  10795. // extract local getter type
  10796. var localType = type.slice(splitPos);
  10797. // Add a port to the getters proxy.
  10798. // Define as getter property because
  10799. // we do not want to evaluate the getters in this time.
  10800. Object.defineProperty(gettersProxy, localType, {
  10801. get: function () { return store.getters[type]; },
  10802. enumerable: true
  10803. });
  10804. });
  10805. store._makeLocalGettersCache[namespace] = gettersProxy;
  10806. }
  10807. return store._makeLocalGettersCache[namespace]
  10808. }
  10809. function registerMutation (store, type, handler, local) {
  10810. var entry = store._mutations[type] || (store._mutations[type] = []);
  10811. entry.push(function wrappedMutationHandler (payload) {
  10812. handler.call(store, local.state, payload);
  10813. });
  10814. }
  10815. function registerAction (store, type, handler, local) {
  10816. var entry = store._actions[type] || (store._actions[type] = []);
  10817. entry.push(function wrappedActionHandler (payload) {
  10818. var res = handler.call(store, {
  10819. dispatch: local.dispatch,
  10820. commit: local.commit,
  10821. getters: local.getters,
  10822. state: local.state,
  10823. rootGetters: store.getters,
  10824. rootState: store.state
  10825. }, payload);
  10826. if (!isPromise(res)) {
  10827. res = Promise.resolve(res);
  10828. }
  10829. if (store._devtoolHook) {
  10830. return res.catch(function (err) {
  10831. store._devtoolHook.emit('vuex:error', err);
  10832. throw err
  10833. })
  10834. } else {
  10835. return res
  10836. }
  10837. });
  10838. }
  10839. function registerGetter (store, type, rawGetter, local) {
  10840. if (store._wrappedGetters[type]) {
  10841. if ((true)) {
  10842. console.error(("[vuex] duplicate getter key: " + type));
  10843. }
  10844. return
  10845. }
  10846. store._wrappedGetters[type] = function wrappedGetter (store) {
  10847. return rawGetter(
  10848. local.state, // local state
  10849. local.getters, // local getters
  10850. store.state, // root state
  10851. store.getters // root getters
  10852. )
  10853. };
  10854. }
  10855. function enableStrictMode (store) {
  10856. store._vm.$watch(function () { return this._data.$$state }, function () {
  10857. if ((true)) {
  10858. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  10859. }
  10860. }, { deep: true, sync: true });
  10861. }
  10862. function getNestedState (state, path) {
  10863. return path.reduce(function (state, key) { return state[key]; }, state)
  10864. }
  10865. function unifyObjectStyle (type, payload, options) {
  10866. if (isObject(type) && type.type) {
  10867. options = payload;
  10868. payload = type;
  10869. type = type.type;
  10870. }
  10871. if ((true)) {
  10872. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10873. }
  10874. return { type: type, payload: payload, options: options }
  10875. }
  10876. function install (_Vue) {
  10877. if (Vue && _Vue === Vue) {
  10878. if ((true)) {
  10879. console.error(
  10880. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10881. );
  10882. }
  10883. return
  10884. }
  10885. Vue = _Vue;
  10886. applyMixin(Vue);
  10887. }
  10888. /**
  10889. * Reduce the code which written in Vue.js for getting the state.
  10890. * @param {String} [namespace] - Module's namespace
  10891. * @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.
  10892. * @param {Object}
  10893. */
  10894. var mapState = normalizeNamespace(function (namespace, states) {
  10895. var res = {};
  10896. if (( true) && !isValidMap(states)) {
  10897. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  10898. }
  10899. normalizeMap(states).forEach(function (ref) {
  10900. var key = ref.key;
  10901. var val = ref.val;
  10902. res[key] = function mappedState () {
  10903. var state = this.$store.state;
  10904. var getters = this.$store.getters;
  10905. if (namespace) {
  10906. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  10907. if (!module) {
  10908. return
  10909. }
  10910. state = module.context.state;
  10911. getters = module.context.getters;
  10912. }
  10913. return typeof val === 'function'
  10914. ? val.call(this, state, getters)
  10915. : state[val]
  10916. };
  10917. // mark vuex getter for devtools
  10918. res[key].vuex = true;
  10919. });
  10920. return res
  10921. });
  10922. /**
  10923. * Reduce the code which written in Vue.js for committing the mutation
  10924. * @param {String} [namespace] - Module's namespace
  10925. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10926. * @return {Object}
  10927. */
  10928. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  10929. var res = {};
  10930. if (( true) && !isValidMap(mutations)) {
  10931. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  10932. }
  10933. normalizeMap(mutations).forEach(function (ref) {
  10934. var key = ref.key;
  10935. var val = ref.val;
  10936. res[key] = function mappedMutation () {
  10937. var args = [], len = arguments.length;
  10938. while ( len-- ) args[ len ] = arguments[ len ];
  10939. // Get the commit method from store
  10940. var commit = this.$store.commit;
  10941. if (namespace) {
  10942. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10943. if (!module) {
  10944. return
  10945. }
  10946. commit = module.context.commit;
  10947. }
  10948. return typeof val === 'function'
  10949. ? val.apply(this, [commit].concat(args))
  10950. : commit.apply(this.$store, [val].concat(args))
  10951. };
  10952. });
  10953. return res
  10954. });
  10955. /**
  10956. * Reduce the code which written in Vue.js for getting the getters
  10957. * @param {String} [namespace] - Module's namespace
  10958. * @param {Object|Array} getters
  10959. * @return {Object}
  10960. */
  10961. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10962. var res = {};
  10963. if (( true) && !isValidMap(getters)) {
  10964. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10965. }
  10966. normalizeMap(getters).forEach(function (ref) {
  10967. var key = ref.key;
  10968. var val = ref.val;
  10969. // The namespace has been mutated by normalizeNamespace
  10970. val = namespace + val;
  10971. res[key] = function mappedGetter () {
  10972. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10973. return
  10974. }
  10975. if (( true) && !(val in this.$store.getters)) {
  10976. console.error(("[vuex] unknown getter: " + val));
  10977. return
  10978. }
  10979. return this.$store.getters[val]
  10980. };
  10981. // mark vuex getter for devtools
  10982. res[key].vuex = true;
  10983. });
  10984. return res
  10985. });
  10986. /**
  10987. * Reduce the code which written in Vue.js for dispatch the action
  10988. * @param {String} [namespace] - Module's namespace
  10989. * @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.
  10990. * @return {Object}
  10991. */
  10992. var mapActions = normalizeNamespace(function (namespace, actions) {
  10993. var res = {};
  10994. if (( true) && !isValidMap(actions)) {
  10995. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10996. }
  10997. normalizeMap(actions).forEach(function (ref) {
  10998. var key = ref.key;
  10999. var val = ref.val;
  11000. res[key] = function mappedAction () {
  11001. var args = [], len = arguments.length;
  11002. while ( len-- ) args[ len ] = arguments[ len ];
  11003. // get dispatch function from store
  11004. var dispatch = this.$store.dispatch;
  11005. if (namespace) {
  11006. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  11007. if (!module) {
  11008. return
  11009. }
  11010. dispatch = module.context.dispatch;
  11011. }
  11012. return typeof val === 'function'
  11013. ? val.apply(this, [dispatch].concat(args))
  11014. : dispatch.apply(this.$store, [val].concat(args))
  11015. };
  11016. });
  11017. return res
  11018. });
  11019. /**
  11020. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  11021. * @param {String} namespace
  11022. * @return {Object}
  11023. */
  11024. var createNamespacedHelpers = function (namespace) { return ({
  11025. mapState: mapState.bind(null, namespace),
  11026. mapGetters: mapGetters.bind(null, namespace),
  11027. mapMutations: mapMutations.bind(null, namespace),
  11028. mapActions: mapActions.bind(null, namespace)
  11029. }); };
  11030. /**
  11031. * Normalize the map
  11032. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  11033. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  11034. * @param {Array|Object} map
  11035. * @return {Object}
  11036. */
  11037. function normalizeMap (map) {
  11038. if (!isValidMap(map)) {
  11039. return []
  11040. }
  11041. return Array.isArray(map)
  11042. ? map.map(function (key) { return ({ key: key, val: key }); })
  11043. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  11044. }
  11045. /**
  11046. * Validate whether given map is valid or not
  11047. * @param {*} map
  11048. * @return {Boolean}
  11049. */
  11050. function isValidMap (map) {
  11051. return Array.isArray(map) || isObject(map)
  11052. }
  11053. /**
  11054. * 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.
  11055. * @param {Function} fn
  11056. * @return {Function}
  11057. */
  11058. function normalizeNamespace (fn) {
  11059. return function (namespace, map) {
  11060. if (typeof namespace !== 'string') {
  11061. map = namespace;
  11062. namespace = '';
  11063. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  11064. namespace += '/';
  11065. }
  11066. return fn(namespace, map)
  11067. }
  11068. }
  11069. /**
  11070. * Search a special module from store by namespace. if module not exist, print error message.
  11071. * @param {Object} store
  11072. * @param {String} helper
  11073. * @param {String} namespace
  11074. * @return {Object}
  11075. */
  11076. function getModuleByNamespace (store, helper, namespace) {
  11077. var module = store._modulesNamespaceMap[namespace];
  11078. if (( true) && !module) {
  11079. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  11080. }
  11081. return module
  11082. }
  11083. var index = {
  11084. Store: Store,
  11085. install: install,
  11086. version: '3.4.0',
  11087. mapState: mapState,
  11088. mapMutations: mapMutations,
  11089. mapGetters: mapGetters,
  11090. mapActions: mapActions,
  11091. createNamespacedHelpers: createNamespacedHelpers
  11092. };
  11093. /* harmony default export */ __webpack_exports__["default"] = (index);
  11094. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  11095. /***/ }),
  11096. /***/ 7:
  11097. /*!****************************************!*\
  11098. !*** G:/gsxm/lnyk/store/model/user.js ***!
  11099. \****************************************/
  11100. /*! no static exports found */
  11101. /***/ (function(module, exports, __webpack_require__) {
  11102. "use strict";
  11103. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  11104. userInfo: {}, //用户信息
  11105. hasLogin: false //是否登录
  11106. };
  11107. var mutations = {
  11108. // 登录
  11109. login: function login(state) {
  11110. state.hasLogin = true;
  11111. },
  11112. // 退出登录
  11113. logout: function logout(state, provider) {
  11114. state.hasLogin = false;
  11115. // 清除缓存用户信息
  11116. uni.removeStorage({
  11117. key: 'userInfo' });
  11118. // 清除缓存token
  11119. uni.removeStorage({
  11120. key: 'token' });
  11121. },
  11122. // 保存用户信息
  11123. setUserInfo: function setUserInfo(state, provider) {
  11124. state.userInfo = provider;
  11125. uni.setStorage({ //缓存用户登陆状态
  11126. key: 'userInfo',
  11127. data: provider });
  11128. } };
  11129. var getters = {};var _default =
  11130. {
  11131. namespaced: true,
  11132. state: state,
  11133. mutations: mutations,
  11134. getters: getters };exports.default = _default;
  11135. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11136. /***/ }),
  11137. /***/ 95:
  11138. /*!*********************************************************!*\
  11139. !*** G:/gsxm/lnyk/components/Sansnn-uQRCode/uqrcode.js ***!
  11140. \*********************************************************/
  11141. /*! no static exports found */
  11142. /***/ (function(module, exports, __webpack_require__) {
  11143. "use strict";
  11144. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; //---------------------------------------------------------------------
  11145. // github https://github.com/Sansnn/uQRCode
  11146. //---------------------------------------------------------------------
  11147. var uQRCode = {};
  11148. (function () {
  11149. //---------------------------------------------------------------------
  11150. // QRCode for JavaScript
  11151. //
  11152. // Copyright (c) 2009 Kazuhiko Arase
  11153. //
  11154. // URL: http://www.d-project.com/
  11155. //
  11156. // Licensed under the MIT license:
  11157. // http://www.opensource.org/licenses/mit-license.php
  11158. //
  11159. // The word "QR Code" is registered trademark of
  11160. // DENSO WAVE INCORPORATED
  11161. // http://www.denso-wave.com/qrcode/faqpatent-e.html
  11162. //
  11163. //---------------------------------------------------------------------
  11164. //---------------------------------------------------------------------
  11165. // QR8bitByte
  11166. //---------------------------------------------------------------------
  11167. function QR8bitByte(data) {
  11168. this.mode = QRMode.MODE_8BIT_BYTE;
  11169. this.data = data;
  11170. }
  11171. QR8bitByte.prototype = {
  11172. getLength: function getLength(buffer) {
  11173. return this.data.length;
  11174. },
  11175. write: function write(buffer) {
  11176. for (var i = 0; i < this.data.length; i++) {
  11177. // not JIS ...
  11178. buffer.put(this.data.charCodeAt(i), 8);
  11179. }
  11180. } };
  11181. //---------------------------------------------------------------------
  11182. // QRCode
  11183. //---------------------------------------------------------------------
  11184. function QRCode(typeNumber, errorCorrectLevel) {
  11185. this.typeNumber = typeNumber;
  11186. this.errorCorrectLevel = errorCorrectLevel;
  11187. this.modules = null;
  11188. this.moduleCount = 0;
  11189. this.dataCache = null;
  11190. this.dataList = new Array();
  11191. }
  11192. QRCode.prototype = {
  11193. addData: function addData(data) {
  11194. var newData = new QR8bitByte(data);
  11195. this.dataList.push(newData);
  11196. this.dataCache = null;
  11197. },
  11198. isDark: function isDark(row, col) {
  11199. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  11200. throw new Error(row + "," + col);
  11201. }
  11202. return this.modules[row][col];
  11203. },
  11204. getModuleCount: function getModuleCount() {
  11205. return this.moduleCount;
  11206. },
  11207. make: function make() {
  11208. // Calculate automatically typeNumber if provided is < 1
  11209. if (this.typeNumber < 1) {
  11210. var typeNumber = 1;
  11211. for (typeNumber = 1; typeNumber < 40; typeNumber++) {
  11212. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
  11213. var buffer = new QRBitBuffer();
  11214. var totalDataCount = 0;
  11215. for (var i = 0; i < rsBlocks.length; i++) {
  11216. totalDataCount += rsBlocks[i].dataCount;
  11217. }
  11218. for (var i = 0; i < this.dataList.length; i++) {
  11219. var data = this.dataList[i];
  11220. buffer.put(data.mode, 4);
  11221. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  11222. data.write(buffer);
  11223. }
  11224. if (buffer.getLengthInBits() <= totalDataCount * 8)
  11225. break;
  11226. }
  11227. this.typeNumber = typeNumber;
  11228. }
  11229. this.makeImpl(false, this.getBestMaskPattern());
  11230. },
  11231. makeImpl: function makeImpl(test, maskPattern) {
  11232. this.moduleCount = this.typeNumber * 4 + 17;
  11233. this.modules = new Array(this.moduleCount);
  11234. for (var row = 0; row < this.moduleCount; row++) {
  11235. this.modules[row] = new Array(this.moduleCount);
  11236. for (var col = 0; col < this.moduleCount; col++) {
  11237. this.modules[row][col] = null; //(col + row) % 3;
  11238. }
  11239. }
  11240. this.setupPositionProbePattern(0, 0);
  11241. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  11242. this.setupPositionProbePattern(0, this.moduleCount - 7);
  11243. this.setupPositionAdjustPattern();
  11244. this.setupTimingPattern();
  11245. this.setupTypeInfo(test, maskPattern);
  11246. if (this.typeNumber >= 7) {
  11247. this.setupTypeNumber(test);
  11248. }
  11249. if (this.dataCache == null) {
  11250. this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  11251. }
  11252. this.mapData(this.dataCache, maskPattern);
  11253. },
  11254. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  11255. for (var r = -1; r <= 7; r++) {
  11256. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  11257. for (var c = -1; c <= 7; c++) {
  11258. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  11259. if (0 <= r && r <= 6 && (c == 0 || c == 6) ||
  11260. 0 <= c && c <= 6 && (r == 0 || r == 6) ||
  11261. 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  11262. this.modules[row + r][col + c] = true;
  11263. } else {
  11264. this.modules[row + r][col + c] = false;
  11265. }
  11266. }
  11267. }
  11268. },
  11269. getBestMaskPattern: function getBestMaskPattern() {
  11270. var minLostPoint = 0;
  11271. var pattern = 0;
  11272. for (var i = 0; i < 8; i++) {
  11273. this.makeImpl(true, i);
  11274. var lostPoint = QRUtil.getLostPoint(this);
  11275. if (i == 0 || minLostPoint > lostPoint) {
  11276. minLostPoint = lostPoint;
  11277. pattern = i;
  11278. }
  11279. }
  11280. return pattern;
  11281. },
  11282. createMovieClip: function createMovieClip(target_mc, instance_name, depth) {
  11283. var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
  11284. var cs = 1;
  11285. this.make();
  11286. for (var row = 0; row < this.modules.length; row++) {
  11287. var y = row * cs;
  11288. for (var col = 0; col < this.modules[row].length; col++) {
  11289. var x = col * cs;
  11290. var dark = this.modules[row][col];
  11291. if (dark) {
  11292. qr_mc.beginFill(0, 100);
  11293. qr_mc.moveTo(x, y);
  11294. qr_mc.lineTo(x + cs, y);
  11295. qr_mc.lineTo(x + cs, y + cs);
  11296. qr_mc.lineTo(x, y + cs);
  11297. qr_mc.endFill();
  11298. }
  11299. }
  11300. }
  11301. return qr_mc;
  11302. },
  11303. setupTimingPattern: function setupTimingPattern() {
  11304. for (var r = 8; r < this.moduleCount - 8; r++) {
  11305. if (this.modules[r][6] != null) {
  11306. continue;
  11307. }
  11308. this.modules[r][6] = r % 2 == 0;
  11309. }
  11310. for (var c = 8; c < this.moduleCount - 8; c++) {
  11311. if (this.modules[6][c] != null) {
  11312. continue;
  11313. }
  11314. this.modules[6][c] = c % 2 == 0;
  11315. }
  11316. },
  11317. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  11318. var pos = QRUtil.getPatternPosition(this.typeNumber);
  11319. for (var i = 0; i < pos.length; i++) {
  11320. for (var j = 0; j < pos.length; j++) {
  11321. var row = pos[i];
  11322. var col = pos[j];
  11323. if (this.modules[row][col] != null) {
  11324. continue;
  11325. }
  11326. for (var r = -2; r <= 2; r++) {
  11327. for (var c = -2; c <= 2; c++) {
  11328. if (r == -2 || r == 2 || c == -2 || c == 2 ||
  11329. r == 0 && c == 0) {
  11330. this.modules[row + r][col + c] = true;
  11331. } else {
  11332. this.modules[row + r][col + c] = false;
  11333. }
  11334. }
  11335. }
  11336. }
  11337. }
  11338. },
  11339. setupTypeNumber: function setupTypeNumber(test) {
  11340. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  11341. for (var i = 0; i < 18; i++) {
  11342. var mod = !test && (bits >> i & 1) == 1;
  11343. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  11344. }
  11345. for (var i = 0; i < 18; i++) {
  11346. var mod = !test && (bits >> i & 1) == 1;
  11347. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  11348. }
  11349. },
  11350. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  11351. var data = this.errorCorrectLevel << 3 | maskPattern;
  11352. var bits = QRUtil.getBCHTypeInfo(data);
  11353. // vertical
  11354. for (var i = 0; i < 15; i++) {
  11355. var mod = !test && (bits >> i & 1) == 1;
  11356. if (i < 6) {
  11357. this.modules[i][8] = mod;
  11358. } else if (i < 8) {
  11359. this.modules[i + 1][8] = mod;
  11360. } else {
  11361. this.modules[this.moduleCount - 15 + i][8] = mod;
  11362. }
  11363. }
  11364. // horizontal
  11365. for (var i = 0; i < 15; i++) {
  11366. var mod = !test && (bits >> i & 1) == 1;
  11367. if (i < 8) {
  11368. this.modules[8][this.moduleCount - i - 1] = mod;
  11369. } else if (i < 9) {
  11370. this.modules[8][15 - i - 1 + 1] = mod;
  11371. } else {
  11372. this.modules[8][15 - i - 1] = mod;
  11373. }
  11374. }
  11375. // fixed module
  11376. this.modules[this.moduleCount - 8][8] = !test;
  11377. },
  11378. mapData: function mapData(data, maskPattern) {
  11379. var inc = -1;
  11380. var row = this.moduleCount - 1;
  11381. var bitIndex = 7;
  11382. var byteIndex = 0;
  11383. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  11384. if (col == 6) col--;
  11385. while (true) {
  11386. for (var c = 0; c < 2; c++) {
  11387. if (this.modules[row][col - c] == null) {
  11388. var dark = false;
  11389. if (byteIndex < data.length) {
  11390. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  11391. }
  11392. var mask = QRUtil.getMask(maskPattern, row, col - c);
  11393. if (mask) {
  11394. dark = !dark;
  11395. }
  11396. this.modules[row][col - c] = dark;
  11397. bitIndex--;
  11398. if (bitIndex == -1) {
  11399. byteIndex++;
  11400. bitIndex = 7;
  11401. }
  11402. }
  11403. }
  11404. row += inc;
  11405. if (row < 0 || this.moduleCount <= row) {
  11406. row -= inc;
  11407. inc = -inc;
  11408. break;
  11409. }
  11410. }
  11411. }
  11412. } };
  11413. QRCode.PAD0 = 0xEC;
  11414. QRCode.PAD1 = 0x11;
  11415. QRCode.createData = function (typeNumber, errorCorrectLevel, dataList) {
  11416. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
  11417. var buffer = new QRBitBuffer();
  11418. for (var i = 0; i < dataList.length; i++) {
  11419. var data = dataList[i];
  11420. buffer.put(data.mode, 4);
  11421. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  11422. data.write(buffer);
  11423. }
  11424. // calc num max data.
  11425. var totalDataCount = 0;
  11426. for (var i = 0; i < rsBlocks.length; i++) {
  11427. totalDataCount += rsBlocks[i].dataCount;
  11428. }
  11429. if (buffer.getLengthInBits() > totalDataCount * 8) {
  11430. throw new Error("code length overflow. (" +
  11431. buffer.getLengthInBits() +
  11432. ">" +
  11433. totalDataCount * 8 +
  11434. ")");
  11435. }
  11436. // end code
  11437. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  11438. buffer.put(0, 4);
  11439. }
  11440. // padding
  11441. while (buffer.getLengthInBits() % 8 != 0) {
  11442. buffer.putBit(false);
  11443. }
  11444. // padding
  11445. while (true) {
  11446. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  11447. break;
  11448. }
  11449. buffer.put(QRCode.PAD0, 8);
  11450. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  11451. break;
  11452. }
  11453. buffer.put(QRCode.PAD1, 8);
  11454. }
  11455. return QRCode.createBytes(buffer, rsBlocks);
  11456. };
  11457. QRCode.createBytes = function (buffer, rsBlocks) {
  11458. var offset = 0;
  11459. var maxDcCount = 0;
  11460. var maxEcCount = 0;
  11461. var dcdata = new Array(rsBlocks.length);
  11462. var ecdata = new Array(rsBlocks.length);
  11463. for (var r = 0; r < rsBlocks.length; r++) {
  11464. var dcCount = rsBlocks[r].dataCount;
  11465. var ecCount = rsBlocks[r].totalCount - dcCount;
  11466. maxDcCount = Math.max(maxDcCount, dcCount);
  11467. maxEcCount = Math.max(maxEcCount, ecCount);
  11468. dcdata[r] = new Array(dcCount);
  11469. for (var i = 0; i < dcdata[r].length; i++) {
  11470. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  11471. }
  11472. offset += dcCount;
  11473. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  11474. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  11475. var modPoly = rawPoly.mod(rsPoly);
  11476. ecdata[r] = new Array(rsPoly.getLength() - 1);
  11477. for (var i = 0; i < ecdata[r].length; i++) {
  11478. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  11479. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  11480. }
  11481. }
  11482. var totalCodeCount = 0;
  11483. for (var i = 0; i < rsBlocks.length; i++) {
  11484. totalCodeCount += rsBlocks[i].totalCount;
  11485. }
  11486. var data = new Array(totalCodeCount);
  11487. var index = 0;
  11488. for (var i = 0; i < maxDcCount; i++) {
  11489. for (var r = 0; r < rsBlocks.length; r++) {
  11490. if (i < dcdata[r].length) {
  11491. data[index++] = dcdata[r][i];
  11492. }
  11493. }
  11494. }
  11495. for (var i = 0; i < maxEcCount; i++) {
  11496. for (var r = 0; r < rsBlocks.length; r++) {
  11497. if (i < ecdata[r].length) {
  11498. data[index++] = ecdata[r][i];
  11499. }
  11500. }
  11501. }
  11502. return data;
  11503. };
  11504. //---------------------------------------------------------------------
  11505. // QRMode
  11506. //---------------------------------------------------------------------
  11507. var QRMode = {
  11508. MODE_NUMBER: 1 << 0,
  11509. MODE_ALPHA_NUM: 1 << 1,
  11510. MODE_8BIT_BYTE: 1 << 2,
  11511. MODE_KANJI: 1 << 3 };
  11512. //---------------------------------------------------------------------
  11513. // QRErrorCorrectLevel
  11514. //---------------------------------------------------------------------
  11515. var QRErrorCorrectLevel = {
  11516. L: 1,
  11517. M: 0,
  11518. Q: 3,
  11519. H: 2 };
  11520. //---------------------------------------------------------------------
  11521. // QRMaskPattern
  11522. //---------------------------------------------------------------------
  11523. var QRMaskPattern = {
  11524. PATTERN000: 0,
  11525. PATTERN001: 1,
  11526. PATTERN010: 2,
  11527. PATTERN011: 3,
  11528. PATTERN100: 4,
  11529. PATTERN101: 5,
  11530. PATTERN110: 6,
  11531. PATTERN111: 7 };
  11532. //---------------------------------------------------------------------
  11533. // QRUtil
  11534. //---------------------------------------------------------------------
  11535. var QRUtil = {
  11536. PATTERN_POSITION_TABLE: [
  11537. [],
  11538. [6, 18],
  11539. [6, 22],
  11540. [6, 26],
  11541. [6, 30],
  11542. [6, 34],
  11543. [6, 22, 38],
  11544. [6, 24, 42],
  11545. [6, 26, 46],
  11546. [6, 28, 50],
  11547. [6, 30, 54],
  11548. [6, 32, 58],
  11549. [6, 34, 62],
  11550. [6, 26, 46, 66],
  11551. [6, 26, 48, 70],
  11552. [6, 26, 50, 74],
  11553. [6, 30, 54, 78],
  11554. [6, 30, 56, 82],
  11555. [6, 30, 58, 86],
  11556. [6, 34, 62, 90],
  11557. [6, 28, 50, 72, 94],
  11558. [6, 26, 50, 74, 98],
  11559. [6, 30, 54, 78, 102],
  11560. [6, 28, 54, 80, 106],
  11561. [6, 32, 58, 84, 110],
  11562. [6, 30, 58, 86, 114],
  11563. [6, 34, 62, 90, 118],
  11564. [6, 26, 50, 74, 98, 122],
  11565. [6, 30, 54, 78, 102, 126],
  11566. [6, 26, 52, 78, 104, 130],
  11567. [6, 30, 56, 82, 108, 134],
  11568. [6, 34, 60, 86, 112, 138],
  11569. [6, 30, 58, 86, 114, 142],
  11570. [6, 34, 62, 90, 118, 146],
  11571. [6, 30, 54, 78, 102, 126, 150],
  11572. [6, 24, 50, 76, 102, 128, 154],
  11573. [6, 28, 54, 80, 106, 132, 158],
  11574. [6, 32, 58, 84, 110, 136, 162],
  11575. [6, 26, 54, 82, 110, 138, 166],
  11576. [6, 30, 58, 86, 114, 142, 170]],
  11577. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  11578. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  11579. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  11580. getBCHTypeInfo: function getBCHTypeInfo(data) {
  11581. var d = data << 10;
  11582. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  11583. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  11584. }
  11585. return (data << 10 | d) ^ QRUtil.G15_MASK;
  11586. },
  11587. getBCHTypeNumber: function getBCHTypeNumber(data) {
  11588. var d = data << 12;
  11589. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  11590. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  11591. }
  11592. return data << 12 | d;
  11593. },
  11594. getBCHDigit: function getBCHDigit(data) {
  11595. var digit = 0;
  11596. while (data != 0) {
  11597. digit++;
  11598. data >>>= 1;
  11599. }
  11600. return digit;
  11601. },
  11602. getPatternPosition: function getPatternPosition(typeNumber) {
  11603. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  11604. },
  11605. getMask: function getMask(maskPattern, i, j) {
  11606. switch (maskPattern) {
  11607. case QRMaskPattern.PATTERN000:
  11608. return (i + j) % 2 == 0;
  11609. case QRMaskPattern.PATTERN001:
  11610. return i % 2 == 0;
  11611. case QRMaskPattern.PATTERN010:
  11612. return j % 3 == 0;
  11613. case QRMaskPattern.PATTERN011:
  11614. return (i + j) % 3 == 0;
  11615. case QRMaskPattern.PATTERN100:
  11616. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  11617. case QRMaskPattern.PATTERN101:
  11618. return i * j % 2 + i * j % 3 == 0;
  11619. case QRMaskPattern.PATTERN110:
  11620. return (i * j % 2 + i * j % 3) % 2 == 0;
  11621. case QRMaskPattern.PATTERN111:
  11622. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  11623. default:
  11624. throw new Error("bad maskPattern:" + maskPattern);}
  11625. },
  11626. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  11627. var a = new QRPolynomial([1], 0);
  11628. for (var i = 0; i < errorCorrectLength; i++) {
  11629. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  11630. }
  11631. return a;
  11632. },
  11633. getLengthInBits: function getLengthInBits(mode, type) {
  11634. if (1 <= type && type < 10) {
  11635. // 1 - 9
  11636. switch (mode) {
  11637. case QRMode.MODE_NUMBER:
  11638. return 10;
  11639. case QRMode.MODE_ALPHA_NUM:
  11640. return 9;
  11641. case QRMode.MODE_8BIT_BYTE:
  11642. return 8;
  11643. case QRMode.MODE_KANJI:
  11644. return 8;
  11645. default:
  11646. throw new Error("mode:" + mode);}
  11647. } else if (type < 27) {
  11648. // 10 - 26
  11649. switch (mode) {
  11650. case QRMode.MODE_NUMBER:
  11651. return 12;
  11652. case QRMode.MODE_ALPHA_NUM:
  11653. return 11;
  11654. case QRMode.MODE_8BIT_BYTE:
  11655. return 16;
  11656. case QRMode.MODE_KANJI:
  11657. return 10;
  11658. default:
  11659. throw new Error("mode:" + mode);}
  11660. } else if (type < 41) {
  11661. // 27 - 40
  11662. switch (mode) {
  11663. case QRMode.MODE_NUMBER:
  11664. return 14;
  11665. case QRMode.MODE_ALPHA_NUM:
  11666. return 13;
  11667. case QRMode.MODE_8BIT_BYTE:
  11668. return 16;
  11669. case QRMode.MODE_KANJI:
  11670. return 12;
  11671. default:
  11672. throw new Error("mode:" + mode);}
  11673. } else {
  11674. throw new Error("type:" + type);
  11675. }
  11676. },
  11677. getLostPoint: function getLostPoint(qrCode) {
  11678. var moduleCount = qrCode.getModuleCount();
  11679. var lostPoint = 0;
  11680. // LEVEL1
  11681. for (var row = 0; row < moduleCount; row++) {
  11682. for (var col = 0; col < moduleCount; col++) {
  11683. var sameCount = 0;
  11684. var dark = qrCode.isDark(row, col);
  11685. for (var r = -1; r <= 1; r++) {
  11686. if (row + r < 0 || moduleCount <= row + r) {
  11687. continue;
  11688. }
  11689. for (var c = -1; c <= 1; c++) {
  11690. if (col + c < 0 || moduleCount <= col + c) {
  11691. continue;
  11692. }
  11693. if (r == 0 && c == 0) {
  11694. continue;
  11695. }
  11696. if (dark == qrCode.isDark(row + r, col + c)) {
  11697. sameCount++;
  11698. }
  11699. }
  11700. }
  11701. if (sameCount > 5) {
  11702. lostPoint += 3 + sameCount - 5;
  11703. }
  11704. }
  11705. }
  11706. // LEVEL2
  11707. for (var row = 0; row < moduleCount - 1; row++) {
  11708. for (var col = 0; col < moduleCount - 1; col++) {
  11709. var count = 0;
  11710. if (qrCode.isDark(row, col)) count++;
  11711. if (qrCode.isDark(row + 1, col)) count++;
  11712. if (qrCode.isDark(row, col + 1)) count++;
  11713. if (qrCode.isDark(row + 1, col + 1)) count++;
  11714. if (count == 0 || count == 4) {
  11715. lostPoint += 3;
  11716. }
  11717. }
  11718. }
  11719. // LEVEL3
  11720. for (var row = 0; row < moduleCount; row++) {
  11721. for (var col = 0; col < moduleCount - 6; col++) {
  11722. if (qrCode.isDark(row, col) &&
  11723. !qrCode.isDark(row, col + 1) &&
  11724. qrCode.isDark(row, col + 2) &&
  11725. qrCode.isDark(row, col + 3) &&
  11726. qrCode.isDark(row, col + 4) &&
  11727. !qrCode.isDark(row, col + 5) &&
  11728. qrCode.isDark(row, col + 6)) {
  11729. lostPoint += 40;
  11730. }
  11731. }
  11732. }
  11733. for (var col = 0; col < moduleCount; col++) {
  11734. for (var row = 0; row < moduleCount - 6; row++) {
  11735. if (qrCode.isDark(row, col) &&
  11736. !qrCode.isDark(row + 1, col) &&
  11737. qrCode.isDark(row + 2, col) &&
  11738. qrCode.isDark(row + 3, col) &&
  11739. qrCode.isDark(row + 4, col) &&
  11740. !qrCode.isDark(row + 5, col) &&
  11741. qrCode.isDark(row + 6, col)) {
  11742. lostPoint += 40;
  11743. }
  11744. }
  11745. }
  11746. // LEVEL4
  11747. var darkCount = 0;
  11748. for (var col = 0; col < moduleCount; col++) {
  11749. for (var row = 0; row < moduleCount; row++) {
  11750. if (qrCode.isDark(row, col)) {
  11751. darkCount++;
  11752. }
  11753. }
  11754. }
  11755. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  11756. lostPoint += ratio * 10;
  11757. return lostPoint;
  11758. } };
  11759. //---------------------------------------------------------------------
  11760. // QRMath
  11761. //---------------------------------------------------------------------
  11762. var QRMath = {
  11763. glog: function glog(n) {
  11764. if (n < 1) {
  11765. throw new Error("glog(" + n + ")");
  11766. }
  11767. return QRMath.LOG_TABLE[n];
  11768. },
  11769. gexp: function gexp(n) {
  11770. while (n < 0) {
  11771. n += 255;
  11772. }
  11773. while (n >= 256) {
  11774. n -= 255;
  11775. }
  11776. return QRMath.EXP_TABLE[n];
  11777. },
  11778. EXP_TABLE: new Array(256),
  11779. LOG_TABLE: new Array(256) };
  11780. for (var i = 0; i < 8; i++) {
  11781. QRMath.EXP_TABLE[i] = 1 << i;
  11782. }
  11783. for (var i = 8; i < 256; i++) {
  11784. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^
  11785. QRMath.EXP_TABLE[i - 5] ^
  11786. QRMath.EXP_TABLE[i - 6] ^
  11787. QRMath.EXP_TABLE[i - 8];
  11788. }
  11789. for (var i = 0; i < 255; i++) {
  11790. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  11791. }
  11792. //---------------------------------------------------------------------
  11793. // QRPolynomial
  11794. //---------------------------------------------------------------------
  11795. function QRPolynomial(num, shift) {
  11796. if (num.length == undefined) {
  11797. throw new Error(num.length + "/" + shift);
  11798. }
  11799. var offset = 0;
  11800. while (offset < num.length && num[offset] == 0) {
  11801. offset++;
  11802. }
  11803. this.num = new Array(num.length - offset + shift);
  11804. for (var i = 0; i < num.length - offset; i++) {
  11805. this.num[i] = num[i + offset];
  11806. }
  11807. }
  11808. QRPolynomial.prototype = {
  11809. get: function get(index) {
  11810. return this.num[index];
  11811. },
  11812. getLength: function getLength() {
  11813. return this.num.length;
  11814. },
  11815. multiply: function multiply(e) {
  11816. var num = new Array(this.getLength() + e.getLength() - 1);
  11817. for (var i = 0; i < this.getLength(); i++) {
  11818. for (var j = 0; j < e.getLength(); j++) {
  11819. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  11820. }
  11821. }
  11822. return new QRPolynomial(num, 0);
  11823. },
  11824. mod: function mod(e) {
  11825. if (this.getLength() - e.getLength() < 0) {
  11826. return this;
  11827. }
  11828. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0));
  11829. var num = new Array(this.getLength());
  11830. for (var i = 0; i < this.getLength(); i++) {
  11831. num[i] = this.get(i);
  11832. }
  11833. for (var i = 0; i < e.getLength(); i++) {
  11834. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  11835. }
  11836. // recursive call
  11837. return new QRPolynomial(num, 0).mod(e);
  11838. } };
  11839. //---------------------------------------------------------------------
  11840. // QRRSBlock
  11841. //---------------------------------------------------------------------
  11842. function QRRSBlock(totalCount, dataCount) {
  11843. this.totalCount = totalCount;
  11844. this.dataCount = dataCount;
  11845. }
  11846. QRRSBlock.RS_BLOCK_TABLE = [
  11847. // L
  11848. // M
  11849. // Q
  11850. // H
  11851. // 1
  11852. [1, 26, 19],
  11853. [1, 26, 16],
  11854. [1, 26, 13],
  11855. [1, 26, 9],
  11856. // 2
  11857. [1, 44, 34],
  11858. [1, 44, 28],
  11859. [1, 44, 22],
  11860. [1, 44, 16],
  11861. // 3
  11862. [1, 70, 55],
  11863. [1, 70, 44],
  11864. [2, 35, 17],
  11865. [2, 35, 13],
  11866. // 4
  11867. [1, 100, 80],
  11868. [2, 50, 32],
  11869. [2, 50, 24],
  11870. [4, 25, 9],
  11871. // 5
  11872. [1, 134, 108],
  11873. [2, 67, 43],
  11874. [2, 33, 15, 2, 34, 16],
  11875. [2, 33, 11, 2, 34, 12],
  11876. // 6
  11877. [2, 86, 68],
  11878. [4, 43, 27],
  11879. [4, 43, 19],
  11880. [4, 43, 15],
  11881. // 7
  11882. [2, 98, 78],
  11883. [4, 49, 31],
  11884. [2, 32, 14, 4, 33, 15],
  11885. [4, 39, 13, 1, 40, 14],
  11886. // 8
  11887. [2, 121, 97],
  11888. [2, 60, 38, 2, 61, 39],
  11889. [4, 40, 18, 2, 41, 19],
  11890. [4, 40, 14, 2, 41, 15],
  11891. // 9
  11892. [2, 146, 116],
  11893. [3, 58, 36, 2, 59, 37],
  11894. [4, 36, 16, 4, 37, 17],
  11895. [4, 36, 12, 4, 37, 13],
  11896. // 10
  11897. [2, 86, 68, 2, 87, 69],
  11898. [4, 69, 43, 1, 70, 44],
  11899. [6, 43, 19, 2, 44, 20],
  11900. [6, 43, 15, 2, 44, 16],
  11901. // 11
  11902. [4, 101, 81],
  11903. [1, 80, 50, 4, 81, 51],
  11904. [4, 50, 22, 4, 51, 23],
  11905. [3, 36, 12, 8, 37, 13],
  11906. // 12
  11907. [2, 116, 92, 2, 117, 93],
  11908. [6, 58, 36, 2, 59, 37],
  11909. [4, 46, 20, 6, 47, 21],
  11910. [7, 42, 14, 4, 43, 15],
  11911. // 13
  11912. [4, 133, 107],
  11913. [8, 59, 37, 1, 60, 38],
  11914. [8, 44, 20, 4, 45, 21],
  11915. [12, 33, 11, 4, 34, 12],
  11916. // 14
  11917. [3, 145, 115, 1, 146, 116],
  11918. [4, 64, 40, 5, 65, 41],
  11919. [11, 36, 16, 5, 37, 17],
  11920. [11, 36, 12, 5, 37, 13],
  11921. // 15
  11922. [5, 109, 87, 1, 110, 88],
  11923. [5, 65, 41, 5, 66, 42],
  11924. [5, 54, 24, 7, 55, 25],
  11925. [11, 36, 12],
  11926. // 16
  11927. [5, 122, 98, 1, 123, 99],
  11928. [7, 73, 45, 3, 74, 46],
  11929. [15, 43, 19, 2, 44, 20],
  11930. [3, 45, 15, 13, 46, 16],
  11931. // 17
  11932. [1, 135, 107, 5, 136, 108],
  11933. [10, 74, 46, 1, 75, 47],
  11934. [1, 50, 22, 15, 51, 23],
  11935. [2, 42, 14, 17, 43, 15],
  11936. // 18
  11937. [5, 150, 120, 1, 151, 121],
  11938. [9, 69, 43, 4, 70, 44],
  11939. [17, 50, 22, 1, 51, 23],
  11940. [2, 42, 14, 19, 43, 15],
  11941. // 19
  11942. [3, 141, 113, 4, 142, 114],
  11943. [3, 70, 44, 11, 71, 45],
  11944. [17, 47, 21, 4, 48, 22],
  11945. [9, 39, 13, 16, 40, 14],
  11946. // 20
  11947. [3, 135, 107, 5, 136, 108],
  11948. [3, 67, 41, 13, 68, 42],
  11949. [15, 54, 24, 5, 55, 25],
  11950. [15, 43, 15, 10, 44, 16],
  11951. // 21
  11952. [4, 144, 116, 4, 145, 117],
  11953. [17, 68, 42],
  11954. [17, 50, 22, 6, 51, 23],
  11955. [19, 46, 16, 6, 47, 17],
  11956. // 22
  11957. [2, 139, 111, 7, 140, 112],
  11958. [17, 74, 46],
  11959. [7, 54, 24, 16, 55, 25],
  11960. [34, 37, 13],
  11961. // 23
  11962. [4, 151, 121, 5, 152, 122],
  11963. [4, 75, 47, 14, 76, 48],
  11964. [11, 54, 24, 14, 55, 25],
  11965. [16, 45, 15, 14, 46, 16],
  11966. // 24
  11967. [6, 147, 117, 4, 148, 118],
  11968. [6, 73, 45, 14, 74, 46],
  11969. [11, 54, 24, 16, 55, 25],
  11970. [30, 46, 16, 2, 47, 17],
  11971. // 25
  11972. [8, 132, 106, 4, 133, 107],
  11973. [8, 75, 47, 13, 76, 48],
  11974. [7, 54, 24, 22, 55, 25],
  11975. [22, 45, 15, 13, 46, 16],
  11976. // 26
  11977. [10, 142, 114, 2, 143, 115],
  11978. [19, 74, 46, 4, 75, 47],
  11979. [28, 50, 22, 6, 51, 23],
  11980. [33, 46, 16, 4, 47, 17],
  11981. // 27
  11982. [8, 152, 122, 4, 153, 123],
  11983. [22, 73, 45, 3, 74, 46],
  11984. [8, 53, 23, 26, 54, 24],
  11985. [12, 45, 15, 28, 46, 16],
  11986. // 28
  11987. [3, 147, 117, 10, 148, 118],
  11988. [3, 73, 45, 23, 74, 46],
  11989. [4, 54, 24, 31, 55, 25],
  11990. [11, 45, 15, 31, 46, 16],
  11991. // 29
  11992. [7, 146, 116, 7, 147, 117],
  11993. [21, 73, 45, 7, 74, 46],
  11994. [1, 53, 23, 37, 54, 24],
  11995. [19, 45, 15, 26, 46, 16],
  11996. // 30
  11997. [5, 145, 115, 10, 146, 116],
  11998. [19, 75, 47, 10, 76, 48],
  11999. [15, 54, 24, 25, 55, 25],
  12000. [23, 45, 15, 25, 46, 16],
  12001. // 31
  12002. [13, 145, 115, 3, 146, 116],
  12003. [2, 74, 46, 29, 75, 47],
  12004. [42, 54, 24, 1, 55, 25],
  12005. [23, 45, 15, 28, 46, 16],
  12006. // 32
  12007. [17, 145, 115],
  12008. [10, 74, 46, 23, 75, 47],
  12009. [10, 54, 24, 35, 55, 25],
  12010. [19, 45, 15, 35, 46, 16],
  12011. // 33
  12012. [17, 145, 115, 1, 146, 116],
  12013. [14, 74, 46, 21, 75, 47],
  12014. [29, 54, 24, 19, 55, 25],
  12015. [11, 45, 15, 46, 46, 16],
  12016. // 34
  12017. [13, 145, 115, 6, 146, 116],
  12018. [14, 74, 46, 23, 75, 47],
  12019. [44, 54, 24, 7, 55, 25],
  12020. [59, 46, 16, 1, 47, 17],
  12021. // 35
  12022. [12, 151, 121, 7, 152, 122],
  12023. [12, 75, 47, 26, 76, 48],
  12024. [39, 54, 24, 14, 55, 25],
  12025. [22, 45, 15, 41, 46, 16],
  12026. // 36
  12027. [6, 151, 121, 14, 152, 122],
  12028. [6, 75, 47, 34, 76, 48],
  12029. [46, 54, 24, 10, 55, 25],
  12030. [2, 45, 15, 64, 46, 16],
  12031. // 37
  12032. [17, 152, 122, 4, 153, 123],
  12033. [29, 74, 46, 14, 75, 47],
  12034. [49, 54, 24, 10, 55, 25],
  12035. [24, 45, 15, 46, 46, 16],
  12036. // 38
  12037. [4, 152, 122, 18, 153, 123],
  12038. [13, 74, 46, 32, 75, 47],
  12039. [48, 54, 24, 14, 55, 25],
  12040. [42, 45, 15, 32, 46, 16],
  12041. // 39
  12042. [20, 147, 117, 4, 148, 118],
  12043. [40, 75, 47, 7, 76, 48],
  12044. [43, 54, 24, 22, 55, 25],
  12045. [10, 45, 15, 67, 46, 16],
  12046. // 40
  12047. [19, 148, 118, 6, 149, 119],
  12048. [18, 75, 47, 31, 76, 48],
  12049. [34, 54, 24, 34, 55, 25],
  12050. [20, 45, 15, 61, 46, 16]];
  12051. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  12052. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  12053. if (rsBlock == undefined) {
  12054. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  12055. }
  12056. var length = rsBlock.length / 3;
  12057. var list = new Array();
  12058. for (var i = 0; i < length; i++) {
  12059. var count = rsBlock[i * 3 + 0];
  12060. var totalCount = rsBlock[i * 3 + 1];
  12061. var dataCount = rsBlock[i * 3 + 2];
  12062. for (var j = 0; j < count; j++) {
  12063. list.push(new QRRSBlock(totalCount, dataCount));
  12064. }
  12065. }
  12066. return list;
  12067. };
  12068. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  12069. switch (errorCorrectLevel) {
  12070. case QRErrorCorrectLevel.L:
  12071. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
  12072. case QRErrorCorrectLevel.M:
  12073. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  12074. case QRErrorCorrectLevel.Q:
  12075. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  12076. case QRErrorCorrectLevel.H:
  12077. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  12078. default:
  12079. return undefined;}
  12080. };
  12081. //---------------------------------------------------------------------
  12082. // QRBitBuffer
  12083. //---------------------------------------------------------------------
  12084. function QRBitBuffer() {
  12085. this.buffer = new Array();
  12086. this.length = 0;
  12087. }
  12088. QRBitBuffer.prototype = {
  12089. get: function get(index) {
  12090. var bufIndex = Math.floor(index / 8);
  12091. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  12092. },
  12093. put: function put(num, length) {
  12094. for (var i = 0; i < length; i++) {
  12095. this.putBit((num >>> length - i - 1 & 1) == 1);
  12096. }
  12097. },
  12098. getLengthInBits: function getLengthInBits() {
  12099. return this.length;
  12100. },
  12101. putBit: function putBit(bit) {
  12102. var bufIndex = Math.floor(this.length / 8);
  12103. if (this.buffer.length <= bufIndex) {
  12104. this.buffer.push(0);
  12105. }
  12106. if (bit) {
  12107. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  12108. }
  12109. this.length++;
  12110. } };
  12111. //---------------------------------------------------------------------
  12112. // Support Chinese
  12113. //---------------------------------------------------------------------
  12114. function utf16To8(text) {
  12115. var result = '';
  12116. var c;
  12117. for (var i = 0; i < text.length; i++) {
  12118. c = text.charCodeAt(i);
  12119. if (c >= 0x0001 && c <= 0x007F) {
  12120. result += text.charAt(i);
  12121. } else if (c > 0x07FF) {
  12122. result += String.fromCharCode(0xE0 | c >> 12 & 0x0F);
  12123. result += String.fromCharCode(0x80 | c >> 6 & 0x3F);
  12124. result += String.fromCharCode(0x80 | c >> 0 & 0x3F);
  12125. } else {
  12126. result += String.fromCharCode(0xC0 | c >> 6 & 0x1F);
  12127. result += String.fromCharCode(0x80 | c >> 0 & 0x3F);
  12128. }
  12129. }
  12130. return result;
  12131. }
  12132. uQRCode = {
  12133. defaults: {
  12134. size: 258,
  12135. margin: 0,
  12136. backgroundColor: '#ffffff',
  12137. foregroundColor: '#000000',
  12138. fileType: 'png', // 'jpg', 'png'
  12139. correctLevel: 3,
  12140. typeNumber: -1 },
  12141. make: function make(options) {
  12142. var defaultOptions = {
  12143. canvasId: options.canvasId,
  12144. componentInstance: options.componentInstance,
  12145. text: options.text,
  12146. size: this.defaults.size,
  12147. margin: this.defaults.margin,
  12148. backgroundColor: this.defaults.backgroundColor,
  12149. foregroundColor: this.defaults.foregroundColor,
  12150. fileType: this.defaults.fileType,
  12151. correctLevel: this.defaults.correctLevel,
  12152. typeNumber: this.defaults.typeNumber };
  12153. if (options) {
  12154. for (var i in options) {
  12155. defaultOptions[i] = options[i];
  12156. }
  12157. }
  12158. options = defaultOptions;
  12159. if (!options.canvasId) {
  12160. console.error('uQRCode: Please set canvasId!');
  12161. return;
  12162. }
  12163. function createCanvas() {
  12164. var qrcode = new QRCode(options.typeNumber, options.correctLevel);
  12165. qrcode.addData(utf16To8(options.text));
  12166. qrcode.make();
  12167. var ctx = uni.createCanvasContext(options.canvasId, options.componentInstance);
  12168. ctx.setFillStyle(options.backgroundColor);
  12169. ctx.fillRect(0, 0, options.size, options.size);
  12170. var tileW = (options.size - options.margin * 2) / qrcode.getModuleCount();
  12171. var tileH = tileW;
  12172. for (var row = 0; row < qrcode.getModuleCount(); row++) {
  12173. for (var col = 0; col < qrcode.getModuleCount(); col++) {
  12174. var style = qrcode.isDark(row, col) ? options.foregroundColor : options.backgroundColor;
  12175. ctx.setFillStyle(style);
  12176. var x = Math.round(col * tileW) + options.margin;
  12177. var y = Math.round(row * tileH) + options.margin;
  12178. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  12179. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  12180. ctx.fillRect(x, y, w, h);
  12181. }
  12182. }
  12183. setTimeout(function () {
  12184. ctx.draw(false, function () {
  12185. setTimeout(function () {
  12186. uni.canvasToTempFilePath({
  12187. canvasId: options.canvasId,
  12188. fileType: options.fileType,
  12189. width: options.size,
  12190. height: options.size,
  12191. destWidth: options.size,
  12192. destHeight: options.size,
  12193. success: function success(res) {
  12194. options.success && options.success(res.tempFilePath);
  12195. },
  12196. fail: function fail(error) {
  12197. options.fail && options.fail(error);
  12198. },
  12199. complete: function complete(res) {
  12200. options.complete && options.complete(res);
  12201. } },
  12202. options.componentInstance);
  12203. }, options.text.length + 100);
  12204. });
  12205. }, 150);
  12206. }
  12207. createCanvas();
  12208. } };
  12209. })();var _default =
  12210. uQRCode;exports.default = _default;
  12211. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12212. /***/ })
  12213. }]);
  12214. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map