vendor.js 361 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478
  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.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 _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}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. /^\$|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 });var
  312. EventChannel = /*#__PURE__*/function () {
  313. function EventChannel(id, events) {var _this = this;_classCallCheck(this, EventChannel);
  314. this.id = id;
  315. this.listener = {};
  316. this.emitCache = {};
  317. if (events) {
  318. Object.keys(events).forEach(function (name) {
  319. _this.on(name, events[name]);
  320. });
  321. }
  322. }_createClass(EventChannel, [{ key: "emit", value: function emit(
  323. eventName) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  324. var fns = this.listener[eventName];
  325. if (!fns) {
  326. return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
  327. }
  328. fns.forEach(function (opt) {
  329. opt.fn.apply(opt.fn, args);
  330. });
  331. this.listener[eventName] = fns.filter(function (opt) {return opt.type !== 'once';});
  332. } }, { key: "on", value: function on(
  333. eventName, fn) {
  334. this._addListener(eventName, 'on', fn);
  335. this._clearCache(eventName);
  336. } }, { key: "once", value: function once(
  337. eventName, fn) {
  338. this._addListener(eventName, 'once', fn);
  339. this._clearCache(eventName);
  340. } }, { key: "off", value: function off(
  341. eventName, fn) {
  342. var fns = this.listener[eventName];
  343. if (!fns) {
  344. return;
  345. }
  346. if (fn) {
  347. for (var i = 0; i < fns.length;) {
  348. if (fns[i].fn === fn) {
  349. fns.splice(i, 1);
  350. i--;
  351. }
  352. i++;
  353. }
  354. } else {
  355. delete this.listener[eventName];
  356. }
  357. } }, { key: "_clearCache", value: function _clearCache(
  358. eventName) {
  359. var cacheArgs = this.emitCache[eventName];
  360. if (cacheArgs) {
  361. for (; cacheArgs.length > 0;) {
  362. this.emit.apply(this, [eventName].concat(cacheArgs.shift()));
  363. }
  364. }
  365. } }, { key: "_addListener", value: function _addListener(
  366. eventName, type, fn) {
  367. (this.listener[eventName] || (this.listener[eventName] = [])).push({
  368. fn: fn,
  369. type: type });
  370. } }]);return EventChannel;}();
  371. var eventChannels = {};
  372. var eventChannelStack = [];
  373. var id = 0;
  374. function initEventChannel(events) {var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  375. id++;
  376. var eventChannel = new EventChannel(id, events);
  377. if (cache) {
  378. eventChannels[id] = eventChannel;
  379. eventChannelStack.push(eventChannel);
  380. }
  381. return eventChannel;
  382. }
  383. function getEventChannel(id) {
  384. if (id) {
  385. var eventChannel = eventChannels[id];
  386. delete eventChannels[id];
  387. return eventChannel;
  388. }
  389. return eventChannelStack.shift();
  390. }
  391. var navigateTo = {
  392. args: function args(fromArgs, toArgs) {
  393. var id = initEventChannel(fromArgs.events).id;
  394. if (fromArgs.url) {
  395. fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id;
  396. }
  397. },
  398. returnValue: function returnValue(fromRes, toRes) {
  399. fromRes.eventChannel = getEventChannel();
  400. } };
  401. function findExistsPageIndex(url) {
  402. var pages = getCurrentPages();
  403. var len = pages.length;
  404. while (len--) {
  405. var page = pages[len];
  406. if (page.$page && page.$page.fullPath === url) {
  407. return len;
  408. }
  409. }
  410. return -1;
  411. }
  412. var redirectTo = {
  413. name: function name(fromArgs) {
  414. if (fromArgs.exists === 'back' && fromArgs.delta) {
  415. return 'navigateBack';
  416. }
  417. return 'redirectTo';
  418. },
  419. args: function args(fromArgs) {
  420. if (fromArgs.exists === 'back' && fromArgs.url) {
  421. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  422. if (existsPageIndex !== -1) {
  423. var delta = getCurrentPages().length - 1 - existsPageIndex;
  424. if (delta > 0) {
  425. fromArgs.delta = delta;
  426. }
  427. }
  428. }
  429. } };
  430. var previewImage = {
  431. args: function args(fromArgs) {
  432. var currentIndex = parseInt(fromArgs.current);
  433. if (isNaN(currentIndex)) {
  434. return;
  435. }
  436. var urls = fromArgs.urls;
  437. if (!Array.isArray(urls)) {
  438. return;
  439. }
  440. var len = urls.length;
  441. if (!len) {
  442. return;
  443. }
  444. if (currentIndex < 0) {
  445. currentIndex = 0;
  446. } else if (currentIndex >= len) {
  447. currentIndex = len - 1;
  448. }
  449. if (currentIndex > 0) {
  450. fromArgs.current = urls[currentIndex];
  451. fromArgs.urls = urls.filter(
  452. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  453. } else {
  454. fromArgs.current = urls[0];
  455. }
  456. return {
  457. indicator: false,
  458. loop: false };
  459. } };
  460. function addSafeAreaInsets(result) {
  461. if (result.safeArea) {
  462. var safeArea = result.safeArea;
  463. result.safeAreaInsets = {
  464. top: safeArea.top,
  465. left: safeArea.left,
  466. right: result.windowWidth - safeArea.right,
  467. bottom: result.windowHeight - safeArea.bottom };
  468. }
  469. }
  470. var protocols = {
  471. redirectTo: redirectTo,
  472. navigateTo: navigateTo,
  473. previewImage: previewImage,
  474. getSystemInfo: {
  475. returnValue: addSafeAreaInsets },
  476. getSystemInfoSync: {
  477. returnValue: addSafeAreaInsets } };
  478. var todos = [
  479. 'vibrate',
  480. 'preloadPage',
  481. 'unPreloadPage',
  482. 'loadSubPackage'];
  483. var canIUses = [];
  484. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  485. function processCallback(methodName, method, returnValue) {
  486. return function (res) {
  487. return method(processReturnValue(methodName, res, returnValue));
  488. };
  489. }
  490. 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;
  491. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  492. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  493. if (isFn(argsOption)) {
  494. argsOption = argsOption(fromArgs, toArgs) || {};
  495. }
  496. for (var key in fromArgs) {
  497. if (hasOwn(argsOption, key)) {
  498. var keyOption = argsOption[key];
  499. if (isFn(keyOption)) {
  500. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  501. }
  502. if (!keyOption) {// 不支持的参数
  503. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  504. } else if (isStr(keyOption)) {// 重写参数 key
  505. toArgs[keyOption] = fromArgs[key];
  506. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  507. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  508. }
  509. } else if (CALLBACKS.indexOf(key) !== -1) {
  510. if (isFn(fromArgs[key])) {
  511. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  512. }
  513. } else {
  514. if (!keepFromArgs) {
  515. toArgs[key] = fromArgs[key];
  516. }
  517. }
  518. }
  519. return toArgs;
  520. } else if (isFn(fromArgs)) {
  521. fromArgs = processCallback(methodName, fromArgs, returnValue);
  522. }
  523. return fromArgs;
  524. }
  525. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  526. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  527. res = protocols.returnValue(methodName, res);
  528. }
  529. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  530. }
  531. function wrapper(methodName, method) {
  532. if (hasOwn(protocols, methodName)) {
  533. var protocol = protocols[methodName];
  534. if (!protocol) {// 暂不支持的 api
  535. return function () {
  536. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  537. };
  538. }
  539. return function (arg1, arg2) {// 目前 api 最多两个参数
  540. var options = protocol;
  541. if (isFn(protocol)) {
  542. options = protocol(arg1);
  543. }
  544. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  545. var args = [arg1];
  546. if (typeof arg2 !== 'undefined') {
  547. args.push(arg2);
  548. }
  549. if (isFn(options.name)) {
  550. methodName = options.name(arg1);
  551. } else if (isStr(options.name)) {
  552. methodName = options.name;
  553. }
  554. var returnValue = wx[methodName].apply(wx, args);
  555. if (isSyncApi(methodName)) {// 同步 api
  556. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  557. }
  558. return returnValue;
  559. };
  560. }
  561. return method;
  562. }
  563. var todoApis = Object.create(null);
  564. var TODOS = [
  565. 'onTabBarMidButtonTap',
  566. 'subscribePush',
  567. 'unsubscribePush',
  568. 'onPush',
  569. 'offPush',
  570. 'share'];
  571. function createTodoApi(name) {
  572. return function todoApi(_ref)
  573. {var fail = _ref.fail,complete = _ref.complete;
  574. var res = {
  575. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  576. isFn(fail) && fail(res);
  577. isFn(complete) && complete(res);
  578. };
  579. }
  580. TODOS.forEach(function (name) {
  581. todoApis[name] = createTodoApi(name);
  582. });
  583. var providers = {
  584. oauth: ['weixin'],
  585. share: ['weixin'],
  586. payment: ['wxpay'],
  587. push: ['weixin'] };
  588. function getProvider(_ref2)
  589. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  590. var res = false;
  591. if (providers[service]) {
  592. res = {
  593. errMsg: 'getProvider:ok',
  594. service: service,
  595. provider: providers[service] };
  596. isFn(success) && success(res);
  597. } else {
  598. res = {
  599. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  600. isFn(fail) && fail(res);
  601. }
  602. isFn(complete) && complete(res);
  603. }
  604. var extraApi = /*#__PURE__*/Object.freeze({
  605. __proto__: null,
  606. getProvider: getProvider });
  607. var getEmitter = function () {
  608. var Emitter;
  609. return function getUniEmitter() {
  610. if (!Emitter) {
  611. Emitter = new _vue.default();
  612. }
  613. return Emitter;
  614. };
  615. }();
  616. function apply(ctx, method, args) {
  617. return ctx[method].apply(ctx, args);
  618. }
  619. function $on() {
  620. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  621. }
  622. function $off() {
  623. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  624. }
  625. function $once() {
  626. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  627. }
  628. function $emit() {
  629. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  630. }
  631. var eventApi = /*#__PURE__*/Object.freeze({
  632. __proto__: null,
  633. $on: $on,
  634. $off: $off,
  635. $once: $once,
  636. $emit: $emit });
  637. var api = /*#__PURE__*/Object.freeze({
  638. __proto__: null });
  639. var MPPage = Page;
  640. var MPComponent = Component;
  641. var customizeRE = /:/g;
  642. var customize = cached(function (str) {
  643. return camelize(str.replace(customizeRE, '-'));
  644. });
  645. function initTriggerEvent(mpInstance) {
  646. {
  647. if (!wx.canIUse('nextTick')) {
  648. return;
  649. }
  650. }
  651. var oldTriggerEvent = mpInstance.triggerEvent;
  652. mpInstance.triggerEvent = function (event) {for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {args[_key4 - 1] = arguments[_key4];}
  653. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  654. };
  655. }
  656. function initHook(name, options) {
  657. var oldHook = options[name];
  658. if (!oldHook) {
  659. options[name] = function () {
  660. initTriggerEvent(this);
  661. };
  662. } else {
  663. options[name] = function () {
  664. initTriggerEvent(this);for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  665. return oldHook.apply(this, args);
  666. };
  667. }
  668. }
  669. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  670. initHook('onLoad', options);
  671. return MPPage(options);
  672. };
  673. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  674. initHook('created', options);
  675. return MPComponent(options);
  676. };
  677. var PAGE_EVENT_HOOKS = [
  678. 'onPullDownRefresh',
  679. 'onReachBottom',
  680. 'onAddToFavorites',
  681. 'onShareTimeline',
  682. 'onShareAppMessage',
  683. 'onPageScroll',
  684. 'onResize',
  685. 'onTabItemTap'];
  686. function initMocks(vm, mocks) {
  687. var mpInstance = vm.$mp[vm.mpType];
  688. mocks.forEach(function (mock) {
  689. if (hasOwn(mpInstance, mock)) {
  690. vm[mock] = mpInstance[mock];
  691. }
  692. });
  693. }
  694. function hasHook(hook, vueOptions) {
  695. if (!vueOptions) {
  696. return true;
  697. }
  698. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  699. return true;
  700. }
  701. vueOptions = vueOptions.default || vueOptions;
  702. if (isFn(vueOptions)) {
  703. if (isFn(vueOptions.extendOptions[hook])) {
  704. return true;
  705. }
  706. if (vueOptions.super &&
  707. vueOptions.super.options &&
  708. Array.isArray(vueOptions.super.options[hook])) {
  709. return true;
  710. }
  711. return false;
  712. }
  713. if (isFn(vueOptions[hook])) {
  714. return true;
  715. }
  716. var mixins = vueOptions.mixins;
  717. if (Array.isArray(mixins)) {
  718. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  719. }
  720. }
  721. function initHooks(mpOptions, hooks, vueOptions) {
  722. hooks.forEach(function (hook) {
  723. if (hasHook(hook, vueOptions)) {
  724. mpOptions[hook] = function (args) {
  725. return this.$vm && this.$vm.__call_hook(hook, args);
  726. };
  727. }
  728. });
  729. }
  730. function initVueComponent(Vue, vueOptions) {
  731. vueOptions = vueOptions.default || vueOptions;
  732. var VueComponent;
  733. if (isFn(vueOptions)) {
  734. VueComponent = vueOptions;
  735. } else {
  736. VueComponent = Vue.extend(vueOptions);
  737. }
  738. vueOptions = VueComponent.options;
  739. return [VueComponent, vueOptions];
  740. }
  741. function initSlots(vm, vueSlots) {
  742. if (Array.isArray(vueSlots) && vueSlots.length) {
  743. var $slots = Object.create(null);
  744. vueSlots.forEach(function (slotName) {
  745. $slots[slotName] = true;
  746. });
  747. vm.$scopedSlots = vm.$slots = $slots;
  748. }
  749. }
  750. function initVueIds(vueIds, mpInstance) {
  751. vueIds = (vueIds || '').split(',');
  752. var len = vueIds.length;
  753. if (len === 1) {
  754. mpInstance._$vueId = vueIds[0];
  755. } else if (len === 2) {
  756. mpInstance._$vueId = vueIds[0];
  757. mpInstance._$vuePid = vueIds[1];
  758. }
  759. }
  760. function initData(vueOptions, context) {
  761. var data = vueOptions.data || {};
  762. var methods = vueOptions.methods || {};
  763. if (typeof data === 'function') {
  764. try {
  765. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  766. } catch (e) {
  767. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  768. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  769. }
  770. }
  771. } else {
  772. try {
  773. // 对 data 格式化
  774. data = JSON.parse(JSON.stringify(data));
  775. } catch (e) {}
  776. }
  777. if (!isPlainObject(data)) {
  778. data = {};
  779. }
  780. Object.keys(methods).forEach(function (methodName) {
  781. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  782. data[methodName] = methods[methodName];
  783. }
  784. });
  785. return data;
  786. }
  787. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  788. function createObserver(name) {
  789. return function observer(newVal, oldVal) {
  790. if (this.$vm) {
  791. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  792. }
  793. };
  794. }
  795. function initBehaviors(vueOptions, initBehavior) {
  796. var vueBehaviors = vueOptions.behaviors;
  797. var vueExtends = vueOptions.extends;
  798. var vueMixins = vueOptions.mixins;
  799. var vueProps = vueOptions.props;
  800. if (!vueProps) {
  801. vueOptions.props = vueProps = [];
  802. }
  803. var behaviors = [];
  804. if (Array.isArray(vueBehaviors)) {
  805. vueBehaviors.forEach(function (behavior) {
  806. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  807. if (behavior === 'uni://form-field') {
  808. if (Array.isArray(vueProps)) {
  809. vueProps.push('name');
  810. vueProps.push('value');
  811. } else {
  812. vueProps.name = {
  813. type: String,
  814. default: '' };
  815. vueProps.value = {
  816. type: [String, Number, Boolean, Array, Object, Date],
  817. default: '' };
  818. }
  819. }
  820. });
  821. }
  822. if (isPlainObject(vueExtends) && vueExtends.props) {
  823. behaviors.push(
  824. initBehavior({
  825. properties: initProperties(vueExtends.props, true) }));
  826. }
  827. if (Array.isArray(vueMixins)) {
  828. vueMixins.forEach(function (vueMixin) {
  829. if (isPlainObject(vueMixin) && vueMixin.props) {
  830. behaviors.push(
  831. initBehavior({
  832. properties: initProperties(vueMixin.props, true) }));
  833. }
  834. });
  835. }
  836. return behaviors;
  837. }
  838. function parsePropType(key, type, defaultValue, file) {
  839. // [String]=>String
  840. if (Array.isArray(type) && type.length === 1) {
  841. return type[0];
  842. }
  843. return type;
  844. }
  845. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  846. var properties = {};
  847. if (!isBehavior) {
  848. properties.vueId = {
  849. type: String,
  850. value: '' };
  851. // 用于字节跳动小程序模拟抽象节点
  852. properties.generic = {
  853. type: Object,
  854. value: null };
  855. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  856. type: null,
  857. value: [],
  858. observer: function observer(newVal, oldVal) {
  859. var $slots = Object.create(null);
  860. newVal.forEach(function (slotName) {
  861. $slots[slotName] = true;
  862. });
  863. this.setData({
  864. $slots: $slots });
  865. } };
  866. }
  867. if (Array.isArray(props)) {// ['title']
  868. props.forEach(function (key) {
  869. properties[key] = {
  870. type: null,
  871. observer: createObserver(key) };
  872. });
  873. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  874. Object.keys(props).forEach(function (key) {
  875. var opts = props[key];
  876. if (isPlainObject(opts)) {// title:{type:String,default:''}
  877. var value = opts.default;
  878. if (isFn(value)) {
  879. value = value();
  880. }
  881. opts.type = parsePropType(key, opts.type);
  882. properties[key] = {
  883. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  884. value: value,
  885. observer: createObserver(key) };
  886. } else {// content:String
  887. var type = parsePropType(key, opts);
  888. properties[key] = {
  889. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  890. observer: createObserver(key) };
  891. }
  892. });
  893. }
  894. return properties;
  895. }
  896. function wrapper$1(event) {
  897. // TODO 又得兼容 mpvue 的 mp 对象
  898. try {
  899. event.mp = JSON.parse(JSON.stringify(event));
  900. } catch (e) {}
  901. event.stopPropagation = noop;
  902. event.preventDefault = noop;
  903. event.target = event.target || {};
  904. if (!hasOwn(event, 'detail')) {
  905. event.detail = {};
  906. }
  907. if (hasOwn(event, 'markerId')) {
  908. event.detail = typeof event.detail === 'object' ? event.detail : {};
  909. event.detail.markerId = event.markerId;
  910. }
  911. if (isPlainObject(event.detail)) {
  912. event.target = Object.assign({}, event.target, event.detail);
  913. }
  914. return event;
  915. }
  916. function getExtraValue(vm, dataPathsArray) {
  917. var context = vm;
  918. dataPathsArray.forEach(function (dataPathArray) {
  919. var dataPath = dataPathArray[0];
  920. var value = dataPathArray[2];
  921. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  922. var propPath = dataPathArray[1];
  923. var valuePath = dataPathArray[3];
  924. var vFor;
  925. if (Number.isInteger(dataPath)) {
  926. vFor = dataPath;
  927. } else if (!dataPath) {
  928. vFor = context;
  929. } else if (typeof dataPath === 'string' && dataPath) {
  930. if (dataPath.indexOf('#s#') === 0) {
  931. vFor = dataPath.substr(3);
  932. } else {
  933. vFor = vm.__get_value(dataPath, context);
  934. }
  935. }
  936. if (Number.isInteger(vFor)) {
  937. context = value;
  938. } else if (!propPath) {
  939. context = vFor[value];
  940. } else {
  941. if (Array.isArray(vFor)) {
  942. context = vFor.find(function (vForItem) {
  943. return vm.__get_value(propPath, vForItem) === value;
  944. });
  945. } else if (isPlainObject(vFor)) {
  946. context = Object.keys(vFor).find(function (vForKey) {
  947. return vm.__get_value(propPath, vFor[vForKey]) === value;
  948. });
  949. } else {
  950. console.error('v-for 暂不支持循环数据:', vFor);
  951. }
  952. }
  953. if (valuePath) {
  954. context = vm.__get_value(valuePath, context);
  955. }
  956. }
  957. });
  958. return context;
  959. }
  960. function processEventExtra(vm, extra, event) {
  961. var extraObj = {};
  962. if (Array.isArray(extra) && extra.length) {
  963. /**
  964. *[
  965. * ['data.items', 'data.id', item.data.id],
  966. * ['metas', 'id', meta.id]
  967. *],
  968. *[
  969. * ['data.items', 'data.id', item.data.id],
  970. * ['metas', 'id', meta.id]
  971. *],
  972. *'test'
  973. */
  974. extra.forEach(function (dataPath, index) {
  975. if (typeof dataPath === 'string') {
  976. if (!dataPath) {// model,prop.sync
  977. extraObj['$' + index] = vm;
  978. } else {
  979. if (dataPath === '$event') {// $event
  980. extraObj['$' + index] = event;
  981. } else if (dataPath === 'arguments') {
  982. if (event.detail && event.detail.__args__) {
  983. extraObj['$' + index] = event.detail.__args__;
  984. } else {
  985. extraObj['$' + index] = [event];
  986. }
  987. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  988. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  989. } else {
  990. extraObj['$' + index] = vm.__get_value(dataPath);
  991. }
  992. }
  993. } else {
  994. extraObj['$' + index] = getExtraValue(vm, dataPath);
  995. }
  996. });
  997. }
  998. return extraObj;
  999. }
  1000. function getObjByArray(arr) {
  1001. var obj = {};
  1002. for (var i = 1; i < arr.length; i++) {
  1003. var element = arr[i];
  1004. obj[element[0]] = element[1];
  1005. }
  1006. return obj;
  1007. }
  1008. 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;
  1009. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1010. if (isCustom) {// 自定义事件
  1011. isCustomMPEvent = event.currentTarget &&
  1012. event.currentTarget.dataset &&
  1013. event.currentTarget.dataset.comType === 'wx';
  1014. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1015. if (isCustomMPEvent) {
  1016. return [event];
  1017. }
  1018. return event.detail.__args__ || event.detail;
  1019. }
  1020. }
  1021. var extraObj = processEventExtra(vm, extra, event);
  1022. var ret = [];
  1023. args.forEach(function (arg) {
  1024. if (arg === '$event') {
  1025. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1026. ret.push(event.target.value);
  1027. } else {
  1028. if (isCustom && !isCustomMPEvent) {
  1029. ret.push(event.detail.__args__[0]);
  1030. } else {// wxcomponent 组件或内置组件
  1031. ret.push(event);
  1032. }
  1033. }
  1034. } else {
  1035. if (Array.isArray(arg) && arg[0] === 'o') {
  1036. ret.push(getObjByArray(arg));
  1037. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1038. ret.push(extraObj[arg]);
  1039. } else {
  1040. ret.push(arg);
  1041. }
  1042. }
  1043. });
  1044. return ret;
  1045. }
  1046. var ONCE = '~';
  1047. var CUSTOM = '^';
  1048. function isMatchEventType(eventType, optType) {
  1049. return eventType === optType ||
  1050. optType === 'regionchange' && (
  1051. eventType === 'begin' ||
  1052. eventType === 'end');
  1053. }
  1054. function getContextVm(vm) {
  1055. var $parent = vm.$parent;
  1056. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1057. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1058. $parent = $parent.$parent;
  1059. }
  1060. return $parent && $parent.$parent;
  1061. }
  1062. function handleEvent(event) {var _this2 = this;
  1063. event = wrapper$1(event);
  1064. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1065. var dataset = (event.currentTarget || event.target).dataset;
  1066. if (!dataset) {
  1067. return console.warn('事件信息不存在');
  1068. }
  1069. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1070. if (!eventOpts) {
  1071. return console.warn('事件信息不存在');
  1072. }
  1073. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1074. var eventType = event.type;
  1075. var ret = [];
  1076. eventOpts.forEach(function (eventOpt) {
  1077. var type = eventOpt[0];
  1078. var eventsArray = eventOpt[1];
  1079. var isCustom = type.charAt(0) === CUSTOM;
  1080. type = isCustom ? type.slice(1) : type;
  1081. var isOnce = type.charAt(0) === ONCE;
  1082. type = isOnce ? type.slice(1) : type;
  1083. if (eventsArray && isMatchEventType(eventType, type)) {
  1084. eventsArray.forEach(function (eventArray) {
  1085. var methodName = eventArray[0];
  1086. if (methodName) {
  1087. var handlerCtx = _this2.$vm;
  1088. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1089. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1090. }
  1091. if (methodName === '$emit') {
  1092. handlerCtx.$emit.apply(handlerCtx,
  1093. processEventArgs(
  1094. _this2.$vm,
  1095. event,
  1096. eventArray[1],
  1097. eventArray[2],
  1098. isCustom,
  1099. methodName));
  1100. return;
  1101. }
  1102. var handler = handlerCtx[methodName];
  1103. if (!isFn(handler)) {
  1104. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1105. }
  1106. if (isOnce) {
  1107. if (handler.once) {
  1108. return;
  1109. }
  1110. handler.once = true;
  1111. }
  1112. var params = processEventArgs(
  1113. _this2.$vm,
  1114. event,
  1115. eventArray[1],
  1116. eventArray[2],
  1117. isCustom,
  1118. methodName);
  1119. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1120. // eslint-disable-next-line no-sparse-arrays
  1121. ret.push(handler.apply(handlerCtx, (Array.isArray(params) ? params : []).concat([,,,,,,,,,, event])));
  1122. }
  1123. });
  1124. }
  1125. });
  1126. if (
  1127. eventType === 'input' &&
  1128. ret.length === 1 &&
  1129. typeof ret[0] !== 'undefined')
  1130. {
  1131. return ret[0];
  1132. }
  1133. }
  1134. var hooks = [
  1135. 'onShow',
  1136. 'onHide',
  1137. 'onError',
  1138. 'onPageNotFound',
  1139. 'onThemeChange',
  1140. 'onUnhandledRejection'];
  1141. function parseBaseApp(vm, _ref3)
  1142. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1143. if (vm.$options.store) {
  1144. _vue.default.prototype.$store = vm.$options.store;
  1145. }
  1146. _vue.default.prototype.mpHost = "mp-weixin";
  1147. _vue.default.mixin({
  1148. beforeCreate: function beforeCreate() {
  1149. if (!this.$options.mpType) {
  1150. return;
  1151. }
  1152. this.mpType = this.$options.mpType;
  1153. this.$mp = _defineProperty({
  1154. data: {} },
  1155. this.mpType, this.$options.mpInstance);
  1156. this.$scope = this.$options.mpInstance;
  1157. delete this.$options.mpType;
  1158. delete this.$options.mpInstance;
  1159. if (this.mpType !== 'app') {
  1160. initRefs(this);
  1161. initMocks(this, mocks);
  1162. }
  1163. } });
  1164. var appOptions = {
  1165. onLaunch: function onLaunch(args) {
  1166. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1167. return;
  1168. }
  1169. {
  1170. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1171. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1172. }
  1173. }
  1174. this.$vm = vm;
  1175. this.$vm.$mp = {
  1176. app: this };
  1177. this.$vm.$scope = this;
  1178. // vm 上也挂载 globalData
  1179. this.$vm.globalData = this.globalData;
  1180. this.$vm._isMounted = true;
  1181. this.$vm.__call_hook('mounted', args);
  1182. this.$vm.__call_hook('onLaunch', args);
  1183. } };
  1184. // 兼容旧版本 globalData
  1185. appOptions.globalData = vm.$options.globalData || {};
  1186. // 将 methods 中的方法挂在 getApp() 中
  1187. var methods = vm.$options.methods;
  1188. if (methods) {
  1189. Object.keys(methods).forEach(function (name) {
  1190. appOptions[name] = methods[name];
  1191. });
  1192. }
  1193. initHooks(appOptions, hooks);
  1194. return appOptions;
  1195. }
  1196. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1197. function findVmByVueId(vm, vuePid) {
  1198. var $children = vm.$children;
  1199. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1200. for (var i = $children.length - 1; i >= 0; i--) {
  1201. var childVm = $children[i];
  1202. if (childVm.$scope._$vueId === vuePid) {
  1203. return childVm;
  1204. }
  1205. }
  1206. // 反向递归查找
  1207. var parentVm;
  1208. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1209. parentVm = findVmByVueId($children[_i], vuePid);
  1210. if (parentVm) {
  1211. return parentVm;
  1212. }
  1213. }
  1214. }
  1215. function initBehavior(options) {
  1216. return Behavior(options);
  1217. }
  1218. function isPage() {
  1219. return !!this.route;
  1220. }
  1221. function initRelation(detail) {
  1222. this.triggerEvent('__l', detail);
  1223. }
  1224. function initRefs(vm) {
  1225. var mpInstance = vm.$scope;
  1226. Object.defineProperty(vm, '$refs', {
  1227. get: function get() {
  1228. var $refs = {};
  1229. var components = mpInstance.selectAllComponents('.vue-ref');
  1230. components.forEach(function (component) {
  1231. var ref = component.dataset.ref;
  1232. $refs[ref] = component.$vm || component;
  1233. });
  1234. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1235. forComponents.forEach(function (component) {
  1236. var ref = component.dataset.ref;
  1237. if (!$refs[ref]) {
  1238. $refs[ref] = [];
  1239. }
  1240. $refs[ref].push(component.$vm || component);
  1241. });
  1242. return $refs;
  1243. } });
  1244. }
  1245. function handleLink(event) {var _ref4 =
  1246. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1247. var parentVm;
  1248. if (vuePid) {
  1249. parentVm = findVmByVueId(this.$vm, vuePid);
  1250. }
  1251. if (!parentVm) {
  1252. parentVm = this.$vm;
  1253. }
  1254. vueOptions.parent = parentVm;
  1255. }
  1256. function parseApp(vm) {
  1257. return parseBaseApp(vm, {
  1258. mocks: mocks,
  1259. initRefs: initRefs });
  1260. }
  1261. function createApp(vm) {
  1262. _vue.default.prototype.getOpenerEventChannel = function () {
  1263. if (!this.__eventChannel__) {
  1264. this.__eventChannel__ = new EventChannel();
  1265. }
  1266. return this.__eventChannel__;
  1267. };
  1268. var callHook = _vue.default.prototype.__call_hook;
  1269. _vue.default.prototype.__call_hook = function (hook, args) {
  1270. if (hook === 'onLoad' && args && args.__id__) {
  1271. this.__eventChannel__ = getEventChannel(args.__id__);
  1272. delete args.__id__;
  1273. }
  1274. return callHook.call(this, hook, args);
  1275. };
  1276. App(parseApp(vm));
  1277. return vm;
  1278. }
  1279. var encodeReserveRE = /[!'()*]/g;
  1280. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1281. var commaRE = /%2C/g;
  1282. // fixed encodeURIComponent which is more conformant to RFC3986:
  1283. // - escapes [!'()*]
  1284. // - preserve commas
  1285. var encode = function encode(str) {return encodeURIComponent(str).
  1286. replace(encodeReserveRE, encodeReserveReplacer).
  1287. replace(commaRE, ',');};
  1288. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1289. var res = obj ? Object.keys(obj).map(function (key) {
  1290. var val = obj[key];
  1291. if (val === undefined) {
  1292. return '';
  1293. }
  1294. if (val === null) {
  1295. return encodeStr(key);
  1296. }
  1297. if (Array.isArray(val)) {
  1298. var result = [];
  1299. val.forEach(function (val2) {
  1300. if (val2 === undefined) {
  1301. return;
  1302. }
  1303. if (val2 === null) {
  1304. result.push(encodeStr(key));
  1305. } else {
  1306. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1307. }
  1308. });
  1309. return result.join('&');
  1310. }
  1311. return encodeStr(key) + '=' + encodeStr(val);
  1312. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1313. return res ? "?".concat(res) : '';
  1314. }
  1315. function parseBaseComponent(vueComponentOptions)
  1316. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1317. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1318. var options = _objectSpread({
  1319. multipleSlots: true,
  1320. addGlobalClass: true },
  1321. vueOptions.options || {});
  1322. {
  1323. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1324. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1325. Object.assign(options, vueOptions['mp-weixin'].options);
  1326. }
  1327. }
  1328. var componentOptions = {
  1329. options: options,
  1330. data: initData(vueOptions, _vue.default.prototype),
  1331. behaviors: initBehaviors(vueOptions, initBehavior),
  1332. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1333. lifetimes: {
  1334. attached: function attached() {
  1335. var properties = this.properties;
  1336. var options = {
  1337. mpType: isPage.call(this) ? 'page' : 'component',
  1338. mpInstance: this,
  1339. propsData: properties };
  1340. initVueIds(properties.vueId, this);
  1341. // 处理父子关系
  1342. initRelation.call(this, {
  1343. vuePid: this._$vuePid,
  1344. vueOptions: options });
  1345. // 初始化 vue 实例
  1346. this.$vm = new VueComponent(options);
  1347. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1348. initSlots(this.$vm, properties.vueSlots);
  1349. // 触发首次 setData
  1350. this.$vm.$mount();
  1351. },
  1352. ready: function ready() {
  1353. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1354. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1355. if (this.$vm) {
  1356. this.$vm._isMounted = true;
  1357. this.$vm.__call_hook('mounted');
  1358. this.$vm.__call_hook('onReady');
  1359. }
  1360. },
  1361. detached: function detached() {
  1362. this.$vm && this.$vm.$destroy();
  1363. } },
  1364. pageLifetimes: {
  1365. show: function show(args) {
  1366. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1367. },
  1368. hide: function hide() {
  1369. this.$vm && this.$vm.__call_hook('onPageHide');
  1370. },
  1371. resize: function resize(size) {
  1372. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1373. } },
  1374. methods: {
  1375. __l: handleLink,
  1376. __e: handleEvent } };
  1377. // externalClasses
  1378. if (vueOptions.externalClasses) {
  1379. componentOptions.externalClasses = vueOptions.externalClasses;
  1380. }
  1381. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1382. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1383. componentOptions.methods[callMethod] = function (args) {
  1384. return this.$vm[callMethod](args);
  1385. };
  1386. });
  1387. }
  1388. if (isPage) {
  1389. return componentOptions;
  1390. }
  1391. return [componentOptions, VueComponent];
  1392. }
  1393. function parseComponent(vueComponentOptions) {
  1394. return parseBaseComponent(vueComponentOptions, {
  1395. isPage: isPage,
  1396. initRelation: initRelation });
  1397. }
  1398. var hooks$1 = [
  1399. 'onShow',
  1400. 'onHide',
  1401. 'onUnload'];
  1402. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1403. function parseBasePage(vuePageOptions, _ref6)
  1404. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1405. var pageOptions = parseComponent(vuePageOptions);
  1406. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1407. pageOptions.methods.onLoad = function (query) {
  1408. this.options = query;
  1409. var copyQuery = Object.assign({}, query);
  1410. delete copyQuery.__id__;
  1411. this.$page = {
  1412. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1413. this.$vm.$mp.query = query; // 兼容 mpvue
  1414. this.$vm.__call_hook('onLoad', query);
  1415. };
  1416. return pageOptions;
  1417. }
  1418. function parsePage(vuePageOptions) {
  1419. return parseBasePage(vuePageOptions, {
  1420. isPage: isPage,
  1421. initRelation: initRelation });
  1422. }
  1423. function createPage(vuePageOptions) {
  1424. {
  1425. return Component(parsePage(vuePageOptions));
  1426. }
  1427. }
  1428. function createComponent(vueOptions) {
  1429. {
  1430. return Component(parseComponent(vueOptions));
  1431. }
  1432. }
  1433. todos.forEach(function (todoApi) {
  1434. protocols[todoApi] = false;
  1435. });
  1436. canIUses.forEach(function (canIUseApi) {
  1437. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1438. canIUseApi;
  1439. if (!wx.canIUse(apiName)) {
  1440. protocols[canIUseApi] = false;
  1441. }
  1442. });
  1443. var uni = {};
  1444. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1445. uni = new Proxy({}, {
  1446. get: function get(target, name) {
  1447. if (hasOwn(target, name)) {
  1448. return target[name];
  1449. }
  1450. if (baseApi[name]) {
  1451. return baseApi[name];
  1452. }
  1453. if (api[name]) {
  1454. return promisify(name, api[name]);
  1455. }
  1456. {
  1457. if (extraApi[name]) {
  1458. return promisify(name, extraApi[name]);
  1459. }
  1460. if (todoApis[name]) {
  1461. return promisify(name, todoApis[name]);
  1462. }
  1463. }
  1464. if (eventApi[name]) {
  1465. return eventApi[name];
  1466. }
  1467. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1468. return;
  1469. }
  1470. return promisify(name, wrapper(name, wx[name]));
  1471. },
  1472. set: function set(target, name, value) {
  1473. target[name] = value;
  1474. return true;
  1475. } });
  1476. } else {
  1477. Object.keys(baseApi).forEach(function (name) {
  1478. uni[name] = baseApi[name];
  1479. });
  1480. {
  1481. Object.keys(todoApis).forEach(function (name) {
  1482. uni[name] = promisify(name, todoApis[name]);
  1483. });
  1484. Object.keys(extraApi).forEach(function (name) {
  1485. uni[name] = promisify(name, todoApis[name]);
  1486. });
  1487. }
  1488. Object.keys(eventApi).forEach(function (name) {
  1489. uni[name] = eventApi[name];
  1490. });
  1491. Object.keys(api).forEach(function (name) {
  1492. uni[name] = promisify(name, api[name]);
  1493. });
  1494. Object.keys(wx).forEach(function (name) {
  1495. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1496. uni[name] = promisify(name, wrapper(name, wx[name]));
  1497. }
  1498. });
  1499. }
  1500. wx.createApp = createApp;
  1501. wx.createPage = createPage;
  1502. wx.createComponent = createComponent;
  1503. var uni$1 = uni;var _default =
  1504. uni$1;exports.default = _default;
  1505. /***/ }),
  1506. /***/ 10:
  1507. /*!**********************************************************************************************************!*\
  1508. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1509. \**********************************************************************************************************/
  1510. /*! exports provided: default */
  1511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1512. "use strict";
  1513. __webpack_require__.r(__webpack_exports__);
  1514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1515. /* globals __VUE_SSR_CONTEXT__ */
  1516. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1517. // This module is a runtime utility for cleaner component module output and will
  1518. // be included in the final webpack user bundle.
  1519. function normalizeComponent (
  1520. scriptExports,
  1521. render,
  1522. staticRenderFns,
  1523. functionalTemplate,
  1524. injectStyles,
  1525. scopeId,
  1526. moduleIdentifier, /* server only */
  1527. shadowMode, /* vue-cli only */
  1528. components, // fixed by xxxxxx auto components
  1529. renderjs // fixed by xxxxxx renderjs
  1530. ) {
  1531. // Vue.extend constructor export interop
  1532. var options = typeof scriptExports === 'function'
  1533. ? scriptExports.options
  1534. : scriptExports
  1535. // fixed by xxxxxx auto components
  1536. if (components) {
  1537. if (!options.components) {
  1538. options.components = {}
  1539. }
  1540. var hasOwn = Object.prototype.hasOwnProperty
  1541. for (var name in components) {
  1542. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1543. options.components[name] = components[name]
  1544. }
  1545. }
  1546. }
  1547. // fixed by xxxxxx renderjs
  1548. if (renderjs) {
  1549. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1550. this[renderjs.__module] = this
  1551. });
  1552. (options.mixins || (options.mixins = [])).push(renderjs)
  1553. }
  1554. // render functions
  1555. if (render) {
  1556. options.render = render
  1557. options.staticRenderFns = staticRenderFns
  1558. options._compiled = true
  1559. }
  1560. // functional template
  1561. if (functionalTemplate) {
  1562. options.functional = true
  1563. }
  1564. // scopedId
  1565. if (scopeId) {
  1566. options._scopeId = 'data-v-' + scopeId
  1567. }
  1568. var hook
  1569. if (moduleIdentifier) { // server build
  1570. hook = function (context) {
  1571. // 2.3 injection
  1572. context =
  1573. context || // cached call
  1574. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1575. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1576. // 2.2 with runInNewContext: true
  1577. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1578. context = __VUE_SSR_CONTEXT__
  1579. }
  1580. // inject component styles
  1581. if (injectStyles) {
  1582. injectStyles.call(this, context)
  1583. }
  1584. // register component module identifier for async chunk inferrence
  1585. if (context && context._registeredComponents) {
  1586. context._registeredComponents.add(moduleIdentifier)
  1587. }
  1588. }
  1589. // used by ssr in case component is cached and beforeCreate
  1590. // never gets called
  1591. options._ssrRegister = hook
  1592. } else if (injectStyles) {
  1593. hook = shadowMode
  1594. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1595. : injectStyles
  1596. }
  1597. if (hook) {
  1598. if (options.functional) {
  1599. // for template-only hot-reload because in that case the render fn doesn't
  1600. // go through the normalizer
  1601. options._injectStyles = hook
  1602. // register for functioal component in vue file
  1603. var originalRender = options.render
  1604. options.render = function renderWithStyleInjection (h, context) {
  1605. hook.call(context)
  1606. return originalRender(h, context)
  1607. }
  1608. } else {
  1609. // inject component registration as beforeCreate hook
  1610. var existing = options.beforeCreate
  1611. options.beforeCreate = existing
  1612. ? [].concat(existing, hook)
  1613. : [hook]
  1614. }
  1615. }
  1616. return {
  1617. exports: scriptExports,
  1618. options: options
  1619. }
  1620. }
  1621. /***/ }),
  1622. /***/ 11:
  1623. /*!***************************************************!*\
  1624. !*** E:/.swdz/uni-app/baoma/mabao/store/index.js ***!
  1625. \***************************************************/
  1626. /*! no static exports found */
  1627. /***/ (function(module, exports, __webpack_require__) {
  1628. "use strict";
  1629. /* 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 */ 12));var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  1630. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 15));
  1631. var _request = _interopRequireDefault(__webpack_require__(/*! @/common/request */ 16));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);});};}
  1632. _vue.default.use(_vuex.default);
  1633. var store = new _vuex.default.Store({
  1634. state: {
  1635. hasLogin: false,
  1636. jwt: uni.getStorageSync('jwt'),
  1637. user: {} },
  1638. // getters
  1639. getters: {
  1640. // ��ȡtokenֵ
  1641. getJwt: function getJwt(state) {
  1642. return state.jwt;
  1643. },
  1644. // ��֤�Ƿ���token
  1645. verifyJwt: function verifyJwt(state) {
  1646. if (state.jwt) {
  1647. state.hasLogin = true;
  1648. return true;
  1649. }
  1650. return false;
  1651. } },
  1652. mutations: {
  1653. setJwt: function setJwt(state, jwt) {
  1654. state.jwt = jwt;
  1655. uni.setStorageSync('jwt', state.jwt);
  1656. },
  1657. login: function login(state) {
  1658. state.hasLogin = true;
  1659. try {
  1660. uni.setStorageSync('jwt', state.jwt);
  1661. } catch (e) {
  1662. // error
  1663. }
  1664. },
  1665. logout: function logout(state) {
  1666. state.hasLogin = false;
  1667. state.user = {};
  1668. state.jwt = '';
  1669. uni.removeStorage({
  1670. key: 'jwt',
  1671. success: function success(res) {} });
  1672. },
  1673. setUser: function setUser(state, user) {
  1674. state.user = user;
  1675. } },
  1676. actions: {
  1677. // lazy loading openid
  1678. getUser: function () {var _getUser = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref,
  1679. refresh) {var commit, state;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:commit = _ref.commit, state = _ref.state;_context.next = 3;return (
  1680. new Promise(function (resolve, reject) {
  1681. if (refresh != true && state.user && Object.keys(state.user).length > 0) {
  1682. resolve(state.user);
  1683. } else {
  1684. _request.default.get("/api/user/userInfo", {}, false).then(function (data) {
  1685. if (data.code == 200) {
  1686. commit('setUser', data.data);
  1687. resolve(data.data);
  1688. } else {
  1689. resolve(null);
  1690. }
  1691. }).catch(function (err) {
  1692. console.info(err);
  1693. reject(err);
  1694. });
  1695. }
  1696. }));case 3:return _context.abrupt("return", _context.sent);case 4:case "end":return _context.stop();}}}, _callee);}));function getUser(_x, _x2) {return _getUser.apply(this, arguments);}return getUser;}() } });var _default =
  1697. store;exports.default = _default;
  1698. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1699. /***/ }),
  1700. /***/ 12:
  1701. /*!**********************************************************!*\
  1702. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  1703. \**********************************************************/
  1704. /*! no static exports found */
  1705. /***/ (function(module, exports, __webpack_require__) {
  1706. module.exports = __webpack_require__(/*! regenerator-runtime */ 13);
  1707. /***/ }),
  1708. /***/ 13:
  1709. /*!************************************************************!*\
  1710. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  1711. \************************************************************/
  1712. /*! no static exports found */
  1713. /***/ (function(module, exports, __webpack_require__) {
  1714. /**
  1715. * Copyright (c) 2014-present, Facebook, Inc.
  1716. *
  1717. * This source code is licensed under the MIT license found in the
  1718. * LICENSE file in the root directory of this source tree.
  1719. */
  1720. // This method of obtaining a reference to the global object needs to be
  1721. // kept identical to the way it is obtained in runtime.js
  1722. var g = (function() {
  1723. return this || (typeof self === "object" && self);
  1724. })() || Function("return this")();
  1725. // Use `getOwnPropertyNames` because not all browsers support calling
  1726. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  1727. var hadRuntime = g.regeneratorRuntime &&
  1728. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  1729. // Save the old regeneratorRuntime in case it needs to be restored later.
  1730. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  1731. // Force reevalutation of runtime.js.
  1732. g.regeneratorRuntime = undefined;
  1733. module.exports = __webpack_require__(/*! ./runtime */ 14);
  1734. if (hadRuntime) {
  1735. // Restore the original runtime.
  1736. g.regeneratorRuntime = oldRuntime;
  1737. } else {
  1738. // Remove the global property added by runtime.js.
  1739. try {
  1740. delete g.regeneratorRuntime;
  1741. } catch(e) {
  1742. g.regeneratorRuntime = undefined;
  1743. }
  1744. }
  1745. /***/ }),
  1746. /***/ 14:
  1747. /*!*****************************************************!*\
  1748. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  1749. \*****************************************************/
  1750. /*! no static exports found */
  1751. /***/ (function(module, exports) {
  1752. /**
  1753. * Copyright (c) 2014-present, Facebook, Inc.
  1754. *
  1755. * This source code is licensed under the MIT license found in the
  1756. * LICENSE file in the root directory of this source tree.
  1757. */
  1758. !(function(global) {
  1759. "use strict";
  1760. var Op = Object.prototype;
  1761. var hasOwn = Op.hasOwnProperty;
  1762. var undefined; // More compressible than void 0.
  1763. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  1764. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  1765. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  1766. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  1767. var inModule = typeof module === "object";
  1768. var runtime = global.regeneratorRuntime;
  1769. if (runtime) {
  1770. if (inModule) {
  1771. // If regeneratorRuntime is defined globally and we're in a module,
  1772. // make the exports object identical to regeneratorRuntime.
  1773. module.exports = runtime;
  1774. }
  1775. // Don't bother evaluating the rest of this file if the runtime was
  1776. // already defined globally.
  1777. return;
  1778. }
  1779. // Define the runtime globally (as expected by generated code) as either
  1780. // module.exports (if we're in a module) or a new, empty object.
  1781. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  1782. function wrap(innerFn, outerFn, self, tryLocsList) {
  1783. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  1784. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  1785. var generator = Object.create(protoGenerator.prototype);
  1786. var context = new Context(tryLocsList || []);
  1787. // The ._invoke method unifies the implementations of the .next,
  1788. // .throw, and .return methods.
  1789. generator._invoke = makeInvokeMethod(innerFn, self, context);
  1790. return generator;
  1791. }
  1792. runtime.wrap = wrap;
  1793. // Try/catch helper to minimize deoptimizations. Returns a completion
  1794. // record like context.tryEntries[i].completion. This interface could
  1795. // have been (and was previously) designed to take a closure to be
  1796. // invoked without arguments, but in all the cases we care about we
  1797. // already have an existing method we want to call, so there's no need
  1798. // to create a new function object. We can even get away with assuming
  1799. // the method takes exactly one argument, since that happens to be true
  1800. // in every case, so we don't have to touch the arguments object. The
  1801. // only additional allocation required is the completion record, which
  1802. // has a stable shape and so hopefully should be cheap to allocate.
  1803. function tryCatch(fn, obj, arg) {
  1804. try {
  1805. return { type: "normal", arg: fn.call(obj, arg) };
  1806. } catch (err) {
  1807. return { type: "throw", arg: err };
  1808. }
  1809. }
  1810. var GenStateSuspendedStart = "suspendedStart";
  1811. var GenStateSuspendedYield = "suspendedYield";
  1812. var GenStateExecuting = "executing";
  1813. var GenStateCompleted = "completed";
  1814. // Returning this object from the innerFn has the same effect as
  1815. // breaking out of the dispatch switch statement.
  1816. var ContinueSentinel = {};
  1817. // Dummy constructor functions that we use as the .constructor and
  1818. // .constructor.prototype properties for functions that return Generator
  1819. // objects. For full spec compliance, you may wish to configure your
  1820. // minifier not to mangle the names of these two functions.
  1821. function Generator() {}
  1822. function GeneratorFunction() {}
  1823. function GeneratorFunctionPrototype() {}
  1824. // This is a polyfill for %IteratorPrototype% for environments that
  1825. // don't natively support it.
  1826. var IteratorPrototype = {};
  1827. IteratorPrototype[iteratorSymbol] = function () {
  1828. return this;
  1829. };
  1830. var getProto = Object.getPrototypeOf;
  1831. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  1832. if (NativeIteratorPrototype &&
  1833. NativeIteratorPrototype !== Op &&
  1834. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  1835. // This environment has a native %IteratorPrototype%; use it instead
  1836. // of the polyfill.
  1837. IteratorPrototype = NativeIteratorPrototype;
  1838. }
  1839. var Gp = GeneratorFunctionPrototype.prototype =
  1840. Generator.prototype = Object.create(IteratorPrototype);
  1841. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  1842. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  1843. GeneratorFunctionPrototype[toStringTagSymbol] =
  1844. GeneratorFunction.displayName = "GeneratorFunction";
  1845. // Helper for defining the .next, .throw, and .return methods of the
  1846. // Iterator interface in terms of a single ._invoke method.
  1847. function defineIteratorMethods(prototype) {
  1848. ["next", "throw", "return"].forEach(function(method) {
  1849. prototype[method] = function(arg) {
  1850. return this._invoke(method, arg);
  1851. };
  1852. });
  1853. }
  1854. runtime.isGeneratorFunction = function(genFun) {
  1855. var ctor = typeof genFun === "function" && genFun.constructor;
  1856. return ctor
  1857. ? ctor === GeneratorFunction ||
  1858. // For the native GeneratorFunction constructor, the best we can
  1859. // do is to check its .name property.
  1860. (ctor.displayName || ctor.name) === "GeneratorFunction"
  1861. : false;
  1862. };
  1863. runtime.mark = function(genFun) {
  1864. if (Object.setPrototypeOf) {
  1865. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  1866. } else {
  1867. genFun.__proto__ = GeneratorFunctionPrototype;
  1868. if (!(toStringTagSymbol in genFun)) {
  1869. genFun[toStringTagSymbol] = "GeneratorFunction";
  1870. }
  1871. }
  1872. genFun.prototype = Object.create(Gp);
  1873. return genFun;
  1874. };
  1875. // Within the body of any async function, `await x` is transformed to
  1876. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  1877. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  1878. // meant to be awaited.
  1879. runtime.awrap = function(arg) {
  1880. return { __await: arg };
  1881. };
  1882. function AsyncIterator(generator) {
  1883. function invoke(method, arg, resolve, reject) {
  1884. var record = tryCatch(generator[method], generator, arg);
  1885. if (record.type === "throw") {
  1886. reject(record.arg);
  1887. } else {
  1888. var result = record.arg;
  1889. var value = result.value;
  1890. if (value &&
  1891. typeof value === "object" &&
  1892. hasOwn.call(value, "__await")) {
  1893. return Promise.resolve(value.__await).then(function(value) {
  1894. invoke("next", value, resolve, reject);
  1895. }, function(err) {
  1896. invoke("throw", err, resolve, reject);
  1897. });
  1898. }
  1899. return Promise.resolve(value).then(function(unwrapped) {
  1900. // When a yielded Promise is resolved, its final value becomes
  1901. // the .value of the Promise<{value,done}> result for the
  1902. // current iteration.
  1903. result.value = unwrapped;
  1904. resolve(result);
  1905. }, function(error) {
  1906. // If a rejected Promise was yielded, throw the rejection back
  1907. // into the async generator function so it can be handled there.
  1908. return invoke("throw", error, resolve, reject);
  1909. });
  1910. }
  1911. }
  1912. var previousPromise;
  1913. function enqueue(method, arg) {
  1914. function callInvokeWithMethodAndArg() {
  1915. return new Promise(function(resolve, reject) {
  1916. invoke(method, arg, resolve, reject);
  1917. });
  1918. }
  1919. return previousPromise =
  1920. // If enqueue has been called before, then we want to wait until
  1921. // all previous Promises have been resolved before calling invoke,
  1922. // so that results are always delivered in the correct order. If
  1923. // enqueue has not been called before, then it is important to
  1924. // call invoke immediately, without waiting on a callback to fire,
  1925. // so that the async generator function has the opportunity to do
  1926. // any necessary setup in a predictable way. This predictability
  1927. // is why the Promise constructor synchronously invokes its
  1928. // executor callback, and why async functions synchronously
  1929. // execute code before the first await. Since we implement simple
  1930. // async functions in terms of async generators, it is especially
  1931. // important to get this right, even though it requires care.
  1932. previousPromise ? previousPromise.then(
  1933. callInvokeWithMethodAndArg,
  1934. // Avoid propagating failures to Promises returned by later
  1935. // invocations of the iterator.
  1936. callInvokeWithMethodAndArg
  1937. ) : callInvokeWithMethodAndArg();
  1938. }
  1939. // Define the unified helper method that is used to implement .next,
  1940. // .throw, and .return (see defineIteratorMethods).
  1941. this._invoke = enqueue;
  1942. }
  1943. defineIteratorMethods(AsyncIterator.prototype);
  1944. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  1945. return this;
  1946. };
  1947. runtime.AsyncIterator = AsyncIterator;
  1948. // Note that simple async functions are implemented on top of
  1949. // AsyncIterator objects; they just return a Promise for the value of
  1950. // the final result produced by the iterator.
  1951. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  1952. var iter = new AsyncIterator(
  1953. wrap(innerFn, outerFn, self, tryLocsList)
  1954. );
  1955. return runtime.isGeneratorFunction(outerFn)
  1956. ? iter // If outerFn is a generator, return the full iterator.
  1957. : iter.next().then(function(result) {
  1958. return result.done ? result.value : iter.next();
  1959. });
  1960. };
  1961. function makeInvokeMethod(innerFn, self, context) {
  1962. var state = GenStateSuspendedStart;
  1963. return function invoke(method, arg) {
  1964. if (state === GenStateExecuting) {
  1965. throw new Error("Generator is already running");
  1966. }
  1967. if (state === GenStateCompleted) {
  1968. if (method === "throw") {
  1969. throw arg;
  1970. }
  1971. // Be forgiving, per 25.3.3.3.3 of the spec:
  1972. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  1973. return doneResult();
  1974. }
  1975. context.method = method;
  1976. context.arg = arg;
  1977. while (true) {
  1978. var delegate = context.delegate;
  1979. if (delegate) {
  1980. var delegateResult = maybeInvokeDelegate(delegate, context);
  1981. if (delegateResult) {
  1982. if (delegateResult === ContinueSentinel) continue;
  1983. return delegateResult;
  1984. }
  1985. }
  1986. if (context.method === "next") {
  1987. // Setting context._sent for legacy support of Babel's
  1988. // function.sent implementation.
  1989. context.sent = context._sent = context.arg;
  1990. } else if (context.method === "throw") {
  1991. if (state === GenStateSuspendedStart) {
  1992. state = GenStateCompleted;
  1993. throw context.arg;
  1994. }
  1995. context.dispatchException(context.arg);
  1996. } else if (context.method === "return") {
  1997. context.abrupt("return", context.arg);
  1998. }
  1999. state = GenStateExecuting;
  2000. var record = tryCatch(innerFn, self, context);
  2001. if (record.type === "normal") {
  2002. // If an exception is thrown from innerFn, we leave state ===
  2003. // GenStateExecuting and loop back for another invocation.
  2004. state = context.done
  2005. ? GenStateCompleted
  2006. : GenStateSuspendedYield;
  2007. if (record.arg === ContinueSentinel) {
  2008. continue;
  2009. }
  2010. return {
  2011. value: record.arg,
  2012. done: context.done
  2013. };
  2014. } else if (record.type === "throw") {
  2015. state = GenStateCompleted;
  2016. // Dispatch the exception by looping back around to the
  2017. // context.dispatchException(context.arg) call above.
  2018. context.method = "throw";
  2019. context.arg = record.arg;
  2020. }
  2021. }
  2022. };
  2023. }
  2024. // Call delegate.iterator[context.method](context.arg) and handle the
  2025. // result, either by returning a { value, done } result from the
  2026. // delegate iterator, or by modifying context.method and context.arg,
  2027. // setting context.delegate to null, and returning the ContinueSentinel.
  2028. function maybeInvokeDelegate(delegate, context) {
  2029. var method = delegate.iterator[context.method];
  2030. if (method === undefined) {
  2031. // A .throw or .return when the delegate iterator has no .throw
  2032. // method always terminates the yield* loop.
  2033. context.delegate = null;
  2034. if (context.method === "throw") {
  2035. if (delegate.iterator.return) {
  2036. // If the delegate iterator has a return method, give it a
  2037. // chance to clean up.
  2038. context.method = "return";
  2039. context.arg = undefined;
  2040. maybeInvokeDelegate(delegate, context);
  2041. if (context.method === "throw") {
  2042. // If maybeInvokeDelegate(context) changed context.method from
  2043. // "return" to "throw", let that override the TypeError below.
  2044. return ContinueSentinel;
  2045. }
  2046. }
  2047. context.method = "throw";
  2048. context.arg = new TypeError(
  2049. "The iterator does not provide a 'throw' method");
  2050. }
  2051. return ContinueSentinel;
  2052. }
  2053. var record = tryCatch(method, delegate.iterator, context.arg);
  2054. if (record.type === "throw") {
  2055. context.method = "throw";
  2056. context.arg = record.arg;
  2057. context.delegate = null;
  2058. return ContinueSentinel;
  2059. }
  2060. var info = record.arg;
  2061. if (! info) {
  2062. context.method = "throw";
  2063. context.arg = new TypeError("iterator result is not an object");
  2064. context.delegate = null;
  2065. return ContinueSentinel;
  2066. }
  2067. if (info.done) {
  2068. // Assign the result of the finished delegate to the temporary
  2069. // variable specified by delegate.resultName (see delegateYield).
  2070. context[delegate.resultName] = info.value;
  2071. // Resume execution at the desired location (see delegateYield).
  2072. context.next = delegate.nextLoc;
  2073. // If context.method was "throw" but the delegate handled the
  2074. // exception, let the outer generator proceed normally. If
  2075. // context.method was "next", forget context.arg since it has been
  2076. // "consumed" by the delegate iterator. If context.method was
  2077. // "return", allow the original .return call to continue in the
  2078. // outer generator.
  2079. if (context.method !== "return") {
  2080. context.method = "next";
  2081. context.arg = undefined;
  2082. }
  2083. } else {
  2084. // Re-yield the result returned by the delegate method.
  2085. return info;
  2086. }
  2087. // The delegate iterator is finished, so forget it and continue with
  2088. // the outer generator.
  2089. context.delegate = null;
  2090. return ContinueSentinel;
  2091. }
  2092. // Define Generator.prototype.{next,throw,return} in terms of the
  2093. // unified ._invoke helper method.
  2094. defineIteratorMethods(Gp);
  2095. Gp[toStringTagSymbol] = "Generator";
  2096. // A Generator should always return itself as the iterator object when the
  2097. // @@iterator function is called on it. Some browsers' implementations of the
  2098. // iterator prototype chain incorrectly implement this, causing the Generator
  2099. // object to not be returned from this call. This ensures that doesn't happen.
  2100. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2101. Gp[iteratorSymbol] = function() {
  2102. return this;
  2103. };
  2104. Gp.toString = function() {
  2105. return "[object Generator]";
  2106. };
  2107. function pushTryEntry(locs) {
  2108. var entry = { tryLoc: locs[0] };
  2109. if (1 in locs) {
  2110. entry.catchLoc = locs[1];
  2111. }
  2112. if (2 in locs) {
  2113. entry.finallyLoc = locs[2];
  2114. entry.afterLoc = locs[3];
  2115. }
  2116. this.tryEntries.push(entry);
  2117. }
  2118. function resetTryEntry(entry) {
  2119. var record = entry.completion || {};
  2120. record.type = "normal";
  2121. delete record.arg;
  2122. entry.completion = record;
  2123. }
  2124. function Context(tryLocsList) {
  2125. // The root entry object (effectively a try statement without a catch
  2126. // or a finally block) gives us a place to store values thrown from
  2127. // locations where there is no enclosing try statement.
  2128. this.tryEntries = [{ tryLoc: "root" }];
  2129. tryLocsList.forEach(pushTryEntry, this);
  2130. this.reset(true);
  2131. }
  2132. runtime.keys = function(object) {
  2133. var keys = [];
  2134. for (var key in object) {
  2135. keys.push(key);
  2136. }
  2137. keys.reverse();
  2138. // Rather than returning an object with a next method, we keep
  2139. // things simple and return the next function itself.
  2140. return function next() {
  2141. while (keys.length) {
  2142. var key = keys.pop();
  2143. if (key in object) {
  2144. next.value = key;
  2145. next.done = false;
  2146. return next;
  2147. }
  2148. }
  2149. // To avoid creating an additional object, we just hang the .value
  2150. // and .done properties off the next function object itself. This
  2151. // also ensures that the minifier will not anonymize the function.
  2152. next.done = true;
  2153. return next;
  2154. };
  2155. };
  2156. function values(iterable) {
  2157. if (iterable) {
  2158. var iteratorMethod = iterable[iteratorSymbol];
  2159. if (iteratorMethod) {
  2160. return iteratorMethod.call(iterable);
  2161. }
  2162. if (typeof iterable.next === "function") {
  2163. return iterable;
  2164. }
  2165. if (!isNaN(iterable.length)) {
  2166. var i = -1, next = function next() {
  2167. while (++i < iterable.length) {
  2168. if (hasOwn.call(iterable, i)) {
  2169. next.value = iterable[i];
  2170. next.done = false;
  2171. return next;
  2172. }
  2173. }
  2174. next.value = undefined;
  2175. next.done = true;
  2176. return next;
  2177. };
  2178. return next.next = next;
  2179. }
  2180. }
  2181. // Return an iterator with no values.
  2182. return { next: doneResult };
  2183. }
  2184. runtime.values = values;
  2185. function doneResult() {
  2186. return { value: undefined, done: true };
  2187. }
  2188. Context.prototype = {
  2189. constructor: Context,
  2190. reset: function(skipTempReset) {
  2191. this.prev = 0;
  2192. this.next = 0;
  2193. // Resetting context._sent for legacy support of Babel's
  2194. // function.sent implementation.
  2195. this.sent = this._sent = undefined;
  2196. this.done = false;
  2197. this.delegate = null;
  2198. this.method = "next";
  2199. this.arg = undefined;
  2200. this.tryEntries.forEach(resetTryEntry);
  2201. if (!skipTempReset) {
  2202. for (var name in this) {
  2203. // Not sure about the optimal order of these conditions:
  2204. if (name.charAt(0) === "t" &&
  2205. hasOwn.call(this, name) &&
  2206. !isNaN(+name.slice(1))) {
  2207. this[name] = undefined;
  2208. }
  2209. }
  2210. }
  2211. },
  2212. stop: function() {
  2213. this.done = true;
  2214. var rootEntry = this.tryEntries[0];
  2215. var rootRecord = rootEntry.completion;
  2216. if (rootRecord.type === "throw") {
  2217. throw rootRecord.arg;
  2218. }
  2219. return this.rval;
  2220. },
  2221. dispatchException: function(exception) {
  2222. if (this.done) {
  2223. throw exception;
  2224. }
  2225. var context = this;
  2226. function handle(loc, caught) {
  2227. record.type = "throw";
  2228. record.arg = exception;
  2229. context.next = loc;
  2230. if (caught) {
  2231. // If the dispatched exception was caught by a catch block,
  2232. // then let that catch block handle the exception normally.
  2233. context.method = "next";
  2234. context.arg = undefined;
  2235. }
  2236. return !! caught;
  2237. }
  2238. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2239. var entry = this.tryEntries[i];
  2240. var record = entry.completion;
  2241. if (entry.tryLoc === "root") {
  2242. // Exception thrown outside of any try block that could handle
  2243. // it, so set the completion value of the entire function to
  2244. // throw the exception.
  2245. return handle("end");
  2246. }
  2247. if (entry.tryLoc <= this.prev) {
  2248. var hasCatch = hasOwn.call(entry, "catchLoc");
  2249. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2250. if (hasCatch && hasFinally) {
  2251. if (this.prev < entry.catchLoc) {
  2252. return handle(entry.catchLoc, true);
  2253. } else if (this.prev < entry.finallyLoc) {
  2254. return handle(entry.finallyLoc);
  2255. }
  2256. } else if (hasCatch) {
  2257. if (this.prev < entry.catchLoc) {
  2258. return handle(entry.catchLoc, true);
  2259. }
  2260. } else if (hasFinally) {
  2261. if (this.prev < entry.finallyLoc) {
  2262. return handle(entry.finallyLoc);
  2263. }
  2264. } else {
  2265. throw new Error("try statement without catch or finally");
  2266. }
  2267. }
  2268. }
  2269. },
  2270. abrupt: function(type, arg) {
  2271. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2272. var entry = this.tryEntries[i];
  2273. if (entry.tryLoc <= this.prev &&
  2274. hasOwn.call(entry, "finallyLoc") &&
  2275. this.prev < entry.finallyLoc) {
  2276. var finallyEntry = entry;
  2277. break;
  2278. }
  2279. }
  2280. if (finallyEntry &&
  2281. (type === "break" ||
  2282. type === "continue") &&
  2283. finallyEntry.tryLoc <= arg &&
  2284. arg <= finallyEntry.finallyLoc) {
  2285. // Ignore the finally entry if control is not jumping to a
  2286. // location outside the try/catch block.
  2287. finallyEntry = null;
  2288. }
  2289. var record = finallyEntry ? finallyEntry.completion : {};
  2290. record.type = type;
  2291. record.arg = arg;
  2292. if (finallyEntry) {
  2293. this.method = "next";
  2294. this.next = finallyEntry.finallyLoc;
  2295. return ContinueSentinel;
  2296. }
  2297. return this.complete(record);
  2298. },
  2299. complete: function(record, afterLoc) {
  2300. if (record.type === "throw") {
  2301. throw record.arg;
  2302. }
  2303. if (record.type === "break" ||
  2304. record.type === "continue") {
  2305. this.next = record.arg;
  2306. } else if (record.type === "return") {
  2307. this.rval = this.arg = record.arg;
  2308. this.method = "return";
  2309. this.next = "end";
  2310. } else if (record.type === "normal" && afterLoc) {
  2311. this.next = afterLoc;
  2312. }
  2313. return ContinueSentinel;
  2314. },
  2315. finish: function(finallyLoc) {
  2316. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2317. var entry = this.tryEntries[i];
  2318. if (entry.finallyLoc === finallyLoc) {
  2319. this.complete(entry.completion, entry.afterLoc);
  2320. resetTryEntry(entry);
  2321. return ContinueSentinel;
  2322. }
  2323. }
  2324. },
  2325. "catch": function(tryLoc) {
  2326. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2327. var entry = this.tryEntries[i];
  2328. if (entry.tryLoc === tryLoc) {
  2329. var record = entry.completion;
  2330. if (record.type === "throw") {
  2331. var thrown = record.arg;
  2332. resetTryEntry(entry);
  2333. }
  2334. return thrown;
  2335. }
  2336. }
  2337. // The context.catch method must only be called with a location
  2338. // argument that corresponds to a known catch block.
  2339. throw new Error("illegal catch attempt");
  2340. },
  2341. delegateYield: function(iterable, resultName, nextLoc) {
  2342. this.delegate = {
  2343. iterator: values(iterable),
  2344. resultName: resultName,
  2345. nextLoc: nextLoc
  2346. };
  2347. if (this.method === "next") {
  2348. // Deliberately forget the last sent value so that we don't
  2349. // accidentally pass it on to the delegate.
  2350. this.arg = undefined;
  2351. }
  2352. return ContinueSentinel;
  2353. }
  2354. };
  2355. })(
  2356. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2357. // Function constructor if we're in global strict mode. That is sadly a form
  2358. // of indirect eval which violates Content Security Policy.
  2359. (function() {
  2360. return this || (typeof self === "object" && self);
  2361. })() || Function("return this")()
  2362. );
  2363. /***/ }),
  2364. /***/ 15:
  2365. /*!********************************************!*\
  2366. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  2367. \********************************************/
  2368. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  2369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2370. "use strict";
  2371. __webpack_require__.r(__webpack_exports__);
  2372. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  2373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  2374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  2375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  2376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  2377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  2378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  2379. /*!
  2380. * vuex v3.4.0
  2381. * (c) 2020 Evan You
  2382. * @license MIT
  2383. */
  2384. function applyMixin (Vue) {
  2385. var version = Number(Vue.version.split('.')[0]);
  2386. if (version >= 2) {
  2387. Vue.mixin({ beforeCreate: vuexInit });
  2388. } else {
  2389. // override init and inject vuex init procedure
  2390. // for 1.x backwards compatibility.
  2391. var _init = Vue.prototype._init;
  2392. Vue.prototype._init = function (options) {
  2393. if ( options === void 0 ) options = {};
  2394. options.init = options.init
  2395. ? [vuexInit].concat(options.init)
  2396. : vuexInit;
  2397. _init.call(this, options);
  2398. };
  2399. }
  2400. /**
  2401. * Vuex init hook, injected into each instances init hooks list.
  2402. */
  2403. function vuexInit () {
  2404. var options = this.$options;
  2405. // store injection
  2406. if (options.store) {
  2407. this.$store = typeof options.store === 'function'
  2408. ? options.store()
  2409. : options.store;
  2410. } else if (options.parent && options.parent.$store) {
  2411. this.$store = options.parent.$store;
  2412. }
  2413. }
  2414. }
  2415. var target = typeof window !== 'undefined'
  2416. ? window
  2417. : typeof global !== 'undefined'
  2418. ? global
  2419. : {};
  2420. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2421. function devtoolPlugin (store) {
  2422. if (!devtoolHook) { return }
  2423. store._devtoolHook = devtoolHook;
  2424. devtoolHook.emit('vuex:init', store);
  2425. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  2426. store.replaceState(targetState);
  2427. });
  2428. store.subscribe(function (mutation, state) {
  2429. devtoolHook.emit('vuex:mutation', mutation, state);
  2430. }, { prepend: true });
  2431. store.subscribeAction(function (action, state) {
  2432. devtoolHook.emit('vuex:action', action, state);
  2433. }, { prepend: true });
  2434. }
  2435. /**
  2436. * Get the first item that pass the test
  2437. * by second argument function
  2438. *
  2439. * @param {Array} list
  2440. * @param {Function} f
  2441. * @return {*}
  2442. */
  2443. /**
  2444. * forEach for object
  2445. */
  2446. function forEachValue (obj, fn) {
  2447. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  2448. }
  2449. function isObject (obj) {
  2450. return obj !== null && typeof obj === 'object'
  2451. }
  2452. function isPromise (val) {
  2453. return val && typeof val.then === 'function'
  2454. }
  2455. function assert (condition, msg) {
  2456. if (!condition) { throw new Error(("[vuex] " + msg)) }
  2457. }
  2458. function partial (fn, arg) {
  2459. return function () {
  2460. return fn(arg)
  2461. }
  2462. }
  2463. // Base data struct for store's module, package with some attribute and method
  2464. var Module = function Module (rawModule, runtime) {
  2465. this.runtime = runtime;
  2466. // Store some children item
  2467. this._children = Object.create(null);
  2468. // Store the origin module object which passed by programmer
  2469. this._rawModule = rawModule;
  2470. var rawState = rawModule.state;
  2471. // Store the origin module's state
  2472. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  2473. };
  2474. var prototypeAccessors = { namespaced: { configurable: true } };
  2475. prototypeAccessors.namespaced.get = function () {
  2476. return !!this._rawModule.namespaced
  2477. };
  2478. Module.prototype.addChild = function addChild (key, module) {
  2479. this._children[key] = module;
  2480. };
  2481. Module.prototype.removeChild = function removeChild (key) {
  2482. delete this._children[key];
  2483. };
  2484. Module.prototype.getChild = function getChild (key) {
  2485. return this._children[key]
  2486. };
  2487. Module.prototype.hasChild = function hasChild (key) {
  2488. return key in this._children
  2489. };
  2490. Module.prototype.update = function update (rawModule) {
  2491. this._rawModule.namespaced = rawModule.namespaced;
  2492. if (rawModule.actions) {
  2493. this._rawModule.actions = rawModule.actions;
  2494. }
  2495. if (rawModule.mutations) {
  2496. this._rawModule.mutations = rawModule.mutations;
  2497. }
  2498. if (rawModule.getters) {
  2499. this._rawModule.getters = rawModule.getters;
  2500. }
  2501. };
  2502. Module.prototype.forEachChild = function forEachChild (fn) {
  2503. forEachValue(this._children, fn);
  2504. };
  2505. Module.prototype.forEachGetter = function forEachGetter (fn) {
  2506. if (this._rawModule.getters) {
  2507. forEachValue(this._rawModule.getters, fn);
  2508. }
  2509. };
  2510. Module.prototype.forEachAction = function forEachAction (fn) {
  2511. if (this._rawModule.actions) {
  2512. forEachValue(this._rawModule.actions, fn);
  2513. }
  2514. };
  2515. Module.prototype.forEachMutation = function forEachMutation (fn) {
  2516. if (this._rawModule.mutations) {
  2517. forEachValue(this._rawModule.mutations, fn);
  2518. }
  2519. };
  2520. Object.defineProperties( Module.prototype, prototypeAccessors );
  2521. var ModuleCollection = function ModuleCollection (rawRootModule) {
  2522. // register root module (Vuex.Store options)
  2523. this.register([], rawRootModule, false);
  2524. };
  2525. ModuleCollection.prototype.get = function get (path) {
  2526. return path.reduce(function (module, key) {
  2527. return module.getChild(key)
  2528. }, this.root)
  2529. };
  2530. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  2531. var module = this.root;
  2532. return path.reduce(function (namespace, key) {
  2533. module = module.getChild(key);
  2534. return namespace + (module.namespaced ? key + '/' : '')
  2535. }, '')
  2536. };
  2537. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  2538. update([], this.root, rawRootModule);
  2539. };
  2540. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  2541. var this$1 = this;
  2542. if ( runtime === void 0 ) runtime = true;
  2543. if ((true)) {
  2544. assertRawModule(path, rawModule);
  2545. }
  2546. var newModule = new Module(rawModule, runtime);
  2547. if (path.length === 0) {
  2548. this.root = newModule;
  2549. } else {
  2550. var parent = this.get(path.slice(0, -1));
  2551. parent.addChild(path[path.length - 1], newModule);
  2552. }
  2553. // register nested modules
  2554. if (rawModule.modules) {
  2555. forEachValue(rawModule.modules, function (rawChildModule, key) {
  2556. this$1.register(path.concat(key), rawChildModule, runtime);
  2557. });
  2558. }
  2559. };
  2560. ModuleCollection.prototype.unregister = function unregister (path) {
  2561. var parent = this.get(path.slice(0, -1));
  2562. var key = path[path.length - 1];
  2563. if (!parent.getChild(key).runtime) { return }
  2564. parent.removeChild(key);
  2565. };
  2566. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  2567. var parent = this.get(path.slice(0, -1));
  2568. var key = path[path.length - 1];
  2569. return parent.hasChild(key)
  2570. };
  2571. function update (path, targetModule, newModule) {
  2572. if ((true)) {
  2573. assertRawModule(path, newModule);
  2574. }
  2575. // update target module
  2576. targetModule.update(newModule);
  2577. // update nested modules
  2578. if (newModule.modules) {
  2579. for (var key in newModule.modules) {
  2580. if (!targetModule.getChild(key)) {
  2581. if ((true)) {
  2582. console.warn(
  2583. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  2584. 'manual reload is needed'
  2585. );
  2586. }
  2587. return
  2588. }
  2589. update(
  2590. path.concat(key),
  2591. targetModule.getChild(key),
  2592. newModule.modules[key]
  2593. );
  2594. }
  2595. }
  2596. }
  2597. var functionAssert = {
  2598. assert: function (value) { return typeof value === 'function'; },
  2599. expected: 'function'
  2600. };
  2601. var objectAssert = {
  2602. assert: function (value) { return typeof value === 'function' ||
  2603. (typeof value === 'object' && typeof value.handler === 'function'); },
  2604. expected: 'function or object with "handler" function'
  2605. };
  2606. var assertTypes = {
  2607. getters: functionAssert,
  2608. mutations: functionAssert,
  2609. actions: objectAssert
  2610. };
  2611. function assertRawModule (path, rawModule) {
  2612. Object.keys(assertTypes).forEach(function (key) {
  2613. if (!rawModule[key]) { return }
  2614. var assertOptions = assertTypes[key];
  2615. forEachValue(rawModule[key], function (value, type) {
  2616. assert(
  2617. assertOptions.assert(value),
  2618. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  2619. );
  2620. });
  2621. });
  2622. }
  2623. function makeAssertionMessage (path, key, type, value, expected) {
  2624. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  2625. if (path.length > 0) {
  2626. buf += " in module \"" + (path.join('.')) + "\"";
  2627. }
  2628. buf += " is " + (JSON.stringify(value)) + ".";
  2629. return buf
  2630. }
  2631. var Vue; // bind on install
  2632. var Store = function Store (options) {
  2633. var this$1 = this;
  2634. if ( options === void 0 ) options = {};
  2635. // Auto install if it is not done yet and `window` has `Vue`.
  2636. // To allow users to avoid auto-installation in some cases,
  2637. // this code should be placed here. See #731
  2638. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  2639. install(window.Vue);
  2640. }
  2641. if ((true)) {
  2642. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  2643. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  2644. assert(this instanceof Store, "store must be called with the new operator.");
  2645. }
  2646. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2647. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2648. // store internal state
  2649. this._committing = false;
  2650. this._actions = Object.create(null);
  2651. this._actionSubscribers = [];
  2652. this._mutations = Object.create(null);
  2653. this._wrappedGetters = Object.create(null);
  2654. this._modules = new ModuleCollection(options);
  2655. this._modulesNamespaceMap = Object.create(null);
  2656. this._subscribers = [];
  2657. this._watcherVM = new Vue();
  2658. this._makeLocalGettersCache = Object.create(null);
  2659. // bind commit and dispatch to self
  2660. var store = this;
  2661. var ref = this;
  2662. var dispatch = ref.dispatch;
  2663. var commit = ref.commit;
  2664. this.dispatch = function boundDispatch (type, payload) {
  2665. return dispatch.call(store, type, payload)
  2666. };
  2667. this.commit = function boundCommit (type, payload, options) {
  2668. return commit.call(store, type, payload, options)
  2669. };
  2670. // strict mode
  2671. this.strict = strict;
  2672. var state = this._modules.root.state;
  2673. // init root module.
  2674. // this also recursively registers all sub-modules
  2675. // and collects all module getters inside this._wrappedGetters
  2676. installModule(this, state, [], this._modules.root);
  2677. // initialize the store vm, which is responsible for the reactivity
  2678. // (also registers _wrappedGetters as computed properties)
  2679. resetStoreVM(this, state);
  2680. // apply plugins
  2681. plugins.forEach(function (plugin) { return plugin(this$1); });
  2682. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  2683. if (useDevtools) {
  2684. devtoolPlugin(this);
  2685. }
  2686. };
  2687. var prototypeAccessors$1 = { state: { configurable: true } };
  2688. prototypeAccessors$1.state.get = function () {
  2689. return this._vm._data.$$state
  2690. };
  2691. prototypeAccessors$1.state.set = function (v) {
  2692. if ((true)) {
  2693. assert(false, "use store.replaceState() to explicit replace store state.");
  2694. }
  2695. };
  2696. Store.prototype.commit = function commit (_type, _payload, _options) {
  2697. var this$1 = this;
  2698. // check object-style commit
  2699. var ref = unifyObjectStyle(_type, _payload, _options);
  2700. var type = ref.type;
  2701. var payload = ref.payload;
  2702. var options = ref.options;
  2703. var mutation = { type: type, payload: payload };
  2704. var entry = this._mutations[type];
  2705. if (!entry) {
  2706. if ((true)) {
  2707. console.error(("[vuex] unknown mutation type: " + type));
  2708. }
  2709. return
  2710. }
  2711. this._withCommit(function () {
  2712. entry.forEach(function commitIterator (handler) {
  2713. handler(payload);
  2714. });
  2715. });
  2716. this._subscribers
  2717. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2718. .forEach(function (sub) { return sub(mutation, this$1.state); });
  2719. if (
  2720. ( true) &&
  2721. options && options.silent
  2722. ) {
  2723. console.warn(
  2724. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  2725. 'Use the filter functionality in the vue-devtools'
  2726. );
  2727. }
  2728. };
  2729. Store.prototype.dispatch = function dispatch (_type, _payload) {
  2730. var this$1 = this;
  2731. // check object-style dispatch
  2732. var ref = unifyObjectStyle(_type, _payload);
  2733. var type = ref.type;
  2734. var payload = ref.payload;
  2735. var action = { type: type, payload: payload };
  2736. var entry = this._actions[type];
  2737. if (!entry) {
  2738. if ((true)) {
  2739. console.error(("[vuex] unknown action type: " + type));
  2740. }
  2741. return
  2742. }
  2743. try {
  2744. this._actionSubscribers
  2745. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2746. .filter(function (sub) { return sub.before; })
  2747. .forEach(function (sub) { return sub.before(action, this$1.state); });
  2748. } catch (e) {
  2749. if ((true)) {
  2750. console.warn("[vuex] error in before action subscribers: ");
  2751. console.error(e);
  2752. }
  2753. }
  2754. var result = entry.length > 1
  2755. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2756. : entry[0](payload);
  2757. return new Promise(function (resolve, reject) {
  2758. result.then(function (res) {
  2759. try {
  2760. this$1._actionSubscribers
  2761. .filter(function (sub) { return sub.after; })
  2762. .forEach(function (sub) { return sub.after(action, this$1.state); });
  2763. } catch (e) {
  2764. if ((true)) {
  2765. console.warn("[vuex] error in after action subscribers: ");
  2766. console.error(e);
  2767. }
  2768. }
  2769. resolve(res);
  2770. }, function (error) {
  2771. try {
  2772. this$1._actionSubscribers
  2773. .filter(function (sub) { return sub.error; })
  2774. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  2775. } catch (e) {
  2776. if ((true)) {
  2777. console.warn("[vuex] error in error action subscribers: ");
  2778. console.error(e);
  2779. }
  2780. }
  2781. reject(error);
  2782. });
  2783. })
  2784. };
  2785. Store.prototype.subscribe = function subscribe (fn, options) {
  2786. return genericSubscribe(fn, this._subscribers, options)
  2787. };
  2788. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  2789. var subs = typeof fn === 'function' ? { before: fn } : fn;
  2790. return genericSubscribe(subs, this._actionSubscribers, options)
  2791. };
  2792. Store.prototype.watch = function watch (getter, cb, options) {
  2793. var this$1 = this;
  2794. if ((true)) {
  2795. assert(typeof getter === 'function', "store.watch only accepts a function.");
  2796. }
  2797. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  2798. };
  2799. Store.prototype.replaceState = function replaceState (state) {
  2800. var this$1 = this;
  2801. this._withCommit(function () {
  2802. this$1._vm._data.$$state = state;
  2803. });
  2804. };
  2805. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  2806. if ( options === void 0 ) options = {};
  2807. if (typeof path === 'string') { path = [path]; }
  2808. if ((true)) {
  2809. assert(Array.isArray(path), "module path must be a string or an Array.");
  2810. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  2811. }
  2812. this._modules.register(path, rawModule);
  2813. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  2814. // reset store to update getters...
  2815. resetStoreVM(this, this.state);
  2816. };
  2817. Store.prototype.unregisterModule = function unregisterModule (path) {
  2818. var this$1 = this;
  2819. if (typeof path === 'string') { path = [path]; }
  2820. if ((true)) {
  2821. assert(Array.isArray(path), "module path must be a string or an Array.");
  2822. }
  2823. this._modules.unregister(path);
  2824. this._withCommit(function () {
  2825. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  2826. Vue.delete(parentState, path[path.length - 1]);
  2827. });
  2828. resetStore(this);
  2829. };
  2830. Store.prototype.hasModule = function hasModule (path) {
  2831. if (typeof path === 'string') { path = [path]; }
  2832. if ((true)) {
  2833. assert(Array.isArray(path), "module path must be a string or an Array.");
  2834. }
  2835. return this._modules.isRegistered(path)
  2836. };
  2837. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2838. this._modules.update(newOptions);
  2839. resetStore(this, true);
  2840. };
  2841. Store.prototype._withCommit = function _withCommit (fn) {
  2842. var committing = this._committing;
  2843. this._committing = true;
  2844. fn();
  2845. this._committing = committing;
  2846. };
  2847. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  2848. function genericSubscribe (fn, subs, options) {
  2849. if (subs.indexOf(fn) < 0) {
  2850. options && options.prepend
  2851. ? subs.unshift(fn)
  2852. : subs.push(fn);
  2853. }
  2854. return function () {
  2855. var i = subs.indexOf(fn);
  2856. if (i > -1) {
  2857. subs.splice(i, 1);
  2858. }
  2859. }
  2860. }
  2861. function resetStore (store, hot) {
  2862. store._actions = Object.create(null);
  2863. store._mutations = Object.create(null);
  2864. store._wrappedGetters = Object.create(null);
  2865. store._modulesNamespaceMap = Object.create(null);
  2866. var state = store.state;
  2867. // init all modules
  2868. installModule(store, state, [], store._modules.root, true);
  2869. // reset vm
  2870. resetStoreVM(store, state, hot);
  2871. }
  2872. function resetStoreVM (store, state, hot) {
  2873. var oldVm = store._vm;
  2874. // bind store public getters
  2875. store.getters = {};
  2876. // reset local getters cache
  2877. store._makeLocalGettersCache = Object.create(null);
  2878. var wrappedGetters = store._wrappedGetters;
  2879. var computed = {};
  2880. forEachValue(wrappedGetters, function (fn, key) {
  2881. // use computed to leverage its lazy-caching mechanism
  2882. // direct inline function use will lead to closure preserving oldVm.
  2883. // using partial to return function with only arguments preserved in closure environment.
  2884. computed[key] = partial(fn, store);
  2885. Object.defineProperty(store.getters, key, {
  2886. get: function () { return store._vm[key]; },
  2887. enumerable: true // for local getters
  2888. });
  2889. });
  2890. // use a Vue instance to store the state tree
  2891. // suppress warnings just in case the user has added
  2892. // some funky global mixins
  2893. var silent = Vue.config.silent;
  2894. Vue.config.silent = true;
  2895. store._vm = new Vue({
  2896. data: {
  2897. $$state: state
  2898. },
  2899. computed: computed
  2900. });
  2901. Vue.config.silent = silent;
  2902. // enable strict mode for new vm
  2903. if (store.strict) {
  2904. enableStrictMode(store);
  2905. }
  2906. if (oldVm) {
  2907. if (hot) {
  2908. // dispatch changes in all subscribed watchers
  2909. // to force getter re-evaluation for hot reloading.
  2910. store._withCommit(function () {
  2911. oldVm._data.$$state = null;
  2912. });
  2913. }
  2914. Vue.nextTick(function () { return oldVm.$destroy(); });
  2915. }
  2916. }
  2917. function installModule (store, rootState, path, module, hot) {
  2918. var isRoot = !path.length;
  2919. var namespace = store._modules.getNamespace(path);
  2920. // register in namespace map
  2921. if (module.namespaced) {
  2922. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  2923. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  2924. }
  2925. store._modulesNamespaceMap[namespace] = module;
  2926. }
  2927. // set state
  2928. if (!isRoot && !hot) {
  2929. var parentState = getNestedState(rootState, path.slice(0, -1));
  2930. var moduleName = path[path.length - 1];
  2931. store._withCommit(function () {
  2932. if ((true)) {
  2933. if (moduleName in parentState) {
  2934. console.warn(
  2935. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  2936. );
  2937. }
  2938. }
  2939. Vue.set(parentState, moduleName, module.state);
  2940. });
  2941. }
  2942. var local = module.context = makeLocalContext(store, namespace, path);
  2943. module.forEachMutation(function (mutation, key) {
  2944. var namespacedType = namespace + key;
  2945. registerMutation(store, namespacedType, mutation, local);
  2946. });
  2947. module.forEachAction(function (action, key) {
  2948. var type = action.root ? key : namespace + key;
  2949. var handler = action.handler || action;
  2950. registerAction(store, type, handler, local);
  2951. });
  2952. module.forEachGetter(function (getter, key) {
  2953. var namespacedType = namespace + key;
  2954. registerGetter(store, namespacedType, getter, local);
  2955. });
  2956. module.forEachChild(function (child, key) {
  2957. installModule(store, rootState, path.concat(key), child, hot);
  2958. });
  2959. }
  2960. /**
  2961. * make localized dispatch, commit, getters and state
  2962. * if there is no namespace, just use root ones
  2963. */
  2964. function makeLocalContext (store, namespace, path) {
  2965. var noNamespace = namespace === '';
  2966. var local = {
  2967. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  2968. var args = unifyObjectStyle(_type, _payload, _options);
  2969. var payload = args.payload;
  2970. var options = args.options;
  2971. var type = args.type;
  2972. if (!options || !options.root) {
  2973. type = namespace + type;
  2974. if (( true) && !store._actions[type]) {
  2975. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  2976. return
  2977. }
  2978. }
  2979. return store.dispatch(type, payload)
  2980. },
  2981. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  2982. var args = unifyObjectStyle(_type, _payload, _options);
  2983. var payload = args.payload;
  2984. var options = args.options;
  2985. var type = args.type;
  2986. if (!options || !options.root) {
  2987. type = namespace + type;
  2988. if (( true) && !store._mutations[type]) {
  2989. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  2990. return
  2991. }
  2992. }
  2993. store.commit(type, payload, options);
  2994. }
  2995. };
  2996. // getters and state object must be gotten lazily
  2997. // because they will be changed by vm update
  2998. Object.defineProperties(local, {
  2999. getters: {
  3000. get: noNamespace
  3001. ? function () { return store.getters; }
  3002. : function () { return makeLocalGetters(store, namespace); }
  3003. },
  3004. state: {
  3005. get: function () { return getNestedState(store.state, path); }
  3006. }
  3007. });
  3008. return local
  3009. }
  3010. function makeLocalGetters (store, namespace) {
  3011. if (!store._makeLocalGettersCache[namespace]) {
  3012. var gettersProxy = {};
  3013. var splitPos = namespace.length;
  3014. Object.keys(store.getters).forEach(function (type) {
  3015. // skip if the target getter is not match this namespace
  3016. if (type.slice(0, splitPos) !== namespace) { return }
  3017. // extract local getter type
  3018. var localType = type.slice(splitPos);
  3019. // Add a port to the getters proxy.
  3020. // Define as getter property because
  3021. // we do not want to evaluate the getters in this time.
  3022. Object.defineProperty(gettersProxy, localType, {
  3023. get: function () { return store.getters[type]; },
  3024. enumerable: true
  3025. });
  3026. });
  3027. store._makeLocalGettersCache[namespace] = gettersProxy;
  3028. }
  3029. return store._makeLocalGettersCache[namespace]
  3030. }
  3031. function registerMutation (store, type, handler, local) {
  3032. var entry = store._mutations[type] || (store._mutations[type] = []);
  3033. entry.push(function wrappedMutationHandler (payload) {
  3034. handler.call(store, local.state, payload);
  3035. });
  3036. }
  3037. function registerAction (store, type, handler, local) {
  3038. var entry = store._actions[type] || (store._actions[type] = []);
  3039. entry.push(function wrappedActionHandler (payload) {
  3040. var res = handler.call(store, {
  3041. dispatch: local.dispatch,
  3042. commit: local.commit,
  3043. getters: local.getters,
  3044. state: local.state,
  3045. rootGetters: store.getters,
  3046. rootState: store.state
  3047. }, payload);
  3048. if (!isPromise(res)) {
  3049. res = Promise.resolve(res);
  3050. }
  3051. if (store._devtoolHook) {
  3052. return res.catch(function (err) {
  3053. store._devtoolHook.emit('vuex:error', err);
  3054. throw err
  3055. })
  3056. } else {
  3057. return res
  3058. }
  3059. });
  3060. }
  3061. function registerGetter (store, type, rawGetter, local) {
  3062. if (store._wrappedGetters[type]) {
  3063. if ((true)) {
  3064. console.error(("[vuex] duplicate getter key: " + type));
  3065. }
  3066. return
  3067. }
  3068. store._wrappedGetters[type] = function wrappedGetter (store) {
  3069. return rawGetter(
  3070. local.state, // local state
  3071. local.getters, // local getters
  3072. store.state, // root state
  3073. store.getters // root getters
  3074. )
  3075. };
  3076. }
  3077. function enableStrictMode (store) {
  3078. store._vm.$watch(function () { return this._data.$$state }, function () {
  3079. if ((true)) {
  3080. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  3081. }
  3082. }, { deep: true, sync: true });
  3083. }
  3084. function getNestedState (state, path) {
  3085. return path.reduce(function (state, key) { return state[key]; }, state)
  3086. }
  3087. function unifyObjectStyle (type, payload, options) {
  3088. if (isObject(type) && type.type) {
  3089. options = payload;
  3090. payload = type;
  3091. type = type.type;
  3092. }
  3093. if ((true)) {
  3094. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  3095. }
  3096. return { type: type, payload: payload, options: options }
  3097. }
  3098. function install (_Vue) {
  3099. if (Vue && _Vue === Vue) {
  3100. if ((true)) {
  3101. console.error(
  3102. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  3103. );
  3104. }
  3105. return
  3106. }
  3107. Vue = _Vue;
  3108. applyMixin(Vue);
  3109. }
  3110. /**
  3111. * Reduce the code which written in Vue.js for getting the state.
  3112. * @param {String} [namespace] - Module's namespace
  3113. * @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.
  3114. * @param {Object}
  3115. */
  3116. var mapState = normalizeNamespace(function (namespace, states) {
  3117. var res = {};
  3118. if (( true) && !isValidMap(states)) {
  3119. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  3120. }
  3121. normalizeMap(states).forEach(function (ref) {
  3122. var key = ref.key;
  3123. var val = ref.val;
  3124. res[key] = function mappedState () {
  3125. var state = this.$store.state;
  3126. var getters = this.$store.getters;
  3127. if (namespace) {
  3128. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  3129. if (!module) {
  3130. return
  3131. }
  3132. state = module.context.state;
  3133. getters = module.context.getters;
  3134. }
  3135. return typeof val === 'function'
  3136. ? val.call(this, state, getters)
  3137. : state[val]
  3138. };
  3139. // mark vuex getter for devtools
  3140. res[key].vuex = true;
  3141. });
  3142. return res
  3143. });
  3144. /**
  3145. * Reduce the code which written in Vue.js for committing the mutation
  3146. * @param {String} [namespace] - Module's namespace
  3147. * @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.
  3148. * @return {Object}
  3149. */
  3150. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  3151. var res = {};
  3152. if (( true) && !isValidMap(mutations)) {
  3153. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  3154. }
  3155. normalizeMap(mutations).forEach(function (ref) {
  3156. var key = ref.key;
  3157. var val = ref.val;
  3158. res[key] = function mappedMutation () {
  3159. var args = [], len = arguments.length;
  3160. while ( len-- ) args[ len ] = arguments[ len ];
  3161. // Get the commit method from store
  3162. var commit = this.$store.commit;
  3163. if (namespace) {
  3164. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  3165. if (!module) {
  3166. return
  3167. }
  3168. commit = module.context.commit;
  3169. }
  3170. return typeof val === 'function'
  3171. ? val.apply(this, [commit].concat(args))
  3172. : commit.apply(this.$store, [val].concat(args))
  3173. };
  3174. });
  3175. return res
  3176. });
  3177. /**
  3178. * Reduce the code which written in Vue.js for getting the getters
  3179. * @param {String} [namespace] - Module's namespace
  3180. * @param {Object|Array} getters
  3181. * @return {Object}
  3182. */
  3183. var mapGetters = normalizeNamespace(function (namespace, getters) {
  3184. var res = {};
  3185. if (( true) && !isValidMap(getters)) {
  3186. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  3187. }
  3188. normalizeMap(getters).forEach(function (ref) {
  3189. var key = ref.key;
  3190. var val = ref.val;
  3191. // The namespace has been mutated by normalizeNamespace
  3192. val = namespace + val;
  3193. res[key] = function mappedGetter () {
  3194. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  3195. return
  3196. }
  3197. if (( true) && !(val in this.$store.getters)) {
  3198. console.error(("[vuex] unknown getter: " + val));
  3199. return
  3200. }
  3201. return this.$store.getters[val]
  3202. };
  3203. // mark vuex getter for devtools
  3204. res[key].vuex = true;
  3205. });
  3206. return res
  3207. });
  3208. /**
  3209. * Reduce the code which written in Vue.js for dispatch the action
  3210. * @param {String} [namespace] - Module's namespace
  3211. * @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.
  3212. * @return {Object}
  3213. */
  3214. var mapActions = normalizeNamespace(function (namespace, actions) {
  3215. var res = {};
  3216. if (( true) && !isValidMap(actions)) {
  3217. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  3218. }
  3219. normalizeMap(actions).forEach(function (ref) {
  3220. var key = ref.key;
  3221. var val = ref.val;
  3222. res[key] = function mappedAction () {
  3223. var args = [], len = arguments.length;
  3224. while ( len-- ) args[ len ] = arguments[ len ];
  3225. // get dispatch function from store
  3226. var dispatch = this.$store.dispatch;
  3227. if (namespace) {
  3228. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  3229. if (!module) {
  3230. return
  3231. }
  3232. dispatch = module.context.dispatch;
  3233. }
  3234. return typeof val === 'function'
  3235. ? val.apply(this, [dispatch].concat(args))
  3236. : dispatch.apply(this.$store, [val].concat(args))
  3237. };
  3238. });
  3239. return res
  3240. });
  3241. /**
  3242. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  3243. * @param {String} namespace
  3244. * @return {Object}
  3245. */
  3246. var createNamespacedHelpers = function (namespace) { return ({
  3247. mapState: mapState.bind(null, namespace),
  3248. mapGetters: mapGetters.bind(null, namespace),
  3249. mapMutations: mapMutations.bind(null, namespace),
  3250. mapActions: mapActions.bind(null, namespace)
  3251. }); };
  3252. /**
  3253. * Normalize the map
  3254. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  3255. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  3256. * @param {Array|Object} map
  3257. * @return {Object}
  3258. */
  3259. function normalizeMap (map) {
  3260. if (!isValidMap(map)) {
  3261. return []
  3262. }
  3263. return Array.isArray(map)
  3264. ? map.map(function (key) { return ({ key: key, val: key }); })
  3265. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  3266. }
  3267. /**
  3268. * Validate whether given map is valid or not
  3269. * @param {*} map
  3270. * @return {Boolean}
  3271. */
  3272. function isValidMap (map) {
  3273. return Array.isArray(map) || isObject(map)
  3274. }
  3275. /**
  3276. * 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.
  3277. * @param {Function} fn
  3278. * @return {Function}
  3279. */
  3280. function normalizeNamespace (fn) {
  3281. return function (namespace, map) {
  3282. if (typeof namespace !== 'string') {
  3283. map = namespace;
  3284. namespace = '';
  3285. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  3286. namespace += '/';
  3287. }
  3288. return fn(namespace, map)
  3289. }
  3290. }
  3291. /**
  3292. * Search a special module from store by namespace. if module not exist, print error message.
  3293. * @param {Object} store
  3294. * @param {String} helper
  3295. * @param {String} namespace
  3296. * @return {Object}
  3297. */
  3298. function getModuleByNamespace (store, helper, namespace) {
  3299. var module = store._modulesNamespaceMap[namespace];
  3300. if (( true) && !module) {
  3301. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  3302. }
  3303. return module
  3304. }
  3305. var index = {
  3306. Store: Store,
  3307. install: install,
  3308. version: '3.4.0',
  3309. mapState: mapState,
  3310. mapMutations: mapMutations,
  3311. mapGetters: mapGetters,
  3312. mapActions: mapActions,
  3313. createNamespacedHelpers: createNamespacedHelpers
  3314. };
  3315. /* harmony default export */ __webpack_exports__["default"] = (index);
  3316. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  3317. /***/ }),
  3318. /***/ 16:
  3319. /*!******************************************************!*\
  3320. !*** E:/.swdz/uni-app/baoma/mabao/common/request.js ***!
  3321. \******************************************************/
  3322. /*! no static exports found */
  3323. /***/ (function(module, exports, __webpack_require__) {
  3324. "use strict";
  3325. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 11));
  3326. var _env = __webpack_require__(/*! @/common/env */ 17);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} //获取环境接口地址
  3327. var user = __webpack_require__(/*! @/common/user.js */ 18);
  3328. /**
  3329. * 判断传入参数的类型,以字符串的形式返回
  3330. * @obj:数据
  3331. **/
  3332. function dataType(obj) {
  3333. if (obj === null) return "Null";
  3334. if (obj === undefined) return "Undefined";
  3335. return Object.prototype.toString.call(obj).slice(8, -1);
  3336. };
  3337. /**
  3338. * 处理对象参数值,排除对象参数值为”“、null、undefined,并返回一个新对象
  3339. **/
  3340. function dealObjectValue(obj) {
  3341. var param = {};
  3342. if (obj === null || obj === undefined || obj === "") return param;
  3343. for (var key in obj) {
  3344. if (dataType(obj[key]) === "Object") {
  3345. param[key] = dealObjectValue(obj[key]);
  3346. } else if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
  3347. param[key] = obj[key];
  3348. }
  3349. }
  3350. return param;
  3351. };
  3352. var post = function post(url, data, showloading) {
  3353. if (showloading != false) {
  3354. uni.showLoading({
  3355. mask: true,
  3356. title: '加载中' });
  3357. }
  3358. return new Promise(function (resolve, reject) {
  3359. data = dealObjectValue(data);
  3360. var jwt = _store.default.getters['getJwt'];
  3361. var header = {
  3362. 'content-type': 'application/x-www-form-urlencoded',
  3363. 'token': jwt //自定义请求头信息
  3364. };
  3365. uni.request({
  3366. url: _env.envHost + url,
  3367. method: 'POST',
  3368. data: data,
  3369. header: header,
  3370. success: function success(res) {
  3371. console.info(res);
  3372. if (res.statusCode == 200) {
  3373. if (res.data.code == 403) {
  3374. _store.default.commit('logout');
  3375. user.loginByWeixinCode().then(function (res) {
  3376. console.info(res);
  3377. }).catch(function (err) {
  3378. });
  3379. } else {
  3380. resolve(res.data);
  3381. }
  3382. } else {
  3383. reject(res.errMsg);
  3384. }
  3385. },
  3386. fail: function fail(err) {
  3387. reject();
  3388. // let errmsg = err.response.data;
  3389. // switch (err.response.status) {
  3390. // case 0:
  3391. // console.log("网络连接错误")
  3392. // errmsg = "网络连接错误";
  3393. // break;
  3394. // case 401:
  3395. // console.log("请登录后操作")
  3396. // errmsg = '请登录后操作';
  3397. // store.dispatch('logout');
  3398. // uni.redirectTo({
  3399. // url: '/pages/auth/login'
  3400. // })
  3401. // break
  3402. // case 404:
  3403. // errmsg = "接口不存在";
  3404. // break
  3405. // }
  3406. // uni.showToast({
  3407. // title: errmsg,
  3408. // icon: 'none'
  3409. // })
  3410. },
  3411. complete: function complete() {
  3412. uni.hideLoading();
  3413. } });
  3414. });
  3415. };
  3416. var get = function get(url, data, showloading) {
  3417. if (showloading != false) {
  3418. uni.showLoading({
  3419. mask: true,
  3420. title: '加载中' });
  3421. }
  3422. return new Promise(function (resolve, reject) {
  3423. data = dealObjectValue(data);
  3424. var jwt = _store.default.getters['getJwt'];
  3425. var header = {
  3426. 'token': jwt //自定义请求头信息
  3427. };
  3428. uni.request({
  3429. url: _env.envHost + url,
  3430. method: 'GET',
  3431. data: data,
  3432. header: header,
  3433. success: function success(res) {
  3434. //console.info(res)
  3435. if (res.statusCode == 200) {
  3436. if (res.data.code == 403) {
  3437. _store.default.commit('logout');
  3438. user.loginByWeixinCode().then(function (res) {
  3439. console.info(res);
  3440. }).catch(function (err) {
  3441. });
  3442. } else {
  3443. resolve(res.data);
  3444. }
  3445. } else {
  3446. reject(res.errMsg);
  3447. }
  3448. },
  3449. fail: function fail(err) {
  3450. reject();
  3451. // let errmsg = err.response.data;
  3452. // switch (err.response.status) {
  3453. // case 0:
  3454. // console.log("网络连接错误")
  3455. // errmsg = "网络连接错误";
  3456. // break;
  3457. // case 401:
  3458. // console.log("请登录后操作")
  3459. // errmsg = '请登录后操作';
  3460. // store.dispatch('logout');
  3461. // uni.redirectTo({
  3462. // url: '/pages/auth/login'
  3463. // })
  3464. // break
  3465. // case 404:
  3466. // errmsg = "接口不存在";
  3467. // break
  3468. // }
  3469. // uni.showToast({
  3470. // title: errmsg,
  3471. // icon: 'none'
  3472. // })
  3473. },
  3474. complete: function complete() {
  3475. uni.hideLoading();
  3476. } });
  3477. });
  3478. };
  3479. var upload = function upload(url, file, data, showloading) {
  3480. if (showloading != false) {
  3481. uni.showLoading({
  3482. mask: true,
  3483. title: '上传中...' });
  3484. }
  3485. return new Promise(function (resolve, reject) {
  3486. data = dealObjectValue(data);
  3487. var jwt = _store.default.getters['getJwt'];
  3488. var header = {
  3489. 'token': jwt //自定义请求头信息
  3490. };
  3491. uni.uploadFile({
  3492. url: _env.envHost + url,
  3493. // files: files,
  3494. filePath: file,
  3495. name: 'file',
  3496. formData: data,
  3497. header: header,
  3498. success: function success(res) {
  3499. console.info(res);
  3500. resolve(res.data);
  3501. },
  3502. fail: function fail(err) {
  3503. uni.showModal({
  3504. content: err.errMsg,
  3505. showCancel: false });
  3506. reject(err);
  3507. console.log('uploadImage fail', err);
  3508. },
  3509. complete: function complete() {
  3510. uni.hideLoading();
  3511. } });
  3512. });
  3513. };
  3514. var uploadAsync = function uploadAsync(url, file, data, _success, showloading) {
  3515. if (showloading != false) {
  3516. uni.showLoading({
  3517. mask: true,
  3518. title: '上传中...' });
  3519. }
  3520. data = dealObjectValue(data);
  3521. var jwt = _store.default.getters['getJwt'];
  3522. var header = {
  3523. 'token': jwt //自定义请求头信息
  3524. };
  3525. return uni.uploadFile({
  3526. url: _env.envHost + url,
  3527. // files: files,
  3528. filePath: file,
  3529. name: 'file',
  3530. formData: data,
  3531. header: header,
  3532. success: function success(res) {
  3533. console.info(res);
  3534. if (_success)
  3535. _success(JSON.parse(res.data));
  3536. },
  3537. fail: function fail(err) {
  3538. uni.showModal({
  3539. content: err.errMsg,
  3540. showCancel: false });
  3541. console.log('uploadImage fail', err);
  3542. },
  3543. complete: function complete() {
  3544. uni.hideLoading();
  3545. } });
  3546. };
  3547. var uploadFiles = function uploadFiles(url, files, data, showloading) {
  3548. if (showloading != false) {
  3549. uni.showLoading({
  3550. mask: true,
  3551. title: '上传中...' });
  3552. }
  3553. console.info(files);
  3554. return new Promise(function (resolve, reject) {
  3555. data = dealObjectValue(data);
  3556. var jwt = _store.default.getters['getJwt'];
  3557. var header = {
  3558. 'token': jwt //自定义请求头信息
  3559. };
  3560. uni.uploadFile({
  3561. url: _env.envHost + url,
  3562. files: files,
  3563. formData: data,
  3564. header: header,
  3565. success: function success(res) {
  3566. console.info(JSON.stringify(res));
  3567. resolve(JSON.parse(res.data));
  3568. },
  3569. fail: function fail(err) {
  3570. uni.showModal({
  3571. content: err.errMsg,
  3572. showCancel: false });
  3573. reject(err);
  3574. console.log('uploadImage fail', err);
  3575. },
  3576. complete: function complete() {
  3577. uni.hideLoading();
  3578. } });
  3579. });
  3580. };var _default =
  3581. {
  3582. post: post,
  3583. upload: upload,
  3584. uploadAsync: uploadAsync,
  3585. uploadFiles: uploadFiles,
  3586. get: get };exports.default = _default;
  3587. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3588. /***/ }),
  3589. /***/ 17:
  3590. /*!**************************************************!*\
  3591. !*** E:/.swdz/uni-app/baoma/mabao/common/env.js ***!
  3592. \**************************************************/
  3593. /*! no static exports found */
  3594. /***/ (function(module, exports, __webpack_require__) {
  3595. "use strict";
  3596. Object.defineProperty(exports, "__esModule", { value: true });exports.imgHost = exports.envHost = void 0;var envHost = 'https://t5.9026.com'; //开发环境
  3597. // export const imgHost='https://www.juyinzhengxin.com/';
  3598. exports.envHost = envHost;var imgHost = 'https://zhengda.oss-cn-chengdu.aliyuncs.com/juyin';exports.imgHost = imgHost;
  3599. /***/ }),
  3600. /***/ 18:
  3601. /*!***************************************************!*\
  3602. !*** E:/.swdz/uni-app/baoma/mabao/common/user.js ***!
  3603. \***************************************************/
  3604. /*! no static exports found */
  3605. /***/ (function(module, exports, __webpack_require__) {
  3606. "use strict";
  3607. /* WEBPACK VAR INJECTION */(function(uni) {
  3608. var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 11));
  3609. var _request = _interopRequireDefault(__webpack_require__(/*! @/common/request */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  3610. * 用户相关服务
  3611. */
  3612. /**
  3613. * Promise封装wx.checkSession
  3614. */
  3615. function checkSession() {
  3616. return new Promise(function (resolve, reject) {
  3617. wx.checkSession({
  3618. success: function success() {
  3619. resolve(true);
  3620. },
  3621. fail: function fail() {
  3622. reject(false);
  3623. } });
  3624. });
  3625. }
  3626. /**
  3627. * Promise封装wx.login
  3628. */
  3629. function login() {
  3630. return new Promise(function (resolve, reject) {
  3631. wx.login({
  3632. success: function success(res) {
  3633. if (res.code) {
  3634. resolve(res);
  3635. } else {
  3636. reject(res);
  3637. }
  3638. },
  3639. fail: function fail(err) {
  3640. reject(err);
  3641. } });
  3642. });
  3643. }
  3644. /**
  3645. * 调用微信登录
  3646. */
  3647. function loginByWeixinCode() {
  3648. return new Promise(function (resolve, reject) {
  3649. return login().then(function (res) {
  3650. var code = res.code;
  3651. //登录远程服务器
  3652. _request.default.post('/api/v1/common/wxLogin', {
  3653. wechat_code: code }).
  3654. then(function (res) {
  3655. if (res.code == 200) {
  3656. if (res.data.token) {
  3657. _store.default.commit('setJwt', res.data.token);
  3658. _store.default.commit('setUser', res.data);
  3659. _store.default.commit('login');
  3660. resolve(res);
  3661. } else {
  3662. uni.showToast({
  3663. title: '登录失败',
  3664. icon: "none" });
  3665. reject(res);
  3666. }
  3667. } else {
  3668. reject(res);
  3669. }
  3670. }).catch(function (err) {
  3671. reject(err);
  3672. });
  3673. }).catch(function (err) {
  3674. reject(err);
  3675. });
  3676. });
  3677. }
  3678. /**
  3679. * 调用微信登录
  3680. */
  3681. function loginByWeixin(userInfo) {
  3682. return new Promise(function (resolve, reject) {
  3683. return login().then(function (res) {
  3684. var code = res.code;
  3685. //登录远程服务器
  3686. _request.default.post('/api/v1/common/wxLogin', {
  3687. // up_id: uni.getStorageSync("up_id"),
  3688. wechat_code: code,
  3689. nickname: userInfo.nickName,
  3690. avatar: userInfo.avatarUrl }).
  3691. then(function (res) {
  3692. if (res.status == 0) {
  3693. if (res.data.token) {
  3694. _store.default.commit('setJwt', res.data.token);
  3695. _store.default.commit('setUser', res.data);
  3696. _store.default.commit('login');
  3697. resolve(res);
  3698. } else {
  3699. reject(res);
  3700. }
  3701. } else {
  3702. reject(res);
  3703. }
  3704. }).catch(function (err) {
  3705. reject(err);
  3706. });
  3707. }).catch(function (err) {
  3708. reject(err);
  3709. });
  3710. });
  3711. }
  3712. /**
  3713. * 判断用户是否登录
  3714. */
  3715. function checkLogin() {
  3716. return new Promise(function (resolve, reject) {
  3717. if (_store.default.getters['verifyJwt']) {
  3718. checkSession().then(function () {
  3719. resolve(true);
  3720. }).catch(function () {
  3721. reject(false);
  3722. });
  3723. } else {
  3724. reject(false);
  3725. }
  3726. });
  3727. }
  3728. module.exports = {
  3729. loginByWeixin: loginByWeixin,
  3730. loginByWeixinCode: loginByWeixinCode,
  3731. checkLogin: checkLogin };
  3732. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3733. /***/ }),
  3734. /***/ 19:
  3735. /*!***************************************************!*\
  3736. !*** E:/.swdz/uni-app/baoma/mabao/common/util.js ***!
  3737. \***************************************************/
  3738. /*! no static exports found */
  3739. /***/ (function(module, exports, __webpack_require__) {
  3740. /* WEBPACK VAR INJECTION */(function(uni) {
  3741. function ViewImage(imgList, e) {
  3742. uni.previewImage({
  3743. urls: imgList,
  3744. current: e.currentTarget.dataset.url });
  3745. }
  3746. function formatTime(time) {
  3747. if (typeof time !== 'number' || time < 0) {
  3748. return time;
  3749. }
  3750. var hour = parseInt(time / 3600);
  3751. time = time % 3600;
  3752. var minute = parseInt(time / 60);
  3753. time = time % 60;
  3754. var second = time;
  3755. return [hour, minute, second].map(function (n) {
  3756. n = n.toString();
  3757. return n[1] ? n : '0' + n;
  3758. }).join(':');
  3759. }
  3760. // 判断是否为手机号
  3761. function isPhoneNumber(pone) {
  3762. var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
  3763. if (!myreg.test(pone)) {
  3764. return false;
  3765. } else {
  3766. return true;
  3767. }
  3768. }
  3769. //密码判断
  3770. function isPassword(p) {
  3771. var myreg = /^[a-zA-Z0-9]{6,12}$/;
  3772. if (!myreg.test(p)) {
  3773. return false;
  3774. } else {
  3775. return true;
  3776. }
  3777. }
  3778. //判断验证码
  3779. function isCaptcha(p) {
  3780. var myreg = /^[0-9A-Za-z]{4,12}$/;
  3781. if (!myreg.test(p)) {
  3782. return false;
  3783. } else {
  3784. return true;
  3785. }
  3786. }
  3787. //判断用户名
  3788. function isUserName(p) {
  3789. var myreg = /^[a-zA-Z0-9]{1,20}$/;
  3790. if (!myreg.test(p)) {
  3791. return false;
  3792. } else {
  3793. return true;
  3794. }
  3795. }
  3796. //判断身份证
  3797. function isIdCard(value) {
  3798. var myReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  3799. if (!myReg.test(value)) {
  3800. return false;
  3801. } else {
  3802. return true;
  3803. }
  3804. }
  3805. var isEmpty = function isEmpty(a) {
  3806. return typeof a == 'undefined' || a == null || a == '' || a == 'undefined';
  3807. };
  3808. function formatLocation(longitude, latitude) {
  3809. if (typeof longitude === 'string' && typeof latitude === 'string') {
  3810. longitude = parseFloat(longitude);
  3811. latitude = parseFloat(latitude);
  3812. }
  3813. longitude = longitude.toFixed(2);
  3814. latitude = latitude.toFixed(2);
  3815. return {
  3816. longitude: longitude.toString().split('.'),
  3817. latitude: latitude.toString().split('.') };
  3818. }
  3819. var dateUtils = {
  3820. UNITS: {
  3821. '年': 31557600000,
  3822. '月': 2629800000,
  3823. '天': 86400000,
  3824. '小时': 3600000,
  3825. '分钟': 60000,
  3826. '秒': 1000 },
  3827. humanize: function humanize(milliseconds, date) {
  3828. var humanize = '';
  3829. var _format = function _format(number) {
  3830. return number < 10 ? '0' + number : number;
  3831. };
  3832. for (var key in this.UNITS) {
  3833. if (milliseconds >= this.UNITS[key]) {
  3834. switch (key) {
  3835. case '小时':
  3836. humanize = _format(date.getHours()) + ':' + _format(date.getMinutes());
  3837. break;
  3838. default:
  3839. humanize = Math.floor(milliseconds / this.UNITS[key]) + key + '前';
  3840. break;}
  3841. break;
  3842. }
  3843. }
  3844. return humanize || '刚刚';
  3845. },
  3846. format: function format(dateStr) {
  3847. var date = this.parse(dateStr);
  3848. var diff = Date.now() - date.getTime();
  3849. if (diff < this.UNITS['天']) {
  3850. return this.humanize(diff, date);
  3851. }
  3852. var _format = function _format(number) {
  3853. return number < 10 ? '0' + number : number;
  3854. };
  3855. return date.getFullYear() + '-' + _format(date.getMonth() + 1) + '-' + _format(date.getDate()) + '-' +
  3856. _format(date.getHours()) + ':' + _format(date.getMinutes());
  3857. },
  3858. formatHms: function formatHms(dateStr) {
  3859. var date = this.parse(dateStr);
  3860. var _format = function _format(number) {
  3861. return number < 10 ? '0' + number : number;
  3862. };
  3863. return _format(date.getHours()) + ':' + _format(date.getMinutes());
  3864. },
  3865. formatYMD: function formatYMD(dateStr) {
  3866. var date = this.parse(dateStr);
  3867. var _format = function _format(number) {
  3868. return number < 10 ? '0' + number : number;
  3869. };
  3870. return date.getFullYear() + '-' + _format(date.getMonth() + 1) + '-' + _format(date.getDate());
  3871. },
  3872. parse: function parse(str) {//将"yyyy-mm-dd HH:MM:ss"格式的字符串,转化为一个Date对象
  3873. if (!str) {
  3874. return new Date();
  3875. }
  3876. var a = str.split(/[^0-9]/);
  3877. return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]);
  3878. },
  3879. /**************************************时间格式化处理************************************/
  3880. dateFtt: function dateFtt(fmt, date) {//author: meizz
  3881. var o = {
  3882. "M+": date.getMonth() + 1, //月份
  3883. "d+": date.getDate(), //日
  3884. "H+": date.getHours(), //小时
  3885. "m+": date.getMinutes(), //分
  3886. "s+": date.getSeconds(), //秒
  3887. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  3888. "S": date.getMilliseconds() //毫秒
  3889. };
  3890. if (/(y+)/.test(fmt))
  3891. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  3892. for (var k in o) {
  3893. if (new RegExp("(" + k + ")").test(fmt))
  3894. fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));}
  3895. return fmt;
  3896. } };
  3897. module.exports = {
  3898. formatTime: formatTime,
  3899. isPhoneNumber: isPhoneNumber,
  3900. isUserName: isUserName,
  3901. isPassword: isPassword,
  3902. isCaptcha: isCaptcha,
  3903. formatLocation: formatLocation,
  3904. dateUtils: dateUtils,
  3905. isEmpty: isEmpty,
  3906. isIdCard: isIdCard,
  3907. ViewImage: ViewImage };
  3908. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3909. /***/ }),
  3910. /***/ 2:
  3911. /*!******************************************************************************************!*\
  3912. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3913. \******************************************************************************************/
  3914. /*! exports provided: default */
  3915. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3916. "use strict";
  3917. __webpack_require__.r(__webpack_exports__);
  3918. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3919. * Vue.js v2.6.11
  3920. * (c) 2014-2020 Evan You
  3921. * Released under the MIT License.
  3922. */
  3923. /* */
  3924. var emptyObject = Object.freeze({});
  3925. // These helpers produce better VM code in JS engines due to their
  3926. // explicitness and function inlining.
  3927. function isUndef (v) {
  3928. return v === undefined || v === null
  3929. }
  3930. function isDef (v) {
  3931. return v !== undefined && v !== null
  3932. }
  3933. function isTrue (v) {
  3934. return v === true
  3935. }
  3936. function isFalse (v) {
  3937. return v === false
  3938. }
  3939. /**
  3940. * Check if value is primitive.
  3941. */
  3942. function isPrimitive (value) {
  3943. return (
  3944. typeof value === 'string' ||
  3945. typeof value === 'number' ||
  3946. // $flow-disable-line
  3947. typeof value === 'symbol' ||
  3948. typeof value === 'boolean'
  3949. )
  3950. }
  3951. /**
  3952. * Quick object check - this is primarily used to tell
  3953. * Objects from primitive values when we know the value
  3954. * is a JSON-compliant type.
  3955. */
  3956. function isObject (obj) {
  3957. return obj !== null && typeof obj === 'object'
  3958. }
  3959. /**
  3960. * Get the raw type string of a value, e.g., [object Object].
  3961. */
  3962. var _toString = Object.prototype.toString;
  3963. function toRawType (value) {
  3964. return _toString.call(value).slice(8, -1)
  3965. }
  3966. /**
  3967. * Strict object type check. Only returns true
  3968. * for plain JavaScript objects.
  3969. */
  3970. function isPlainObject (obj) {
  3971. return _toString.call(obj) === '[object Object]'
  3972. }
  3973. function isRegExp (v) {
  3974. return _toString.call(v) === '[object RegExp]'
  3975. }
  3976. /**
  3977. * Check if val is a valid array index.
  3978. */
  3979. function isValidArrayIndex (val) {
  3980. var n = parseFloat(String(val));
  3981. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3982. }
  3983. function isPromise (val) {
  3984. return (
  3985. isDef(val) &&
  3986. typeof val.then === 'function' &&
  3987. typeof val.catch === 'function'
  3988. )
  3989. }
  3990. /**
  3991. * Convert a value to a string that is actually rendered.
  3992. */
  3993. function toString (val) {
  3994. return val == null
  3995. ? ''
  3996. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3997. ? JSON.stringify(val, null, 2)
  3998. : String(val)
  3999. }
  4000. /**
  4001. * Convert an input value to a number for persistence.
  4002. * If the conversion fails, return original string.
  4003. */
  4004. function toNumber (val) {
  4005. var n = parseFloat(val);
  4006. return isNaN(n) ? val : n
  4007. }
  4008. /**
  4009. * Make a map and return a function for checking if a key
  4010. * is in that map.
  4011. */
  4012. function makeMap (
  4013. str,
  4014. expectsLowerCase
  4015. ) {
  4016. var map = Object.create(null);
  4017. var list = str.split(',');
  4018. for (var i = 0; i < list.length; i++) {
  4019. map[list[i]] = true;
  4020. }
  4021. return expectsLowerCase
  4022. ? function (val) { return map[val.toLowerCase()]; }
  4023. : function (val) { return map[val]; }
  4024. }
  4025. /**
  4026. * Check if a tag is a built-in tag.
  4027. */
  4028. var isBuiltInTag = makeMap('slot,component', true);
  4029. /**
  4030. * Check if an attribute is a reserved attribute.
  4031. */
  4032. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4033. /**
  4034. * Remove an item from an array.
  4035. */
  4036. function remove (arr, item) {
  4037. if (arr.length) {
  4038. var index = arr.indexOf(item);
  4039. if (index > -1) {
  4040. return arr.splice(index, 1)
  4041. }
  4042. }
  4043. }
  4044. /**
  4045. * Check whether an object has the property.
  4046. */
  4047. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4048. function hasOwn (obj, key) {
  4049. return hasOwnProperty.call(obj, key)
  4050. }
  4051. /**
  4052. * Create a cached version of a pure function.
  4053. */
  4054. function cached (fn) {
  4055. var cache = Object.create(null);
  4056. return (function cachedFn (str) {
  4057. var hit = cache[str];
  4058. return hit || (cache[str] = fn(str))
  4059. })
  4060. }
  4061. /**
  4062. * Camelize a hyphen-delimited string.
  4063. */
  4064. var camelizeRE = /-(\w)/g;
  4065. var camelize = cached(function (str) {
  4066. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4067. });
  4068. /**
  4069. * Capitalize a string.
  4070. */
  4071. var capitalize = cached(function (str) {
  4072. return str.charAt(0).toUpperCase() + str.slice(1)
  4073. });
  4074. /**
  4075. * Hyphenate a camelCase string.
  4076. */
  4077. var hyphenateRE = /\B([A-Z])/g;
  4078. var hyphenate = cached(function (str) {
  4079. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4080. });
  4081. /**
  4082. * Simple bind polyfill for environments that do not support it,
  4083. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4084. * since native bind is now performant enough in most browsers.
  4085. * But removing it would mean breaking code that was able to run in
  4086. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4087. */
  4088. /* istanbul ignore next */
  4089. function polyfillBind (fn, ctx) {
  4090. function boundFn (a) {
  4091. var l = arguments.length;
  4092. return l
  4093. ? l > 1
  4094. ? fn.apply(ctx, arguments)
  4095. : fn.call(ctx, a)
  4096. : fn.call(ctx)
  4097. }
  4098. boundFn._length = fn.length;
  4099. return boundFn
  4100. }
  4101. function nativeBind (fn, ctx) {
  4102. return fn.bind(ctx)
  4103. }
  4104. var bind = Function.prototype.bind
  4105. ? nativeBind
  4106. : polyfillBind;
  4107. /**
  4108. * Convert an Array-like object to a real Array.
  4109. */
  4110. function toArray (list, start) {
  4111. start = start || 0;
  4112. var i = list.length - start;
  4113. var ret = new Array(i);
  4114. while (i--) {
  4115. ret[i] = list[i + start];
  4116. }
  4117. return ret
  4118. }
  4119. /**
  4120. * Mix properties into target object.
  4121. */
  4122. function extend (to, _from) {
  4123. for (var key in _from) {
  4124. to[key] = _from[key];
  4125. }
  4126. return to
  4127. }
  4128. /**
  4129. * Merge an Array of Objects into a single Object.
  4130. */
  4131. function toObject (arr) {
  4132. var res = {};
  4133. for (var i = 0; i < arr.length; i++) {
  4134. if (arr[i]) {
  4135. extend(res, arr[i]);
  4136. }
  4137. }
  4138. return res
  4139. }
  4140. /* eslint-disable no-unused-vars */
  4141. /**
  4142. * Perform no operation.
  4143. * Stubbing args to make Flow happy without leaving useless transpiled code
  4144. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4145. */
  4146. function noop (a, b, c) {}
  4147. /**
  4148. * Always return false.
  4149. */
  4150. var no = function (a, b, c) { return false; };
  4151. /* eslint-enable no-unused-vars */
  4152. /**
  4153. * Return the same value.
  4154. */
  4155. var identity = function (_) { return _; };
  4156. /**
  4157. * Check if two values are loosely equal - that is,
  4158. * if they are plain objects, do they have the same shape?
  4159. */
  4160. function looseEqual (a, b) {
  4161. if (a === b) { return true }
  4162. var isObjectA = isObject(a);
  4163. var isObjectB = isObject(b);
  4164. if (isObjectA && isObjectB) {
  4165. try {
  4166. var isArrayA = Array.isArray(a);
  4167. var isArrayB = Array.isArray(b);
  4168. if (isArrayA && isArrayB) {
  4169. return a.length === b.length && a.every(function (e, i) {
  4170. return looseEqual(e, b[i])
  4171. })
  4172. } else if (a instanceof Date && b instanceof Date) {
  4173. return a.getTime() === b.getTime()
  4174. } else if (!isArrayA && !isArrayB) {
  4175. var keysA = Object.keys(a);
  4176. var keysB = Object.keys(b);
  4177. return keysA.length === keysB.length && keysA.every(function (key) {
  4178. return looseEqual(a[key], b[key])
  4179. })
  4180. } else {
  4181. /* istanbul ignore next */
  4182. return false
  4183. }
  4184. } catch (e) {
  4185. /* istanbul ignore next */
  4186. return false
  4187. }
  4188. } else if (!isObjectA && !isObjectB) {
  4189. return String(a) === String(b)
  4190. } else {
  4191. return false
  4192. }
  4193. }
  4194. /**
  4195. * Return the first index at which a loosely equal value can be
  4196. * found in the array (if value is a plain object, the array must
  4197. * contain an object of the same shape), or -1 if it is not present.
  4198. */
  4199. function looseIndexOf (arr, val) {
  4200. for (var i = 0; i < arr.length; i++) {
  4201. if (looseEqual(arr[i], val)) { return i }
  4202. }
  4203. return -1
  4204. }
  4205. /**
  4206. * Ensure a function is called only once.
  4207. */
  4208. function once (fn) {
  4209. var called = false;
  4210. return function () {
  4211. if (!called) {
  4212. called = true;
  4213. fn.apply(this, arguments);
  4214. }
  4215. }
  4216. }
  4217. var ASSET_TYPES = [
  4218. 'component',
  4219. 'directive',
  4220. 'filter'
  4221. ];
  4222. var LIFECYCLE_HOOKS = [
  4223. 'beforeCreate',
  4224. 'created',
  4225. 'beforeMount',
  4226. 'mounted',
  4227. 'beforeUpdate',
  4228. 'updated',
  4229. 'beforeDestroy',
  4230. 'destroyed',
  4231. 'activated',
  4232. 'deactivated',
  4233. 'errorCaptured',
  4234. 'serverPrefetch'
  4235. ];
  4236. /* */
  4237. var config = ({
  4238. /**
  4239. * Option merge strategies (used in core/util/options)
  4240. */
  4241. // $flow-disable-line
  4242. optionMergeStrategies: Object.create(null),
  4243. /**
  4244. * Whether to suppress warnings.
  4245. */
  4246. silent: false,
  4247. /**
  4248. * Show production mode tip message on boot?
  4249. */
  4250. productionTip: "development" !== 'production',
  4251. /**
  4252. * Whether to enable devtools
  4253. */
  4254. devtools: "development" !== 'production',
  4255. /**
  4256. * Whether to record perf
  4257. */
  4258. performance: false,
  4259. /**
  4260. * Error handler for watcher errors
  4261. */
  4262. errorHandler: null,
  4263. /**
  4264. * Warn handler for watcher warns
  4265. */
  4266. warnHandler: null,
  4267. /**
  4268. * Ignore certain custom elements
  4269. */
  4270. ignoredElements: [],
  4271. /**
  4272. * Custom user key aliases for v-on
  4273. */
  4274. // $flow-disable-line
  4275. keyCodes: Object.create(null),
  4276. /**
  4277. * Check if a tag is reserved so that it cannot be registered as a
  4278. * component. This is platform-dependent and may be overwritten.
  4279. */
  4280. isReservedTag: no,
  4281. /**
  4282. * Check if an attribute is reserved so that it cannot be used as a component
  4283. * prop. This is platform-dependent and may be overwritten.
  4284. */
  4285. isReservedAttr: no,
  4286. /**
  4287. * Check if a tag is an unknown element.
  4288. * Platform-dependent.
  4289. */
  4290. isUnknownElement: no,
  4291. /**
  4292. * Get the namespace of an element
  4293. */
  4294. getTagNamespace: noop,
  4295. /**
  4296. * Parse the real tag name for the specific platform.
  4297. */
  4298. parsePlatformTagName: identity,
  4299. /**
  4300. * Check if an attribute must be bound using property, e.g. value
  4301. * Platform-dependent.
  4302. */
  4303. mustUseProp: no,
  4304. /**
  4305. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4306. * This will significantly reduce performance if set to false.
  4307. */
  4308. async: true,
  4309. /**
  4310. * Exposed for legacy reasons
  4311. */
  4312. _lifecycleHooks: LIFECYCLE_HOOKS
  4313. });
  4314. /* */
  4315. /**
  4316. * unicode letters used for parsing html tags, component names and property paths.
  4317. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4318. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4319. */
  4320. 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/;
  4321. /**
  4322. * Check if a string starts with $ or _
  4323. */
  4324. function isReserved (str) {
  4325. var c = (str + '').charCodeAt(0);
  4326. return c === 0x24 || c === 0x5F
  4327. }
  4328. /**
  4329. * Define a property.
  4330. */
  4331. function def (obj, key, val, enumerable) {
  4332. Object.defineProperty(obj, key, {
  4333. value: val,
  4334. enumerable: !!enumerable,
  4335. writable: true,
  4336. configurable: true
  4337. });
  4338. }
  4339. /**
  4340. * Parse simple path.
  4341. */
  4342. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4343. function parsePath (path) {
  4344. if (bailRE.test(path)) {
  4345. return
  4346. }
  4347. var segments = path.split('.');
  4348. return function (obj) {
  4349. for (var i = 0; i < segments.length; i++) {
  4350. if (!obj) { return }
  4351. obj = obj[segments[i]];
  4352. }
  4353. return obj
  4354. }
  4355. }
  4356. /* */
  4357. // can we use __proto__?
  4358. var hasProto = '__proto__' in {};
  4359. // Browser environment sniffing
  4360. var inBrowser = typeof window !== 'undefined';
  4361. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4362. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4363. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4364. var isIE = UA && /msie|trident/.test(UA);
  4365. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4366. var isEdge = UA && UA.indexOf('edge/') > 0;
  4367. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4368. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4369. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4370. var isPhantomJS = UA && /phantomjs/.test(UA);
  4371. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4372. // Firefox has a "watch" function on Object.prototype...
  4373. var nativeWatch = ({}).watch;
  4374. if (inBrowser) {
  4375. try {
  4376. var opts = {};
  4377. Object.defineProperty(opts, 'passive', ({
  4378. get: function get () {
  4379. }
  4380. })); // https://github.com/facebook/flow/issues/285
  4381. window.addEventListener('test-passive', null, opts);
  4382. } catch (e) {}
  4383. }
  4384. // this needs to be lazy-evaled because vue may be required before
  4385. // vue-server-renderer can set VUE_ENV
  4386. var _isServer;
  4387. var isServerRendering = function () {
  4388. if (_isServer === undefined) {
  4389. /* istanbul ignore if */
  4390. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4391. // detect presence of vue-server-renderer and avoid
  4392. // Webpack shimming the process
  4393. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4394. } else {
  4395. _isServer = false;
  4396. }
  4397. }
  4398. return _isServer
  4399. };
  4400. // detect devtools
  4401. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4402. /* istanbul ignore next */
  4403. function isNative (Ctor) {
  4404. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4405. }
  4406. var hasSymbol =
  4407. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4408. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4409. var _Set;
  4410. /* istanbul ignore if */ // $flow-disable-line
  4411. if (typeof Set !== 'undefined' && isNative(Set)) {
  4412. // use native Set when available.
  4413. _Set = Set;
  4414. } else {
  4415. // a non-standard Set polyfill that only works with primitive keys.
  4416. _Set = /*@__PURE__*/(function () {
  4417. function Set () {
  4418. this.set = Object.create(null);
  4419. }
  4420. Set.prototype.has = function has (key) {
  4421. return this.set[key] === true
  4422. };
  4423. Set.prototype.add = function add (key) {
  4424. this.set[key] = true;
  4425. };
  4426. Set.prototype.clear = function clear () {
  4427. this.set = Object.create(null);
  4428. };
  4429. return Set;
  4430. }());
  4431. }
  4432. /* */
  4433. var warn = noop;
  4434. var tip = noop;
  4435. var generateComponentTrace = (noop); // work around flow check
  4436. var formatComponentName = (noop);
  4437. if (true) {
  4438. var hasConsole = typeof console !== 'undefined';
  4439. var classifyRE = /(?:^|[-_])(\w)/g;
  4440. var classify = function (str) { return str
  4441. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4442. .replace(/[-_]/g, ''); };
  4443. warn = function (msg, vm) {
  4444. var trace = vm ? generateComponentTrace(vm) : '';
  4445. if (config.warnHandler) {
  4446. config.warnHandler.call(null, msg, vm, trace);
  4447. } else if (hasConsole && (!config.silent)) {
  4448. console.error(("[Vue warn]: " + msg + trace));
  4449. }
  4450. };
  4451. tip = function (msg, vm) {
  4452. if (hasConsole && (!config.silent)) {
  4453. console.warn("[Vue tip]: " + msg + (
  4454. vm ? generateComponentTrace(vm) : ''
  4455. ));
  4456. }
  4457. };
  4458. formatComponentName = function (vm, includeFile) {
  4459. if (vm.$root === vm) {
  4460. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4461. return ('') + vm.$options.__file
  4462. }
  4463. return '<Root>'
  4464. }
  4465. var options = typeof vm === 'function' && vm.cid != null
  4466. ? vm.options
  4467. : vm._isVue
  4468. ? vm.$options || vm.constructor.options
  4469. : vm;
  4470. var name = options.name || options._componentTag;
  4471. var file = options.__file;
  4472. if (!name && file) {
  4473. var match = file.match(/([^/\\]+)\.vue$/);
  4474. name = match && match[1];
  4475. }
  4476. return (
  4477. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4478. (file && includeFile !== false ? (" at " + file) : '')
  4479. )
  4480. };
  4481. var repeat = function (str, n) {
  4482. var res = '';
  4483. while (n) {
  4484. if (n % 2 === 1) { res += str; }
  4485. if (n > 1) { str += str; }
  4486. n >>= 1;
  4487. }
  4488. return res
  4489. };
  4490. generateComponentTrace = function (vm) {
  4491. if (vm._isVue && vm.$parent) {
  4492. var tree = [];
  4493. var currentRecursiveSequence = 0;
  4494. while (vm && vm.$options.name !== 'PageBody') {
  4495. if (tree.length > 0) {
  4496. var last = tree[tree.length - 1];
  4497. if (last.constructor === vm.constructor) {
  4498. currentRecursiveSequence++;
  4499. vm = vm.$parent;
  4500. continue
  4501. } else if (currentRecursiveSequence > 0) {
  4502. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4503. currentRecursiveSequence = 0;
  4504. }
  4505. }
  4506. !vm.$options.isReserved && tree.push(vm);
  4507. vm = vm.$parent;
  4508. }
  4509. return '\n\nfound in\n\n' + tree
  4510. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4511. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4512. : formatComponentName(vm))); })
  4513. .join('\n')
  4514. } else {
  4515. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4516. }
  4517. };
  4518. }
  4519. /* */
  4520. var uid = 0;
  4521. /**
  4522. * A dep is an observable that can have multiple
  4523. * directives subscribing to it.
  4524. */
  4525. var Dep = function Dep () {
  4526. this.id = uid++;
  4527. this.subs = [];
  4528. };
  4529. Dep.prototype.addSub = function addSub (sub) {
  4530. this.subs.push(sub);
  4531. };
  4532. Dep.prototype.removeSub = function removeSub (sub) {
  4533. remove(this.subs, sub);
  4534. };
  4535. Dep.prototype.depend = function depend () {
  4536. if (Dep.SharedObject.target) {
  4537. Dep.SharedObject.target.addDep(this);
  4538. }
  4539. };
  4540. Dep.prototype.notify = function notify () {
  4541. // stabilize the subscriber list first
  4542. var subs = this.subs.slice();
  4543. if ( true && !config.async) {
  4544. // subs aren't sorted in scheduler if not running async
  4545. // we need to sort them now to make sure they fire in correct
  4546. // order
  4547. subs.sort(function (a, b) { return a.id - b.id; });
  4548. }
  4549. for (var i = 0, l = subs.length; i < l; i++) {
  4550. subs[i].update();
  4551. }
  4552. };
  4553. // The current target watcher being evaluated.
  4554. // This is globally unique because only one watcher
  4555. // can be evaluated at a time.
  4556. // fixed by xxxxxx (nvue shared vuex)
  4557. /* eslint-disable no-undef */
  4558. Dep.SharedObject = {};
  4559. Dep.SharedObject.target = null;
  4560. Dep.SharedObject.targetStack = [];
  4561. function pushTarget (target) {
  4562. Dep.SharedObject.targetStack.push(target);
  4563. Dep.SharedObject.target = target;
  4564. }
  4565. function popTarget () {
  4566. Dep.SharedObject.targetStack.pop();
  4567. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4568. }
  4569. /* */
  4570. var VNode = function VNode (
  4571. tag,
  4572. data,
  4573. children,
  4574. text,
  4575. elm,
  4576. context,
  4577. componentOptions,
  4578. asyncFactory
  4579. ) {
  4580. this.tag = tag;
  4581. this.data = data;
  4582. this.children = children;
  4583. this.text = text;
  4584. this.elm = elm;
  4585. this.ns = undefined;
  4586. this.context = context;
  4587. this.fnContext = undefined;
  4588. this.fnOptions = undefined;
  4589. this.fnScopeId = undefined;
  4590. this.key = data && data.key;
  4591. this.componentOptions = componentOptions;
  4592. this.componentInstance = undefined;
  4593. this.parent = undefined;
  4594. this.raw = false;
  4595. this.isStatic = false;
  4596. this.isRootInsert = true;
  4597. this.isComment = false;
  4598. this.isCloned = false;
  4599. this.isOnce = false;
  4600. this.asyncFactory = asyncFactory;
  4601. this.asyncMeta = undefined;
  4602. this.isAsyncPlaceholder = false;
  4603. };
  4604. var prototypeAccessors = { child: { configurable: true } };
  4605. // DEPRECATED: alias for componentInstance for backwards compat.
  4606. /* istanbul ignore next */
  4607. prototypeAccessors.child.get = function () {
  4608. return this.componentInstance
  4609. };
  4610. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4611. var createEmptyVNode = function (text) {
  4612. if ( text === void 0 ) text = '';
  4613. var node = new VNode();
  4614. node.text = text;
  4615. node.isComment = true;
  4616. return node
  4617. };
  4618. function createTextVNode (val) {
  4619. return new VNode(undefined, undefined, undefined, String(val))
  4620. }
  4621. // optimized shallow clone
  4622. // used for static nodes and slot nodes because they may be reused across
  4623. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4624. // on their elm reference.
  4625. function cloneVNode (vnode) {
  4626. var cloned = new VNode(
  4627. vnode.tag,
  4628. vnode.data,
  4629. // #7975
  4630. // clone children array to avoid mutating original in case of cloning
  4631. // a child.
  4632. vnode.children && vnode.children.slice(),
  4633. vnode.text,
  4634. vnode.elm,
  4635. vnode.context,
  4636. vnode.componentOptions,
  4637. vnode.asyncFactory
  4638. );
  4639. cloned.ns = vnode.ns;
  4640. cloned.isStatic = vnode.isStatic;
  4641. cloned.key = vnode.key;
  4642. cloned.isComment = vnode.isComment;
  4643. cloned.fnContext = vnode.fnContext;
  4644. cloned.fnOptions = vnode.fnOptions;
  4645. cloned.fnScopeId = vnode.fnScopeId;
  4646. cloned.asyncMeta = vnode.asyncMeta;
  4647. cloned.isCloned = true;
  4648. return cloned
  4649. }
  4650. /*
  4651. * not type checking this file because flow doesn't play well with
  4652. * dynamically accessing methods on Array prototype
  4653. */
  4654. var arrayProto = Array.prototype;
  4655. var arrayMethods = Object.create(arrayProto);
  4656. var methodsToPatch = [
  4657. 'push',
  4658. 'pop',
  4659. 'shift',
  4660. 'unshift',
  4661. 'splice',
  4662. 'sort',
  4663. 'reverse'
  4664. ];
  4665. /**
  4666. * Intercept mutating methods and emit events
  4667. */
  4668. methodsToPatch.forEach(function (method) {
  4669. // cache original method
  4670. var original = arrayProto[method];
  4671. def(arrayMethods, method, function mutator () {
  4672. var args = [], len = arguments.length;
  4673. while ( len-- ) args[ len ] = arguments[ len ];
  4674. var result = original.apply(this, args);
  4675. var ob = this.__ob__;
  4676. var inserted;
  4677. switch (method) {
  4678. case 'push':
  4679. case 'unshift':
  4680. inserted = args;
  4681. break
  4682. case 'splice':
  4683. inserted = args.slice(2);
  4684. break
  4685. }
  4686. if (inserted) { ob.observeArray(inserted); }
  4687. // notify change
  4688. ob.dep.notify();
  4689. return result
  4690. });
  4691. });
  4692. /* */
  4693. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4694. /**
  4695. * In some cases we may want to disable observation inside a component's
  4696. * update computation.
  4697. */
  4698. var shouldObserve = true;
  4699. function toggleObserving (value) {
  4700. shouldObserve = value;
  4701. }
  4702. /**
  4703. * Observer class that is attached to each observed
  4704. * object. Once attached, the observer converts the target
  4705. * object's property keys into getter/setters that
  4706. * collect dependencies and dispatch updates.
  4707. */
  4708. var Observer = function Observer (value) {
  4709. this.value = value;
  4710. this.dep = new Dep();
  4711. this.vmCount = 0;
  4712. def(value, '__ob__', this);
  4713. if (Array.isArray(value)) {
  4714. if (hasProto) {
  4715. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4716. if(value.push !== value.__proto__.push){
  4717. copyAugment(value, arrayMethods, arrayKeys);
  4718. } else {
  4719. protoAugment(value, arrayMethods);
  4720. }
  4721. }
  4722. } else {
  4723. copyAugment(value, arrayMethods, arrayKeys);
  4724. }
  4725. this.observeArray(value);
  4726. } else {
  4727. this.walk(value);
  4728. }
  4729. };
  4730. /**
  4731. * Walk through all properties and convert them into
  4732. * getter/setters. This method should only be called when
  4733. * value type is Object.
  4734. */
  4735. Observer.prototype.walk = function walk (obj) {
  4736. var keys = Object.keys(obj);
  4737. for (var i = 0; i < keys.length; i++) {
  4738. defineReactive$$1(obj, keys[i]);
  4739. }
  4740. };
  4741. /**
  4742. * Observe a list of Array items.
  4743. */
  4744. Observer.prototype.observeArray = function observeArray (items) {
  4745. for (var i = 0, l = items.length; i < l; i++) {
  4746. observe(items[i]);
  4747. }
  4748. };
  4749. // helpers
  4750. /**
  4751. * Augment a target Object or Array by intercepting
  4752. * the prototype chain using __proto__
  4753. */
  4754. function protoAugment (target, src) {
  4755. /* eslint-disable no-proto */
  4756. target.__proto__ = src;
  4757. /* eslint-enable no-proto */
  4758. }
  4759. /**
  4760. * Augment a target Object or Array by defining
  4761. * hidden properties.
  4762. */
  4763. /* istanbul ignore next */
  4764. function copyAugment (target, src, keys) {
  4765. for (var i = 0, l = keys.length; i < l; i++) {
  4766. var key = keys[i];
  4767. def(target, key, src[key]);
  4768. }
  4769. }
  4770. /**
  4771. * Attempt to create an observer instance for a value,
  4772. * returns the new observer if successfully observed,
  4773. * or the existing observer if the value already has one.
  4774. */
  4775. function observe (value, asRootData) {
  4776. if (!isObject(value) || value instanceof VNode) {
  4777. return
  4778. }
  4779. var ob;
  4780. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4781. ob = value.__ob__;
  4782. } else if (
  4783. shouldObserve &&
  4784. !isServerRendering() &&
  4785. (Array.isArray(value) || isPlainObject(value)) &&
  4786. Object.isExtensible(value) &&
  4787. !value._isVue
  4788. ) {
  4789. ob = new Observer(value);
  4790. }
  4791. if (asRootData && ob) {
  4792. ob.vmCount++;
  4793. }
  4794. return ob
  4795. }
  4796. /**
  4797. * Define a reactive property on an Object.
  4798. */
  4799. function defineReactive$$1 (
  4800. obj,
  4801. key,
  4802. val,
  4803. customSetter,
  4804. shallow
  4805. ) {
  4806. var dep = new Dep();
  4807. var property = Object.getOwnPropertyDescriptor(obj, key);
  4808. if (property && property.configurable === false) {
  4809. return
  4810. }
  4811. // cater for pre-defined getter/setters
  4812. var getter = property && property.get;
  4813. var setter = property && property.set;
  4814. if ((!getter || setter) && arguments.length === 2) {
  4815. val = obj[key];
  4816. }
  4817. var childOb = !shallow && observe(val);
  4818. Object.defineProperty(obj, key, {
  4819. enumerable: true,
  4820. configurable: true,
  4821. get: function reactiveGetter () {
  4822. var value = getter ? getter.call(obj) : val;
  4823. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4824. dep.depend();
  4825. if (childOb) {
  4826. childOb.dep.depend();
  4827. if (Array.isArray(value)) {
  4828. dependArray(value);
  4829. }
  4830. }
  4831. }
  4832. return value
  4833. },
  4834. set: function reactiveSetter (newVal) {
  4835. var value = getter ? getter.call(obj) : val;
  4836. /* eslint-disable no-self-compare */
  4837. if (newVal === value || (newVal !== newVal && value !== value)) {
  4838. return
  4839. }
  4840. /* eslint-enable no-self-compare */
  4841. if ( true && customSetter) {
  4842. customSetter();
  4843. }
  4844. // #7981: for accessor properties without setter
  4845. if (getter && !setter) { return }
  4846. if (setter) {
  4847. setter.call(obj, newVal);
  4848. } else {
  4849. val = newVal;
  4850. }
  4851. childOb = !shallow && observe(newVal);
  4852. dep.notify();
  4853. }
  4854. });
  4855. }
  4856. /**
  4857. * Set a property on an object. Adds the new property and
  4858. * triggers change notification if the property doesn't
  4859. * already exist.
  4860. */
  4861. function set (target, key, val) {
  4862. if ( true &&
  4863. (isUndef(target) || isPrimitive(target))
  4864. ) {
  4865. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4866. }
  4867. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4868. target.length = Math.max(target.length, key);
  4869. target.splice(key, 1, val);
  4870. return val
  4871. }
  4872. if (key in target && !(key in Object.prototype)) {
  4873. target[key] = val;
  4874. return val
  4875. }
  4876. var ob = (target).__ob__;
  4877. if (target._isVue || (ob && ob.vmCount)) {
  4878. true && warn(
  4879. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4880. 'at runtime - declare it upfront in the data option.'
  4881. );
  4882. return val
  4883. }
  4884. if (!ob) {
  4885. target[key] = val;
  4886. return val
  4887. }
  4888. defineReactive$$1(ob.value, key, val);
  4889. ob.dep.notify();
  4890. return val
  4891. }
  4892. /**
  4893. * Delete a property and trigger change if necessary.
  4894. */
  4895. function del (target, key) {
  4896. if ( true &&
  4897. (isUndef(target) || isPrimitive(target))
  4898. ) {
  4899. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4900. }
  4901. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4902. target.splice(key, 1);
  4903. return
  4904. }
  4905. var ob = (target).__ob__;
  4906. if (target._isVue || (ob && ob.vmCount)) {
  4907. true && warn(
  4908. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4909. '- just set it to null.'
  4910. );
  4911. return
  4912. }
  4913. if (!hasOwn(target, key)) {
  4914. return
  4915. }
  4916. delete target[key];
  4917. if (!ob) {
  4918. return
  4919. }
  4920. ob.dep.notify();
  4921. }
  4922. /**
  4923. * Collect dependencies on array elements when the array is touched, since
  4924. * we cannot intercept array element access like property getters.
  4925. */
  4926. function dependArray (value) {
  4927. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4928. e = value[i];
  4929. e && e.__ob__ && e.__ob__.dep.depend();
  4930. if (Array.isArray(e)) {
  4931. dependArray(e);
  4932. }
  4933. }
  4934. }
  4935. /* */
  4936. /**
  4937. * Option overwriting strategies are functions that handle
  4938. * how to merge a parent option value and a child option
  4939. * value into the final value.
  4940. */
  4941. var strats = config.optionMergeStrategies;
  4942. /**
  4943. * Options with restrictions
  4944. */
  4945. if (true) {
  4946. strats.el = strats.propsData = function (parent, child, vm, key) {
  4947. if (!vm) {
  4948. warn(
  4949. "option \"" + key + "\" can only be used during instance " +
  4950. 'creation with the `new` keyword.'
  4951. );
  4952. }
  4953. return defaultStrat(parent, child)
  4954. };
  4955. }
  4956. /**
  4957. * Helper that recursively merges two data objects together.
  4958. */
  4959. function mergeData (to, from) {
  4960. if (!from) { return to }
  4961. var key, toVal, fromVal;
  4962. var keys = hasSymbol
  4963. ? Reflect.ownKeys(from)
  4964. : Object.keys(from);
  4965. for (var i = 0; i < keys.length; i++) {
  4966. key = keys[i];
  4967. // in case the object is already observed...
  4968. if (key === '__ob__') { continue }
  4969. toVal = to[key];
  4970. fromVal = from[key];
  4971. if (!hasOwn(to, key)) {
  4972. set(to, key, fromVal);
  4973. } else if (
  4974. toVal !== fromVal &&
  4975. isPlainObject(toVal) &&
  4976. isPlainObject(fromVal)
  4977. ) {
  4978. mergeData(toVal, fromVal);
  4979. }
  4980. }
  4981. return to
  4982. }
  4983. /**
  4984. * Data
  4985. */
  4986. function mergeDataOrFn (
  4987. parentVal,
  4988. childVal,
  4989. vm
  4990. ) {
  4991. if (!vm) {
  4992. // in a Vue.extend merge, both should be functions
  4993. if (!childVal) {
  4994. return parentVal
  4995. }
  4996. if (!parentVal) {
  4997. return childVal
  4998. }
  4999. // when parentVal & childVal are both present,
  5000. // we need to return a function that returns the
  5001. // merged result of both functions... no need to
  5002. // check if parentVal is a function here because
  5003. // it has to be a function to pass previous merges.
  5004. return function mergedDataFn () {
  5005. return mergeData(
  5006. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5007. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5008. )
  5009. }
  5010. } else {
  5011. return function mergedInstanceDataFn () {
  5012. // instance merge
  5013. var instanceData = typeof childVal === 'function'
  5014. ? childVal.call(vm, vm)
  5015. : childVal;
  5016. var defaultData = typeof parentVal === 'function'
  5017. ? parentVal.call(vm, vm)
  5018. : parentVal;
  5019. if (instanceData) {
  5020. return mergeData(instanceData, defaultData)
  5021. } else {
  5022. return defaultData
  5023. }
  5024. }
  5025. }
  5026. }
  5027. strats.data = function (
  5028. parentVal,
  5029. childVal,
  5030. vm
  5031. ) {
  5032. if (!vm) {
  5033. if (childVal && typeof childVal !== 'function') {
  5034. true && warn(
  5035. 'The "data" option should be a function ' +
  5036. 'that returns a per-instance value in component ' +
  5037. 'definitions.',
  5038. vm
  5039. );
  5040. return parentVal
  5041. }
  5042. return mergeDataOrFn(parentVal, childVal)
  5043. }
  5044. return mergeDataOrFn(parentVal, childVal, vm)
  5045. };
  5046. /**
  5047. * Hooks and props are merged as arrays.
  5048. */
  5049. function mergeHook (
  5050. parentVal,
  5051. childVal
  5052. ) {
  5053. var res = childVal
  5054. ? parentVal
  5055. ? parentVal.concat(childVal)
  5056. : Array.isArray(childVal)
  5057. ? childVal
  5058. : [childVal]
  5059. : parentVal;
  5060. return res
  5061. ? dedupeHooks(res)
  5062. : res
  5063. }
  5064. function dedupeHooks (hooks) {
  5065. var res = [];
  5066. for (var i = 0; i < hooks.length; i++) {
  5067. if (res.indexOf(hooks[i]) === -1) {
  5068. res.push(hooks[i]);
  5069. }
  5070. }
  5071. return res
  5072. }
  5073. LIFECYCLE_HOOKS.forEach(function (hook) {
  5074. strats[hook] = mergeHook;
  5075. });
  5076. /**
  5077. * Assets
  5078. *
  5079. * When a vm is present (instance creation), we need to do
  5080. * a three-way merge between constructor options, instance
  5081. * options and parent options.
  5082. */
  5083. function mergeAssets (
  5084. parentVal,
  5085. childVal,
  5086. vm,
  5087. key
  5088. ) {
  5089. var res = Object.create(parentVal || null);
  5090. if (childVal) {
  5091. true && assertObjectType(key, childVal, vm);
  5092. return extend(res, childVal)
  5093. } else {
  5094. return res
  5095. }
  5096. }
  5097. ASSET_TYPES.forEach(function (type) {
  5098. strats[type + 's'] = mergeAssets;
  5099. });
  5100. /**
  5101. * Watchers.
  5102. *
  5103. * Watchers hashes should not overwrite one
  5104. * another, so we merge them as arrays.
  5105. */
  5106. strats.watch = function (
  5107. parentVal,
  5108. childVal,
  5109. vm,
  5110. key
  5111. ) {
  5112. // work around Firefox's Object.prototype.watch...
  5113. if (parentVal === nativeWatch) { parentVal = undefined; }
  5114. if (childVal === nativeWatch) { childVal = undefined; }
  5115. /* istanbul ignore if */
  5116. if (!childVal) { return Object.create(parentVal || null) }
  5117. if (true) {
  5118. assertObjectType(key, childVal, vm);
  5119. }
  5120. if (!parentVal) { return childVal }
  5121. var ret = {};
  5122. extend(ret, parentVal);
  5123. for (var key$1 in childVal) {
  5124. var parent = ret[key$1];
  5125. var child = childVal[key$1];
  5126. if (parent && !Array.isArray(parent)) {
  5127. parent = [parent];
  5128. }
  5129. ret[key$1] = parent
  5130. ? parent.concat(child)
  5131. : Array.isArray(child) ? child : [child];
  5132. }
  5133. return ret
  5134. };
  5135. /**
  5136. * Other object hashes.
  5137. */
  5138. strats.props =
  5139. strats.methods =
  5140. strats.inject =
  5141. strats.computed = function (
  5142. parentVal,
  5143. childVal,
  5144. vm,
  5145. key
  5146. ) {
  5147. if (childVal && "development" !== 'production') {
  5148. assertObjectType(key, childVal, vm);
  5149. }
  5150. if (!parentVal) { return childVal }
  5151. var ret = Object.create(null);
  5152. extend(ret, parentVal);
  5153. if (childVal) { extend(ret, childVal); }
  5154. return ret
  5155. };
  5156. strats.provide = mergeDataOrFn;
  5157. /**
  5158. * Default strategy.
  5159. */
  5160. var defaultStrat = function (parentVal, childVal) {
  5161. return childVal === undefined
  5162. ? parentVal
  5163. : childVal
  5164. };
  5165. /**
  5166. * Validate component names
  5167. */
  5168. function checkComponents (options) {
  5169. for (var key in options.components) {
  5170. validateComponentName(key);
  5171. }
  5172. }
  5173. function validateComponentName (name) {
  5174. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5175. warn(
  5176. 'Invalid component name: "' + name + '". Component names ' +
  5177. 'should conform to valid custom element name in html5 specification.'
  5178. );
  5179. }
  5180. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5181. warn(
  5182. 'Do not use built-in or reserved HTML elements as component ' +
  5183. 'id: ' + name
  5184. );
  5185. }
  5186. }
  5187. /**
  5188. * Ensure all props option syntax are normalized into the
  5189. * Object-based format.
  5190. */
  5191. function normalizeProps (options, vm) {
  5192. var props = options.props;
  5193. if (!props) { return }
  5194. var res = {};
  5195. var i, val, name;
  5196. if (Array.isArray(props)) {
  5197. i = props.length;
  5198. while (i--) {
  5199. val = props[i];
  5200. if (typeof val === 'string') {
  5201. name = camelize(val);
  5202. res[name] = { type: null };
  5203. } else if (true) {
  5204. warn('props must be strings when using array syntax.');
  5205. }
  5206. }
  5207. } else if (isPlainObject(props)) {
  5208. for (var key in props) {
  5209. val = props[key];
  5210. name = camelize(key);
  5211. res[name] = isPlainObject(val)
  5212. ? val
  5213. : { type: val };
  5214. }
  5215. } else if (true) {
  5216. warn(
  5217. "Invalid value for option \"props\": expected an Array or an Object, " +
  5218. "but got " + (toRawType(props)) + ".",
  5219. vm
  5220. );
  5221. }
  5222. options.props = res;
  5223. }
  5224. /**
  5225. * Normalize all injections into Object-based format
  5226. */
  5227. function normalizeInject (options, vm) {
  5228. var inject = options.inject;
  5229. if (!inject) { return }
  5230. var normalized = options.inject = {};
  5231. if (Array.isArray(inject)) {
  5232. for (var i = 0; i < inject.length; i++) {
  5233. normalized[inject[i]] = { from: inject[i] };
  5234. }
  5235. } else if (isPlainObject(inject)) {
  5236. for (var key in inject) {
  5237. var val = inject[key];
  5238. normalized[key] = isPlainObject(val)
  5239. ? extend({ from: key }, val)
  5240. : { from: val };
  5241. }
  5242. } else if (true) {
  5243. warn(
  5244. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5245. "but got " + (toRawType(inject)) + ".",
  5246. vm
  5247. );
  5248. }
  5249. }
  5250. /**
  5251. * Normalize raw function directives into object format.
  5252. */
  5253. function normalizeDirectives (options) {
  5254. var dirs = options.directives;
  5255. if (dirs) {
  5256. for (var key in dirs) {
  5257. var def$$1 = dirs[key];
  5258. if (typeof def$$1 === 'function') {
  5259. dirs[key] = { bind: def$$1, update: def$$1 };
  5260. }
  5261. }
  5262. }
  5263. }
  5264. function assertObjectType (name, value, vm) {
  5265. if (!isPlainObject(value)) {
  5266. warn(
  5267. "Invalid value for option \"" + name + "\": expected an Object, " +
  5268. "but got " + (toRawType(value)) + ".",
  5269. vm
  5270. );
  5271. }
  5272. }
  5273. /**
  5274. * Merge two option objects into a new one.
  5275. * Core utility used in both instantiation and inheritance.
  5276. */
  5277. function mergeOptions (
  5278. parent,
  5279. child,
  5280. vm
  5281. ) {
  5282. if (true) {
  5283. checkComponents(child);
  5284. }
  5285. if (typeof child === 'function') {
  5286. child = child.options;
  5287. }
  5288. normalizeProps(child, vm);
  5289. normalizeInject(child, vm);
  5290. normalizeDirectives(child);
  5291. // Apply extends and mixins on the child options,
  5292. // but only if it is a raw options object that isn't
  5293. // the result of another mergeOptions call.
  5294. // Only merged options has the _base property.
  5295. if (!child._base) {
  5296. if (child.extends) {
  5297. parent = mergeOptions(parent, child.extends, vm);
  5298. }
  5299. if (child.mixins) {
  5300. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5301. parent = mergeOptions(parent, child.mixins[i], vm);
  5302. }
  5303. }
  5304. }
  5305. var options = {};
  5306. var key;
  5307. for (key in parent) {
  5308. mergeField(key);
  5309. }
  5310. for (key in child) {
  5311. if (!hasOwn(parent, key)) {
  5312. mergeField(key);
  5313. }
  5314. }
  5315. function mergeField (key) {
  5316. var strat = strats[key] || defaultStrat;
  5317. options[key] = strat(parent[key], child[key], vm, key);
  5318. }
  5319. return options
  5320. }
  5321. /**
  5322. * Resolve an asset.
  5323. * This function is used because child instances need access
  5324. * to assets defined in its ancestor chain.
  5325. */
  5326. function resolveAsset (
  5327. options,
  5328. type,
  5329. id,
  5330. warnMissing
  5331. ) {
  5332. /* istanbul ignore if */
  5333. if (typeof id !== 'string') {
  5334. return
  5335. }
  5336. var assets = options[type];
  5337. // check local registration variations first
  5338. if (hasOwn(assets, id)) { return assets[id] }
  5339. var camelizedId = camelize(id);
  5340. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5341. var PascalCaseId = capitalize(camelizedId);
  5342. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5343. // fallback to prototype chain
  5344. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5345. if ( true && warnMissing && !res) {
  5346. warn(
  5347. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5348. options
  5349. );
  5350. }
  5351. return res
  5352. }
  5353. /* */
  5354. function validateProp (
  5355. key,
  5356. propOptions,
  5357. propsData,
  5358. vm
  5359. ) {
  5360. var prop = propOptions[key];
  5361. var absent = !hasOwn(propsData, key);
  5362. var value = propsData[key];
  5363. // boolean casting
  5364. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5365. if (booleanIndex > -1) {
  5366. if (absent && !hasOwn(prop, 'default')) {
  5367. value = false;
  5368. } else if (value === '' || value === hyphenate(key)) {
  5369. // only cast empty string / same name to boolean if
  5370. // boolean has higher priority
  5371. var stringIndex = getTypeIndex(String, prop.type);
  5372. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5373. value = true;
  5374. }
  5375. }
  5376. }
  5377. // check default value
  5378. if (value === undefined) {
  5379. value = getPropDefaultValue(vm, prop, key);
  5380. // since the default value is a fresh copy,
  5381. // make sure to observe it.
  5382. var prevShouldObserve = shouldObserve;
  5383. toggleObserving(true);
  5384. observe(value);
  5385. toggleObserving(prevShouldObserve);
  5386. }
  5387. if (
  5388. true
  5389. ) {
  5390. assertProp(prop, key, value, vm, absent);
  5391. }
  5392. return value
  5393. }
  5394. /**
  5395. * Get the default value of a prop.
  5396. */
  5397. function getPropDefaultValue (vm, prop, key) {
  5398. // no default, return undefined
  5399. if (!hasOwn(prop, 'default')) {
  5400. return undefined
  5401. }
  5402. var def = prop.default;
  5403. // warn against non-factory defaults for Object & Array
  5404. if ( true && isObject(def)) {
  5405. warn(
  5406. 'Invalid default value for prop "' + key + '": ' +
  5407. 'Props with type Object/Array must use a factory function ' +
  5408. 'to return the default value.',
  5409. vm
  5410. );
  5411. }
  5412. // the raw prop value was also undefined from previous render,
  5413. // return previous default value to avoid unnecessary watcher trigger
  5414. if (vm && vm.$options.propsData &&
  5415. vm.$options.propsData[key] === undefined &&
  5416. vm._props[key] !== undefined
  5417. ) {
  5418. return vm._props[key]
  5419. }
  5420. // call factory function for non-Function types
  5421. // a value is Function if its prototype is function even across different execution context
  5422. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5423. ? def.call(vm)
  5424. : def
  5425. }
  5426. /**
  5427. * Assert whether a prop is valid.
  5428. */
  5429. function assertProp (
  5430. prop,
  5431. name,
  5432. value,
  5433. vm,
  5434. absent
  5435. ) {
  5436. if (prop.required && absent) {
  5437. warn(
  5438. 'Missing required prop: "' + name + '"',
  5439. vm
  5440. );
  5441. return
  5442. }
  5443. if (value == null && !prop.required) {
  5444. return
  5445. }
  5446. var type = prop.type;
  5447. var valid = !type || type === true;
  5448. var expectedTypes = [];
  5449. if (type) {
  5450. if (!Array.isArray(type)) {
  5451. type = [type];
  5452. }
  5453. for (var i = 0; i < type.length && !valid; i++) {
  5454. var assertedType = assertType(value, type[i]);
  5455. expectedTypes.push(assertedType.expectedType || '');
  5456. valid = assertedType.valid;
  5457. }
  5458. }
  5459. if (!valid) {
  5460. warn(
  5461. getInvalidTypeMessage(name, value, expectedTypes),
  5462. vm
  5463. );
  5464. return
  5465. }
  5466. var validator = prop.validator;
  5467. if (validator) {
  5468. if (!validator(value)) {
  5469. warn(
  5470. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5471. vm
  5472. );
  5473. }
  5474. }
  5475. }
  5476. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5477. function assertType (value, type) {
  5478. var valid;
  5479. var expectedType = getType(type);
  5480. if (simpleCheckRE.test(expectedType)) {
  5481. var t = typeof value;
  5482. valid = t === expectedType.toLowerCase();
  5483. // for primitive wrapper objects
  5484. if (!valid && t === 'object') {
  5485. valid = value instanceof type;
  5486. }
  5487. } else if (expectedType === 'Object') {
  5488. valid = isPlainObject(value);
  5489. } else if (expectedType === 'Array') {
  5490. valid = Array.isArray(value);
  5491. } else {
  5492. valid = value instanceof type;
  5493. }
  5494. return {
  5495. valid: valid,
  5496. expectedType: expectedType
  5497. }
  5498. }
  5499. /**
  5500. * Use function string name to check built-in types,
  5501. * because a simple equality check will fail when running
  5502. * across different vms / iframes.
  5503. */
  5504. function getType (fn) {
  5505. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5506. return match ? match[1] : ''
  5507. }
  5508. function isSameType (a, b) {
  5509. return getType(a) === getType(b)
  5510. }
  5511. function getTypeIndex (type, expectedTypes) {
  5512. if (!Array.isArray(expectedTypes)) {
  5513. return isSameType(expectedTypes, type) ? 0 : -1
  5514. }
  5515. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5516. if (isSameType(expectedTypes[i], type)) {
  5517. return i
  5518. }
  5519. }
  5520. return -1
  5521. }
  5522. function getInvalidTypeMessage (name, value, expectedTypes) {
  5523. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5524. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5525. var expectedType = expectedTypes[0];
  5526. var receivedType = toRawType(value);
  5527. var expectedValue = styleValue(value, expectedType);
  5528. var receivedValue = styleValue(value, receivedType);
  5529. // check if we need to specify expected value
  5530. if (expectedTypes.length === 1 &&
  5531. isExplicable(expectedType) &&
  5532. !isBoolean(expectedType, receivedType)) {
  5533. message += " with value " + expectedValue;
  5534. }
  5535. message += ", got " + receivedType + " ";
  5536. // check if we need to specify received value
  5537. if (isExplicable(receivedType)) {
  5538. message += "with value " + receivedValue + ".";
  5539. }
  5540. return message
  5541. }
  5542. function styleValue (value, type) {
  5543. if (type === 'String') {
  5544. return ("\"" + value + "\"")
  5545. } else if (type === 'Number') {
  5546. return ("" + (Number(value)))
  5547. } else {
  5548. return ("" + value)
  5549. }
  5550. }
  5551. function isExplicable (value) {
  5552. var explicitTypes = ['string', 'number', 'boolean'];
  5553. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5554. }
  5555. function isBoolean () {
  5556. var args = [], len = arguments.length;
  5557. while ( len-- ) args[ len ] = arguments[ len ];
  5558. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5559. }
  5560. /* */
  5561. function handleError (err, vm, info) {
  5562. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5563. // See: https://github.com/vuejs/vuex/issues/1505
  5564. pushTarget();
  5565. try {
  5566. if (vm) {
  5567. var cur = vm;
  5568. while ((cur = cur.$parent)) {
  5569. var hooks = cur.$options.errorCaptured;
  5570. if (hooks) {
  5571. for (var i = 0; i < hooks.length; i++) {
  5572. try {
  5573. var capture = hooks[i].call(cur, err, vm, info) === false;
  5574. if (capture) { return }
  5575. } catch (e) {
  5576. globalHandleError(e, cur, 'errorCaptured hook');
  5577. }
  5578. }
  5579. }
  5580. }
  5581. }
  5582. globalHandleError(err, vm, info);
  5583. } finally {
  5584. popTarget();
  5585. }
  5586. }
  5587. function invokeWithErrorHandling (
  5588. handler,
  5589. context,
  5590. args,
  5591. vm,
  5592. info
  5593. ) {
  5594. var res;
  5595. try {
  5596. res = args ? handler.apply(context, args) : handler.call(context);
  5597. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5598. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5599. // issue #9511
  5600. // avoid catch triggering multiple times when nested calls
  5601. res._handled = true;
  5602. }
  5603. } catch (e) {
  5604. handleError(e, vm, info);
  5605. }
  5606. return res
  5607. }
  5608. function globalHandleError (err, vm, info) {
  5609. if (config.errorHandler) {
  5610. try {
  5611. return config.errorHandler.call(null, err, vm, info)
  5612. } catch (e) {
  5613. // if the user intentionally throws the original error in the handler,
  5614. // do not log it twice
  5615. if (e !== err) {
  5616. logError(e, null, 'config.errorHandler');
  5617. }
  5618. }
  5619. }
  5620. logError(err, vm, info);
  5621. }
  5622. function logError (err, vm, info) {
  5623. if (true) {
  5624. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5625. }
  5626. /* istanbul ignore else */
  5627. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5628. console.error(err);
  5629. } else {
  5630. throw err
  5631. }
  5632. }
  5633. /* */
  5634. var callbacks = [];
  5635. var pending = false;
  5636. function flushCallbacks () {
  5637. pending = false;
  5638. var copies = callbacks.slice(0);
  5639. callbacks.length = 0;
  5640. for (var i = 0; i < copies.length; i++) {
  5641. copies[i]();
  5642. }
  5643. }
  5644. // Here we have async deferring wrappers using microtasks.
  5645. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5646. // However, it has subtle problems when state is changed right before repaint
  5647. // (e.g. #6813, out-in transitions).
  5648. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5649. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5650. // So we now use microtasks everywhere, again.
  5651. // A major drawback of this tradeoff is that there are some scenarios
  5652. // where microtasks have too high a priority and fire in between supposedly
  5653. // sequential events (e.g. #4521, #6690, which have workarounds)
  5654. // or even between bubbling of the same event (#6566).
  5655. var timerFunc;
  5656. // The nextTick behavior leverages the microtask queue, which can be accessed
  5657. // via either native Promise.then or MutationObserver.
  5658. // MutationObserver has wider support, however it is seriously bugged in
  5659. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5660. // completely stops working after triggering a few times... so, if native
  5661. // Promise is available, we will use it:
  5662. /* istanbul ignore next, $flow-disable-line */
  5663. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5664. var p = Promise.resolve();
  5665. timerFunc = function () {
  5666. p.then(flushCallbacks);
  5667. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5668. // it can get stuck in a weird state where callbacks are pushed into the
  5669. // microtask queue but the queue isn't being flushed, until the browser
  5670. // needs to do some other work, e.g. handle a timer. Therefore we can
  5671. // "force" the microtask queue to be flushed by adding an empty timer.
  5672. if (isIOS) { setTimeout(noop); }
  5673. };
  5674. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5675. isNative(MutationObserver) ||
  5676. // PhantomJS and iOS 7.x
  5677. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5678. )) {
  5679. // Use MutationObserver where native Promise is not available,
  5680. // e.g. PhantomJS, iOS7, Android 4.4
  5681. // (#6466 MutationObserver is unreliable in IE11)
  5682. var counter = 1;
  5683. var observer = new MutationObserver(flushCallbacks);
  5684. var textNode = document.createTextNode(String(counter));
  5685. observer.observe(textNode, {
  5686. characterData: true
  5687. });
  5688. timerFunc = function () {
  5689. counter = (counter + 1) % 2;
  5690. textNode.data = String(counter);
  5691. };
  5692. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5693. // Fallback to setImmediate.
  5694. // Technically it leverages the (macro) task queue,
  5695. // but it is still a better choice than setTimeout.
  5696. timerFunc = function () {
  5697. setImmediate(flushCallbacks);
  5698. };
  5699. } else {
  5700. // Fallback to setTimeout.
  5701. timerFunc = function () {
  5702. setTimeout(flushCallbacks, 0);
  5703. };
  5704. }
  5705. function nextTick (cb, ctx) {
  5706. var _resolve;
  5707. callbacks.push(function () {
  5708. if (cb) {
  5709. try {
  5710. cb.call(ctx);
  5711. } catch (e) {
  5712. handleError(e, ctx, 'nextTick');
  5713. }
  5714. } else if (_resolve) {
  5715. _resolve(ctx);
  5716. }
  5717. });
  5718. if (!pending) {
  5719. pending = true;
  5720. timerFunc();
  5721. }
  5722. // $flow-disable-line
  5723. if (!cb && typeof Promise !== 'undefined') {
  5724. return new Promise(function (resolve) {
  5725. _resolve = resolve;
  5726. })
  5727. }
  5728. }
  5729. /* */
  5730. /* not type checking this file because flow doesn't play well with Proxy */
  5731. var initProxy;
  5732. if (true) {
  5733. var allowedGlobals = makeMap(
  5734. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5735. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5736. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5737. 'require' // for Webpack/Browserify
  5738. );
  5739. var warnNonPresent = function (target, key) {
  5740. warn(
  5741. "Property or method \"" + key + "\" is not defined on the instance but " +
  5742. 'referenced during render. Make sure that this property is reactive, ' +
  5743. 'either in the data option, or for class-based components, by ' +
  5744. 'initializing the property. ' +
  5745. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5746. target
  5747. );
  5748. };
  5749. var warnReservedPrefix = function (target, key) {
  5750. warn(
  5751. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5752. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5753. 'prevent conflicts with Vue internals. ' +
  5754. 'See: https://vuejs.org/v2/api/#data',
  5755. target
  5756. );
  5757. };
  5758. var hasProxy =
  5759. typeof Proxy !== 'undefined' && isNative(Proxy);
  5760. if (hasProxy) {
  5761. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5762. config.keyCodes = new Proxy(config.keyCodes, {
  5763. set: function set (target, key, value) {
  5764. if (isBuiltInModifier(key)) {
  5765. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5766. return false
  5767. } else {
  5768. target[key] = value;
  5769. return true
  5770. }
  5771. }
  5772. });
  5773. }
  5774. var hasHandler = {
  5775. has: function has (target, key) {
  5776. var has = key in target;
  5777. var isAllowed = allowedGlobals(key) ||
  5778. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5779. if (!has && !isAllowed) {
  5780. if (key in target.$data) { warnReservedPrefix(target, key); }
  5781. else { warnNonPresent(target, key); }
  5782. }
  5783. return has || !isAllowed
  5784. }
  5785. };
  5786. var getHandler = {
  5787. get: function get (target, key) {
  5788. if (typeof key === 'string' && !(key in target)) {
  5789. if (key in target.$data) { warnReservedPrefix(target, key); }
  5790. else { warnNonPresent(target, key); }
  5791. }
  5792. return target[key]
  5793. }
  5794. };
  5795. initProxy = function initProxy (vm) {
  5796. if (hasProxy) {
  5797. // determine which proxy handler to use
  5798. var options = vm.$options;
  5799. var handlers = options.render && options.render._withStripped
  5800. ? getHandler
  5801. : hasHandler;
  5802. vm._renderProxy = new Proxy(vm, handlers);
  5803. } else {
  5804. vm._renderProxy = vm;
  5805. }
  5806. };
  5807. }
  5808. /* */
  5809. var seenObjects = new _Set();
  5810. /**
  5811. * Recursively traverse an object to evoke all converted
  5812. * getters, so that every nested property inside the object
  5813. * is collected as a "deep" dependency.
  5814. */
  5815. function traverse (val) {
  5816. _traverse(val, seenObjects);
  5817. seenObjects.clear();
  5818. }
  5819. function _traverse (val, seen) {
  5820. var i, keys;
  5821. var isA = Array.isArray(val);
  5822. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5823. return
  5824. }
  5825. if (val.__ob__) {
  5826. var depId = val.__ob__.dep.id;
  5827. if (seen.has(depId)) {
  5828. return
  5829. }
  5830. seen.add(depId);
  5831. }
  5832. if (isA) {
  5833. i = val.length;
  5834. while (i--) { _traverse(val[i], seen); }
  5835. } else {
  5836. keys = Object.keys(val);
  5837. i = keys.length;
  5838. while (i--) { _traverse(val[keys[i]], seen); }
  5839. }
  5840. }
  5841. var mark;
  5842. var measure;
  5843. if (true) {
  5844. var perf = inBrowser && window.performance;
  5845. /* istanbul ignore if */
  5846. if (
  5847. perf &&
  5848. perf.mark &&
  5849. perf.measure &&
  5850. perf.clearMarks &&
  5851. perf.clearMeasures
  5852. ) {
  5853. mark = function (tag) { return perf.mark(tag); };
  5854. measure = function (name, startTag, endTag) {
  5855. perf.measure(name, startTag, endTag);
  5856. perf.clearMarks(startTag);
  5857. perf.clearMarks(endTag);
  5858. // perf.clearMeasures(name)
  5859. };
  5860. }
  5861. }
  5862. /* */
  5863. var normalizeEvent = cached(function (name) {
  5864. var passive = name.charAt(0) === '&';
  5865. name = passive ? name.slice(1) : name;
  5866. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5867. name = once$$1 ? name.slice(1) : name;
  5868. var capture = name.charAt(0) === '!';
  5869. name = capture ? name.slice(1) : name;
  5870. return {
  5871. name: name,
  5872. once: once$$1,
  5873. capture: capture,
  5874. passive: passive
  5875. }
  5876. });
  5877. function createFnInvoker (fns, vm) {
  5878. function invoker () {
  5879. var arguments$1 = arguments;
  5880. var fns = invoker.fns;
  5881. if (Array.isArray(fns)) {
  5882. var cloned = fns.slice();
  5883. for (var i = 0; i < cloned.length; i++) {
  5884. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5885. }
  5886. } else {
  5887. // return handler return value for single handlers
  5888. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5889. }
  5890. }
  5891. invoker.fns = fns;
  5892. return invoker
  5893. }
  5894. function updateListeners (
  5895. on,
  5896. oldOn,
  5897. add,
  5898. remove$$1,
  5899. createOnceHandler,
  5900. vm
  5901. ) {
  5902. var name, def$$1, cur, old, event;
  5903. for (name in on) {
  5904. def$$1 = cur = on[name];
  5905. old = oldOn[name];
  5906. event = normalizeEvent(name);
  5907. if (isUndef(cur)) {
  5908. true && warn(
  5909. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5910. vm
  5911. );
  5912. } else if (isUndef(old)) {
  5913. if (isUndef(cur.fns)) {
  5914. cur = on[name] = createFnInvoker(cur, vm);
  5915. }
  5916. if (isTrue(event.once)) {
  5917. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5918. }
  5919. add(event.name, cur, event.capture, event.passive, event.params);
  5920. } else if (cur !== old) {
  5921. old.fns = cur;
  5922. on[name] = old;
  5923. }
  5924. }
  5925. for (name in oldOn) {
  5926. if (isUndef(on[name])) {
  5927. event = normalizeEvent(name);
  5928. remove$$1(event.name, oldOn[name], event.capture);
  5929. }
  5930. }
  5931. }
  5932. /* */
  5933. /* */
  5934. // fixed by xxxxxx (mp properties)
  5935. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5936. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5937. if (isUndef(propOptions)) {
  5938. return res
  5939. }
  5940. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5941. var attrs = data.attrs;
  5942. var props = data.props;
  5943. if (isDef(attrs) || isDef(props)) {
  5944. for (var key in propOptions) {
  5945. var altKey = hyphenate(key);
  5946. var result = checkProp(res, props, key, altKey, true) ||
  5947. checkProp(res, attrs, key, altKey, false);
  5948. // externalClass
  5949. if (
  5950. result &&
  5951. res[key] &&
  5952. externalClasses.indexOf(altKey) !== -1 &&
  5953. context[camelize(res[key])]
  5954. ) {
  5955. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5956. res[key] = context[camelize(res[key])];
  5957. }
  5958. }
  5959. }
  5960. return res
  5961. }
  5962. function extractPropsFromVNodeData (
  5963. data,
  5964. Ctor,
  5965. tag,
  5966. context// fixed by xxxxxx
  5967. ) {
  5968. // we are only extracting raw values here.
  5969. // validation and default values are handled in the child
  5970. // component itself.
  5971. var propOptions = Ctor.options.props;
  5972. if (isUndef(propOptions)) {
  5973. // fixed by xxxxxx
  5974. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5975. }
  5976. var res = {};
  5977. var attrs = data.attrs;
  5978. var props = data.props;
  5979. if (isDef(attrs) || isDef(props)) {
  5980. for (var key in propOptions) {
  5981. var altKey = hyphenate(key);
  5982. if (true) {
  5983. var keyInLowerCase = key.toLowerCase();
  5984. if (
  5985. key !== keyInLowerCase &&
  5986. attrs && hasOwn(attrs, keyInLowerCase)
  5987. ) {
  5988. tip(
  5989. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5990. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5991. " \"" + key + "\". " +
  5992. "Note that HTML attributes are case-insensitive and camelCased " +
  5993. "props need to use their kebab-case equivalents when using in-DOM " +
  5994. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5995. );
  5996. }
  5997. }
  5998. checkProp(res, props, key, altKey, true) ||
  5999. checkProp(res, attrs, key, altKey, false);
  6000. }
  6001. }
  6002. // fixed by xxxxxx
  6003. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6004. }
  6005. function checkProp (
  6006. res,
  6007. hash,
  6008. key,
  6009. altKey,
  6010. preserve
  6011. ) {
  6012. if (isDef(hash)) {
  6013. if (hasOwn(hash, key)) {
  6014. res[key] = hash[key];
  6015. if (!preserve) {
  6016. delete hash[key];
  6017. }
  6018. return true
  6019. } else if (hasOwn(hash, altKey)) {
  6020. res[key] = hash[altKey];
  6021. if (!preserve) {
  6022. delete hash[altKey];
  6023. }
  6024. return true
  6025. }
  6026. }
  6027. return false
  6028. }
  6029. /* */
  6030. // The template compiler attempts to minimize the need for normalization by
  6031. // statically analyzing the template at compile time.
  6032. //
  6033. // For plain HTML markup, normalization can be completely skipped because the
  6034. // generated render function is guaranteed to return Array<VNode>. There are
  6035. // two cases where extra normalization is needed:
  6036. // 1. When the children contains components - because a functional component
  6037. // may return an Array instead of a single root. In this case, just a simple
  6038. // normalization is needed - if any child is an Array, we flatten the whole
  6039. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6040. // because functional components already normalize their own children.
  6041. function simpleNormalizeChildren (children) {
  6042. for (var i = 0; i < children.length; i++) {
  6043. if (Array.isArray(children[i])) {
  6044. return Array.prototype.concat.apply([], children)
  6045. }
  6046. }
  6047. return children
  6048. }
  6049. // 2. When the children contains constructs that always generated nested Arrays,
  6050. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6051. // with hand-written render functions / JSX. In such cases a full normalization
  6052. // is needed to cater to all possible types of children values.
  6053. function normalizeChildren (children) {
  6054. return isPrimitive(children)
  6055. ? [createTextVNode(children)]
  6056. : Array.isArray(children)
  6057. ? normalizeArrayChildren(children)
  6058. : undefined
  6059. }
  6060. function isTextNode (node) {
  6061. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6062. }
  6063. function normalizeArrayChildren (children, nestedIndex) {
  6064. var res = [];
  6065. var i, c, lastIndex, last;
  6066. for (i = 0; i < children.length; i++) {
  6067. c = children[i];
  6068. if (isUndef(c) || typeof c === 'boolean') { continue }
  6069. lastIndex = res.length - 1;
  6070. last = res[lastIndex];
  6071. // nested
  6072. if (Array.isArray(c)) {
  6073. if (c.length > 0) {
  6074. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6075. // merge adjacent text nodes
  6076. if (isTextNode(c[0]) && isTextNode(last)) {
  6077. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6078. c.shift();
  6079. }
  6080. res.push.apply(res, c);
  6081. }
  6082. } else if (isPrimitive(c)) {
  6083. if (isTextNode(last)) {
  6084. // merge adjacent text nodes
  6085. // this is necessary for SSR hydration because text nodes are
  6086. // essentially merged when rendered to HTML strings
  6087. res[lastIndex] = createTextVNode(last.text + c);
  6088. } else if (c !== '') {
  6089. // convert primitive to vnode
  6090. res.push(createTextVNode(c));
  6091. }
  6092. } else {
  6093. if (isTextNode(c) && isTextNode(last)) {
  6094. // merge adjacent text nodes
  6095. res[lastIndex] = createTextVNode(last.text + c.text);
  6096. } else {
  6097. // default key for nested array children (likely generated by v-for)
  6098. if (isTrue(children._isVList) &&
  6099. isDef(c.tag) &&
  6100. isUndef(c.key) &&
  6101. isDef(nestedIndex)) {
  6102. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6103. }
  6104. res.push(c);
  6105. }
  6106. }
  6107. }
  6108. return res
  6109. }
  6110. /* */
  6111. function initProvide (vm) {
  6112. var provide = vm.$options.provide;
  6113. if (provide) {
  6114. vm._provided = typeof provide === 'function'
  6115. ? provide.call(vm)
  6116. : provide;
  6117. }
  6118. }
  6119. function initInjections (vm) {
  6120. var result = resolveInject(vm.$options.inject, vm);
  6121. if (result) {
  6122. toggleObserving(false);
  6123. Object.keys(result).forEach(function (key) {
  6124. /* istanbul ignore else */
  6125. if (true) {
  6126. defineReactive$$1(vm, key, result[key], function () {
  6127. warn(
  6128. "Avoid mutating an injected value directly since the changes will be " +
  6129. "overwritten whenever the provided component re-renders. " +
  6130. "injection being mutated: \"" + key + "\"",
  6131. vm
  6132. );
  6133. });
  6134. } else {}
  6135. });
  6136. toggleObserving(true);
  6137. }
  6138. }
  6139. function resolveInject (inject, vm) {
  6140. if (inject) {
  6141. // inject is :any because flow is not smart enough to figure out cached
  6142. var result = Object.create(null);
  6143. var keys = hasSymbol
  6144. ? Reflect.ownKeys(inject)
  6145. : Object.keys(inject);
  6146. for (var i = 0; i < keys.length; i++) {
  6147. var key = keys[i];
  6148. // #6574 in case the inject object is observed...
  6149. if (key === '__ob__') { continue }
  6150. var provideKey = inject[key].from;
  6151. var source = vm;
  6152. while (source) {
  6153. if (source._provided && hasOwn(source._provided, provideKey)) {
  6154. result[key] = source._provided[provideKey];
  6155. break
  6156. }
  6157. source = source.$parent;
  6158. }
  6159. if (!source) {
  6160. if ('default' in inject[key]) {
  6161. var provideDefault = inject[key].default;
  6162. result[key] = typeof provideDefault === 'function'
  6163. ? provideDefault.call(vm)
  6164. : provideDefault;
  6165. } else if (true) {
  6166. warn(("Injection \"" + key + "\" not found"), vm);
  6167. }
  6168. }
  6169. }
  6170. return result
  6171. }
  6172. }
  6173. /* */
  6174. /**
  6175. * Runtime helper for resolving raw children VNodes into a slot object.
  6176. */
  6177. function resolveSlots (
  6178. children,
  6179. context
  6180. ) {
  6181. if (!children || !children.length) {
  6182. return {}
  6183. }
  6184. var slots = {};
  6185. for (var i = 0, l = children.length; i < l; i++) {
  6186. var child = children[i];
  6187. var data = child.data;
  6188. // remove slot attribute if the node is resolved as a Vue slot node
  6189. if (data && data.attrs && data.attrs.slot) {
  6190. delete data.attrs.slot;
  6191. }
  6192. // named slots should only be respected if the vnode was rendered in the
  6193. // same context.
  6194. if ((child.context === context || child.fnContext === context) &&
  6195. data && data.slot != null
  6196. ) {
  6197. var name = data.slot;
  6198. var slot = (slots[name] || (slots[name] = []));
  6199. if (child.tag === 'template') {
  6200. slot.push.apply(slot, child.children || []);
  6201. } else {
  6202. slot.push(child);
  6203. }
  6204. } else {
  6205. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6206. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6207. (slots['page'] || (slots['page'] = [])).push(child);
  6208. }else{
  6209. (slots.default || (slots.default = [])).push(child);
  6210. }
  6211. }
  6212. }
  6213. // ignore slots that contains only whitespace
  6214. for (var name$1 in slots) {
  6215. if (slots[name$1].every(isWhitespace)) {
  6216. delete slots[name$1];
  6217. }
  6218. }
  6219. return slots
  6220. }
  6221. function isWhitespace (node) {
  6222. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6223. }
  6224. /* */
  6225. function normalizeScopedSlots (
  6226. slots,
  6227. normalSlots,
  6228. prevSlots
  6229. ) {
  6230. var res;
  6231. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6232. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6233. var key = slots && slots.$key;
  6234. if (!slots) {
  6235. res = {};
  6236. } else if (slots._normalized) {
  6237. // fast path 1: child component re-render only, parent did not change
  6238. return slots._normalized
  6239. } else if (
  6240. isStable &&
  6241. prevSlots &&
  6242. prevSlots !== emptyObject &&
  6243. key === prevSlots.$key &&
  6244. !hasNormalSlots &&
  6245. !prevSlots.$hasNormal
  6246. ) {
  6247. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6248. // only need to normalize once
  6249. return prevSlots
  6250. } else {
  6251. res = {};
  6252. for (var key$1 in slots) {
  6253. if (slots[key$1] && key$1[0] !== '$') {
  6254. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6255. }
  6256. }
  6257. }
  6258. // expose normal slots on scopedSlots
  6259. for (var key$2 in normalSlots) {
  6260. if (!(key$2 in res)) {
  6261. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6262. }
  6263. }
  6264. // avoriaz seems to mock a non-extensible $scopedSlots object
  6265. // and when that is passed down this would cause an error
  6266. if (slots && Object.isExtensible(slots)) {
  6267. (slots)._normalized = res;
  6268. }
  6269. def(res, '$stable', isStable);
  6270. def(res, '$key', key);
  6271. def(res, '$hasNormal', hasNormalSlots);
  6272. return res
  6273. }
  6274. function normalizeScopedSlot(normalSlots, key, fn) {
  6275. var normalized = function () {
  6276. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6277. res = res && typeof res === 'object' && !Array.isArray(res)
  6278. ? [res] // single vnode
  6279. : normalizeChildren(res);
  6280. return res && (
  6281. res.length === 0 ||
  6282. (res.length === 1 && res[0].isComment) // #9658
  6283. ) ? undefined
  6284. : res
  6285. };
  6286. // this is a slot using the new v-slot syntax without scope. although it is
  6287. // compiled as a scoped slot, render fn users would expect it to be present
  6288. // on this.$slots because the usage is semantically a normal slot.
  6289. if (fn.proxy) {
  6290. Object.defineProperty(normalSlots, key, {
  6291. get: normalized,
  6292. enumerable: true,
  6293. configurable: true
  6294. });
  6295. }
  6296. return normalized
  6297. }
  6298. function proxyNormalSlot(slots, key) {
  6299. return function () { return slots[key]; }
  6300. }
  6301. /* */
  6302. /**
  6303. * Runtime helper for rendering v-for lists.
  6304. */
  6305. function renderList (
  6306. val,
  6307. render
  6308. ) {
  6309. var ret, i, l, keys, key;
  6310. if (Array.isArray(val) || typeof val === 'string') {
  6311. ret = new Array(val.length);
  6312. for (i = 0, l = val.length; i < l; i++) {
  6313. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6314. }
  6315. } else if (typeof val === 'number') {
  6316. ret = new Array(val);
  6317. for (i = 0; i < val; i++) {
  6318. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6319. }
  6320. } else if (isObject(val)) {
  6321. if (hasSymbol && val[Symbol.iterator]) {
  6322. ret = [];
  6323. var iterator = val[Symbol.iterator]();
  6324. var result = iterator.next();
  6325. while (!result.done) {
  6326. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  6327. result = iterator.next();
  6328. }
  6329. } else {
  6330. keys = Object.keys(val);
  6331. ret = new Array(keys.length);
  6332. for (i = 0, l = keys.length; i < l; i++) {
  6333. key = keys[i];
  6334. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6335. }
  6336. }
  6337. }
  6338. if (!isDef(ret)) {
  6339. ret = [];
  6340. }
  6341. (ret)._isVList = true;
  6342. return ret
  6343. }
  6344. /* */
  6345. /**
  6346. * Runtime helper for rendering <slot>
  6347. */
  6348. function renderSlot (
  6349. name,
  6350. fallback,
  6351. props,
  6352. bindObject
  6353. ) {
  6354. var scopedSlotFn = this.$scopedSlots[name];
  6355. var nodes;
  6356. if (scopedSlotFn) { // scoped slot
  6357. props = props || {};
  6358. if (bindObject) {
  6359. if ( true && !isObject(bindObject)) {
  6360. warn(
  6361. 'slot v-bind without argument expects an Object',
  6362. this
  6363. );
  6364. }
  6365. props = extend(extend({}, bindObject), props);
  6366. }
  6367. // fixed by xxxxxx app-plus scopedSlot
  6368. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6369. } else {
  6370. nodes = this.$slots[name] || fallback;
  6371. }
  6372. var target = props && props.slot;
  6373. if (target) {
  6374. return this.$createElement('template', { slot: target }, nodes)
  6375. } else {
  6376. return nodes
  6377. }
  6378. }
  6379. /* */
  6380. /**
  6381. * Runtime helper for resolving filters
  6382. */
  6383. function resolveFilter (id) {
  6384. return resolveAsset(this.$options, 'filters', id, true) || identity
  6385. }
  6386. /* */
  6387. function isKeyNotMatch (expect, actual) {
  6388. if (Array.isArray(expect)) {
  6389. return expect.indexOf(actual) === -1
  6390. } else {
  6391. return expect !== actual
  6392. }
  6393. }
  6394. /**
  6395. * Runtime helper for checking keyCodes from config.
  6396. * exposed as Vue.prototype._k
  6397. * passing in eventKeyName as last argument separately for backwards compat
  6398. */
  6399. function checkKeyCodes (
  6400. eventKeyCode,
  6401. key,
  6402. builtInKeyCode,
  6403. eventKeyName,
  6404. builtInKeyName
  6405. ) {
  6406. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6407. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6408. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6409. } else if (mappedKeyCode) {
  6410. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6411. } else if (eventKeyName) {
  6412. return hyphenate(eventKeyName) !== key
  6413. }
  6414. }
  6415. /* */
  6416. /**
  6417. * Runtime helper for merging v-bind="object" into a VNode's data.
  6418. */
  6419. function bindObjectProps (
  6420. data,
  6421. tag,
  6422. value,
  6423. asProp,
  6424. isSync
  6425. ) {
  6426. if (value) {
  6427. if (!isObject(value)) {
  6428. true && warn(
  6429. 'v-bind without argument expects an Object or Array value',
  6430. this
  6431. );
  6432. } else {
  6433. if (Array.isArray(value)) {
  6434. value = toObject(value);
  6435. }
  6436. var hash;
  6437. var loop = function ( key ) {
  6438. if (
  6439. key === 'class' ||
  6440. key === 'style' ||
  6441. isReservedAttribute(key)
  6442. ) {
  6443. hash = data;
  6444. } else {
  6445. var type = data.attrs && data.attrs.type;
  6446. hash = asProp || config.mustUseProp(tag, type, key)
  6447. ? data.domProps || (data.domProps = {})
  6448. : data.attrs || (data.attrs = {});
  6449. }
  6450. var camelizedKey = camelize(key);
  6451. var hyphenatedKey = hyphenate(key);
  6452. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6453. hash[key] = value[key];
  6454. if (isSync) {
  6455. var on = data.on || (data.on = {});
  6456. on[("update:" + key)] = function ($event) {
  6457. value[key] = $event;
  6458. };
  6459. }
  6460. }
  6461. };
  6462. for (var key in value) loop( key );
  6463. }
  6464. }
  6465. return data
  6466. }
  6467. /* */
  6468. /**
  6469. * Runtime helper for rendering static trees.
  6470. */
  6471. function renderStatic (
  6472. index,
  6473. isInFor
  6474. ) {
  6475. var cached = this._staticTrees || (this._staticTrees = []);
  6476. var tree = cached[index];
  6477. // if has already-rendered static tree and not inside v-for,
  6478. // we can reuse the same tree.
  6479. if (tree && !isInFor) {
  6480. return tree
  6481. }
  6482. // otherwise, render a fresh tree.
  6483. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6484. this._renderProxy,
  6485. null,
  6486. this // for render fns generated for functional component templates
  6487. );
  6488. markStatic(tree, ("__static__" + index), false);
  6489. return tree
  6490. }
  6491. /**
  6492. * Runtime helper for v-once.
  6493. * Effectively it means marking the node as static with a unique key.
  6494. */
  6495. function markOnce (
  6496. tree,
  6497. index,
  6498. key
  6499. ) {
  6500. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6501. return tree
  6502. }
  6503. function markStatic (
  6504. tree,
  6505. key,
  6506. isOnce
  6507. ) {
  6508. if (Array.isArray(tree)) {
  6509. for (var i = 0; i < tree.length; i++) {
  6510. if (tree[i] && typeof tree[i] !== 'string') {
  6511. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6512. }
  6513. }
  6514. } else {
  6515. markStaticNode(tree, key, isOnce);
  6516. }
  6517. }
  6518. function markStaticNode (node, key, isOnce) {
  6519. node.isStatic = true;
  6520. node.key = key;
  6521. node.isOnce = isOnce;
  6522. }
  6523. /* */
  6524. function bindObjectListeners (data, value) {
  6525. if (value) {
  6526. if (!isPlainObject(value)) {
  6527. true && warn(
  6528. 'v-on without argument expects an Object value',
  6529. this
  6530. );
  6531. } else {
  6532. var on = data.on = data.on ? extend({}, data.on) : {};
  6533. for (var key in value) {
  6534. var existing = on[key];
  6535. var ours = value[key];
  6536. on[key] = existing ? [].concat(existing, ours) : ours;
  6537. }
  6538. }
  6539. }
  6540. return data
  6541. }
  6542. /* */
  6543. function resolveScopedSlots (
  6544. fns, // see flow/vnode
  6545. res,
  6546. // the following are added in 2.6
  6547. hasDynamicKeys,
  6548. contentHashKey
  6549. ) {
  6550. res = res || { $stable: !hasDynamicKeys };
  6551. for (var i = 0; i < fns.length; i++) {
  6552. var slot = fns[i];
  6553. if (Array.isArray(slot)) {
  6554. resolveScopedSlots(slot, res, hasDynamicKeys);
  6555. } else if (slot) {
  6556. // marker for reverse proxying v-slot without scope on this.$slots
  6557. if (slot.proxy) {
  6558. slot.fn.proxy = true;
  6559. }
  6560. res[slot.key] = slot.fn;
  6561. }
  6562. }
  6563. if (contentHashKey) {
  6564. (res).$key = contentHashKey;
  6565. }
  6566. return res
  6567. }
  6568. /* */
  6569. function bindDynamicKeys (baseObj, values) {
  6570. for (var i = 0; i < values.length; i += 2) {
  6571. var key = values[i];
  6572. if (typeof key === 'string' && key) {
  6573. baseObj[values[i]] = values[i + 1];
  6574. } else if ( true && key !== '' && key !== null) {
  6575. // null is a special value for explicitly removing a binding
  6576. warn(
  6577. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6578. this
  6579. );
  6580. }
  6581. }
  6582. return baseObj
  6583. }
  6584. // helper to dynamically append modifier runtime markers to event names.
  6585. // ensure only append when value is already string, otherwise it will be cast
  6586. // to string and cause the type check to miss.
  6587. function prependModifier (value, symbol) {
  6588. return typeof value === 'string' ? symbol + value : value
  6589. }
  6590. /* */
  6591. function installRenderHelpers (target) {
  6592. target._o = markOnce;
  6593. target._n = toNumber;
  6594. target._s = toString;
  6595. target._l = renderList;
  6596. target._t = renderSlot;
  6597. target._q = looseEqual;
  6598. target._i = looseIndexOf;
  6599. target._m = renderStatic;
  6600. target._f = resolveFilter;
  6601. target._k = checkKeyCodes;
  6602. target._b = bindObjectProps;
  6603. target._v = createTextVNode;
  6604. target._e = createEmptyVNode;
  6605. target._u = resolveScopedSlots;
  6606. target._g = bindObjectListeners;
  6607. target._d = bindDynamicKeys;
  6608. target._p = prependModifier;
  6609. }
  6610. /* */
  6611. function FunctionalRenderContext (
  6612. data,
  6613. props,
  6614. children,
  6615. parent,
  6616. Ctor
  6617. ) {
  6618. var this$1 = this;
  6619. var options = Ctor.options;
  6620. // ensure the createElement function in functional components
  6621. // gets a unique context - this is necessary for correct named slot check
  6622. var contextVm;
  6623. if (hasOwn(parent, '_uid')) {
  6624. contextVm = Object.create(parent);
  6625. // $flow-disable-line
  6626. contextVm._original = parent;
  6627. } else {
  6628. // the context vm passed in is a functional context as well.
  6629. // in this case we want to make sure we are able to get a hold to the
  6630. // real context instance.
  6631. contextVm = parent;
  6632. // $flow-disable-line
  6633. parent = parent._original;
  6634. }
  6635. var isCompiled = isTrue(options._compiled);
  6636. var needNormalization = !isCompiled;
  6637. this.data = data;
  6638. this.props = props;
  6639. this.children = children;
  6640. this.parent = parent;
  6641. this.listeners = data.on || emptyObject;
  6642. this.injections = resolveInject(options.inject, parent);
  6643. this.slots = function () {
  6644. if (!this$1.$slots) {
  6645. normalizeScopedSlots(
  6646. data.scopedSlots,
  6647. this$1.$slots = resolveSlots(children, parent)
  6648. );
  6649. }
  6650. return this$1.$slots
  6651. };
  6652. Object.defineProperty(this, 'scopedSlots', ({
  6653. enumerable: true,
  6654. get: function get () {
  6655. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6656. }
  6657. }));
  6658. // support for compiled functional template
  6659. if (isCompiled) {
  6660. // exposing $options for renderStatic()
  6661. this.$options = options;
  6662. // pre-resolve slots for renderSlot()
  6663. this.$slots = this.slots();
  6664. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6665. }
  6666. if (options._scopeId) {
  6667. this._c = function (a, b, c, d) {
  6668. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6669. if (vnode && !Array.isArray(vnode)) {
  6670. vnode.fnScopeId = options._scopeId;
  6671. vnode.fnContext = parent;
  6672. }
  6673. return vnode
  6674. };
  6675. } else {
  6676. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6677. }
  6678. }
  6679. installRenderHelpers(FunctionalRenderContext.prototype);
  6680. function createFunctionalComponent (
  6681. Ctor,
  6682. propsData,
  6683. data,
  6684. contextVm,
  6685. children
  6686. ) {
  6687. var options = Ctor.options;
  6688. var props = {};
  6689. var propOptions = options.props;
  6690. if (isDef(propOptions)) {
  6691. for (var key in propOptions) {
  6692. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6693. }
  6694. } else {
  6695. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6696. if (isDef(data.props)) { mergeProps(props, data.props); }
  6697. }
  6698. var renderContext = new FunctionalRenderContext(
  6699. data,
  6700. props,
  6701. children,
  6702. contextVm,
  6703. Ctor
  6704. );
  6705. var vnode = options.render.call(null, renderContext._c, renderContext);
  6706. if (vnode instanceof VNode) {
  6707. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6708. } else if (Array.isArray(vnode)) {
  6709. var vnodes = normalizeChildren(vnode) || [];
  6710. var res = new Array(vnodes.length);
  6711. for (var i = 0; i < vnodes.length; i++) {
  6712. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6713. }
  6714. return res
  6715. }
  6716. }
  6717. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6718. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6719. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6720. // that should not be matched to match.
  6721. var clone = cloneVNode(vnode);
  6722. clone.fnContext = contextVm;
  6723. clone.fnOptions = options;
  6724. if (true) {
  6725. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6726. }
  6727. if (data.slot) {
  6728. (clone.data || (clone.data = {})).slot = data.slot;
  6729. }
  6730. return clone
  6731. }
  6732. function mergeProps (to, from) {
  6733. for (var key in from) {
  6734. to[camelize(key)] = from[key];
  6735. }
  6736. }
  6737. /* */
  6738. /* */
  6739. /* */
  6740. /* */
  6741. // inline hooks to be invoked on component VNodes during patch
  6742. var componentVNodeHooks = {
  6743. init: function init (vnode, hydrating) {
  6744. if (
  6745. vnode.componentInstance &&
  6746. !vnode.componentInstance._isDestroyed &&
  6747. vnode.data.keepAlive
  6748. ) {
  6749. // kept-alive components, treat as a patch
  6750. var mountedNode = vnode; // work around flow
  6751. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6752. } else {
  6753. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6754. vnode,
  6755. activeInstance
  6756. );
  6757. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6758. }
  6759. },
  6760. prepatch: function prepatch (oldVnode, vnode) {
  6761. var options = vnode.componentOptions;
  6762. var child = vnode.componentInstance = oldVnode.componentInstance;
  6763. updateChildComponent(
  6764. child,
  6765. options.propsData, // updated props
  6766. options.listeners, // updated listeners
  6767. vnode, // new parent vnode
  6768. options.children // new children
  6769. );
  6770. },
  6771. insert: function insert (vnode) {
  6772. var context = vnode.context;
  6773. var componentInstance = vnode.componentInstance;
  6774. if (!componentInstance._isMounted) {
  6775. callHook(componentInstance, 'onServiceCreated');
  6776. callHook(componentInstance, 'onServiceAttached');
  6777. componentInstance._isMounted = true;
  6778. callHook(componentInstance, 'mounted');
  6779. }
  6780. if (vnode.data.keepAlive) {
  6781. if (context._isMounted) {
  6782. // vue-router#1212
  6783. // During updates, a kept-alive component's child components may
  6784. // change, so directly walking the tree here may call activated hooks
  6785. // on incorrect children. Instead we push them into a queue which will
  6786. // be processed after the whole patch process ended.
  6787. queueActivatedComponent(componentInstance);
  6788. } else {
  6789. activateChildComponent(componentInstance, true /* direct */);
  6790. }
  6791. }
  6792. },
  6793. destroy: function destroy (vnode) {
  6794. var componentInstance = vnode.componentInstance;
  6795. if (!componentInstance._isDestroyed) {
  6796. if (!vnode.data.keepAlive) {
  6797. componentInstance.$destroy();
  6798. } else {
  6799. deactivateChildComponent(componentInstance, true /* direct */);
  6800. }
  6801. }
  6802. }
  6803. };
  6804. var hooksToMerge = Object.keys(componentVNodeHooks);
  6805. function createComponent (
  6806. Ctor,
  6807. data,
  6808. context,
  6809. children,
  6810. tag
  6811. ) {
  6812. if (isUndef(Ctor)) {
  6813. return
  6814. }
  6815. var baseCtor = context.$options._base;
  6816. // plain options object: turn it into a constructor
  6817. if (isObject(Ctor)) {
  6818. Ctor = baseCtor.extend(Ctor);
  6819. }
  6820. // if at this stage it's not a constructor or an async component factory,
  6821. // reject.
  6822. if (typeof Ctor !== 'function') {
  6823. if (true) {
  6824. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6825. }
  6826. return
  6827. }
  6828. // async component
  6829. var asyncFactory;
  6830. if (isUndef(Ctor.cid)) {
  6831. asyncFactory = Ctor;
  6832. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6833. if (Ctor === undefined) {
  6834. // return a placeholder node for async component, which is rendered
  6835. // as a comment node but preserves all the raw information for the node.
  6836. // the information will be used for async server-rendering and hydration.
  6837. return createAsyncPlaceholder(
  6838. asyncFactory,
  6839. data,
  6840. context,
  6841. children,
  6842. tag
  6843. )
  6844. }
  6845. }
  6846. data = data || {};
  6847. // resolve constructor options in case global mixins are applied after
  6848. // component constructor creation
  6849. resolveConstructorOptions(Ctor);
  6850. // transform component v-model data into props & events
  6851. if (isDef(data.model)) {
  6852. transformModel(Ctor.options, data);
  6853. }
  6854. // extract props
  6855. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6856. // functional component
  6857. if (isTrue(Ctor.options.functional)) {
  6858. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6859. }
  6860. // extract listeners, since these needs to be treated as
  6861. // child component listeners instead of DOM listeners
  6862. var listeners = data.on;
  6863. // replace with listeners with .native modifier
  6864. // so it gets processed during parent component patch.
  6865. data.on = data.nativeOn;
  6866. if (isTrue(Ctor.options.abstract)) {
  6867. // abstract components do not keep anything
  6868. // other than props & listeners & slot
  6869. // work around flow
  6870. var slot = data.slot;
  6871. data = {};
  6872. if (slot) {
  6873. data.slot = slot;
  6874. }
  6875. }
  6876. // install component management hooks onto the placeholder node
  6877. installComponentHooks(data);
  6878. // return a placeholder vnode
  6879. var name = Ctor.options.name || tag;
  6880. var vnode = new VNode(
  6881. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6882. data, undefined, undefined, undefined, context,
  6883. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6884. asyncFactory
  6885. );
  6886. return vnode
  6887. }
  6888. function createComponentInstanceForVnode (
  6889. vnode, // we know it's MountedComponentVNode but flow doesn't
  6890. parent // activeInstance in lifecycle state
  6891. ) {
  6892. var options = {
  6893. _isComponent: true,
  6894. _parentVnode: vnode,
  6895. parent: parent
  6896. };
  6897. // check inline-template render functions
  6898. var inlineTemplate = vnode.data.inlineTemplate;
  6899. if (isDef(inlineTemplate)) {
  6900. options.render = inlineTemplate.render;
  6901. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6902. }
  6903. return new vnode.componentOptions.Ctor(options)
  6904. }
  6905. function installComponentHooks (data) {
  6906. var hooks = data.hook || (data.hook = {});
  6907. for (var i = 0; i < hooksToMerge.length; i++) {
  6908. var key = hooksToMerge[i];
  6909. var existing = hooks[key];
  6910. var toMerge = componentVNodeHooks[key];
  6911. if (existing !== toMerge && !(existing && existing._merged)) {
  6912. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6913. }
  6914. }
  6915. }
  6916. function mergeHook$1 (f1, f2) {
  6917. var merged = function (a, b) {
  6918. // flow complains about extra args which is why we use any
  6919. f1(a, b);
  6920. f2(a, b);
  6921. };
  6922. merged._merged = true;
  6923. return merged
  6924. }
  6925. // transform component v-model info (value and callback) into
  6926. // prop and event handler respectively.
  6927. function transformModel (options, data) {
  6928. var prop = (options.model && options.model.prop) || 'value';
  6929. var event = (options.model && options.model.event) || 'input'
  6930. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6931. var on = data.on || (data.on = {});
  6932. var existing = on[event];
  6933. var callback = data.model.callback;
  6934. if (isDef(existing)) {
  6935. if (
  6936. Array.isArray(existing)
  6937. ? existing.indexOf(callback) === -1
  6938. : existing !== callback
  6939. ) {
  6940. on[event] = [callback].concat(existing);
  6941. }
  6942. } else {
  6943. on[event] = callback;
  6944. }
  6945. }
  6946. /* */
  6947. var SIMPLE_NORMALIZE = 1;
  6948. var ALWAYS_NORMALIZE = 2;
  6949. // wrapper function for providing a more flexible interface
  6950. // without getting yelled at by flow
  6951. function createElement (
  6952. context,
  6953. tag,
  6954. data,
  6955. children,
  6956. normalizationType,
  6957. alwaysNormalize
  6958. ) {
  6959. if (Array.isArray(data) || isPrimitive(data)) {
  6960. normalizationType = children;
  6961. children = data;
  6962. data = undefined;
  6963. }
  6964. if (isTrue(alwaysNormalize)) {
  6965. normalizationType = ALWAYS_NORMALIZE;
  6966. }
  6967. return _createElement(context, tag, data, children, normalizationType)
  6968. }
  6969. function _createElement (
  6970. context,
  6971. tag,
  6972. data,
  6973. children,
  6974. normalizationType
  6975. ) {
  6976. if (isDef(data) && isDef((data).__ob__)) {
  6977. true && warn(
  6978. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6979. 'Always create fresh vnode data objects in each render!',
  6980. context
  6981. );
  6982. return createEmptyVNode()
  6983. }
  6984. // object syntax in v-bind
  6985. if (isDef(data) && isDef(data.is)) {
  6986. tag = data.is;
  6987. }
  6988. if (!tag) {
  6989. // in case of component :is set to falsy value
  6990. return createEmptyVNode()
  6991. }
  6992. // warn against non-primitive key
  6993. if ( true &&
  6994. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6995. ) {
  6996. {
  6997. warn(
  6998. 'Avoid using non-primitive value as key, ' +
  6999. 'use string/number value instead.',
  7000. context
  7001. );
  7002. }
  7003. }
  7004. // support single function children as default scoped slot
  7005. if (Array.isArray(children) &&
  7006. typeof children[0] === 'function'
  7007. ) {
  7008. data = data || {};
  7009. data.scopedSlots = { default: children[0] };
  7010. children.length = 0;
  7011. }
  7012. if (normalizationType === ALWAYS_NORMALIZE) {
  7013. children = normalizeChildren(children);
  7014. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7015. children = simpleNormalizeChildren(children);
  7016. }
  7017. var vnode, ns;
  7018. if (typeof tag === 'string') {
  7019. var Ctor;
  7020. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7021. if (config.isReservedTag(tag)) {
  7022. // platform built-in elements
  7023. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7024. warn(
  7025. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7026. context
  7027. );
  7028. }
  7029. vnode = new VNode(
  7030. config.parsePlatformTagName(tag), data, children,
  7031. undefined, undefined, context
  7032. );
  7033. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7034. // component
  7035. vnode = createComponent(Ctor, data, context, children, tag);
  7036. } else {
  7037. // unknown or unlisted namespaced elements
  7038. // check at runtime because it may get assigned a namespace when its
  7039. // parent normalizes children
  7040. vnode = new VNode(
  7041. tag, data, children,
  7042. undefined, undefined, context
  7043. );
  7044. }
  7045. } else {
  7046. // direct component options / constructor
  7047. vnode = createComponent(tag, data, context, children);
  7048. }
  7049. if (Array.isArray(vnode)) {
  7050. return vnode
  7051. } else if (isDef(vnode)) {
  7052. if (isDef(ns)) { applyNS(vnode, ns); }
  7053. if (isDef(data)) { registerDeepBindings(data); }
  7054. return vnode
  7055. } else {
  7056. return createEmptyVNode()
  7057. }
  7058. }
  7059. function applyNS (vnode, ns, force) {
  7060. vnode.ns = ns;
  7061. if (vnode.tag === 'foreignObject') {
  7062. // use default namespace inside foreignObject
  7063. ns = undefined;
  7064. force = true;
  7065. }
  7066. if (isDef(vnode.children)) {
  7067. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7068. var child = vnode.children[i];
  7069. if (isDef(child.tag) && (
  7070. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7071. applyNS(child, ns, force);
  7072. }
  7073. }
  7074. }
  7075. }
  7076. // ref #5318
  7077. // necessary to ensure parent re-render when deep bindings like :style and
  7078. // :class are used on slot nodes
  7079. function registerDeepBindings (data) {
  7080. if (isObject(data.style)) {
  7081. traverse(data.style);
  7082. }
  7083. if (isObject(data.class)) {
  7084. traverse(data.class);
  7085. }
  7086. }
  7087. /* */
  7088. function initRender (vm) {
  7089. vm._vnode = null; // the root of the child tree
  7090. vm._staticTrees = null; // v-once cached trees
  7091. var options = vm.$options;
  7092. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7093. var renderContext = parentVnode && parentVnode.context;
  7094. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7095. vm.$scopedSlots = emptyObject;
  7096. // bind the createElement fn to this instance
  7097. // so that we get proper render context inside it.
  7098. // args order: tag, data, children, normalizationType, alwaysNormalize
  7099. // internal version is used by render functions compiled from templates
  7100. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7101. // normalization is always applied for the public version, used in
  7102. // user-written render functions.
  7103. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7104. // $attrs & $listeners are exposed for easier HOC creation.
  7105. // they need to be reactive so that HOCs using them are always updated
  7106. var parentData = parentVnode && parentVnode.data;
  7107. /* istanbul ignore else */
  7108. if (true) {
  7109. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7110. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7111. }, true);
  7112. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7113. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7114. }, true);
  7115. } else {}
  7116. }
  7117. var currentRenderingInstance = null;
  7118. function renderMixin (Vue) {
  7119. // install runtime convenience helpers
  7120. installRenderHelpers(Vue.prototype);
  7121. Vue.prototype.$nextTick = function (fn) {
  7122. return nextTick(fn, this)
  7123. };
  7124. Vue.prototype._render = function () {
  7125. var vm = this;
  7126. var ref = vm.$options;
  7127. var render = ref.render;
  7128. var _parentVnode = ref._parentVnode;
  7129. if (_parentVnode) {
  7130. vm.$scopedSlots = normalizeScopedSlots(
  7131. _parentVnode.data.scopedSlots,
  7132. vm.$slots,
  7133. vm.$scopedSlots
  7134. );
  7135. }
  7136. // set parent vnode. this allows render functions to have access
  7137. // to the data on the placeholder node.
  7138. vm.$vnode = _parentVnode;
  7139. // render self
  7140. var vnode;
  7141. try {
  7142. // There's no need to maintain a stack because all render fns are called
  7143. // separately from one another. Nested component's render fns are called
  7144. // when parent component is patched.
  7145. currentRenderingInstance = vm;
  7146. vnode = render.call(vm._renderProxy, vm.$createElement);
  7147. } catch (e) {
  7148. handleError(e, vm, "render");
  7149. // return error render result,
  7150. // or previous vnode to prevent render error causing blank component
  7151. /* istanbul ignore else */
  7152. if ( true && vm.$options.renderError) {
  7153. try {
  7154. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7155. } catch (e) {
  7156. handleError(e, vm, "renderError");
  7157. vnode = vm._vnode;
  7158. }
  7159. } else {
  7160. vnode = vm._vnode;
  7161. }
  7162. } finally {
  7163. currentRenderingInstance = null;
  7164. }
  7165. // if the returned array contains only a single node, allow it
  7166. if (Array.isArray(vnode) && vnode.length === 1) {
  7167. vnode = vnode[0];
  7168. }
  7169. // return empty vnode in case the render function errored out
  7170. if (!(vnode instanceof VNode)) {
  7171. if ( true && Array.isArray(vnode)) {
  7172. warn(
  7173. 'Multiple root nodes returned from render function. Render function ' +
  7174. 'should return a single root node.',
  7175. vm
  7176. );
  7177. }
  7178. vnode = createEmptyVNode();
  7179. }
  7180. // set parent
  7181. vnode.parent = _parentVnode;
  7182. return vnode
  7183. };
  7184. }
  7185. /* */
  7186. function ensureCtor (comp, base) {
  7187. if (
  7188. comp.__esModule ||
  7189. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7190. ) {
  7191. comp = comp.default;
  7192. }
  7193. return isObject(comp)
  7194. ? base.extend(comp)
  7195. : comp
  7196. }
  7197. function createAsyncPlaceholder (
  7198. factory,
  7199. data,
  7200. context,
  7201. children,
  7202. tag
  7203. ) {
  7204. var node = createEmptyVNode();
  7205. node.asyncFactory = factory;
  7206. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7207. return node
  7208. }
  7209. function resolveAsyncComponent (
  7210. factory,
  7211. baseCtor
  7212. ) {
  7213. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7214. return factory.errorComp
  7215. }
  7216. if (isDef(factory.resolved)) {
  7217. return factory.resolved
  7218. }
  7219. var owner = currentRenderingInstance;
  7220. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7221. // already pending
  7222. factory.owners.push(owner);
  7223. }
  7224. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7225. return factory.loadingComp
  7226. }
  7227. if (owner && !isDef(factory.owners)) {
  7228. var owners = factory.owners = [owner];
  7229. var sync = true;
  7230. var timerLoading = null;
  7231. var timerTimeout = null
  7232. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7233. var forceRender = function (renderCompleted) {
  7234. for (var i = 0, l = owners.length; i < l; i++) {
  7235. (owners[i]).$forceUpdate();
  7236. }
  7237. if (renderCompleted) {
  7238. owners.length = 0;
  7239. if (timerLoading !== null) {
  7240. clearTimeout(timerLoading);
  7241. timerLoading = null;
  7242. }
  7243. if (timerTimeout !== null) {
  7244. clearTimeout(timerTimeout);
  7245. timerTimeout = null;
  7246. }
  7247. }
  7248. };
  7249. var resolve = once(function (res) {
  7250. // cache resolved
  7251. factory.resolved = ensureCtor(res, baseCtor);
  7252. // invoke callbacks only if this is not a synchronous resolve
  7253. // (async resolves are shimmed as synchronous during SSR)
  7254. if (!sync) {
  7255. forceRender(true);
  7256. } else {
  7257. owners.length = 0;
  7258. }
  7259. });
  7260. var reject = once(function (reason) {
  7261. true && warn(
  7262. "Failed to resolve async component: " + (String(factory)) +
  7263. (reason ? ("\nReason: " + reason) : '')
  7264. );
  7265. if (isDef(factory.errorComp)) {
  7266. factory.error = true;
  7267. forceRender(true);
  7268. }
  7269. });
  7270. var res = factory(resolve, reject);
  7271. if (isObject(res)) {
  7272. if (isPromise(res)) {
  7273. // () => Promise
  7274. if (isUndef(factory.resolved)) {
  7275. res.then(resolve, reject);
  7276. }
  7277. } else if (isPromise(res.component)) {
  7278. res.component.then(resolve, reject);
  7279. if (isDef(res.error)) {
  7280. factory.errorComp = ensureCtor(res.error, baseCtor);
  7281. }
  7282. if (isDef(res.loading)) {
  7283. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7284. if (res.delay === 0) {
  7285. factory.loading = true;
  7286. } else {
  7287. timerLoading = setTimeout(function () {
  7288. timerLoading = null;
  7289. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7290. factory.loading = true;
  7291. forceRender(false);
  7292. }
  7293. }, res.delay || 200);
  7294. }
  7295. }
  7296. if (isDef(res.timeout)) {
  7297. timerTimeout = setTimeout(function () {
  7298. timerTimeout = null;
  7299. if (isUndef(factory.resolved)) {
  7300. reject(
  7301. true
  7302. ? ("timeout (" + (res.timeout) + "ms)")
  7303. : undefined
  7304. );
  7305. }
  7306. }, res.timeout);
  7307. }
  7308. }
  7309. }
  7310. sync = false;
  7311. // return in case resolved synchronously
  7312. return factory.loading
  7313. ? factory.loadingComp
  7314. : factory.resolved
  7315. }
  7316. }
  7317. /* */
  7318. function isAsyncPlaceholder (node) {
  7319. return node.isComment && node.asyncFactory
  7320. }
  7321. /* */
  7322. function getFirstComponentChild (children) {
  7323. if (Array.isArray(children)) {
  7324. for (var i = 0; i < children.length; i++) {
  7325. var c = children[i];
  7326. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7327. return c
  7328. }
  7329. }
  7330. }
  7331. }
  7332. /* */
  7333. /* */
  7334. function initEvents (vm) {
  7335. vm._events = Object.create(null);
  7336. vm._hasHookEvent = false;
  7337. // init parent attached events
  7338. var listeners = vm.$options._parentListeners;
  7339. if (listeners) {
  7340. updateComponentListeners(vm, listeners);
  7341. }
  7342. }
  7343. var target;
  7344. function add (event, fn) {
  7345. target.$on(event, fn);
  7346. }
  7347. function remove$1 (event, fn) {
  7348. target.$off(event, fn);
  7349. }
  7350. function createOnceHandler (event, fn) {
  7351. var _target = target;
  7352. return function onceHandler () {
  7353. var res = fn.apply(null, arguments);
  7354. if (res !== null) {
  7355. _target.$off(event, onceHandler);
  7356. }
  7357. }
  7358. }
  7359. function updateComponentListeners (
  7360. vm,
  7361. listeners,
  7362. oldListeners
  7363. ) {
  7364. target = vm;
  7365. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7366. target = undefined;
  7367. }
  7368. function eventsMixin (Vue) {
  7369. var hookRE = /^hook:/;
  7370. Vue.prototype.$on = function (event, fn) {
  7371. var vm = this;
  7372. if (Array.isArray(event)) {
  7373. for (var i = 0, l = event.length; i < l; i++) {
  7374. vm.$on(event[i], fn);
  7375. }
  7376. } else {
  7377. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7378. // optimize hook:event cost by using a boolean flag marked at registration
  7379. // instead of a hash lookup
  7380. if (hookRE.test(event)) {
  7381. vm._hasHookEvent = true;
  7382. }
  7383. }
  7384. return vm
  7385. };
  7386. Vue.prototype.$once = function (event, fn) {
  7387. var vm = this;
  7388. function on () {
  7389. vm.$off(event, on);
  7390. fn.apply(vm, arguments);
  7391. }
  7392. on.fn = fn;
  7393. vm.$on(event, on);
  7394. return vm
  7395. };
  7396. Vue.prototype.$off = function (event, fn) {
  7397. var vm = this;
  7398. // all
  7399. if (!arguments.length) {
  7400. vm._events = Object.create(null);
  7401. return vm
  7402. }
  7403. // array of events
  7404. if (Array.isArray(event)) {
  7405. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7406. vm.$off(event[i$1], fn);
  7407. }
  7408. return vm
  7409. }
  7410. // specific event
  7411. var cbs = vm._events[event];
  7412. if (!cbs) {
  7413. return vm
  7414. }
  7415. if (!fn) {
  7416. vm._events[event] = null;
  7417. return vm
  7418. }
  7419. // specific handler
  7420. var cb;
  7421. var i = cbs.length;
  7422. while (i--) {
  7423. cb = cbs[i];
  7424. if (cb === fn || cb.fn === fn) {
  7425. cbs.splice(i, 1);
  7426. break
  7427. }
  7428. }
  7429. return vm
  7430. };
  7431. Vue.prototype.$emit = function (event) {
  7432. var vm = this;
  7433. if (true) {
  7434. var lowerCaseEvent = event.toLowerCase();
  7435. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7436. tip(
  7437. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7438. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7439. "Note that HTML attributes are case-insensitive and you cannot use " +
  7440. "v-on to listen to camelCase events when using in-DOM templates. " +
  7441. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7442. );
  7443. }
  7444. }
  7445. var cbs = vm._events[event];
  7446. if (cbs) {
  7447. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7448. var args = toArray(arguments, 1);
  7449. var info = "event handler for \"" + event + "\"";
  7450. for (var i = 0, l = cbs.length; i < l; i++) {
  7451. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7452. }
  7453. }
  7454. return vm
  7455. };
  7456. }
  7457. /* */
  7458. var activeInstance = null;
  7459. var isUpdatingChildComponent = false;
  7460. function setActiveInstance(vm) {
  7461. var prevActiveInstance = activeInstance;
  7462. activeInstance = vm;
  7463. return function () {
  7464. activeInstance = prevActiveInstance;
  7465. }
  7466. }
  7467. function initLifecycle (vm) {
  7468. var options = vm.$options;
  7469. // locate first non-abstract parent
  7470. var parent = options.parent;
  7471. if (parent && !options.abstract) {
  7472. while (parent.$options.abstract && parent.$parent) {
  7473. parent = parent.$parent;
  7474. }
  7475. parent.$children.push(vm);
  7476. }
  7477. vm.$parent = parent;
  7478. vm.$root = parent ? parent.$root : vm;
  7479. vm.$children = [];
  7480. vm.$refs = {};
  7481. vm._watcher = null;
  7482. vm._inactive = null;
  7483. vm._directInactive = false;
  7484. vm._isMounted = false;
  7485. vm._isDestroyed = false;
  7486. vm._isBeingDestroyed = false;
  7487. }
  7488. function lifecycleMixin (Vue) {
  7489. Vue.prototype._update = function (vnode, hydrating) {
  7490. var vm = this;
  7491. var prevEl = vm.$el;
  7492. var prevVnode = vm._vnode;
  7493. var restoreActiveInstance = setActiveInstance(vm);
  7494. vm._vnode = vnode;
  7495. // Vue.prototype.__patch__ is injected in entry points
  7496. // based on the rendering backend used.
  7497. if (!prevVnode) {
  7498. // initial render
  7499. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7500. } else {
  7501. // updates
  7502. vm.$el = vm.__patch__(prevVnode, vnode);
  7503. }
  7504. restoreActiveInstance();
  7505. // update __vue__ reference
  7506. if (prevEl) {
  7507. prevEl.__vue__ = null;
  7508. }
  7509. if (vm.$el) {
  7510. vm.$el.__vue__ = vm;
  7511. }
  7512. // if parent is an HOC, update its $el as well
  7513. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7514. vm.$parent.$el = vm.$el;
  7515. }
  7516. // updated hook is called by the scheduler to ensure that children are
  7517. // updated in a parent's updated hook.
  7518. };
  7519. Vue.prototype.$forceUpdate = function () {
  7520. var vm = this;
  7521. if (vm._watcher) {
  7522. vm._watcher.update();
  7523. }
  7524. };
  7525. Vue.prototype.$destroy = function () {
  7526. var vm = this;
  7527. if (vm._isBeingDestroyed) {
  7528. return
  7529. }
  7530. callHook(vm, 'beforeDestroy');
  7531. vm._isBeingDestroyed = true;
  7532. // remove self from parent
  7533. var parent = vm.$parent;
  7534. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7535. remove(parent.$children, vm);
  7536. }
  7537. // teardown watchers
  7538. if (vm._watcher) {
  7539. vm._watcher.teardown();
  7540. }
  7541. var i = vm._watchers.length;
  7542. while (i--) {
  7543. vm._watchers[i].teardown();
  7544. }
  7545. // remove reference from data ob
  7546. // frozen object may not have observer.
  7547. if (vm._data.__ob__) {
  7548. vm._data.__ob__.vmCount--;
  7549. }
  7550. // call the last hook...
  7551. vm._isDestroyed = true;
  7552. // invoke destroy hooks on current rendered tree
  7553. vm.__patch__(vm._vnode, null);
  7554. // fire destroyed hook
  7555. callHook(vm, 'destroyed');
  7556. // turn off all instance listeners.
  7557. vm.$off();
  7558. // remove __vue__ reference
  7559. if (vm.$el) {
  7560. vm.$el.__vue__ = null;
  7561. }
  7562. // release circular reference (#6759)
  7563. if (vm.$vnode) {
  7564. vm.$vnode.parent = null;
  7565. }
  7566. };
  7567. }
  7568. function updateChildComponent (
  7569. vm,
  7570. propsData,
  7571. listeners,
  7572. parentVnode,
  7573. renderChildren
  7574. ) {
  7575. if (true) {
  7576. isUpdatingChildComponent = true;
  7577. }
  7578. // determine whether component has slot children
  7579. // we need to do this before overwriting $options._renderChildren.
  7580. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7581. // dynamic slot names). Static scoped slots compiled from template has the
  7582. // "$stable" marker.
  7583. var newScopedSlots = parentVnode.data.scopedSlots;
  7584. var oldScopedSlots = vm.$scopedSlots;
  7585. var hasDynamicScopedSlot = !!(
  7586. (newScopedSlots && !newScopedSlots.$stable) ||
  7587. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7588. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7589. );
  7590. // Any static slot children from the parent may have changed during parent's
  7591. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7592. // update is necessary to ensure correctness.
  7593. var needsForceUpdate = !!(
  7594. renderChildren || // has new static slots
  7595. vm.$options._renderChildren || // has old static slots
  7596. hasDynamicScopedSlot
  7597. );
  7598. vm.$options._parentVnode = parentVnode;
  7599. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7600. if (vm._vnode) { // update child tree's parent
  7601. vm._vnode.parent = parentVnode;
  7602. }
  7603. vm.$options._renderChildren = renderChildren;
  7604. // update $attrs and $listeners hash
  7605. // these are also reactive so they may trigger child update if the child
  7606. // used them during render
  7607. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7608. vm.$listeners = listeners || emptyObject;
  7609. // update props
  7610. if (propsData && vm.$options.props) {
  7611. toggleObserving(false);
  7612. var props = vm._props;
  7613. var propKeys = vm.$options._propKeys || [];
  7614. for (var i = 0; i < propKeys.length; i++) {
  7615. var key = propKeys[i];
  7616. var propOptions = vm.$options.props; // wtf flow?
  7617. props[key] = validateProp(key, propOptions, propsData, vm);
  7618. }
  7619. toggleObserving(true);
  7620. // keep a copy of raw propsData
  7621. vm.$options.propsData = propsData;
  7622. }
  7623. // fixed by xxxxxx update properties(mp runtime)
  7624. vm._$updateProperties && vm._$updateProperties(vm);
  7625. // update listeners
  7626. listeners = listeners || emptyObject;
  7627. var oldListeners = vm.$options._parentListeners;
  7628. vm.$options._parentListeners = listeners;
  7629. updateComponentListeners(vm, listeners, oldListeners);
  7630. // resolve slots + force update if has children
  7631. if (needsForceUpdate) {
  7632. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7633. vm.$forceUpdate();
  7634. }
  7635. if (true) {
  7636. isUpdatingChildComponent = false;
  7637. }
  7638. }
  7639. function isInInactiveTree (vm) {
  7640. while (vm && (vm = vm.$parent)) {
  7641. if (vm._inactive) { return true }
  7642. }
  7643. return false
  7644. }
  7645. function activateChildComponent (vm, direct) {
  7646. if (direct) {
  7647. vm._directInactive = false;
  7648. if (isInInactiveTree(vm)) {
  7649. return
  7650. }
  7651. } else if (vm._directInactive) {
  7652. return
  7653. }
  7654. if (vm._inactive || vm._inactive === null) {
  7655. vm._inactive = false;
  7656. for (var i = 0; i < vm.$children.length; i++) {
  7657. activateChildComponent(vm.$children[i]);
  7658. }
  7659. callHook(vm, 'activated');
  7660. }
  7661. }
  7662. function deactivateChildComponent (vm, direct) {
  7663. if (direct) {
  7664. vm._directInactive = true;
  7665. if (isInInactiveTree(vm)) {
  7666. return
  7667. }
  7668. }
  7669. if (!vm._inactive) {
  7670. vm._inactive = true;
  7671. for (var i = 0; i < vm.$children.length; i++) {
  7672. deactivateChildComponent(vm.$children[i]);
  7673. }
  7674. callHook(vm, 'deactivated');
  7675. }
  7676. }
  7677. function callHook (vm, hook) {
  7678. // #7573 disable dep collection when invoking lifecycle hooks
  7679. pushTarget();
  7680. var handlers = vm.$options[hook];
  7681. var info = hook + " hook";
  7682. if (handlers) {
  7683. for (var i = 0, j = handlers.length; i < j; i++) {
  7684. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7685. }
  7686. }
  7687. if (vm._hasHookEvent) {
  7688. vm.$emit('hook:' + hook);
  7689. }
  7690. popTarget();
  7691. }
  7692. /* */
  7693. var MAX_UPDATE_COUNT = 100;
  7694. var queue = [];
  7695. var activatedChildren = [];
  7696. var has = {};
  7697. var circular = {};
  7698. var waiting = false;
  7699. var flushing = false;
  7700. var index = 0;
  7701. /**
  7702. * Reset the scheduler's state.
  7703. */
  7704. function resetSchedulerState () {
  7705. index = queue.length = activatedChildren.length = 0;
  7706. has = {};
  7707. if (true) {
  7708. circular = {};
  7709. }
  7710. waiting = flushing = false;
  7711. }
  7712. // Async edge case #6566 requires saving the timestamp when event listeners are
  7713. // attached. However, calling performance.now() has a perf overhead especially
  7714. // if the page has thousands of event listeners. Instead, we take a timestamp
  7715. // every time the scheduler flushes and use that for all event listeners
  7716. // attached during that flush.
  7717. var currentFlushTimestamp = 0;
  7718. // Async edge case fix requires storing an event listener's attach timestamp.
  7719. var getNow = Date.now;
  7720. // Determine what event timestamp the browser is using. Annoyingly, the
  7721. // timestamp can either be hi-res (relative to page load) or low-res
  7722. // (relative to UNIX epoch), so in order to compare time we have to use the
  7723. // same timestamp type when saving the flush timestamp.
  7724. // All IE versions use low-res event timestamps, and have problematic clock
  7725. // implementations (#9632)
  7726. if (inBrowser && !isIE) {
  7727. var performance = window.performance;
  7728. if (
  7729. performance &&
  7730. typeof performance.now === 'function' &&
  7731. getNow() > document.createEvent('Event').timeStamp
  7732. ) {
  7733. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7734. // smaller than it, it means the event is using a hi-res timestamp,
  7735. // and we need to use the hi-res version for event listener timestamps as
  7736. // well.
  7737. getNow = function () { return performance.now(); };
  7738. }
  7739. }
  7740. /**
  7741. * Flush both queues and run the watchers.
  7742. */
  7743. function flushSchedulerQueue () {
  7744. currentFlushTimestamp = getNow();
  7745. flushing = true;
  7746. var watcher, id;
  7747. // Sort queue before flush.
  7748. // This ensures that:
  7749. // 1. Components are updated from parent to child. (because parent is always
  7750. // created before the child)
  7751. // 2. A component's user watchers are run before its render watcher (because
  7752. // user watchers are created before the render watcher)
  7753. // 3. If a component is destroyed during a parent component's watcher run,
  7754. // its watchers can be skipped.
  7755. queue.sort(function (a, b) { return a.id - b.id; });
  7756. // do not cache length because more watchers might be pushed
  7757. // as we run existing watchers
  7758. for (index = 0; index < queue.length; index++) {
  7759. watcher = queue[index];
  7760. if (watcher.before) {
  7761. watcher.before();
  7762. }
  7763. id = watcher.id;
  7764. has[id] = null;
  7765. watcher.run();
  7766. // in dev build, check and stop circular updates.
  7767. if ( true && has[id] != null) {
  7768. circular[id] = (circular[id] || 0) + 1;
  7769. if (circular[id] > MAX_UPDATE_COUNT) {
  7770. warn(
  7771. 'You may have an infinite update loop ' + (
  7772. watcher.user
  7773. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7774. : "in a component render function."
  7775. ),
  7776. watcher.vm
  7777. );
  7778. break
  7779. }
  7780. }
  7781. }
  7782. // keep copies of post queues before resetting state
  7783. var activatedQueue = activatedChildren.slice();
  7784. var updatedQueue = queue.slice();
  7785. resetSchedulerState();
  7786. // call component updated and activated hooks
  7787. callActivatedHooks(activatedQueue);
  7788. callUpdatedHooks(updatedQueue);
  7789. // devtool hook
  7790. /* istanbul ignore if */
  7791. if (devtools && config.devtools) {
  7792. devtools.emit('flush');
  7793. }
  7794. }
  7795. function callUpdatedHooks (queue) {
  7796. var i = queue.length;
  7797. while (i--) {
  7798. var watcher = queue[i];
  7799. var vm = watcher.vm;
  7800. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7801. callHook(vm, 'updated');
  7802. }
  7803. }
  7804. }
  7805. /**
  7806. * Queue a kept-alive component that was activated during patch.
  7807. * The queue will be processed after the entire tree has been patched.
  7808. */
  7809. function queueActivatedComponent (vm) {
  7810. // setting _inactive to false here so that a render function can
  7811. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7812. vm._inactive = false;
  7813. activatedChildren.push(vm);
  7814. }
  7815. function callActivatedHooks (queue) {
  7816. for (var i = 0; i < queue.length; i++) {
  7817. queue[i]._inactive = true;
  7818. activateChildComponent(queue[i], true /* true */);
  7819. }
  7820. }
  7821. /**
  7822. * Push a watcher into the watcher queue.
  7823. * Jobs with duplicate IDs will be skipped unless it's
  7824. * pushed when the queue is being flushed.
  7825. */
  7826. function queueWatcher (watcher) {
  7827. var id = watcher.id;
  7828. if (has[id] == null) {
  7829. has[id] = true;
  7830. if (!flushing) {
  7831. queue.push(watcher);
  7832. } else {
  7833. // if already flushing, splice the watcher based on its id
  7834. // if already past its id, it will be run next immediately.
  7835. var i = queue.length - 1;
  7836. while (i > index && queue[i].id > watcher.id) {
  7837. i--;
  7838. }
  7839. queue.splice(i + 1, 0, watcher);
  7840. }
  7841. // queue the flush
  7842. if (!waiting) {
  7843. waiting = true;
  7844. if ( true && !config.async) {
  7845. flushSchedulerQueue();
  7846. return
  7847. }
  7848. nextTick(flushSchedulerQueue);
  7849. }
  7850. }
  7851. }
  7852. /* */
  7853. var uid$2 = 0;
  7854. /**
  7855. * A watcher parses an expression, collects dependencies,
  7856. * and fires callback when the expression value changes.
  7857. * This is used for both the $watch() api and directives.
  7858. */
  7859. var Watcher = function Watcher (
  7860. vm,
  7861. expOrFn,
  7862. cb,
  7863. options,
  7864. isRenderWatcher
  7865. ) {
  7866. this.vm = vm;
  7867. if (isRenderWatcher) {
  7868. vm._watcher = this;
  7869. }
  7870. vm._watchers.push(this);
  7871. // options
  7872. if (options) {
  7873. this.deep = !!options.deep;
  7874. this.user = !!options.user;
  7875. this.lazy = !!options.lazy;
  7876. this.sync = !!options.sync;
  7877. this.before = options.before;
  7878. } else {
  7879. this.deep = this.user = this.lazy = this.sync = false;
  7880. }
  7881. this.cb = cb;
  7882. this.id = ++uid$2; // uid for batching
  7883. this.active = true;
  7884. this.dirty = this.lazy; // for lazy watchers
  7885. this.deps = [];
  7886. this.newDeps = [];
  7887. this.depIds = new _Set();
  7888. this.newDepIds = new _Set();
  7889. this.expression = true
  7890. ? expOrFn.toString()
  7891. : undefined;
  7892. // parse expression for getter
  7893. if (typeof expOrFn === 'function') {
  7894. this.getter = expOrFn;
  7895. } else {
  7896. this.getter = parsePath(expOrFn);
  7897. if (!this.getter) {
  7898. this.getter = noop;
  7899. true && warn(
  7900. "Failed watching path: \"" + expOrFn + "\" " +
  7901. 'Watcher only accepts simple dot-delimited paths. ' +
  7902. 'For full control, use a function instead.',
  7903. vm
  7904. );
  7905. }
  7906. }
  7907. this.value = this.lazy
  7908. ? undefined
  7909. : this.get();
  7910. };
  7911. /**
  7912. * Evaluate the getter, and re-collect dependencies.
  7913. */
  7914. Watcher.prototype.get = function get () {
  7915. pushTarget(this);
  7916. var value;
  7917. var vm = this.vm;
  7918. try {
  7919. value = this.getter.call(vm, vm);
  7920. } catch (e) {
  7921. if (this.user) {
  7922. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7923. } else {
  7924. throw e
  7925. }
  7926. } finally {
  7927. // "touch" every property so they are all tracked as
  7928. // dependencies for deep watching
  7929. if (this.deep) {
  7930. traverse(value);
  7931. }
  7932. popTarget();
  7933. this.cleanupDeps();
  7934. }
  7935. return value
  7936. };
  7937. /**
  7938. * Add a dependency to this directive.
  7939. */
  7940. Watcher.prototype.addDep = function addDep (dep) {
  7941. var id = dep.id;
  7942. if (!this.newDepIds.has(id)) {
  7943. this.newDepIds.add(id);
  7944. this.newDeps.push(dep);
  7945. if (!this.depIds.has(id)) {
  7946. dep.addSub(this);
  7947. }
  7948. }
  7949. };
  7950. /**
  7951. * Clean up for dependency collection.
  7952. */
  7953. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7954. var i = this.deps.length;
  7955. while (i--) {
  7956. var dep = this.deps[i];
  7957. if (!this.newDepIds.has(dep.id)) {
  7958. dep.removeSub(this);
  7959. }
  7960. }
  7961. var tmp = this.depIds;
  7962. this.depIds = this.newDepIds;
  7963. this.newDepIds = tmp;
  7964. this.newDepIds.clear();
  7965. tmp = this.deps;
  7966. this.deps = this.newDeps;
  7967. this.newDeps = tmp;
  7968. this.newDeps.length = 0;
  7969. };
  7970. /**
  7971. * Subscriber interface.
  7972. * Will be called when a dependency changes.
  7973. */
  7974. Watcher.prototype.update = function update () {
  7975. /* istanbul ignore else */
  7976. if (this.lazy) {
  7977. this.dirty = true;
  7978. } else if (this.sync) {
  7979. this.run();
  7980. } else {
  7981. queueWatcher(this);
  7982. }
  7983. };
  7984. /**
  7985. * Scheduler job interface.
  7986. * Will be called by the scheduler.
  7987. */
  7988. Watcher.prototype.run = function run () {
  7989. if (this.active) {
  7990. var value = this.get();
  7991. if (
  7992. value !== this.value ||
  7993. // Deep watchers and watchers on Object/Arrays should fire even
  7994. // when the value is the same, because the value may
  7995. // have mutated.
  7996. isObject(value) ||
  7997. this.deep
  7998. ) {
  7999. // set new value
  8000. var oldValue = this.value;
  8001. this.value = value;
  8002. if (this.user) {
  8003. try {
  8004. this.cb.call(this.vm, value, oldValue);
  8005. } catch (e) {
  8006. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8007. }
  8008. } else {
  8009. this.cb.call(this.vm, value, oldValue);
  8010. }
  8011. }
  8012. }
  8013. };
  8014. /**
  8015. * Evaluate the value of the watcher.
  8016. * This only gets called for lazy watchers.
  8017. */
  8018. Watcher.prototype.evaluate = function evaluate () {
  8019. this.value = this.get();
  8020. this.dirty = false;
  8021. };
  8022. /**
  8023. * Depend on all deps collected by this watcher.
  8024. */
  8025. Watcher.prototype.depend = function depend () {
  8026. var i = this.deps.length;
  8027. while (i--) {
  8028. this.deps[i].depend();
  8029. }
  8030. };
  8031. /**
  8032. * Remove self from all dependencies' subscriber list.
  8033. */
  8034. Watcher.prototype.teardown = function teardown () {
  8035. if (this.active) {
  8036. // remove self from vm's watcher list
  8037. // this is a somewhat expensive operation so we skip it
  8038. // if the vm is being destroyed.
  8039. if (!this.vm._isBeingDestroyed) {
  8040. remove(this.vm._watchers, this);
  8041. }
  8042. var i = this.deps.length;
  8043. while (i--) {
  8044. this.deps[i].removeSub(this);
  8045. }
  8046. this.active = false;
  8047. }
  8048. };
  8049. /* */
  8050. var sharedPropertyDefinition = {
  8051. enumerable: true,
  8052. configurable: true,
  8053. get: noop,
  8054. set: noop
  8055. };
  8056. function proxy (target, sourceKey, key) {
  8057. sharedPropertyDefinition.get = function proxyGetter () {
  8058. return this[sourceKey][key]
  8059. };
  8060. sharedPropertyDefinition.set = function proxySetter (val) {
  8061. this[sourceKey][key] = val;
  8062. };
  8063. Object.defineProperty(target, key, sharedPropertyDefinition);
  8064. }
  8065. function initState (vm) {
  8066. vm._watchers = [];
  8067. var opts = vm.$options;
  8068. if (opts.props) { initProps(vm, opts.props); }
  8069. if (opts.methods) { initMethods(vm, opts.methods); }
  8070. if (opts.data) {
  8071. initData(vm);
  8072. } else {
  8073. observe(vm._data = {}, true /* asRootData */);
  8074. }
  8075. if (opts.computed) { initComputed(vm, opts.computed); }
  8076. if (opts.watch && opts.watch !== nativeWatch) {
  8077. initWatch(vm, opts.watch);
  8078. }
  8079. }
  8080. function initProps (vm, propsOptions) {
  8081. var propsData = vm.$options.propsData || {};
  8082. var props = vm._props = {};
  8083. // cache prop keys so that future props updates can iterate using Array
  8084. // instead of dynamic object key enumeration.
  8085. var keys = vm.$options._propKeys = [];
  8086. var isRoot = !vm.$parent;
  8087. // root instance props should be converted
  8088. if (!isRoot) {
  8089. toggleObserving(false);
  8090. }
  8091. var loop = function ( key ) {
  8092. keys.push(key);
  8093. var value = validateProp(key, propsOptions, propsData, vm);
  8094. /* istanbul ignore else */
  8095. if (true) {
  8096. var hyphenatedKey = hyphenate(key);
  8097. if (isReservedAttribute(hyphenatedKey) ||
  8098. config.isReservedAttr(hyphenatedKey)) {
  8099. warn(
  8100. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8101. vm
  8102. );
  8103. }
  8104. defineReactive$$1(props, key, value, function () {
  8105. if (!isRoot && !isUpdatingChildComponent) {
  8106. {
  8107. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  8108. return
  8109. }
  8110. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8111. if(
  8112. key === 'value' &&
  8113. Array.isArray(vm.$options.behaviors) &&
  8114. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8115. ){
  8116. return
  8117. }
  8118. if(vm._getFormData){
  8119. return
  8120. }
  8121. var $parent = vm.$parent;
  8122. while($parent){
  8123. if($parent.__next_tick_pending){
  8124. return
  8125. }
  8126. $parent = $parent.$parent;
  8127. }
  8128. }
  8129. warn(
  8130. "Avoid mutating a prop directly since the value will be " +
  8131. "overwritten whenever the parent component re-renders. " +
  8132. "Instead, use a data or computed property based on the prop's " +
  8133. "value. Prop being mutated: \"" + key + "\"",
  8134. vm
  8135. );
  8136. }
  8137. });
  8138. } else {}
  8139. // static props are already proxied on the component's prototype
  8140. // during Vue.extend(). We only need to proxy props defined at
  8141. // instantiation here.
  8142. if (!(key in vm)) {
  8143. proxy(vm, "_props", key);
  8144. }
  8145. };
  8146. for (var key in propsOptions) loop( key );
  8147. toggleObserving(true);
  8148. }
  8149. function initData (vm) {
  8150. var data = vm.$options.data;
  8151. data = vm._data = typeof data === 'function'
  8152. ? getData(data, vm)
  8153. : data || {};
  8154. if (!isPlainObject(data)) {
  8155. data = {};
  8156. true && warn(
  8157. 'data functions should return an object:\n' +
  8158. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8159. vm
  8160. );
  8161. }
  8162. // proxy data on instance
  8163. var keys = Object.keys(data);
  8164. var props = vm.$options.props;
  8165. var methods = vm.$options.methods;
  8166. var i = keys.length;
  8167. while (i--) {
  8168. var key = keys[i];
  8169. if (true) {
  8170. if (methods && hasOwn(methods, key)) {
  8171. warn(
  8172. ("Method \"" + key + "\" has already been defined as a data property."),
  8173. vm
  8174. );
  8175. }
  8176. }
  8177. if (props && hasOwn(props, key)) {
  8178. true && warn(
  8179. "The data property \"" + key + "\" is already declared as a prop. " +
  8180. "Use prop default value instead.",
  8181. vm
  8182. );
  8183. } else if (!isReserved(key)) {
  8184. proxy(vm, "_data", key);
  8185. }
  8186. }
  8187. // observe data
  8188. observe(data, true /* asRootData */);
  8189. }
  8190. function getData (data, vm) {
  8191. // #7573 disable dep collection when invoking data getters
  8192. pushTarget();
  8193. try {
  8194. return data.call(vm, vm)
  8195. } catch (e) {
  8196. handleError(e, vm, "data()");
  8197. return {}
  8198. } finally {
  8199. popTarget();
  8200. }
  8201. }
  8202. var computedWatcherOptions = { lazy: true };
  8203. function initComputed (vm, computed) {
  8204. // $flow-disable-line
  8205. var watchers = vm._computedWatchers = Object.create(null);
  8206. // computed properties are just getters during SSR
  8207. var isSSR = isServerRendering();
  8208. for (var key in computed) {
  8209. var userDef = computed[key];
  8210. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8211. if ( true && getter == null) {
  8212. warn(
  8213. ("Getter is missing for computed property \"" + key + "\"."),
  8214. vm
  8215. );
  8216. }
  8217. if (!isSSR) {
  8218. // create internal watcher for the computed property.
  8219. watchers[key] = new Watcher(
  8220. vm,
  8221. getter || noop,
  8222. noop,
  8223. computedWatcherOptions
  8224. );
  8225. }
  8226. // component-defined computed properties are already defined on the
  8227. // component prototype. We only need to define computed properties defined
  8228. // at instantiation here.
  8229. if (!(key in vm)) {
  8230. defineComputed(vm, key, userDef);
  8231. } else if (true) {
  8232. if (key in vm.$data) {
  8233. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8234. } else if (vm.$options.props && key in vm.$options.props) {
  8235. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8236. }
  8237. }
  8238. }
  8239. }
  8240. function defineComputed (
  8241. target,
  8242. key,
  8243. userDef
  8244. ) {
  8245. var shouldCache = !isServerRendering();
  8246. if (typeof userDef === 'function') {
  8247. sharedPropertyDefinition.get = shouldCache
  8248. ? createComputedGetter(key)
  8249. : createGetterInvoker(userDef);
  8250. sharedPropertyDefinition.set = noop;
  8251. } else {
  8252. sharedPropertyDefinition.get = userDef.get
  8253. ? shouldCache && userDef.cache !== false
  8254. ? createComputedGetter(key)
  8255. : createGetterInvoker(userDef.get)
  8256. : noop;
  8257. sharedPropertyDefinition.set = userDef.set || noop;
  8258. }
  8259. if ( true &&
  8260. sharedPropertyDefinition.set === noop) {
  8261. sharedPropertyDefinition.set = function () {
  8262. warn(
  8263. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8264. this
  8265. );
  8266. };
  8267. }
  8268. Object.defineProperty(target, key, sharedPropertyDefinition);
  8269. }
  8270. function createComputedGetter (key) {
  8271. return function computedGetter () {
  8272. var watcher = this._computedWatchers && this._computedWatchers[key];
  8273. if (watcher) {
  8274. if (watcher.dirty) {
  8275. watcher.evaluate();
  8276. }
  8277. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8278. watcher.depend();
  8279. }
  8280. return watcher.value
  8281. }
  8282. }
  8283. }
  8284. function createGetterInvoker(fn) {
  8285. return function computedGetter () {
  8286. return fn.call(this, this)
  8287. }
  8288. }
  8289. function initMethods (vm, methods) {
  8290. var props = vm.$options.props;
  8291. for (var key in methods) {
  8292. if (true) {
  8293. if (typeof methods[key] !== 'function') {
  8294. warn(
  8295. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8296. "Did you reference the function correctly?",
  8297. vm
  8298. );
  8299. }
  8300. if (props && hasOwn(props, key)) {
  8301. warn(
  8302. ("Method \"" + key + "\" has already been defined as a prop."),
  8303. vm
  8304. );
  8305. }
  8306. if ((key in vm) && isReserved(key)) {
  8307. warn(
  8308. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8309. "Avoid defining component methods that start with _ or $."
  8310. );
  8311. }
  8312. }
  8313. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8314. }
  8315. }
  8316. function initWatch (vm, watch) {
  8317. for (var key in watch) {
  8318. var handler = watch[key];
  8319. if (Array.isArray(handler)) {
  8320. for (var i = 0; i < handler.length; i++) {
  8321. createWatcher(vm, key, handler[i]);
  8322. }
  8323. } else {
  8324. createWatcher(vm, key, handler);
  8325. }
  8326. }
  8327. }
  8328. function createWatcher (
  8329. vm,
  8330. expOrFn,
  8331. handler,
  8332. options
  8333. ) {
  8334. if (isPlainObject(handler)) {
  8335. options = handler;
  8336. handler = handler.handler;
  8337. }
  8338. if (typeof handler === 'string') {
  8339. handler = vm[handler];
  8340. }
  8341. return vm.$watch(expOrFn, handler, options)
  8342. }
  8343. function stateMixin (Vue) {
  8344. // flow somehow has problems with directly declared definition object
  8345. // when using Object.defineProperty, so we have to procedurally build up
  8346. // the object here.
  8347. var dataDef = {};
  8348. dataDef.get = function () { return this._data };
  8349. var propsDef = {};
  8350. propsDef.get = function () { return this._props };
  8351. if (true) {
  8352. dataDef.set = function () {
  8353. warn(
  8354. 'Avoid replacing instance root $data. ' +
  8355. 'Use nested data properties instead.',
  8356. this
  8357. );
  8358. };
  8359. propsDef.set = function () {
  8360. warn("$props is readonly.", this);
  8361. };
  8362. }
  8363. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8364. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8365. Vue.prototype.$set = set;
  8366. Vue.prototype.$delete = del;
  8367. Vue.prototype.$watch = function (
  8368. expOrFn,
  8369. cb,
  8370. options
  8371. ) {
  8372. var vm = this;
  8373. if (isPlainObject(cb)) {
  8374. return createWatcher(vm, expOrFn, cb, options)
  8375. }
  8376. options = options || {};
  8377. options.user = true;
  8378. var watcher = new Watcher(vm, expOrFn, cb, options);
  8379. if (options.immediate) {
  8380. try {
  8381. cb.call(vm, watcher.value);
  8382. } catch (error) {
  8383. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8384. }
  8385. }
  8386. return function unwatchFn () {
  8387. watcher.teardown();
  8388. }
  8389. };
  8390. }
  8391. /* */
  8392. var uid$3 = 0;
  8393. function initMixin (Vue) {
  8394. Vue.prototype._init = function (options) {
  8395. var vm = this;
  8396. // a uid
  8397. vm._uid = uid$3++;
  8398. var startTag, endTag;
  8399. /* istanbul ignore if */
  8400. if ( true && config.performance && mark) {
  8401. startTag = "vue-perf-start:" + (vm._uid);
  8402. endTag = "vue-perf-end:" + (vm._uid);
  8403. mark(startTag);
  8404. }
  8405. // a flag to avoid this being observed
  8406. vm._isVue = true;
  8407. // merge options
  8408. if (options && options._isComponent) {
  8409. // optimize internal component instantiation
  8410. // since dynamic options merging is pretty slow, and none of the
  8411. // internal component options needs special treatment.
  8412. initInternalComponent(vm, options);
  8413. } else {
  8414. vm.$options = mergeOptions(
  8415. resolveConstructorOptions(vm.constructor),
  8416. options || {},
  8417. vm
  8418. );
  8419. }
  8420. /* istanbul ignore else */
  8421. if (true) {
  8422. initProxy(vm);
  8423. } else {}
  8424. // expose real self
  8425. vm._self = vm;
  8426. initLifecycle(vm);
  8427. initEvents(vm);
  8428. initRender(vm);
  8429. callHook(vm, 'beforeCreate');
  8430. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8431. initState(vm);
  8432. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8433. !vm._$fallback && callHook(vm, 'created');
  8434. /* istanbul ignore if */
  8435. if ( true && config.performance && mark) {
  8436. vm._name = formatComponentName(vm, false);
  8437. mark(endTag);
  8438. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8439. }
  8440. if (vm.$options.el) {
  8441. vm.$mount(vm.$options.el);
  8442. }
  8443. };
  8444. }
  8445. function initInternalComponent (vm, options) {
  8446. var opts = vm.$options = Object.create(vm.constructor.options);
  8447. // doing this because it's faster than dynamic enumeration.
  8448. var parentVnode = options._parentVnode;
  8449. opts.parent = options.parent;
  8450. opts._parentVnode = parentVnode;
  8451. var vnodeComponentOptions = parentVnode.componentOptions;
  8452. opts.propsData = vnodeComponentOptions.propsData;
  8453. opts._parentListeners = vnodeComponentOptions.listeners;
  8454. opts._renderChildren = vnodeComponentOptions.children;
  8455. opts._componentTag = vnodeComponentOptions.tag;
  8456. if (options.render) {
  8457. opts.render = options.render;
  8458. opts.staticRenderFns = options.staticRenderFns;
  8459. }
  8460. }
  8461. function resolveConstructorOptions (Ctor) {
  8462. var options = Ctor.options;
  8463. if (Ctor.super) {
  8464. var superOptions = resolveConstructorOptions(Ctor.super);
  8465. var cachedSuperOptions = Ctor.superOptions;
  8466. if (superOptions !== cachedSuperOptions) {
  8467. // super option changed,
  8468. // need to resolve new options.
  8469. Ctor.superOptions = superOptions;
  8470. // check if there are any late-modified/attached options (#4976)
  8471. var modifiedOptions = resolveModifiedOptions(Ctor);
  8472. // update base extend options
  8473. if (modifiedOptions) {
  8474. extend(Ctor.extendOptions, modifiedOptions);
  8475. }
  8476. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8477. if (options.name) {
  8478. options.components[options.name] = Ctor;
  8479. }
  8480. }
  8481. }
  8482. return options
  8483. }
  8484. function resolveModifiedOptions (Ctor) {
  8485. var modified;
  8486. var latest = Ctor.options;
  8487. var sealed = Ctor.sealedOptions;
  8488. for (var key in latest) {
  8489. if (latest[key] !== sealed[key]) {
  8490. if (!modified) { modified = {}; }
  8491. modified[key] = latest[key];
  8492. }
  8493. }
  8494. return modified
  8495. }
  8496. function Vue (options) {
  8497. if ( true &&
  8498. !(this instanceof Vue)
  8499. ) {
  8500. warn('Vue is a constructor and should be called with the `new` keyword');
  8501. }
  8502. this._init(options);
  8503. }
  8504. initMixin(Vue);
  8505. stateMixin(Vue);
  8506. eventsMixin(Vue);
  8507. lifecycleMixin(Vue);
  8508. renderMixin(Vue);
  8509. /* */
  8510. function initUse (Vue) {
  8511. Vue.use = function (plugin) {
  8512. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8513. if (installedPlugins.indexOf(plugin) > -1) {
  8514. return this
  8515. }
  8516. // additional parameters
  8517. var args = toArray(arguments, 1);
  8518. args.unshift(this);
  8519. if (typeof plugin.install === 'function') {
  8520. plugin.install.apply(plugin, args);
  8521. } else if (typeof plugin === 'function') {
  8522. plugin.apply(null, args);
  8523. }
  8524. installedPlugins.push(plugin);
  8525. return this
  8526. };
  8527. }
  8528. /* */
  8529. function initMixin$1 (Vue) {
  8530. Vue.mixin = function (mixin) {
  8531. this.options = mergeOptions(this.options, mixin);
  8532. return this
  8533. };
  8534. }
  8535. /* */
  8536. function initExtend (Vue) {
  8537. /**
  8538. * Each instance constructor, including Vue, has a unique
  8539. * cid. This enables us to create wrapped "child
  8540. * constructors" for prototypal inheritance and cache them.
  8541. */
  8542. Vue.cid = 0;
  8543. var cid = 1;
  8544. /**
  8545. * Class inheritance
  8546. */
  8547. Vue.extend = function (extendOptions) {
  8548. extendOptions = extendOptions || {};
  8549. var Super = this;
  8550. var SuperId = Super.cid;
  8551. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8552. if (cachedCtors[SuperId]) {
  8553. return cachedCtors[SuperId]
  8554. }
  8555. var name = extendOptions.name || Super.options.name;
  8556. if ( true && name) {
  8557. validateComponentName(name);
  8558. }
  8559. var Sub = function VueComponent (options) {
  8560. this._init(options);
  8561. };
  8562. Sub.prototype = Object.create(Super.prototype);
  8563. Sub.prototype.constructor = Sub;
  8564. Sub.cid = cid++;
  8565. Sub.options = mergeOptions(
  8566. Super.options,
  8567. extendOptions
  8568. );
  8569. Sub['super'] = Super;
  8570. // For props and computed properties, we define the proxy getters on
  8571. // the Vue instances at extension time, on the extended prototype. This
  8572. // avoids Object.defineProperty calls for each instance created.
  8573. if (Sub.options.props) {
  8574. initProps$1(Sub);
  8575. }
  8576. if (Sub.options.computed) {
  8577. initComputed$1(Sub);
  8578. }
  8579. // allow further extension/mixin/plugin usage
  8580. Sub.extend = Super.extend;
  8581. Sub.mixin = Super.mixin;
  8582. Sub.use = Super.use;
  8583. // create asset registers, so extended classes
  8584. // can have their private assets too.
  8585. ASSET_TYPES.forEach(function (type) {
  8586. Sub[type] = Super[type];
  8587. });
  8588. // enable recursive self-lookup
  8589. if (name) {
  8590. Sub.options.components[name] = Sub;
  8591. }
  8592. // keep a reference to the super options at extension time.
  8593. // later at instantiation we can check if Super's options have
  8594. // been updated.
  8595. Sub.superOptions = Super.options;
  8596. Sub.extendOptions = extendOptions;
  8597. Sub.sealedOptions = extend({}, Sub.options);
  8598. // cache constructor
  8599. cachedCtors[SuperId] = Sub;
  8600. return Sub
  8601. };
  8602. }
  8603. function initProps$1 (Comp) {
  8604. var props = Comp.options.props;
  8605. for (var key in props) {
  8606. proxy(Comp.prototype, "_props", key);
  8607. }
  8608. }
  8609. function initComputed$1 (Comp) {
  8610. var computed = Comp.options.computed;
  8611. for (var key in computed) {
  8612. defineComputed(Comp.prototype, key, computed[key]);
  8613. }
  8614. }
  8615. /* */
  8616. function initAssetRegisters (Vue) {
  8617. /**
  8618. * Create asset registration methods.
  8619. */
  8620. ASSET_TYPES.forEach(function (type) {
  8621. Vue[type] = function (
  8622. id,
  8623. definition
  8624. ) {
  8625. if (!definition) {
  8626. return this.options[type + 's'][id]
  8627. } else {
  8628. /* istanbul ignore if */
  8629. if ( true && type === 'component') {
  8630. validateComponentName(id);
  8631. }
  8632. if (type === 'component' && isPlainObject(definition)) {
  8633. definition.name = definition.name || id;
  8634. definition = this.options._base.extend(definition);
  8635. }
  8636. if (type === 'directive' && typeof definition === 'function') {
  8637. definition = { bind: definition, update: definition };
  8638. }
  8639. this.options[type + 's'][id] = definition;
  8640. return definition
  8641. }
  8642. };
  8643. });
  8644. }
  8645. /* */
  8646. function getComponentName (opts) {
  8647. return opts && (opts.Ctor.options.name || opts.tag)
  8648. }
  8649. function matches (pattern, name) {
  8650. if (Array.isArray(pattern)) {
  8651. return pattern.indexOf(name) > -1
  8652. } else if (typeof pattern === 'string') {
  8653. return pattern.split(',').indexOf(name) > -1
  8654. } else if (isRegExp(pattern)) {
  8655. return pattern.test(name)
  8656. }
  8657. /* istanbul ignore next */
  8658. return false
  8659. }
  8660. function pruneCache (keepAliveInstance, filter) {
  8661. var cache = keepAliveInstance.cache;
  8662. var keys = keepAliveInstance.keys;
  8663. var _vnode = keepAliveInstance._vnode;
  8664. for (var key in cache) {
  8665. var cachedNode = cache[key];
  8666. if (cachedNode) {
  8667. var name = getComponentName(cachedNode.componentOptions);
  8668. if (name && !filter(name)) {
  8669. pruneCacheEntry(cache, key, keys, _vnode);
  8670. }
  8671. }
  8672. }
  8673. }
  8674. function pruneCacheEntry (
  8675. cache,
  8676. key,
  8677. keys,
  8678. current
  8679. ) {
  8680. var cached$$1 = cache[key];
  8681. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8682. cached$$1.componentInstance.$destroy();
  8683. }
  8684. cache[key] = null;
  8685. remove(keys, key);
  8686. }
  8687. var patternTypes = [String, RegExp, Array];
  8688. var KeepAlive = {
  8689. name: 'keep-alive',
  8690. abstract: true,
  8691. props: {
  8692. include: patternTypes,
  8693. exclude: patternTypes,
  8694. max: [String, Number]
  8695. },
  8696. created: function created () {
  8697. this.cache = Object.create(null);
  8698. this.keys = [];
  8699. },
  8700. destroyed: function destroyed () {
  8701. for (var key in this.cache) {
  8702. pruneCacheEntry(this.cache, key, this.keys);
  8703. }
  8704. },
  8705. mounted: function mounted () {
  8706. var this$1 = this;
  8707. this.$watch('include', function (val) {
  8708. pruneCache(this$1, function (name) { return matches(val, name); });
  8709. });
  8710. this.$watch('exclude', function (val) {
  8711. pruneCache(this$1, function (name) { return !matches(val, name); });
  8712. });
  8713. },
  8714. render: function render () {
  8715. var slot = this.$slots.default;
  8716. var vnode = getFirstComponentChild(slot);
  8717. var componentOptions = vnode && vnode.componentOptions;
  8718. if (componentOptions) {
  8719. // check pattern
  8720. var name = getComponentName(componentOptions);
  8721. var ref = this;
  8722. var include = ref.include;
  8723. var exclude = ref.exclude;
  8724. if (
  8725. // not included
  8726. (include && (!name || !matches(include, name))) ||
  8727. // excluded
  8728. (exclude && name && matches(exclude, name))
  8729. ) {
  8730. return vnode
  8731. }
  8732. var ref$1 = this;
  8733. var cache = ref$1.cache;
  8734. var keys = ref$1.keys;
  8735. var key = vnode.key == null
  8736. // same constructor may get registered as different local components
  8737. // so cid alone is not enough (#3269)
  8738. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8739. : vnode.key;
  8740. if (cache[key]) {
  8741. vnode.componentInstance = cache[key].componentInstance;
  8742. // make current key freshest
  8743. remove(keys, key);
  8744. keys.push(key);
  8745. } else {
  8746. cache[key] = vnode;
  8747. keys.push(key);
  8748. // prune oldest entry
  8749. if (this.max && keys.length > parseInt(this.max)) {
  8750. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8751. }
  8752. }
  8753. vnode.data.keepAlive = true;
  8754. }
  8755. return vnode || (slot && slot[0])
  8756. }
  8757. };
  8758. var builtInComponents = {
  8759. KeepAlive: KeepAlive
  8760. };
  8761. /* */
  8762. function initGlobalAPI (Vue) {
  8763. // config
  8764. var configDef = {};
  8765. configDef.get = function () { return config; };
  8766. if (true) {
  8767. configDef.set = function () {
  8768. warn(
  8769. 'Do not replace the Vue.config object, set individual fields instead.'
  8770. );
  8771. };
  8772. }
  8773. Object.defineProperty(Vue, 'config', configDef);
  8774. // exposed util methods.
  8775. // NOTE: these are not considered part of the public API - avoid relying on
  8776. // them unless you are aware of the risk.
  8777. Vue.util = {
  8778. warn: warn,
  8779. extend: extend,
  8780. mergeOptions: mergeOptions,
  8781. defineReactive: defineReactive$$1
  8782. };
  8783. Vue.set = set;
  8784. Vue.delete = del;
  8785. Vue.nextTick = nextTick;
  8786. // 2.6 explicit observable API
  8787. Vue.observable = function (obj) {
  8788. observe(obj);
  8789. return obj
  8790. };
  8791. Vue.options = Object.create(null);
  8792. ASSET_TYPES.forEach(function (type) {
  8793. Vue.options[type + 's'] = Object.create(null);
  8794. });
  8795. // this is used to identify the "base" constructor to extend all plain-object
  8796. // components with in Weex's multi-instance scenarios.
  8797. Vue.options._base = Vue;
  8798. extend(Vue.options.components, builtInComponents);
  8799. initUse(Vue);
  8800. initMixin$1(Vue);
  8801. initExtend(Vue);
  8802. initAssetRegisters(Vue);
  8803. }
  8804. initGlobalAPI(Vue);
  8805. Object.defineProperty(Vue.prototype, '$isServer', {
  8806. get: isServerRendering
  8807. });
  8808. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8809. get: function get () {
  8810. /* istanbul ignore next */
  8811. return this.$vnode && this.$vnode.ssrContext
  8812. }
  8813. });
  8814. // expose FunctionalRenderContext for ssr runtime helper installation
  8815. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8816. value: FunctionalRenderContext
  8817. });
  8818. Vue.version = '2.6.11';
  8819. /**
  8820. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8821. */
  8822. var ARRAYTYPE = '[object Array]';
  8823. var OBJECTTYPE = '[object Object]';
  8824. // const FUNCTIONTYPE = '[object Function]'
  8825. function diff(current, pre) {
  8826. var result = {};
  8827. syncKeys(current, pre);
  8828. _diff(current, pre, '', result);
  8829. return result
  8830. }
  8831. function syncKeys(current, pre) {
  8832. if (current === pre) { return }
  8833. var rootCurrentType = type(current);
  8834. var rootPreType = type(pre);
  8835. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8836. if(Object.keys(current).length >= Object.keys(pre).length){
  8837. for (var key in pre) {
  8838. var currentValue = current[key];
  8839. if (currentValue === undefined) {
  8840. current[key] = null;
  8841. } else {
  8842. syncKeys(currentValue, pre[key]);
  8843. }
  8844. }
  8845. }
  8846. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8847. if (current.length >= pre.length) {
  8848. pre.forEach(function (item, index) {
  8849. syncKeys(current[index], item);
  8850. });
  8851. }
  8852. }
  8853. }
  8854. function _diff(current, pre, path, result) {
  8855. if (current === pre) { return }
  8856. var rootCurrentType = type(current);
  8857. var rootPreType = type(pre);
  8858. if (rootCurrentType == OBJECTTYPE) {
  8859. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8860. setResult(result, path, current);
  8861. } else {
  8862. var loop = function ( key ) {
  8863. var currentValue = current[key];
  8864. var preValue = pre[key];
  8865. var currentType = type(currentValue);
  8866. var preType = type(preValue);
  8867. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8868. if (currentValue != pre[key]) {
  8869. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8870. }
  8871. } else if (currentType == ARRAYTYPE) {
  8872. if (preType != ARRAYTYPE) {
  8873. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8874. } else {
  8875. if (currentValue.length < preValue.length) {
  8876. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8877. } else {
  8878. currentValue.forEach(function (item, index) {
  8879. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8880. });
  8881. }
  8882. }
  8883. } else if (currentType == OBJECTTYPE) {
  8884. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8885. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8886. } else {
  8887. for (var subKey in currentValue) {
  8888. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8889. }
  8890. }
  8891. }
  8892. };
  8893. for (var key in current) loop( key );
  8894. }
  8895. } else if (rootCurrentType == ARRAYTYPE) {
  8896. if (rootPreType != ARRAYTYPE) {
  8897. setResult(result, path, current);
  8898. } else {
  8899. if (current.length < pre.length) {
  8900. setResult(result, path, current);
  8901. } else {
  8902. current.forEach(function (item, index) {
  8903. _diff(item, pre[index], path + '[' + index + ']', result);
  8904. });
  8905. }
  8906. }
  8907. } else {
  8908. setResult(result, path, current);
  8909. }
  8910. }
  8911. function setResult(result, k, v) {
  8912. // if (type(v) != FUNCTIONTYPE) {
  8913. result[k] = v;
  8914. // }
  8915. }
  8916. function type(obj) {
  8917. return Object.prototype.toString.call(obj)
  8918. }
  8919. /* */
  8920. function flushCallbacks$1(vm) {
  8921. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8922. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8923. var mpInstance = vm.$scope;
  8924. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8925. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8926. }
  8927. var copies = vm.__next_tick_callbacks.slice(0);
  8928. vm.__next_tick_callbacks.length = 0;
  8929. for (var i = 0; i < copies.length; i++) {
  8930. copies[i]();
  8931. }
  8932. }
  8933. }
  8934. function hasRenderWatcher(vm) {
  8935. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8936. }
  8937. function nextTick$1(vm, cb) {
  8938. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8939. //2.nextTick 之前存在 render watcher
  8940. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8941. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8942. var mpInstance = vm.$scope;
  8943. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8944. ']:nextVueTick');
  8945. }
  8946. return nextTick(cb, vm)
  8947. }else{
  8948. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8949. var mpInstance$1 = vm.$scope;
  8950. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8951. ']:nextMPTick');
  8952. }
  8953. }
  8954. var _resolve;
  8955. if (!vm.__next_tick_callbacks) {
  8956. vm.__next_tick_callbacks = [];
  8957. }
  8958. vm.__next_tick_callbacks.push(function () {
  8959. if (cb) {
  8960. try {
  8961. cb.call(vm);
  8962. } catch (e) {
  8963. handleError(e, vm, 'nextTick');
  8964. }
  8965. } else if (_resolve) {
  8966. _resolve(vm);
  8967. }
  8968. });
  8969. // $flow-disable-line
  8970. if (!cb && typeof Promise !== 'undefined') {
  8971. return new Promise(function (resolve) {
  8972. _resolve = resolve;
  8973. })
  8974. }
  8975. }
  8976. /* */
  8977. function cloneWithData(vm) {
  8978. // 确保当前 vm 所有数据被同步
  8979. var ret = Object.create(null);
  8980. var dataKeys = [].concat(
  8981. Object.keys(vm._data || {}),
  8982. Object.keys(vm._computedWatchers || {}));
  8983. dataKeys.reduce(function(ret, key) {
  8984. ret[key] = vm[key];
  8985. return ret
  8986. }, ret);
  8987. // vue-composition-api
  8988. var rawBindings = vm.__secret_vfa_state__ && vm.__secret_vfa_state__.rawBindings;
  8989. if (rawBindings) {
  8990. Object.keys(rawBindings).forEach(function (key) {
  8991. ret[key] = vm[key];
  8992. });
  8993. }
  8994. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8995. Object.assign(ret, vm.$mp.data || {});
  8996. if (
  8997. Array.isArray(vm.$options.behaviors) &&
  8998. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8999. ) { //form-field
  9000. ret['name'] = vm.name;
  9001. ret['value'] = vm.value;
  9002. }
  9003. return JSON.parse(JSON.stringify(ret))
  9004. }
  9005. var patch = function(oldVnode, vnode) {
  9006. var this$1 = this;
  9007. if (vnode === null) { //destroy
  9008. return
  9009. }
  9010. if (this.mpType === 'page' || this.mpType === 'component') {
  9011. var mpInstance = this.$scope;
  9012. var data = Object.create(null);
  9013. try {
  9014. data = cloneWithData(this);
  9015. } catch (err) {
  9016. console.error(err);
  9017. }
  9018. data.__webviewId__ = mpInstance.data.__webviewId__;
  9019. var mpData = Object.create(null);
  9020. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9021. mpData[key] = mpInstance.data[key];
  9022. });
  9023. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9024. if (Object.keys(diffData).length) {
  9025. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9026. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9027. ']差量更新',
  9028. JSON.stringify(diffData));
  9029. }
  9030. this.__next_tick_pending = true;
  9031. mpInstance.setData(diffData, function () {
  9032. this$1.__next_tick_pending = false;
  9033. flushCallbacks$1(this$1);
  9034. });
  9035. } else {
  9036. flushCallbacks$1(this);
  9037. }
  9038. }
  9039. };
  9040. /* */
  9041. function createEmptyRender() {
  9042. }
  9043. function mountComponent$1(
  9044. vm,
  9045. el,
  9046. hydrating
  9047. ) {
  9048. if (!vm.mpType) {//main.js 中的 new Vue
  9049. return vm
  9050. }
  9051. if (vm.mpType === 'app') {
  9052. vm.$options.render = createEmptyRender;
  9053. }
  9054. if (!vm.$options.render) {
  9055. vm.$options.render = createEmptyRender;
  9056. if (true) {
  9057. /* istanbul ignore if */
  9058. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9059. vm.$options.el || el) {
  9060. warn(
  9061. 'You are using the runtime-only build of Vue where the template ' +
  9062. 'compiler is not available. Either pre-compile the templates into ' +
  9063. 'render functions, or use the compiler-included build.',
  9064. vm
  9065. );
  9066. } else {
  9067. warn(
  9068. 'Failed to mount component: template or render function not defined.',
  9069. vm
  9070. );
  9071. }
  9072. }
  9073. }
  9074. !vm._$fallback && callHook(vm, 'beforeMount');
  9075. var updateComponent = function () {
  9076. vm._update(vm._render(), hydrating);
  9077. };
  9078. // we set this to vm._watcher inside the watcher's constructor
  9079. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9080. // component's mounted hook), which relies on vm._watcher being already defined
  9081. new Watcher(vm, updateComponent, noop, {
  9082. before: function before() {
  9083. if (vm._isMounted && !vm._isDestroyed) {
  9084. callHook(vm, 'beforeUpdate');
  9085. }
  9086. }
  9087. }, true /* isRenderWatcher */);
  9088. hydrating = false;
  9089. return vm
  9090. }
  9091. /* */
  9092. function renderClass (
  9093. staticClass,
  9094. dynamicClass
  9095. ) {
  9096. if (isDef(staticClass) || isDef(dynamicClass)) {
  9097. return concat(staticClass, stringifyClass(dynamicClass))
  9098. }
  9099. /* istanbul ignore next */
  9100. return ''
  9101. }
  9102. function concat (a, b) {
  9103. return a ? b ? (a + ' ' + b) : a : (b || '')
  9104. }
  9105. function stringifyClass (value) {
  9106. if (Array.isArray(value)) {
  9107. return stringifyArray(value)
  9108. }
  9109. if (isObject(value)) {
  9110. return stringifyObject(value)
  9111. }
  9112. if (typeof value === 'string') {
  9113. return value
  9114. }
  9115. /* istanbul ignore next */
  9116. return ''
  9117. }
  9118. function stringifyArray (value) {
  9119. var res = '';
  9120. var stringified;
  9121. for (var i = 0, l = value.length; i < l; i++) {
  9122. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9123. if (res) { res += ' '; }
  9124. res += stringified;
  9125. }
  9126. }
  9127. return res
  9128. }
  9129. function stringifyObject (value) {
  9130. var res = '';
  9131. for (var key in value) {
  9132. if (value[key]) {
  9133. if (res) { res += ' '; }
  9134. res += key;
  9135. }
  9136. }
  9137. return res
  9138. }
  9139. /* */
  9140. var parseStyleText = cached(function (cssText) {
  9141. var res = {};
  9142. var listDelimiter = /;(?![^(]*\))/g;
  9143. var propertyDelimiter = /:(.+)/;
  9144. cssText.split(listDelimiter).forEach(function (item) {
  9145. if (item) {
  9146. var tmp = item.split(propertyDelimiter);
  9147. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9148. }
  9149. });
  9150. return res
  9151. });
  9152. // normalize possible array / string values into Object
  9153. function normalizeStyleBinding (bindingStyle) {
  9154. if (Array.isArray(bindingStyle)) {
  9155. return toObject(bindingStyle)
  9156. }
  9157. if (typeof bindingStyle === 'string') {
  9158. return parseStyleText(bindingStyle)
  9159. }
  9160. return bindingStyle
  9161. }
  9162. /* */
  9163. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9164. function getTarget(obj, path) {
  9165. var parts = path.split('.');
  9166. var key = parts[0];
  9167. if (key.indexOf('__$n') === 0) { //number index
  9168. key = parseInt(key.replace('__$n', ''));
  9169. }
  9170. if (parts.length === 1) {
  9171. return obj[key]
  9172. }
  9173. return getTarget(obj[key], parts.slice(1).join('.'))
  9174. }
  9175. function internalMixin(Vue) {
  9176. Vue.config.errorHandler = function(err, vm, info) {
  9177. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9178. console.error(err);
  9179. /* eslint-disable no-undef */
  9180. var app = getApp();
  9181. if (app && app.onError) {
  9182. app.onError(err);
  9183. }
  9184. };
  9185. var oldEmit = Vue.prototype.$emit;
  9186. Vue.prototype.$emit = function(event) {
  9187. if (this.$scope && event) {
  9188. this.$scope['triggerEvent'](event, {
  9189. __args__: toArray(arguments, 1)
  9190. });
  9191. }
  9192. return oldEmit.apply(this, arguments)
  9193. };
  9194. Vue.prototype.$nextTick = function(fn) {
  9195. return nextTick$1(this, fn)
  9196. };
  9197. MP_METHODS.forEach(function (method) {
  9198. Vue.prototype[method] = function(args) {
  9199. if (this.$scope && this.$scope[method]) {
  9200. return this.$scope[method](args)
  9201. }
  9202. // mp-alipay
  9203. if (typeof my === 'undefined') {
  9204. return
  9205. }
  9206. if (method === 'createSelectorQuery') {
  9207. /* eslint-disable no-undef */
  9208. return my.createSelectorQuery(args)
  9209. } else if (method === 'createIntersectionObserver') {
  9210. /* eslint-disable no-undef */
  9211. return my.createIntersectionObserver(args)
  9212. }
  9213. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9214. };
  9215. });
  9216. Vue.prototype.__init_provide = initProvide;
  9217. Vue.prototype.__init_injections = initInjections;
  9218. Vue.prototype.__call_hook = function(hook, args) {
  9219. var vm = this;
  9220. // #7573 disable dep collection when invoking lifecycle hooks
  9221. pushTarget();
  9222. var handlers = vm.$options[hook];
  9223. var info = hook + " hook";
  9224. var ret;
  9225. if (handlers) {
  9226. for (var i = 0, j = handlers.length; i < j; i++) {
  9227. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9228. }
  9229. }
  9230. if (vm._hasHookEvent) {
  9231. vm.$emit('hook:' + hook, args);
  9232. }
  9233. popTarget();
  9234. return ret
  9235. };
  9236. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9237. if (Array.isArray(modifiers)) {
  9238. if (modifiers.indexOf('trim') !== -1) {
  9239. value = value.trim();
  9240. }
  9241. if (modifiers.indexOf('number') !== -1) {
  9242. value = this._n(value);
  9243. }
  9244. }
  9245. if (!target) {
  9246. target = this;
  9247. }
  9248. target[key] = value;
  9249. };
  9250. Vue.prototype.__set_sync = function(target, key, value) {
  9251. if (!target) {
  9252. target = this;
  9253. }
  9254. target[key] = value;
  9255. };
  9256. Vue.prototype.__get_orig = function(item) {
  9257. if (isPlainObject(item)) {
  9258. return item['$orig'] || item
  9259. }
  9260. return item
  9261. };
  9262. Vue.prototype.__get_value = function(dataPath, target) {
  9263. return getTarget(target || this, dataPath)
  9264. };
  9265. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9266. return renderClass(staticClass, dynamicClass)
  9267. };
  9268. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9269. if (!dynamicStyle && !staticStyle) {
  9270. return ''
  9271. }
  9272. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9273. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9274. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9275. };
  9276. Vue.prototype.__map = function(val, iteratee) {
  9277. //TODO 暂不考虑 string
  9278. var ret, i, l, keys, key;
  9279. if (Array.isArray(val)) {
  9280. ret = new Array(val.length);
  9281. for (i = 0, l = val.length; i < l; i++) {
  9282. ret[i] = iteratee(val[i], i);
  9283. }
  9284. return ret
  9285. } else if (isObject(val)) {
  9286. keys = Object.keys(val);
  9287. ret = Object.create(null);
  9288. for (i = 0, l = keys.length; i < l; i++) {
  9289. key = keys[i];
  9290. ret[key] = iteratee(val[key], key, i);
  9291. }
  9292. return ret
  9293. } else if (typeof val === 'number') {
  9294. ret = new Array(val);
  9295. for (i = 0, l = val; i < l; i++) {
  9296. // 第一个参数暂时仍和小程序一致
  9297. ret[i] = iteratee(i, i);
  9298. }
  9299. return ret
  9300. }
  9301. return []
  9302. };
  9303. }
  9304. /* */
  9305. var LIFECYCLE_HOOKS$1 = [
  9306. //App
  9307. 'onLaunch',
  9308. 'onShow',
  9309. 'onHide',
  9310. 'onUniNViewMessage',
  9311. 'onPageNotFound',
  9312. 'onThemeChange',
  9313. 'onError',
  9314. 'onUnhandledRejection',
  9315. //Page
  9316. 'onLoad',
  9317. // 'onShow',
  9318. 'onReady',
  9319. // 'onHide',
  9320. 'onUnload',
  9321. 'onPullDownRefresh',
  9322. 'onReachBottom',
  9323. 'onTabItemTap',
  9324. 'onAddToFavorites',
  9325. 'onShareTimeline',
  9326. 'onShareAppMessage',
  9327. 'onResize',
  9328. 'onPageScroll',
  9329. 'onNavigationBarButtonTap',
  9330. 'onBackPress',
  9331. 'onNavigationBarSearchInputChanged',
  9332. 'onNavigationBarSearchInputConfirmed',
  9333. 'onNavigationBarSearchInputClicked',
  9334. //Component
  9335. // 'onReady', // 兼容旧版本,应该移除该事件
  9336. 'onPageShow',
  9337. 'onPageHide',
  9338. 'onPageResize'
  9339. ];
  9340. function lifecycleMixin$1(Vue) {
  9341. //fixed vue-class-component
  9342. var oldExtend = Vue.extend;
  9343. Vue.extend = function(extendOptions) {
  9344. extendOptions = extendOptions || {};
  9345. var methods = extendOptions.methods;
  9346. if (methods) {
  9347. Object.keys(methods).forEach(function (methodName) {
  9348. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9349. extendOptions[methodName] = methods[methodName];
  9350. delete methods[methodName];
  9351. }
  9352. });
  9353. }
  9354. return oldExtend.call(this, extendOptions)
  9355. };
  9356. var strategies = Vue.config.optionMergeStrategies;
  9357. var mergeHook = strategies.created;
  9358. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9359. strategies[hook] = mergeHook;
  9360. });
  9361. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9362. }
  9363. /* */
  9364. // install platform patch function
  9365. Vue.prototype.__patch__ = patch;
  9366. // public mount method
  9367. Vue.prototype.$mount = function(
  9368. el ,
  9369. hydrating
  9370. ) {
  9371. return mountComponent$1(this, el, hydrating)
  9372. };
  9373. lifecycleMixin$1(Vue);
  9374. internalMixin(Vue);
  9375. /* */
  9376. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9377. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9378. /***/ }),
  9379. /***/ 20:
  9380. /*!******************************************************!*\
  9381. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/index.js ***!
  9382. \******************************************************/
  9383. /*! no static exports found */
  9384. /***/ (function(module, exports, __webpack_require__) {
  9385. "use strict";
  9386. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  9387. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 21));
  9388. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 22));
  9389. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 26));
  9390. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 27));
  9391. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 28));
  9392. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 29));
  9393. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 30));
  9394. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 31));
  9395. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 32));
  9396. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 33));
  9397. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 34));
  9398. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 24));
  9399. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 23));
  9400. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 35));
  9401. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 25));
  9402. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 36));
  9403. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 37));
  9404. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 38));
  9405. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 39));
  9406. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 40));
  9407. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 41);
  9408. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 42));
  9409. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 43));
  9410. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 44));
  9411. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 45));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  9412. // 引入关于是否mixin集成小程序分享的配置
  9413. // import wxshare from './libs/mixin/mpShare.js'
  9414. // 全局挂载引入http相关请求拦截插件
  9415. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  9416. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  9417. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  9418. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  9419. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  9420. // let vuexStore = {};
  9421. // try {
  9422. // vuexStore = require("@/store/$u.mixin.js");
  9423. // } catch (e) {
  9424. // //TODO handle the exception
  9425. // }
  9426. // post类型对象参数转为get类型url参数
  9427. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  9428. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get, post: _request.default.post,
  9429. put: _request.default.put,
  9430. 'delete': _request.default.delete,
  9431. hexToRgb: _colorGradient.default.hexToRgb,
  9432. rgbToHex: _colorGradient.default.rgbToHex,
  9433. test: _test.default,
  9434. random: _random.default,
  9435. deepClone: _deepClone.default,
  9436. deepMerge: _deepMerge.default,
  9437. getParent: _getParent.default,
  9438. $parent: _$parent.default,
  9439. addUnit: _addUnit.default,
  9440. trim: _trim.default,
  9441. type: ['primary', 'success', 'error', 'warning', 'info'],
  9442. http: _request.default,
  9443. toast: _toast.default,
  9444. config: _config.default, // uView配置信息相关,比如版本号
  9445. zIndex: _zIndex.default,
  9446. debounce: _debounce.default,
  9447. throttle: _throttle.default };
  9448. var install = function install(Vue) {
  9449. Vue.mixin(_mixin.default);
  9450. if (Vue.prototype.openShare) {
  9451. Vue.mixin(mpShare);
  9452. }
  9453. // Vue.mixin(vuexStore);
  9454. // 时间格式化,同时两个名称,date和timeFormat
  9455. Vue.filter('timeFormat', function (timestamp, format) {
  9456. return (0, _timeFormat.default)(timestamp, format);
  9457. });
  9458. Vue.filter('date', function (timestamp, format) {
  9459. return (0, _timeFormat.default)(timestamp, format);
  9460. });
  9461. // 将多久以前的方法,注入到全局过滤器
  9462. Vue.filter('timeFrom', function (timestamp, format) {
  9463. return (0, _timeFrom.default)(timestamp, format);
  9464. });
  9465. Vue.prototype.$u = $u;
  9466. };var _default =
  9467. {
  9468. install: install };exports.default = _default;
  9469. /***/ }),
  9470. /***/ 21:
  9471. /*!*****************************************************************!*\
  9472. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/mixin/mixin.js ***!
  9473. \*****************************************************************/
  9474. /*! no static exports found */
  9475. /***/ (function(module, exports, __webpack_require__) {
  9476. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  9477. data: function data() {
  9478. return {};
  9479. },
  9480. onLoad: function onLoad() {
  9481. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  9482. this.$u.getRect = this.$uGetRect;
  9483. },
  9484. methods: {
  9485. // 查询节点信息
  9486. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  9487. // 解决办法为在组件根部再套一个没有任何作用的view元素
  9488. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  9489. return new Promise(function (resolve) {
  9490. uni.createSelectorQuery().
  9491. in(_this)[all ? 'selectAll' : 'select'](selector).
  9492. boundingClientRect(function (rect) {
  9493. if (all && Array.isArray(rect) && rect.length) {
  9494. resolve(rect);
  9495. }
  9496. if (!all && rect) {
  9497. resolve(rect);
  9498. }
  9499. }).
  9500. exec();
  9501. });
  9502. },
  9503. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  9504. // 避免在created中去定义parent变量
  9505. if (!this.parent) this.parent = false;
  9506. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  9507. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  9508. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  9509. this.parent = this.$u.$parent.call(this, parentName);
  9510. if (this.parent) {
  9511. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  9512. Object.keys(this.parentData).map(function (key) {
  9513. _this2.parentData[key] = _this2.parent[key];
  9514. });
  9515. }
  9516. } },
  9517. onReachBottom: function onReachBottom() {
  9518. uni.$emit('uOnReachBottom');
  9519. } };
  9520. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9521. /***/ }),
  9522. /***/ 22:
  9523. /*!*******************************************************************!*\
  9524. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/request/index.js ***!
  9525. \*******************************************************************/
  9526. /*! no static exports found */
  9527. /***/ (function(module, exports, __webpack_require__) {
  9528. "use strict";
  9529. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 23));
  9530. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 25));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  9531. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  9532. // 设置全局默认配置
  9533. value: function setConfig(customConfig) {
  9534. // 深度合并对象,否则会造成对象深层属性丢失
  9535. this.config = (0, _deepMerge.default)(this.config, customConfig);
  9536. }
  9537. // 主要请求部分
  9538. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9539. // 检查请求拦截
  9540. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  9541. var tmpConfig = {};
  9542. var interceptorRequest = this.interceptor.request(options);
  9543. if (interceptorRequest === false) {
  9544. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  9545. return new Promise(function () {});
  9546. }
  9547. this.options = interceptorRequest;
  9548. }
  9549. options.dataType = options.dataType || this.config.dataType;
  9550. options.responseType = options.responseType || this.config.responseType;
  9551. options.url = options.url || '';
  9552. options.params = options.params || {};
  9553. options.header = Object.assign(this.config.header, options.header);
  9554. options.method = options.method || this.config.method;
  9555. return new Promise(function (resolve, reject) {
  9556. options.complete = function (response) {
  9557. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  9558. uni.hideLoading();
  9559. // 清除定时器,如果请求回来了,就无需loading
  9560. clearTimeout(_this.config.timer);
  9561. _this.config.timer = null;
  9562. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  9563. if (_this.config.originalData) {
  9564. // 判断是否存在拦截器
  9565. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  9566. var resInterceptors = _this.interceptor.response(response);
  9567. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  9568. if (resInterceptors !== false) {
  9569. resolve(resInterceptors);
  9570. } else {
  9571. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  9572. reject(response);
  9573. }
  9574. } else {
  9575. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  9576. resolve(response);
  9577. }
  9578. } else {
  9579. if (response.statusCode == 200) {
  9580. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  9581. var _resInterceptors = _this.interceptor.response(response.data);
  9582. if (_resInterceptors !== false) {
  9583. resolve(_resInterceptors);
  9584. } else {
  9585. reject(response.data);
  9586. }
  9587. } else {
  9588. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  9589. resolve(response.data);
  9590. }
  9591. } else {
  9592. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  9593. // if(response.errMsg) {
  9594. // uni.showModal({
  9595. // title: response.errMsg
  9596. // });
  9597. // }
  9598. reject(response);
  9599. }
  9600. }
  9601. };
  9602. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  9603. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  9604. options.url : '/' + options.url);
  9605. // 是否显示loading
  9606. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  9607. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  9608. if (_this.config.showLoading && !_this.config.timer) {
  9609. _this.config.timer = setTimeout(function () {
  9610. uni.showLoading({
  9611. title: _this.config.loadingText,
  9612. mask: _this.config.loadingMask });
  9613. _this.config.timer = null;
  9614. }, _this.config.loadingTime);
  9615. }
  9616. uni.request(options);
  9617. });
  9618. // .catch(res => {
  9619. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  9620. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  9621. // return new Promise(()=>{});
  9622. // })
  9623. } }]);
  9624. function Request() {var _this2 = this;_classCallCheck(this, Request);
  9625. this.config = {
  9626. baseUrl: '', // 请求的根域名
  9627. // 默认的请求头
  9628. header: {},
  9629. method: 'POST',
  9630. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  9631. dataType: 'json',
  9632. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  9633. responseType: 'text',
  9634. showLoading: true, // 是否显示请求中的loading
  9635. loadingText: '请求中...',
  9636. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  9637. timer: null, // 定时器
  9638. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  9639. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  9640. };
  9641. // 拦截器
  9642. this.interceptor = {
  9643. // 请求前的拦截
  9644. request: null,
  9645. // 请求后的拦截
  9646. response: null };
  9647. // get请求
  9648. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9649. return _this2.request({
  9650. method: 'GET',
  9651. url: url,
  9652. header: header,
  9653. data: data });
  9654. };
  9655. // post请求
  9656. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9657. return _this2.request({
  9658. url: url,
  9659. method: 'POST',
  9660. header: header,
  9661. data: data });
  9662. };
  9663. // put请求,不支持支付宝小程序(HX2.6.15)
  9664. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9665. return _this2.request({
  9666. url: url,
  9667. method: 'PUT',
  9668. header: header,
  9669. data: data });
  9670. };
  9671. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  9672. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9673. return _this2.request({
  9674. url: url,
  9675. method: 'DELETE',
  9676. header: header,
  9677. data: data });
  9678. };
  9679. }return Request;}();var _default =
  9680. new Request();exports.default = _default;
  9681. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9682. /***/ }),
  9683. /***/ 23:
  9684. /*!************************************************************************!*\
  9685. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/deepMerge.js ***!
  9686. \************************************************************************/
  9687. /*! no static exports found */
  9688. /***/ (function(module, exports, __webpack_require__) {
  9689. "use strict";
  9690. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 24));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9691. // JS对象深度合并
  9692. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9693. target = (0, _deepClone.default)(target);
  9694. if (typeof target !== 'object' || typeof source !== 'object') return false;
  9695. for (var prop in source) {
  9696. if (!source.hasOwnProperty(prop)) continue;
  9697. if (prop in target) {
  9698. if (typeof target[prop] !== 'object') {
  9699. target[prop] = source[prop];
  9700. } else {
  9701. if (typeof source[prop] !== 'object') {
  9702. target[prop] = source[prop];
  9703. } else {
  9704. if (target[prop].concat && source[prop].concat) {
  9705. target[prop] = target[prop].concat(source[prop]);
  9706. } else {
  9707. target[prop] = deepMerge(target[prop], source[prop]);
  9708. }
  9709. }
  9710. }
  9711. } else {
  9712. target[prop] = source[prop];
  9713. }
  9714. }
  9715. return target;
  9716. }var _default =
  9717. deepMerge;exports.default = _default;
  9718. /***/ }),
  9719. /***/ 24:
  9720. /*!************************************************************************!*\
  9721. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/deepClone.js ***!
  9722. \************************************************************************/
  9723. /*! no static exports found */
  9724. /***/ (function(module, exports, __webpack_require__) {
  9725. "use strict";
  9726. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  9727. function isArray(arr) {
  9728. return Object.prototype.toString.call(arr) === '[object Array]';
  9729. }
  9730. // 深度克隆
  9731. function deepClone(obj) {
  9732. // 对常见的“非”值,直接返回原来值
  9733. if ([null, undefined, NaN, false].includes(obj)) return obj;
  9734. if (typeof obj !== "object" && typeof obj !== 'function') {
  9735. //原始类型直接返回
  9736. return obj;
  9737. }
  9738. var o = isArray(obj) ? [] : {};
  9739. for (var i in obj) {
  9740. if (obj.hasOwnProperty(i)) {
  9741. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  9742. }
  9743. }
  9744. return o;
  9745. }var _default =
  9746. deepClone;exports.default = _default;
  9747. /***/ }),
  9748. /***/ 25:
  9749. /*!*******************************************************************!*\
  9750. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/test.js ***!
  9751. \*******************************************************************/
  9752. /*! no static exports found */
  9753. /***/ (function(module, exports, __webpack_require__) {
  9754. "use strict";
  9755. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9756. * 验证电子邮箱格式
  9757. */
  9758. function email(value) {
  9759. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  9760. }
  9761. /**
  9762. * 验证手机格式
  9763. */
  9764. function mobile(value) {
  9765. return /^1[23456789]\d{9}$/.test(value);
  9766. }
  9767. /**
  9768. * 验证URL格式
  9769. */
  9770. function url(value) {
  9771. return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.
  9772. test(value);
  9773. }
  9774. /**
  9775. * 验证日期格式
  9776. */
  9777. function date(value) {
  9778. return !/Invalid|NaN/.test(new Date(value).toString());
  9779. }
  9780. /**
  9781. * 验证ISO类型的日期格式
  9782. */
  9783. function dateISO(value) {
  9784. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  9785. }
  9786. /**
  9787. * 验证十进制数字
  9788. */
  9789. function number(value) {
  9790. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  9791. }
  9792. /**
  9793. * 验证整数
  9794. */
  9795. function digits(value) {
  9796. return /^\d+$/.test(value);
  9797. }
  9798. /**
  9799. * 验证身份证号码
  9800. */
  9801. function idCard(value) {
  9802. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  9803. value);
  9804. }
  9805. /**
  9806. * 是否车牌号
  9807. */
  9808. function carNo(value) {
  9809. // 新能源车牌
  9810. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  9811. // 旧车牌
  9812. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  9813. if (value.length === 7) {
  9814. return creg.test(value);
  9815. } else if (value.length === 8) {
  9816. return xreg.test(value);
  9817. } else {
  9818. return false;
  9819. }
  9820. }
  9821. /**
  9822. * 金额,只允许2位小数
  9823. */
  9824. function amount(value) {
  9825. //金额,只允许保留两位小数
  9826. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  9827. }
  9828. /**
  9829. * 中文
  9830. */
  9831. function chinese(value) {
  9832. var reg = /^[\u4e00-\u9fa5]+$/gi;
  9833. return reg.test(value);
  9834. }
  9835. /**
  9836. * 只能输入字母
  9837. */
  9838. function letter(value) {
  9839. return /^[a-zA-Z]*$/.test(value);
  9840. }
  9841. /**
  9842. * 只能是字母或者数字
  9843. */
  9844. function enOrNum(value) {
  9845. //英文或者数字
  9846. var reg = /^[0-9a-zA-Z]*$/g;
  9847. return reg.test(value);
  9848. }
  9849. /**
  9850. * 验证是否包含某个值
  9851. */
  9852. function contains(value, param) {
  9853. return value.indexOf(param) >= 0;
  9854. }
  9855. /**
  9856. * 验证一个值范围[min, max]
  9857. */
  9858. function range(value, param) {
  9859. return value >= param[0] && value <= param[1];
  9860. }
  9861. /**
  9862. * 验证一个长度范围[min, max]
  9863. */
  9864. function rangeLength(value, param) {
  9865. return value.length >= param[0] && value.length <= param[1];
  9866. }
  9867. /**
  9868. * 是否固定电话
  9869. */
  9870. function landline(value) {
  9871. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  9872. return reg.test(value);
  9873. }
  9874. /**
  9875. * 判断是否为空
  9876. */
  9877. function empty(value) {
  9878. switch (typeof value) {
  9879. case 'undefined':
  9880. return true;
  9881. case 'string':
  9882. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  9883. break;
  9884. case 'boolean':
  9885. if (!value) return true;
  9886. break;
  9887. case 'number':
  9888. if (0 === value || isNaN(value)) return true;
  9889. break;
  9890. case 'object':
  9891. if (null === value || value.length === 0) return true;
  9892. for (var i in value) {
  9893. return false;
  9894. }
  9895. return true;}
  9896. return false;
  9897. }
  9898. /**
  9899. * 是否json字符串
  9900. */
  9901. function jsonString(value) {
  9902. if (typeof value == 'string') {
  9903. try {
  9904. var obj = JSON.parse(value);
  9905. if (typeof obj == 'object' && obj) {
  9906. return true;
  9907. } else {
  9908. return false;
  9909. }
  9910. } catch (e) {
  9911. return false;
  9912. }
  9913. }
  9914. return false;
  9915. }
  9916. /**
  9917. * 是否数组
  9918. */
  9919. function array(value) {
  9920. if (typeof Array.isArray === "function") {
  9921. return Array.isArray(value);
  9922. } else {
  9923. return Object.prototype.toString.call(value) === "[object Array]";
  9924. }
  9925. }
  9926. /**
  9927. * 是否对象
  9928. */
  9929. function object(value) {
  9930. return Object.prototype.toString.call(value) === '[object Object]';
  9931. }
  9932. /**
  9933. * 是否短信验证码
  9934. */
  9935. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  9936. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  9937. }var _default =
  9938. {
  9939. email: email,
  9940. mobile: mobile,
  9941. url: url,
  9942. date: date,
  9943. dateISO: dateISO,
  9944. number: number,
  9945. digits: digits,
  9946. idCard: idCard,
  9947. carNo: carNo,
  9948. amount: amount,
  9949. chinese: chinese,
  9950. letter: letter,
  9951. enOrNum: enOrNum,
  9952. contains: contains,
  9953. range: range,
  9954. rangeLength: rangeLength,
  9955. empty: empty,
  9956. isEmpty: empty,
  9957. jsonString: jsonString,
  9958. landline: landline,
  9959. object: object,
  9960. array: array,
  9961. code: code };exports.default = _default;
  9962. /***/ }),
  9963. /***/ 26:
  9964. /*!**************************************************************************!*\
  9965. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/queryParams.js ***!
  9966. \**************************************************************************/
  9967. /*! no static exports found */
  9968. /***/ (function(module, exports, __webpack_require__) {
  9969. "use strict";
  9970. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9971. * 对象转url参数
  9972. * @param {*} data,对象
  9973. * @param {*} isPrefix,是否自动加上"?"
  9974. */
  9975. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  9976. var prefix = isPrefix ? '?' : '';
  9977. var _result = [];
  9978. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  9979. key) {
  9980. var value = data[key];
  9981. // 去掉为空的参数
  9982. if (['', undefined, null].indexOf(value) >= 0) {
  9983. return "continue";
  9984. }
  9985. // 如果值为数组,另行处理
  9986. if (value.constructor === Array) {
  9987. // e.g. {ids: [1, 2, 3]}
  9988. switch (arrayFormat) {
  9989. case 'indices':
  9990. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  9991. for (var i = 0; i < value.length; i++) {
  9992. _result.push(key + '[' + i + ']=' + value[i]);
  9993. }
  9994. break;
  9995. case 'brackets':
  9996. // 结果: ids[]=1&ids[]=2&ids[]=3
  9997. value.forEach(function (_value) {
  9998. _result.push(key + '[]=' + _value);
  9999. });
  10000. break;
  10001. case 'repeat':
  10002. // 结果: ids=1&ids=2&ids=3
  10003. value.forEach(function (_value) {
  10004. _result.push(key + '=' + _value);
  10005. });
  10006. break;
  10007. case 'comma':
  10008. // 结果: ids=1,2,3
  10009. var commaStr = "";
  10010. value.forEach(function (_value) {
  10011. commaStr += (commaStr ? "," : "") + _value;
  10012. });
  10013. _result.push(key + '=' + commaStr);
  10014. break;
  10015. default:
  10016. value.forEach(function (_value) {
  10017. _result.push(key + '[]=' + _value);
  10018. });}
  10019. } else {
  10020. _result.push(key + '=' + value);
  10021. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  10022. }
  10023. return _result.length ? prefix + _result.join('&') : '';
  10024. }var _default =
  10025. queryParams;exports.default = _default;
  10026. /***/ }),
  10027. /***/ 27:
  10028. /*!********************************************************************!*\
  10029. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/route.js ***!
  10030. \********************************************************************/
  10031. /*! no static exports found */
  10032. /***/ (function(module, exports, __webpack_require__) {
  10033. "use strict";
  10034. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _queryParams = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/queryParams.js */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10035. /**
  10036. * 路由跳转
  10037. * 注意:本方法没有对跳转的回调函数进行封装
  10038. */
  10039. function route() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  10040. var config = {
  10041. type: 'navigateTo',
  10042. url: '',
  10043. delta: 1, // navigateBack页面后退时,回退的层数
  10044. params: {}, // 传递的参数
  10045. animationType: 'pop-in', // 窗口动画,只在APP有效
  10046. animationDuration: 300 // 窗口动画持续时间,单位毫秒,只在APP有效
  10047. };
  10048. config = Object.assign(config, options);
  10049. // 如果url没有"/"开头,添加上,因为uni的路由跳转需要"/"开头
  10050. if (config.url[0] != '/') config.url = '/' + config.url;
  10051. // 判断是否有传递显式的参数,Object.keys转为数组并判断长度,switchTab类型时不能携带参数
  10052. if (Object.keys(config.params).length && config.type != 'switchTab') {
  10053. // 判断用户传递的url中,是否带有参数
  10054. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  10055. // 如果有url中有get参数,转换后无需带上"?"
  10056. var query = '';
  10057. if (/.*\/.*\?.*=.*/.test(config.url)) {
  10058. // object对象转为get类型的参数
  10059. query = (0, _queryParams.default)(config.params, false);
  10060. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10061. config.url += "&" + query;
  10062. } else {
  10063. query = (0, _queryParams.default)(config.params);
  10064. config.url += query;
  10065. }
  10066. }
  10067. // 简写形式,把url和参数拼接起来
  10068. if (typeof options === 'string' && typeof params == 'object') {
  10069. var _query = '';
  10070. if (/.*\/.*\?.*=.*/.test(options)) {
  10071. // object对象转为get类型的参数
  10072. _query = (0, _queryParams.default)(params, false);
  10073. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10074. options += "&" + _query;
  10075. } else {
  10076. _query = (0, _queryParams.default)(params);
  10077. options += _query;
  10078. }
  10079. }
  10080. // 判断是否一个字符串,如果是,直接跳转(简写法)
  10081. // 如果是中情形,默认第二个参数为对象形式的参数
  10082. if (typeof options === 'string') {
  10083. if (options[0] != '/') options = '/' + options;
  10084. return uni.navigateTo({
  10085. url: options });
  10086. }
  10087. // navigateTo类型的跳转
  10088. if (config.type == 'navigateTo' || config.type == 'to') {
  10089. return uni.navigateTo({
  10090. url: config.url,
  10091. animationType: config.animationType,
  10092. animationDuration: config.animationDuration });
  10093. }
  10094. if (config.type == 'redirectTo' || config.type == 'redirect') {
  10095. return uni.redirectTo({
  10096. url: config.url });
  10097. }
  10098. if (config.type == 'switchTab' || config.type == 'tab') {
  10099. return uni.switchTab({
  10100. url: config.url });
  10101. }
  10102. if (config.type == 'reLaunch') {
  10103. return uni.reLaunch({
  10104. url: config.url });
  10105. }
  10106. if (config.type == 'navigateBack' || config.type == 'back') {
  10107. return uni.navigateBack({
  10108. delta: parseInt(config.delta ? config.delta : this.delta) });
  10109. }
  10110. }var _default =
  10111. route;exports.default = _default;
  10112. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10113. /***/ }),
  10114. /***/ 28:
  10115. /*!*************************************************************************!*\
  10116. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/timeFormat.js ***!
  10117. \*************************************************************************/
  10118. /*! no static exports found */
  10119. /***/ (function(module, exports, __webpack_require__) {
  10120. "use strict";
  10121. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  10122. // 所以这里做一个兼容polyfill的兼容处理
  10123. if (!String.prototype.padStart) {
  10124. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  10125. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  10126. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  10127. 'fillString must be String');
  10128. var str = this;
  10129. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  10130. if (str.length >= maxLength) return String(str);
  10131. var fillLength = maxLength - str.length,
  10132. times = Math.ceil(fillLength / fillString.length);
  10133. while (times >>= 1) {
  10134. fillString += fillString;
  10135. if (times === 1) {
  10136. fillString += fillString;
  10137. }
  10138. }
  10139. return fillString.slice(0, fillLength) + str;
  10140. };
  10141. }
  10142. function timeFormat() {var timestamp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  10143. // 其他更多是格式化有如下:
  10144. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  10145. timestamp = parseInt(timestamp);
  10146. // 如果为null,则格式化当前时间
  10147. if (!timestamp) timestamp = Number(new Date());
  10148. // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
  10149. if (timestamp.toString().length == 10) timestamp *= 1000;
  10150. var date = new Date(timestamp);
  10151. var ret;
  10152. var opt = {
  10153. "y+": date.getFullYear().toString(), // 年
  10154. "m+": (date.getMonth() + 1).toString(), // 月
  10155. "d+": date.getDate().toString(), // 日
  10156. "h+": date.getHours().toString(), // 时
  10157. "M+": date.getMinutes().toString(), // 分
  10158. "s+": date.getSeconds().toString() // 秒
  10159. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  10160. };
  10161. for (var k in opt) {
  10162. ret = new RegExp("(" + k + ")").exec(fmt);
  10163. if (ret) {
  10164. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  10165. };
  10166. };
  10167. return fmt;
  10168. }var _default =
  10169. timeFormat;exports.default = _default;
  10170. /***/ }),
  10171. /***/ 29:
  10172. /*!***********************************************************************!*\
  10173. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/timeFrom.js ***!
  10174. \***********************************************************************/
  10175. /*! no static exports found */
  10176. /***/ (function(module, exports, __webpack_require__) {
  10177. "use strict";
  10178. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 28));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10179. /**
  10180. * 时间戳转为多久之前
  10181. * @param String timestamp 时间戳
  10182. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  10183. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  10184. */
  10185. function timeFrom() {var timestamp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  10186. if (timestamp == null) timestamp = Number(new Date());
  10187. timestamp = parseInt(timestamp);
  10188. // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
  10189. if (timestamp.toString().length == 10) timestamp *= 1000;
  10190. var timer = new Date().getTime() - timestamp;
  10191. timer = parseInt(timer / 1000);
  10192. // 如果小于5分钟,则返回"刚刚",其他以此类推
  10193. var tips = '';
  10194. switch (true) {
  10195. case timer < 300:
  10196. tips = '刚刚';
  10197. break;
  10198. case timer >= 300 && timer < 3600:
  10199. tips = parseInt(timer / 60) + '分钟前';
  10200. break;
  10201. case timer >= 3600 && timer < 86400:
  10202. tips = parseInt(timer / 3600) + '小时前';
  10203. break;
  10204. case timer >= 86400 && timer < 2592000:
  10205. tips = parseInt(timer / 86400) + '天前';
  10206. break;
  10207. default:
  10208. // 如果format为false,则无论什么时间戳,都显示xx之前
  10209. if (format === false) {
  10210. if (timer >= 2592000 && timer < 365 * 86400) {
  10211. tips = parseInt(timer / (86400 * 30)) + '个月前';
  10212. } else {
  10213. tips = parseInt(timer / (86400 * 365)) + '年前';
  10214. }
  10215. } else {
  10216. tips = (0, _timeFormat.default)(timestamp, format);
  10217. }}
  10218. return tips;
  10219. }var _default =
  10220. timeFrom;exports.default = _default;
  10221. /***/ }),
  10222. /***/ 3:
  10223. /*!***********************************!*\
  10224. !*** (webpack)/buildin/global.js ***!
  10225. \***********************************/
  10226. /*! no static exports found */
  10227. /***/ (function(module, exports) {
  10228. var g;
  10229. // This works in non-strict mode
  10230. g = (function() {
  10231. return this;
  10232. })();
  10233. try {
  10234. // This works if eval is allowed (see CSP)
  10235. g = g || new Function("return this")();
  10236. } catch (e) {
  10237. // This works if the window reference is available
  10238. if (typeof window === "object") g = window;
  10239. }
  10240. // g can still be undefined, but nothing to do about it...
  10241. // We return undefined, instead of nothing here, so it's
  10242. // easier to handle this case. if(!global) { ...}
  10243. module.exports = g;
  10244. /***/ }),
  10245. /***/ 30:
  10246. /*!****************************************************************************!*\
  10247. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/colorGradient.js ***!
  10248. \****************************************************************************/
  10249. /*! no static exports found */
  10250. /***/ (function(module, exports, __webpack_require__) {
  10251. "use strict";
  10252. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10253. * 求两个颜色之间的渐变值
  10254. * @param {string} startColor 开始的颜色
  10255. * @param {string} endColor 结束的颜色
  10256. * @param {number} step 颜色等分的份额
  10257. * */
  10258. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  10259. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  10260. var startR = startRGB[0];
  10261. var startG = startRGB[1];
  10262. var startB = startRGB[2];
  10263. var endRGB = hexToRgb(endColor, false);
  10264. var endR = endRGB[0];
  10265. var endG = endRGB[1];
  10266. var endB = endRGB[2];
  10267. var sR = (endR - startR) / step; //总差值
  10268. var sG = (endG - startG) / step;
  10269. var sB = (endB - startB) / step;
  10270. var colorArr = [];
  10271. for (var i = 0; i < step; i++) {
  10272. //计算每一步的hex值
  10273. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  10274. i + startB) + ')');
  10275. colorArr.push(hex);
  10276. }
  10277. return colorArr;
  10278. }
  10279. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  10280. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  10281. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  10282. sColor = sColor.toLowerCase();
  10283. if (sColor && reg.test(sColor)) {
  10284. if (sColor.length === 4) {
  10285. var sColorNew = "#";
  10286. for (var i = 1; i < 4; i += 1) {
  10287. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  10288. }
  10289. sColor = sColorNew;
  10290. }
  10291. //处理六位的颜色值
  10292. var sColorChange = [];
  10293. for (var _i = 1; _i < 7; _i += 2) {
  10294. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  10295. }
  10296. if (!str) {
  10297. return sColorChange;
  10298. } else {
  10299. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  10300. }
  10301. } else if (/^(rgb|RGB)/.test(sColor)) {
  10302. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  10303. return arr.map(function (val) {return Number(val);});
  10304. } else {
  10305. return sColor;
  10306. }
  10307. };
  10308. // 将rgb表示方式转换为hex表示方式
  10309. function rgbToHex(rgb) {
  10310. var _this = rgb;
  10311. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  10312. if (/^(rgb|RGB)/.test(_this)) {
  10313. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  10314. var strHex = "#";
  10315. for (var i = 0; i < aColor.length; i++) {
  10316. var hex = Number(aColor[i]).toString(16);
  10317. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  10318. if (hex === "0") {
  10319. hex += hex;
  10320. }
  10321. strHex += hex;
  10322. }
  10323. if (strHex.length !== 7) {
  10324. strHex = _this;
  10325. }
  10326. return strHex;
  10327. } else if (reg.test(_this)) {
  10328. var aNum = _this.replace(/#/, "").split("");
  10329. if (aNum.length === 6) {
  10330. return _this;
  10331. } else if (aNum.length === 3) {
  10332. var numHex = "#";
  10333. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  10334. numHex += aNum[_i2] + aNum[_i2];
  10335. }
  10336. return numHex;
  10337. }
  10338. } else {
  10339. return _this;
  10340. }
  10341. }var _default =
  10342. {
  10343. colorGradient: colorGradient,
  10344. hexToRgb: hexToRgb,
  10345. rgbToHex: rgbToHex };exports.default = _default;
  10346. /***/ }),
  10347. /***/ 300:
  10348. /*!******************************************************************!*\
  10349. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/util/emitter.js ***!
  10350. \******************************************************************/
  10351. /*! no static exports found */
  10352. /***/ (function(module, exports, __webpack_require__) {
  10353. "use strict";
  10354. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10355. * 递归使用 call 方式this指向
  10356. * @param componentName // 需要找的组件的名称
  10357. * @param eventName // 事件名称
  10358. * @param params // 需要传递的参数
  10359. */
  10360. function _broadcast(componentName, eventName, params) {
  10361. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  10362. this.$children.map(function (child) {
  10363. if (componentName === child.$options.name) {
  10364. child.$emit.apply(child, [eventName].concat(params));
  10365. } else {
  10366. _broadcast.apply(child, [componentName, eventName].concat(params));
  10367. }
  10368. });
  10369. }var _default =
  10370. {
  10371. methods: {
  10372. /**
  10373. * 派发 (向上查找) (一个)
  10374. * @param componentName // 需要找的组件的名称
  10375. * @param eventName // 事件名称
  10376. * @param params // 需要传递的参数
  10377. */
  10378. dispatch: function dispatch(componentName, eventName, params) {
  10379. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  10380. var name = parent.$options.name; // 获取当前组件实例的name
  10381. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  10382. // 循环出当前名称的一样的组件实例
  10383. while (parent && (!name || name !== componentName)) {
  10384. parent = parent.$parent;
  10385. if (parent) {
  10386. name = parent.$options.name;
  10387. }
  10388. }
  10389. // 有节点表示当前找到了name一样的实例
  10390. if (parent) {
  10391. parent.$emit.apply(parent, [eventName].concat(params));
  10392. }
  10393. },
  10394. /**
  10395. * 广播 (向下查找) (广播多个)
  10396. * @param componentName // 需要找的组件的名称
  10397. * @param eventName // 事件名称
  10398. * @param params // 需要传递的参数
  10399. */
  10400. broadcast: function broadcast(componentName, eventName, params) {
  10401. _broadcast.call(this, componentName, eventName, params);
  10402. } } };exports.default = _default;
  10403. /***/ }),
  10404. /***/ 31:
  10405. /*!*******************************************************************!*\
  10406. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/guid.js ***!
  10407. \*******************************************************************/
  10408. /*! no static exports found */
  10409. /***/ (function(module, exports, __webpack_require__) {
  10410. "use strict";
  10411. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10412. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  10413. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  10414. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  10415. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  10416. * v-for的时候,推荐使用后端返回的id而不是循环的index
  10417. * @param {Number} len uuid的长度
  10418. * @param {Boolean} firstU 将返回的首字母置为"u"
  10419. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  10420. */
  10421. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  10422. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  10423. var uuid = [];
  10424. radix = radix || chars.length;
  10425. if (len) {
  10426. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  10427. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  10428. } else {
  10429. var r;
  10430. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  10431. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  10432. uuid[14] = '4';
  10433. for (var _i = 0; _i < 36; _i++) {
  10434. if (!uuid[_i]) {
  10435. r = 0 | Math.random() * 16;
  10436. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  10437. }
  10438. }
  10439. }
  10440. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  10441. if (firstU) {
  10442. uuid.shift();
  10443. return 'u' + uuid.join('');
  10444. } else {
  10445. return uuid.join('');
  10446. }
  10447. }var _default =
  10448. guid;exports.default = _default;
  10449. /***/ }),
  10450. /***/ 32:
  10451. /*!********************************************************************!*\
  10452. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/color.js ***!
  10453. \********************************************************************/
  10454. /*! no static exports found */
  10455. /***/ (function(module, exports, __webpack_require__) {
  10456. "use strict";
  10457. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  10458. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  10459. var color = {
  10460. primary: "#2979ff",
  10461. primaryDark: "#2b85e4",
  10462. primaryDisabled: "#a0cfff",
  10463. primaryLight: "#ecf5ff",
  10464. bgColor: "#f3f4f6",
  10465. info: "#909399",
  10466. infoDark: "#82848a",
  10467. infoDisabled: "#c8c9cc",
  10468. infoLight: "#f4f4f5",
  10469. warning: "#ff9900",
  10470. warningDark: "#f29100",
  10471. warningDisabled: "#fcbd71",
  10472. warningLight: "#fdf6ec",
  10473. error: "#fa3534",
  10474. errorDark: "#dd6161",
  10475. errorDisabled: "#fab6b6",
  10476. errorLight: "#fef0f0",
  10477. success: "#19be6b",
  10478. successDark: "#18b566",
  10479. successDisabled: "#71d5a1",
  10480. successLight: "#dbf1e1",
  10481. mainColor: "#303133",
  10482. contentColor: "#606266",
  10483. tipsColor: "#909399",
  10484. lightColor: "#c0c4cc",
  10485. borderColor: "#e4e7ed" };var _default =
  10486. color;exports.default = _default;
  10487. /***/ }),
  10488. /***/ 33:
  10489. /*!************************************************************************!*\
  10490. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/type2icon.js ***!
  10491. \************************************************************************/
  10492. /*! no static exports found */
  10493. /***/ (function(module, exports, __webpack_require__) {
  10494. "use strict";
  10495. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10496. * 根据主题type值,获取对应的图标
  10497. * @param String type 主题名称,primary|info|error|warning|success
  10498. * @param String fill 是否使用fill填充实体的图标
  10499. */
  10500. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  10501. // 如果非预置值,默认为success
  10502. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  10503. var iconName = '';
  10504. // 目前(2019-12-12),info和primary使用同一个图标
  10505. switch (type) {
  10506. case 'primary':
  10507. iconName = 'info-circle';
  10508. break;
  10509. case 'info':
  10510. iconName = 'info-circle';
  10511. break;
  10512. case 'error':
  10513. iconName = 'close-circle';
  10514. break;
  10515. case 'warning':
  10516. iconName = 'error-circle';
  10517. break;
  10518. case 'success':
  10519. iconName = 'checkmark-circle';
  10520. break;
  10521. default:
  10522. iconName = 'checkmark-circle';}
  10523. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  10524. if (fill) iconName += '-fill';
  10525. return iconName;
  10526. }var _default =
  10527. type2icon;exports.default = _default;
  10528. /***/ }),
  10529. /***/ 34:
  10530. /*!**************************************************************************!*\
  10531. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/randomArray.js ***!
  10532. \**************************************************************************/
  10533. /*! no static exports found */
  10534. /***/ (function(module, exports, __webpack_require__) {
  10535. "use strict";
  10536. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  10537. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  10538. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  10539. return array.sort(function () {return Math.random() - 0.5;});
  10540. }var _default =
  10541. randomArray;exports.default = _default;
  10542. /***/ }),
  10543. /***/ 35:
  10544. /*!**********************************************************************!*\
  10545. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/addUnit.js ***!
  10546. \**********************************************************************/
  10547. /*! no static exports found */
  10548. /***/ (function(module, exports, __webpack_require__) {
  10549. "use strict";
  10550. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 25));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10551. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  10552. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  10553. value = String(value);
  10554. // 用uView内置验证规则中的number判断是否为数值
  10555. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  10556. }
  10557. /***/ }),
  10558. /***/ 36:
  10559. /*!*********************************************************************!*\
  10560. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/random.js ***!
  10561. \*********************************************************************/
  10562. /*! no static exports found */
  10563. /***/ (function(module, exports, __webpack_require__) {
  10564. "use strict";
  10565. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  10566. if (min >= 0 && max > 0 && max >= min) {
  10567. var gab = max - min + 1;
  10568. return Math.floor(Math.random() * gab + min);
  10569. } else {
  10570. return 0;
  10571. }
  10572. }var _default =
  10573. random;exports.default = _default;
  10574. /***/ }),
  10575. /***/ 364:
  10576. /*!******************************************************************!*\
  10577. !*** E:/.swdz/uni-app/baoma/mabao/components/uni-icons/icons.js ***!
  10578. \******************************************************************/
  10579. /*! no static exports found */
  10580. /***/ (function(module, exports, __webpack_require__) {
  10581. "use strict";
  10582. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10583. "pulldown": "\uE588",
  10584. "refreshempty": "\uE461",
  10585. "back": "\uE471",
  10586. "forward": "\uE470",
  10587. "more": "\uE507",
  10588. "more-filled": "\uE537",
  10589. "scan": "\uE612",
  10590. "qq": "\uE264",
  10591. "weibo": "\uE260",
  10592. "weixin": "\uE261",
  10593. "pengyouquan": "\uE262",
  10594. "loop": "\uE565",
  10595. "refresh": "\uE407",
  10596. "refresh-filled": "\uE437",
  10597. "arrowthindown": "\uE585",
  10598. "arrowthinleft": "\uE586",
  10599. "arrowthinright": "\uE587",
  10600. "arrowthinup": "\uE584",
  10601. "undo-filled": "\uE7D6",
  10602. "undo": "\uE406",
  10603. "redo": "\uE405",
  10604. "redo-filled": "\uE7D9",
  10605. "bars": "\uE563",
  10606. "chatboxes": "\uE203",
  10607. "camera": "\uE301",
  10608. "chatboxes-filled": "\uE233",
  10609. "camera-filled": "\uE7EF",
  10610. "cart-filled": "\uE7F4",
  10611. "cart": "\uE7F5",
  10612. "checkbox-filled": "\uE442",
  10613. "checkbox": "\uE7FA",
  10614. "arrowleft": "\uE582",
  10615. "arrowdown": "\uE581",
  10616. "arrowright": "\uE583",
  10617. "smallcircle-filled": "\uE801",
  10618. "arrowup": "\uE580",
  10619. "circle": "\uE411",
  10620. "eye-filled": "\uE568",
  10621. "eye-slash-filled": "\uE822",
  10622. "eye-slash": "\uE823",
  10623. "eye": "\uE824",
  10624. "flag-filled": "\uE825",
  10625. "flag": "\uE508",
  10626. "gear-filled": "\uE532",
  10627. "reload": "\uE462",
  10628. "gear": "\uE502",
  10629. "hand-thumbsdown-filled": "\uE83B",
  10630. "hand-thumbsdown": "\uE83C",
  10631. "hand-thumbsup-filled": "\uE83D",
  10632. "heart-filled": "\uE83E",
  10633. "hand-thumbsup": "\uE83F",
  10634. "heart": "\uE840",
  10635. "home": "\uE500",
  10636. "info": "\uE504",
  10637. "home-filled": "\uE530",
  10638. "info-filled": "\uE534",
  10639. "circle-filled": "\uE441",
  10640. "chat-filled": "\uE847",
  10641. "chat": "\uE263",
  10642. "mail-open-filled": "\uE84D",
  10643. "email-filled": "\uE231",
  10644. "mail-open": "\uE84E",
  10645. "email": "\uE201",
  10646. "checkmarkempty": "\uE472",
  10647. "list": "\uE562",
  10648. "locked-filled": "\uE856",
  10649. "locked": "\uE506",
  10650. "map-filled": "\uE85C",
  10651. "map-pin": "\uE85E",
  10652. "map-pin-ellipse": "\uE864",
  10653. "map": "\uE364",
  10654. "minus-filled": "\uE440",
  10655. "mic-filled": "\uE332",
  10656. "minus": "\uE410",
  10657. "micoff": "\uE360",
  10658. "mic": "\uE302",
  10659. "clear": "\uE434",
  10660. "smallcircle": "\uE868",
  10661. "close": "\uE404",
  10662. "closeempty": "\uE460",
  10663. "paperclip": "\uE567",
  10664. "paperplane": "\uE503",
  10665. "paperplane-filled": "\uE86E",
  10666. "person-filled": "\uE131",
  10667. "contact-filled": "\uE130",
  10668. "person": "\uE101",
  10669. "contact": "\uE100",
  10670. "images-filled": "\uE87A",
  10671. "phone": "\uE200",
  10672. "images": "\uE87B",
  10673. "image": "\uE363",
  10674. "image-filled": "\uE877",
  10675. "location-filled": "\uE333",
  10676. "location": "\uE303",
  10677. "plus-filled": "\uE439",
  10678. "plus": "\uE409",
  10679. "plusempty": "\uE468",
  10680. "help-filled": "\uE535",
  10681. "help": "\uE505",
  10682. "navigate-filled": "\uE884",
  10683. "navigate": "\uE501",
  10684. "mic-slash-filled": "\uE892",
  10685. "search": "\uE466",
  10686. "settings": "\uE560",
  10687. "sound": "\uE590",
  10688. "sound-filled": "\uE8A1",
  10689. "spinner-cycle": "\uE465",
  10690. "download-filled": "\uE8A4",
  10691. "personadd-filled": "\uE132",
  10692. "videocam-filled": "\uE8AF",
  10693. "personadd": "\uE102",
  10694. "upload": "\uE402",
  10695. "upload-filled": "\uE8B1",
  10696. "starhalf": "\uE463",
  10697. "star-filled": "\uE438",
  10698. "star": "\uE408",
  10699. "trash": "\uE401",
  10700. "phone-filled": "\uE230",
  10701. "compose": "\uE400",
  10702. "videocam": "\uE300",
  10703. "trash-filled": "\uE8DC",
  10704. "download": "\uE403",
  10705. "chatbubble-filled": "\uE232",
  10706. "chatbubble": "\uE202",
  10707. "cloud-download": "\uE8E4",
  10708. "cloud-upload-filled": "\uE8E5",
  10709. "cloud-upload": "\uE8E6",
  10710. "cloud-download-filled": "\uE8E9",
  10711. "headphones": "\uE8BF",
  10712. "shop": "\uE609" };exports.default = _default;
  10713. /***/ }),
  10714. /***/ 37:
  10715. /*!*******************************************************************!*\
  10716. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/trim.js ***!
  10717. \*******************************************************************/
  10718. /*! no static exports found */
  10719. /***/ (function(module, exports, __webpack_require__) {
  10720. "use strict";
  10721. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  10722. if (pos == 'both') {
  10723. return str.replace(/^\s+|\s+$/g, "");
  10724. } else if (pos == "left") {
  10725. return str.replace(/^\s*/, '');
  10726. } else if (pos == 'right') {
  10727. return str.replace(/(\s*$)/g, "");
  10728. } else if (pos == 'all') {
  10729. return str.replace(/\s+/g, "");
  10730. } else {
  10731. return str;
  10732. }
  10733. }var _default =
  10734. trim;exports.default = _default;
  10735. /***/ }),
  10736. /***/ 38:
  10737. /*!********************************************************************!*\
  10738. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/toast.js ***!
  10739. \********************************************************************/
  10740. /*! no static exports found */
  10741. /***/ (function(module, exports, __webpack_require__) {
  10742. "use strict";
  10743. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  10744. uni.showToast({
  10745. title: title,
  10746. icon: 'none',
  10747. duration: duration });
  10748. }var _default =
  10749. toast;exports.default = _default;
  10750. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10751. /***/ }),
  10752. /***/ 39:
  10753. /*!************************************************************************!*\
  10754. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/getParent.js ***!
  10755. \************************************************************************/
  10756. /*! no static exports found */
  10757. /***/ (function(module, exports, __webpack_require__) {
  10758. "use strict";
  10759. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  10760. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  10761. function getParent(name, keys) {
  10762. var parent = this.$parent;
  10763. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  10764. while (parent) {
  10765. // 父组件
  10766. if (parent.$options.name !== name) {
  10767. // 如果组件的name不相等,继续上一级寻找
  10768. parent = parent.$parent;
  10769. } else {var _ret = function () {
  10770. var data = {};
  10771. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  10772. if (Array.isArray(keys)) {
  10773. keys.map(function (val) {
  10774. data[val] = parent[val] ? parent[val] : '';
  10775. });
  10776. } else {
  10777. // 历遍传过来的对象参数
  10778. for (var i in keys) {
  10779. // 如果子组件有此值则用,无此值则用父组件的值
  10780. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  10781. if (Array.isArray(keys[i])) {
  10782. if (keys[i].length) {
  10783. data[i] = keys[i];
  10784. } else {
  10785. data[i] = parent[i];
  10786. }
  10787. } else if (keys[i].constructor === Object) {
  10788. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  10789. if (Object.keys(keys[i]).length) {
  10790. data[i] = keys[i];
  10791. } else {
  10792. data[i] = parent[i];
  10793. }
  10794. } else {
  10795. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  10796. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  10797. }
  10798. }
  10799. }
  10800. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  10801. }
  10802. }
  10803. return {};
  10804. }
  10805. /***/ }),
  10806. /***/ 4:
  10807. /*!***********************************************!*\
  10808. !*** E:/.swdz/uni-app/baoma/mabao/pages.json ***!
  10809. \***********************************************/
  10810. /*! no static exports found */
  10811. /***/ (function(module, exports) {
  10812. /***/ }),
  10813. /***/ 40:
  10814. /*!**********************************************************************!*\
  10815. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/$parent.js ***!
  10816. \**********************************************************************/
  10817. /*! no static exports found */
  10818. /***/ (function(module, exports, __webpack_require__) {
  10819. "use strict";
  10820. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  10821. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  10822. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  10823. // 值(默认为undefined),就是查找最顶层的$parent
  10824. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  10825. var parent = this.$parent;
  10826. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  10827. while (parent) {
  10828. // 父组件
  10829. if (parent.$options && parent.$options.name !== name) {
  10830. // 如果组件的name不相等,继续上一级寻找
  10831. parent = parent.$parent;
  10832. } else {
  10833. return parent;
  10834. }
  10835. }
  10836. return false;
  10837. }
  10838. /***/ }),
  10839. /***/ 41:
  10840. /*!******************************************************************!*\
  10841. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/sys.js ***!
  10842. \******************************************************************/
  10843. /*! no static exports found */
  10844. /***/ (function(module, exports, __webpack_require__) {
  10845. "use strict";
  10846. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  10847. return uni.getSystemInfoSync().platform;
  10848. };
  10849. function sys() {
  10850. return uni.getSystemInfoSync();
  10851. }
  10852. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10853. /***/ }),
  10854. /***/ 42:
  10855. /*!***********************************************************************!*\
  10856. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/debounce.js ***!
  10857. \***********************************************************************/
  10858. /*! no static exports found */
  10859. /***/ (function(module, exports, __webpack_require__) {
  10860. "use strict";
  10861. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  10862. /**
  10863. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  10864. *
  10865. * @param {Function} func 要执行的回调函数
  10866. * @param {Number} wait 延时的时间
  10867. * @param {Boolean} immediate 是否立即执行
  10868. * @return null
  10869. */
  10870. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  10871. // 清除定时器
  10872. if (timeout !== null) clearTimeout(timeout);
  10873. // 立即执行,此类情况一般用不到
  10874. if (immediate) {
  10875. var callNow = !timeout;
  10876. timeout = setTimeout(function () {
  10877. timeout = null;
  10878. }, wait);
  10879. if (callNow) typeof func === 'function' && func();
  10880. } else {
  10881. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  10882. timeout = setTimeout(function () {
  10883. typeof func === 'function' && func();
  10884. }, wait);
  10885. }
  10886. }var _default =
  10887. debounce;exports.default = _default;
  10888. /***/ }),
  10889. /***/ 43:
  10890. /*!***********************************************************************!*\
  10891. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/throttle.js ***!
  10892. \***********************************************************************/
  10893. /*! no static exports found */
  10894. /***/ (function(module, exports, __webpack_require__) {
  10895. "use strict";
  10896. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  10897. /**
  10898. * 节流原理:在一定时间内,只能触发一次
  10899. *
  10900. * @param {Function} func 要执行的回调函数
  10901. * @param {Number} wait 延时的时间
  10902. * @param {Boolean} immediate 是否立即执行
  10903. * @return null
  10904. */
  10905. function throttle(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10906. if (immediate) {
  10907. if (!flag) {
  10908. flag = true;
  10909. // 如果是立即执行,则在wait毫秒内开始时执行
  10910. typeof func === 'function' && func();
  10911. timer = setTimeout(function () {
  10912. flag = false;
  10913. }, wait);
  10914. }
  10915. } else {
  10916. if (!flag) {
  10917. flag = true;
  10918. // 如果是非立即执行,则在wait毫秒内的结束处执行
  10919. timer = setTimeout(function () {
  10920. flag = false;
  10921. typeof func === 'function' && func();
  10922. }, wait);
  10923. }
  10924. }
  10925. };var _default =
  10926. throttle;exports.default = _default;
  10927. /***/ }),
  10928. /***/ 44:
  10929. /*!*******************************************************************!*\
  10930. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/config/config.js ***!
  10931. \*******************************************************************/
  10932. /*! no static exports found */
  10933. /***/ (function(module, exports, __webpack_require__) {
  10934. "use strict";
  10935. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-09-22
  10936. var version = '1.7.3';var _default =
  10937. {
  10938. v: version,
  10939. version: version,
  10940. // 主题名称
  10941. type: [
  10942. 'primary',
  10943. 'success',
  10944. 'info',
  10945. 'error',
  10946. 'warning'] };exports.default = _default;
  10947. /***/ }),
  10948. /***/ 45:
  10949. /*!*******************************************************************!*\
  10950. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/config/zIndex.js ***!
  10951. \*******************************************************************/
  10952. /*! no static exports found */
  10953. /***/ (function(module, exports, __webpack_require__) {
  10954. "use strict";
  10955. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  10956. /**
  10957. * actionsheet: 999
  10958. * modal: 999
  10959. * navigate: 998
  10960. * tabbar: 998
  10961. * toast: 999
  10962. */var _default =
  10963. {
  10964. toast: 10090,
  10965. noNetwork: 10080,
  10966. // popup包含popup,actionsheet,keyboard,picker的值
  10967. popup: 10075,
  10968. mask: 10070,
  10969. navbar: 980,
  10970. topTips: 975,
  10971. sticky: 970,
  10972. indexListSticky: 965 };exports.default = _default;
  10973. /***/ })
  10974. }]);
  10975. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map