vendor.js 310 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. var HOOKS = [
  107. 'invoke',
  108. 'success',
  109. 'fail',
  110. 'complete',
  111. 'returnValue'];
  112. var globalInterceptors = {};
  113. var scopedInterceptors = {};
  114. function mergeHook(parentVal, childVal) {
  115. var res = childVal ?
  116. parentVal ?
  117. parentVal.concat(childVal) :
  118. Array.isArray(childVal) ?
  119. childVal : [childVal] :
  120. parentVal;
  121. return res ?
  122. dedupeHooks(res) :
  123. res;
  124. }
  125. function dedupeHooks(hooks) {
  126. var res = [];
  127. for (var i = 0; i < hooks.length; i++) {
  128. if (res.indexOf(hooks[i]) === -1) {
  129. res.push(hooks[i]);
  130. }
  131. }
  132. return res;
  133. }
  134. function removeHook(hooks, hook) {
  135. var index = hooks.indexOf(hook);
  136. if (index !== -1) {
  137. hooks.splice(index, 1);
  138. }
  139. }
  140. function mergeInterceptorHook(interceptor, option) {
  141. Object.keys(option).forEach(function (hook) {
  142. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  143. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  144. }
  145. });
  146. }
  147. function removeInterceptorHook(interceptor, option) {
  148. if (!interceptor || !option) {
  149. return;
  150. }
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. removeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function addInterceptor(method, option) {
  158. if (typeof method === 'string' && isPlainObject(option)) {
  159. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  160. } else if (isPlainObject(method)) {
  161. mergeInterceptorHook(globalInterceptors, method);
  162. }
  163. }
  164. function removeInterceptor(method, option) {
  165. if (typeof method === 'string') {
  166. if (isPlainObject(option)) {
  167. removeInterceptorHook(scopedInterceptors[method], option);
  168. } else {
  169. delete scopedInterceptors[method];
  170. }
  171. } else if (isPlainObject(method)) {
  172. removeInterceptorHook(globalInterceptors, method);
  173. }
  174. }
  175. function wrapperHook(hook) {
  176. return function (data) {
  177. return hook(data) || data;
  178. };
  179. }
  180. function isPromise(obj) {
  181. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  182. }
  183. function queue(hooks, data) {
  184. var promise = false;
  185. for (var i = 0; i < hooks.length; i++) {
  186. var hook = hooks[i];
  187. if (promise) {
  188. promise = Promise.resolve(wrapperHook(hook));
  189. } else {
  190. var res = hook(data);
  191. if (isPromise(res)) {
  192. promise = Promise.resolve(res);
  193. }
  194. if (res === false) {
  195. return {
  196. then: function then() {} };
  197. }
  198. }
  199. }
  200. return promise || {
  201. then: function then(callback) {
  202. return callback(data);
  203. } };
  204. }
  205. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  206. ['success', 'fail', 'complete'].forEach(function (name) {
  207. if (Array.isArray(interceptor[name])) {
  208. var oldCallback = options[name];
  209. options[name] = function callbackInterceptor(res) {
  210. queue(interceptor[name], res).then(function (res) {
  211. /* eslint-disable no-mixed-operators */
  212. return isFn(oldCallback) && oldCallback(res) || res;
  213. });
  214. };
  215. }
  216. });
  217. return options;
  218. }
  219. function wrapperReturnValue(method, returnValue) {
  220. var returnValueHooks = [];
  221. if (Array.isArray(globalInterceptors.returnValue)) {
  222. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  223. }
  224. var interceptor = scopedInterceptors[method];
  225. if (interceptor && Array.isArray(interceptor.returnValue)) {
  226. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  227. }
  228. returnValueHooks.forEach(function (hook) {
  229. returnValue = hook(returnValue) || returnValue;
  230. });
  231. return returnValue;
  232. }
  233. function getApiInterceptorHooks(method) {
  234. var interceptor = Object.create(null);
  235. Object.keys(globalInterceptors).forEach(function (hook) {
  236. if (hook !== 'returnValue') {
  237. interceptor[hook] = globalInterceptors[hook].slice();
  238. }
  239. });
  240. var scopedInterceptor = scopedInterceptors[method];
  241. if (scopedInterceptor) {
  242. Object.keys(scopedInterceptor).forEach(function (hook) {
  243. if (hook !== 'returnValue') {
  244. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  245. }
  246. });
  247. }
  248. return interceptor;
  249. }
  250. 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];}
  251. var interceptor = getApiInterceptorHooks(method);
  252. if (interceptor && Object.keys(interceptor).length) {
  253. if (Array.isArray(interceptor.invoke)) {
  254. var res = queue(interceptor.invoke, options);
  255. return res.then(function (options) {
  256. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  257. });
  258. } else {
  259. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  260. }
  261. }
  262. return api.apply(void 0, [options].concat(params));
  263. }
  264. var promiseInterceptor = {
  265. returnValue: function returnValue(res) {
  266. if (!isPromise(res)) {
  267. return res;
  268. }
  269. return new Promise(function (resolve, reject) {
  270. res.then(function (res) {
  271. if (res[0]) {
  272. reject(res[0]);
  273. } else {
  274. resolve(res[1]);
  275. }
  276. });
  277. });
  278. } };
  279. var SYNC_API_RE =
  280. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  281. var CONTEXT_API_RE = /^create|Manager$/;
  282. // Context例外情况
  283. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  284. // 同步例外情况
  285. var ASYNC_API = ['createBLEConnection'];
  286. var CALLBACK_API_RE = /^on|^off/;
  287. function isContextApi(name) {
  288. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  289. }
  290. function isSyncApi(name) {
  291. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  292. }
  293. function isCallbackApi(name) {
  294. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  295. }
  296. function handlePromise(promise) {
  297. return promise.then(function (data) {
  298. return [null, data];
  299. }).
  300. catch(function (err) {return [err];});
  301. }
  302. function shouldPromise(name) {
  303. if (
  304. isContextApi(name) ||
  305. isSyncApi(name) ||
  306. isCallbackApi(name))
  307. {
  308. return false;
  309. }
  310. return true;
  311. }
  312. /* eslint-disable no-extend-native */
  313. if (!Promise.prototype.finally) {
  314. Promise.prototype.finally = function (callback) {
  315. var promise = this.constructor;
  316. return this.then(
  317. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  318. function (reason) {return promise.resolve(callback()).then(function () {
  319. throw reason;
  320. });});
  321. };
  322. }
  323. function promisify(name, api) {
  324. if (!shouldPromise(name)) {
  325. return api;
  326. }
  327. 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];}
  328. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  329. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  330. }
  331. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  332. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  333. success: resolve,
  334. fail: reject })].concat(
  335. params));
  336. })));
  337. };
  338. }
  339. var EPS = 1e-4;
  340. var BASE_DEVICE_WIDTH = 750;
  341. var isIOS = false;
  342. var deviceWidth = 0;
  343. var deviceDPR = 0;
  344. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  345. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  346. deviceWidth = windowWidth;
  347. deviceDPR = pixelRatio;
  348. isIOS = platform === 'ios';
  349. }
  350. function upx2px(number, newDeviceWidth) {
  351. if (deviceWidth === 0) {
  352. checkDeviceWidth();
  353. }
  354. number = Number(number);
  355. if (number === 0) {
  356. return 0;
  357. }
  358. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  359. if (result < 0) {
  360. result = -result;
  361. }
  362. result = Math.floor(result + EPS);
  363. if (result === 0) {
  364. if (deviceDPR === 1 || !isIOS) {
  365. result = 1;
  366. } else {
  367. result = 0.5;
  368. }
  369. }
  370. return number < 0 ? -result : result;
  371. }
  372. function getLocale() {
  373. // 优先使用 $locale
  374. var app = getApp({
  375. allowDefault: true });
  376. if (app && app.$vm) {
  377. return app.$vm.$locale;
  378. }
  379. return wx.getSystemInfoSync().language || 'zh-Hans';
  380. }
  381. function setLocale(locale) {
  382. var app = getApp();
  383. if (!app) {
  384. return false;
  385. }
  386. var oldLocale = app.$vm.$locale;
  387. if (oldLocale !== locale) {
  388. app.$vm.$locale = locale;
  389. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  390. locale: locale });});
  391. return true;
  392. }
  393. return false;
  394. }
  395. var onLocaleChangeCallbacks = [];
  396. function onLocaleChange(fn) {
  397. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  398. onLocaleChangeCallbacks.push(fn);
  399. }
  400. }
  401. if (typeof global !== 'undefined') {
  402. global.getLocale = getLocale;
  403. }
  404. var interceptors = {
  405. promiseInterceptor: promiseInterceptor };
  406. var baseApi = /*#__PURE__*/Object.freeze({
  407. __proto__: null,
  408. upx2px: upx2px,
  409. getLocale: getLocale,
  410. setLocale: setLocale,
  411. onLocaleChange: onLocaleChange,
  412. addInterceptor: addInterceptor,
  413. removeInterceptor: removeInterceptor,
  414. interceptors: interceptors });
  415. function findExistsPageIndex(url) {
  416. var pages = getCurrentPages();
  417. var len = pages.length;
  418. while (len--) {
  419. var page = pages[len];
  420. if (page.$page && page.$page.fullPath === url) {
  421. return len;
  422. }
  423. }
  424. return -1;
  425. }
  426. var redirectTo = {
  427. name: function name(fromArgs) {
  428. if (fromArgs.exists === 'back' && fromArgs.delta) {
  429. return 'navigateBack';
  430. }
  431. return 'redirectTo';
  432. },
  433. args: function args(fromArgs) {
  434. if (fromArgs.exists === 'back' && fromArgs.url) {
  435. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  436. if (existsPageIndex !== -1) {
  437. var delta = getCurrentPages().length - 1 - existsPageIndex;
  438. if (delta > 0) {
  439. fromArgs.delta = delta;
  440. }
  441. }
  442. }
  443. } };
  444. var previewImage = {
  445. args: function args(fromArgs) {
  446. var currentIndex = parseInt(fromArgs.current);
  447. if (isNaN(currentIndex)) {
  448. return;
  449. }
  450. var urls = fromArgs.urls;
  451. if (!Array.isArray(urls)) {
  452. return;
  453. }
  454. var len = urls.length;
  455. if (!len) {
  456. return;
  457. }
  458. if (currentIndex < 0) {
  459. currentIndex = 0;
  460. } else if (currentIndex >= len) {
  461. currentIndex = len - 1;
  462. }
  463. if (currentIndex > 0) {
  464. fromArgs.current = urls[currentIndex];
  465. fromArgs.urls = urls.filter(
  466. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  467. } else {
  468. fromArgs.current = urls[0];
  469. }
  470. return {
  471. indicator: false,
  472. loop: false };
  473. } };
  474. var UUID_KEY = '__DC_STAT_UUID';
  475. var deviceId;
  476. function addUuid(result) {
  477. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  478. if (!deviceId) {
  479. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  480. wx.setStorage({
  481. key: UUID_KEY,
  482. data: deviceId });
  483. }
  484. result.deviceId = deviceId;
  485. }
  486. function addSafeAreaInsets(result) {
  487. if (result.safeArea) {
  488. var safeArea = result.safeArea;
  489. result.safeAreaInsets = {
  490. top: safeArea.top,
  491. left: safeArea.left,
  492. right: result.windowWidth - safeArea.right,
  493. bottom: result.windowHeight - safeArea.bottom };
  494. }
  495. }
  496. var getSystemInfo = {
  497. returnValue: function returnValue(result) {
  498. addUuid(result);
  499. addSafeAreaInsets(result);
  500. } };
  501. // import navigateTo from 'uni-helpers/navigate-to'
  502. var protocols = {
  503. redirectTo: redirectTo,
  504. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  505. previewImage: previewImage,
  506. getSystemInfo: getSystemInfo,
  507. getSystemInfoSync: getSystemInfo };
  508. var todos = [
  509. 'vibrate',
  510. 'preloadPage',
  511. 'unPreloadPage',
  512. 'loadSubPackage'];
  513. var canIUses = [];
  514. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  515. function processCallback(methodName, method, returnValue) {
  516. return function (res) {
  517. return method(processReturnValue(methodName, res, returnValue));
  518. };
  519. }
  520. 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;
  521. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  522. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  523. if (isFn(argsOption)) {
  524. argsOption = argsOption(fromArgs, toArgs) || {};
  525. }
  526. for (var key in fromArgs) {
  527. if (hasOwn(argsOption, key)) {
  528. var keyOption = argsOption[key];
  529. if (isFn(keyOption)) {
  530. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  531. }
  532. if (!keyOption) {// 不支持的参数
  533. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  534. } else if (isStr(keyOption)) {// 重写参数 key
  535. toArgs[keyOption] = fromArgs[key];
  536. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  537. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  538. }
  539. } else if (CALLBACKS.indexOf(key) !== -1) {
  540. if (isFn(fromArgs[key])) {
  541. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  542. }
  543. } else {
  544. if (!keepFromArgs) {
  545. toArgs[key] = fromArgs[key];
  546. }
  547. }
  548. }
  549. return toArgs;
  550. } else if (isFn(fromArgs)) {
  551. fromArgs = processCallback(methodName, fromArgs, returnValue);
  552. }
  553. return fromArgs;
  554. }
  555. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  556. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  557. res = protocols.returnValue(methodName, res);
  558. }
  559. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  560. }
  561. function wrapper(methodName, method) {
  562. if (hasOwn(protocols, methodName)) {
  563. var protocol = protocols[methodName];
  564. if (!protocol) {// 暂不支持的 api
  565. return function () {
  566. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  567. };
  568. }
  569. return function (arg1, arg2) {// 目前 api 最多两个参数
  570. var options = protocol;
  571. if (isFn(protocol)) {
  572. options = protocol(arg1);
  573. }
  574. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  575. var args = [arg1];
  576. if (typeof arg2 !== 'undefined') {
  577. args.push(arg2);
  578. }
  579. if (isFn(options.name)) {
  580. methodName = options.name(arg1);
  581. } else if (isStr(options.name)) {
  582. methodName = options.name;
  583. }
  584. var returnValue = wx[methodName].apply(wx, args);
  585. if (isSyncApi(methodName)) {// 同步 api
  586. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  587. }
  588. return returnValue;
  589. };
  590. }
  591. return method;
  592. }
  593. var todoApis = Object.create(null);
  594. var TODOS = [
  595. 'onTabBarMidButtonTap',
  596. 'subscribePush',
  597. 'unsubscribePush',
  598. 'onPush',
  599. 'offPush',
  600. 'share'];
  601. function createTodoApi(name) {
  602. return function todoApi(_ref)
  603. {var fail = _ref.fail,complete = _ref.complete;
  604. var res = {
  605. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  606. isFn(fail) && fail(res);
  607. isFn(complete) && complete(res);
  608. };
  609. }
  610. TODOS.forEach(function (name) {
  611. todoApis[name] = createTodoApi(name);
  612. });
  613. var providers = {
  614. oauth: ['weixin'],
  615. share: ['weixin'],
  616. payment: ['wxpay'],
  617. push: ['weixin'] };
  618. function getProvider(_ref2)
  619. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  620. var res = false;
  621. if (providers[service]) {
  622. res = {
  623. errMsg: 'getProvider:ok',
  624. service: service,
  625. provider: providers[service] };
  626. isFn(success) && success(res);
  627. } else {
  628. res = {
  629. errMsg: 'getProvider:fail service not found' };
  630. isFn(fail) && fail(res);
  631. }
  632. isFn(complete) && complete(res);
  633. }
  634. var extraApi = /*#__PURE__*/Object.freeze({
  635. __proto__: null,
  636. getProvider: getProvider });
  637. var getEmitter = function () {
  638. var Emitter;
  639. return function getUniEmitter() {
  640. if (!Emitter) {
  641. Emitter = new _vue.default();
  642. }
  643. return Emitter;
  644. };
  645. }();
  646. function apply(ctx, method, args) {
  647. return ctx[method].apply(ctx, args);
  648. }
  649. function $on() {
  650. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  651. }
  652. function $off() {
  653. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  654. }
  655. function $once() {
  656. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  657. }
  658. function $emit() {
  659. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  660. }
  661. var eventApi = /*#__PURE__*/Object.freeze({
  662. __proto__: null,
  663. $on: $on,
  664. $off: $off,
  665. $once: $once,
  666. $emit: $emit });
  667. var api = /*#__PURE__*/Object.freeze({
  668. __proto__: null });
  669. var MPPage = Page;
  670. var MPComponent = Component;
  671. var customizeRE = /:/g;
  672. var customize = cached(function (str) {
  673. return camelize(str.replace(customizeRE, '-'));
  674. });
  675. function initTriggerEvent(mpInstance) {
  676. var oldTriggerEvent = mpInstance.triggerEvent;
  677. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  678. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  679. };
  680. }
  681. function initHook(name, options, isComponent) {
  682. var oldHook = options[name];
  683. if (!oldHook) {
  684. options[name] = function () {
  685. initTriggerEvent(this);
  686. };
  687. } else {
  688. options[name] = function () {
  689. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  690. return oldHook.apply(this, args);
  691. };
  692. }
  693. }
  694. if (!MPPage.__$wrappered) {
  695. MPPage.__$wrappered = true;
  696. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  697. initHook('onLoad', options);
  698. return MPPage(options);
  699. };
  700. Page.after = MPPage.after;
  701. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  702. initHook('created', options);
  703. return MPComponent(options);
  704. };
  705. }
  706. var PAGE_EVENT_HOOKS = [
  707. 'onPullDownRefresh',
  708. 'onReachBottom',
  709. 'onAddToFavorites',
  710. 'onShareTimeline',
  711. 'onShareAppMessage',
  712. 'onPageScroll',
  713. 'onResize',
  714. 'onTabItemTap'];
  715. function initMocks(vm, mocks) {
  716. var mpInstance = vm.$mp[vm.mpType];
  717. mocks.forEach(function (mock) {
  718. if (hasOwn(mpInstance, mock)) {
  719. vm[mock] = mpInstance[mock];
  720. }
  721. });
  722. }
  723. function hasHook(hook, vueOptions) {
  724. if (!vueOptions) {
  725. return true;
  726. }
  727. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  728. return true;
  729. }
  730. vueOptions = vueOptions.default || vueOptions;
  731. if (isFn(vueOptions)) {
  732. if (isFn(vueOptions.extendOptions[hook])) {
  733. return true;
  734. }
  735. if (vueOptions.super &&
  736. vueOptions.super.options &&
  737. Array.isArray(vueOptions.super.options[hook])) {
  738. return true;
  739. }
  740. return false;
  741. }
  742. if (isFn(vueOptions[hook])) {
  743. return true;
  744. }
  745. var mixins = vueOptions.mixins;
  746. if (Array.isArray(mixins)) {
  747. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  748. }
  749. }
  750. function initHooks(mpOptions, hooks, vueOptions) {
  751. hooks.forEach(function (hook) {
  752. if (hasHook(hook, vueOptions)) {
  753. mpOptions[hook] = function (args) {
  754. return this.$vm && this.$vm.__call_hook(hook, args);
  755. };
  756. }
  757. });
  758. }
  759. function initVueComponent(Vue, vueOptions) {
  760. vueOptions = vueOptions.default || vueOptions;
  761. var VueComponent;
  762. if (isFn(vueOptions)) {
  763. VueComponent = vueOptions;
  764. } else {
  765. VueComponent = Vue.extend(vueOptions);
  766. }
  767. vueOptions = VueComponent.options;
  768. return [VueComponent, vueOptions];
  769. }
  770. function initSlots(vm, vueSlots) {
  771. if (Array.isArray(vueSlots) && vueSlots.length) {
  772. var $slots = Object.create(null);
  773. vueSlots.forEach(function (slotName) {
  774. $slots[slotName] = true;
  775. });
  776. vm.$scopedSlots = vm.$slots = $slots;
  777. }
  778. }
  779. function initVueIds(vueIds, mpInstance) {
  780. vueIds = (vueIds || '').split(',');
  781. var len = vueIds.length;
  782. if (len === 1) {
  783. mpInstance._$vueId = vueIds[0];
  784. } else if (len === 2) {
  785. mpInstance._$vueId = vueIds[0];
  786. mpInstance._$vuePid = vueIds[1];
  787. }
  788. }
  789. function initData(vueOptions, context) {
  790. var data = vueOptions.data || {};
  791. var methods = vueOptions.methods || {};
  792. if (typeof data === 'function') {
  793. try {
  794. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  795. } catch (e) {
  796. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  797. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  798. }
  799. }
  800. } else {
  801. try {
  802. // 对 data 格式化
  803. data = JSON.parse(JSON.stringify(data));
  804. } catch (e) {}
  805. }
  806. if (!isPlainObject(data)) {
  807. data = {};
  808. }
  809. Object.keys(methods).forEach(function (methodName) {
  810. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  811. data[methodName] = methods[methodName];
  812. }
  813. });
  814. return data;
  815. }
  816. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  817. function createObserver(name) {
  818. return function observer(newVal, oldVal) {
  819. if (this.$vm) {
  820. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  821. }
  822. };
  823. }
  824. function initBehaviors(vueOptions, initBehavior) {
  825. var vueBehaviors = vueOptions.behaviors;
  826. var vueExtends = vueOptions.extends;
  827. var vueMixins = vueOptions.mixins;
  828. var vueProps = vueOptions.props;
  829. if (!vueProps) {
  830. vueOptions.props = vueProps = [];
  831. }
  832. var behaviors = [];
  833. if (Array.isArray(vueBehaviors)) {
  834. vueBehaviors.forEach(function (behavior) {
  835. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  836. if (behavior === 'uni://form-field') {
  837. if (Array.isArray(vueProps)) {
  838. vueProps.push('name');
  839. vueProps.push('value');
  840. } else {
  841. vueProps.name = {
  842. type: String,
  843. default: '' };
  844. vueProps.value = {
  845. type: [String, Number, Boolean, Array, Object, Date],
  846. default: '' };
  847. }
  848. }
  849. });
  850. }
  851. if (isPlainObject(vueExtends) && vueExtends.props) {
  852. behaviors.push(
  853. initBehavior({
  854. properties: initProperties(vueExtends.props, true) }));
  855. }
  856. if (Array.isArray(vueMixins)) {
  857. vueMixins.forEach(function (vueMixin) {
  858. if (isPlainObject(vueMixin) && vueMixin.props) {
  859. behaviors.push(
  860. initBehavior({
  861. properties: initProperties(vueMixin.props, true) }));
  862. }
  863. });
  864. }
  865. return behaviors;
  866. }
  867. function parsePropType(key, type, defaultValue, file) {
  868. // [String]=>String
  869. if (Array.isArray(type) && type.length === 1) {
  870. return type[0];
  871. }
  872. return type;
  873. }
  874. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  875. var properties = {};
  876. if (!isBehavior) {
  877. properties.vueId = {
  878. type: String,
  879. value: '' };
  880. // 用于字节跳动小程序模拟抽象节点
  881. properties.generic = {
  882. type: Object,
  883. value: null };
  884. // scopedSlotsCompiler auto
  885. properties.scopedSlotsCompiler = {
  886. type: String,
  887. value: '' };
  888. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  889. type: null,
  890. value: [],
  891. observer: function observer(newVal, oldVal) {
  892. var $slots = Object.create(null);
  893. newVal.forEach(function (slotName) {
  894. $slots[slotName] = true;
  895. });
  896. this.setData({
  897. $slots: $slots });
  898. } };
  899. }
  900. if (Array.isArray(props)) {// ['title']
  901. props.forEach(function (key) {
  902. properties[key] = {
  903. type: null,
  904. observer: createObserver(key) };
  905. });
  906. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  907. Object.keys(props).forEach(function (key) {
  908. var opts = props[key];
  909. if (isPlainObject(opts)) {// title:{type:String,default:''}
  910. var value = opts.default;
  911. if (isFn(value)) {
  912. value = value();
  913. }
  914. opts.type = parsePropType(key, opts.type);
  915. properties[key] = {
  916. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  917. value: value,
  918. observer: createObserver(key) };
  919. } else {// content:String
  920. var type = parsePropType(key, opts);
  921. properties[key] = {
  922. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  923. observer: createObserver(key) };
  924. }
  925. });
  926. }
  927. return properties;
  928. }
  929. function wrapper$1(event) {
  930. // TODO 又得兼容 mpvue 的 mp 对象
  931. try {
  932. event.mp = JSON.parse(JSON.stringify(event));
  933. } catch (e) {}
  934. event.stopPropagation = noop;
  935. event.preventDefault = noop;
  936. event.target = event.target || {};
  937. if (!hasOwn(event, 'detail')) {
  938. event.detail = {};
  939. }
  940. if (hasOwn(event, 'markerId')) {
  941. event.detail = typeof event.detail === 'object' ? event.detail : {};
  942. event.detail.markerId = event.markerId;
  943. }
  944. if (isPlainObject(event.detail)) {
  945. event.target = Object.assign({}, event.target, event.detail);
  946. }
  947. return event;
  948. }
  949. function getExtraValue(vm, dataPathsArray) {
  950. var context = vm;
  951. dataPathsArray.forEach(function (dataPathArray) {
  952. var dataPath = dataPathArray[0];
  953. var value = dataPathArray[2];
  954. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  955. var propPath = dataPathArray[1];
  956. var valuePath = dataPathArray[3];
  957. var vFor;
  958. if (Number.isInteger(dataPath)) {
  959. vFor = dataPath;
  960. } else if (!dataPath) {
  961. vFor = context;
  962. } else if (typeof dataPath === 'string' && dataPath) {
  963. if (dataPath.indexOf('#s#') === 0) {
  964. vFor = dataPath.substr(3);
  965. } else {
  966. vFor = vm.__get_value(dataPath, context);
  967. }
  968. }
  969. if (Number.isInteger(vFor)) {
  970. context = value;
  971. } else if (!propPath) {
  972. context = vFor[value];
  973. } else {
  974. if (Array.isArray(vFor)) {
  975. context = vFor.find(function (vForItem) {
  976. return vm.__get_value(propPath, vForItem) === value;
  977. });
  978. } else if (isPlainObject(vFor)) {
  979. context = Object.keys(vFor).find(function (vForKey) {
  980. return vm.__get_value(propPath, vFor[vForKey]) === value;
  981. });
  982. } else {
  983. console.error('v-for 暂不支持循环数据:', vFor);
  984. }
  985. }
  986. if (valuePath) {
  987. context = vm.__get_value(valuePath, context);
  988. }
  989. }
  990. });
  991. return context;
  992. }
  993. function processEventExtra(vm, extra, event) {
  994. var extraObj = {};
  995. if (Array.isArray(extra) && extra.length) {
  996. /**
  997. *[
  998. * ['data.items', 'data.id', item.data.id],
  999. * ['metas', 'id', meta.id]
  1000. *],
  1001. *[
  1002. * ['data.items', 'data.id', item.data.id],
  1003. * ['metas', 'id', meta.id]
  1004. *],
  1005. *'test'
  1006. */
  1007. extra.forEach(function (dataPath, index) {
  1008. if (typeof dataPath === 'string') {
  1009. if (!dataPath) {// model,prop.sync
  1010. extraObj['$' + index] = vm;
  1011. } else {
  1012. if (dataPath === '$event') {// $event
  1013. extraObj['$' + index] = event;
  1014. } else if (dataPath === 'arguments') {
  1015. if (event.detail && event.detail.__args__) {
  1016. extraObj['$' + index] = event.detail.__args__;
  1017. } else {
  1018. extraObj['$' + index] = [event];
  1019. }
  1020. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1021. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1022. } else {
  1023. extraObj['$' + index] = vm.__get_value(dataPath);
  1024. }
  1025. }
  1026. } else {
  1027. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1028. }
  1029. });
  1030. }
  1031. return extraObj;
  1032. }
  1033. function getObjByArray(arr) {
  1034. var obj = {};
  1035. for (var i = 1; i < arr.length; i++) {
  1036. var element = arr[i];
  1037. obj[element[0]] = element[1];
  1038. }
  1039. return obj;
  1040. }
  1041. 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;
  1042. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1043. if (isCustom) {// 自定义事件
  1044. isCustomMPEvent = event.currentTarget &&
  1045. event.currentTarget.dataset &&
  1046. event.currentTarget.dataset.comType === 'wx';
  1047. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1048. if (isCustomMPEvent) {
  1049. return [event];
  1050. }
  1051. return event.detail.__args__ || event.detail;
  1052. }
  1053. }
  1054. var extraObj = processEventExtra(vm, extra, event);
  1055. var ret = [];
  1056. args.forEach(function (arg) {
  1057. if (arg === '$event') {
  1058. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1059. ret.push(event.target.value);
  1060. } else {
  1061. if (isCustom && !isCustomMPEvent) {
  1062. ret.push(event.detail.__args__[0]);
  1063. } else {// wxcomponent 组件或内置组件
  1064. ret.push(event);
  1065. }
  1066. }
  1067. } else {
  1068. if (Array.isArray(arg) && arg[0] === 'o') {
  1069. ret.push(getObjByArray(arg));
  1070. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1071. ret.push(extraObj[arg]);
  1072. } else {
  1073. ret.push(arg);
  1074. }
  1075. }
  1076. });
  1077. return ret;
  1078. }
  1079. var ONCE = '~';
  1080. var CUSTOM = '^';
  1081. function isMatchEventType(eventType, optType) {
  1082. return eventType === optType ||
  1083. optType === 'regionchange' && (
  1084. eventType === 'begin' ||
  1085. eventType === 'end');
  1086. }
  1087. function getContextVm(vm) {
  1088. var $parent = vm.$parent;
  1089. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1090. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1091. $parent = $parent.$parent;
  1092. }
  1093. return $parent && $parent.$parent;
  1094. }
  1095. function handleEvent(event) {var _this = this;
  1096. event = wrapper$1(event);
  1097. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1098. var dataset = (event.currentTarget || event.target).dataset;
  1099. if (!dataset) {
  1100. return console.warn('事件信息不存在');
  1101. }
  1102. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1103. if (!eventOpts) {
  1104. return console.warn('事件信息不存在');
  1105. }
  1106. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1107. var eventType = event.type;
  1108. var ret = [];
  1109. eventOpts.forEach(function (eventOpt) {
  1110. var type = eventOpt[0];
  1111. var eventsArray = eventOpt[1];
  1112. var isCustom = type.charAt(0) === CUSTOM;
  1113. type = isCustom ? type.slice(1) : type;
  1114. var isOnce = type.charAt(0) === ONCE;
  1115. type = isOnce ? type.slice(1) : type;
  1116. if (eventsArray && isMatchEventType(eventType, type)) {
  1117. eventsArray.forEach(function (eventArray) {
  1118. var methodName = eventArray[0];
  1119. if (methodName) {
  1120. var handlerCtx = _this.$vm;
  1121. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1122. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1123. }
  1124. if (methodName === '$emit') {
  1125. handlerCtx.$emit.apply(handlerCtx,
  1126. processEventArgs(
  1127. _this.$vm,
  1128. event,
  1129. eventArray[1],
  1130. eventArray[2],
  1131. isCustom,
  1132. methodName));
  1133. return;
  1134. }
  1135. var handler = handlerCtx[methodName];
  1136. if (!isFn(handler)) {
  1137. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1138. }
  1139. if (isOnce) {
  1140. if (handler.once) {
  1141. return;
  1142. }
  1143. handler.once = true;
  1144. }
  1145. var params = processEventArgs(
  1146. _this.$vm,
  1147. event,
  1148. eventArray[1],
  1149. eventArray[2],
  1150. isCustom,
  1151. methodName);
  1152. params = Array.isArray(params) ? params : [];
  1153. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1154. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1155. // eslint-disable-next-line no-sparse-arrays
  1156. params = params.concat([,,,,,,,,,, event]);
  1157. }
  1158. ret.push(handler.apply(handlerCtx, params));
  1159. }
  1160. });
  1161. }
  1162. });
  1163. if (
  1164. eventType === 'input' &&
  1165. ret.length === 1 &&
  1166. typeof ret[0] !== 'undefined')
  1167. {
  1168. return ret[0];
  1169. }
  1170. }
  1171. var locale;
  1172. {
  1173. locale = wx.getSystemInfoSync().language;
  1174. }
  1175. var i18n = (0, _uniI18n.initVueI18n)(
  1176. locale,
  1177. {});
  1178. var t = i18n.t;
  1179. var i18nMixin = i18n.mixin = {
  1180. beforeCreate: function beforeCreate() {var _this2 = this;
  1181. var unwatch = i18n.i18n.watchLocale(function () {
  1182. _this2.$forceUpdate();
  1183. });
  1184. this.$once('hook:beforeDestroy', function () {
  1185. unwatch();
  1186. });
  1187. },
  1188. methods: {
  1189. $$t: function $$t(key, values) {
  1190. return t(key, values);
  1191. } } };
  1192. var setLocale$1 = i18n.setLocale;
  1193. var getLocale$1 = i18n.getLocale;
  1194. function initAppLocale(Vue, appVm, locale) {
  1195. var state = Vue.observable({
  1196. locale: locale || i18n.getLocale() });
  1197. var localeWatchers = [];
  1198. appVm.$watchLocale = function (fn) {
  1199. localeWatchers.push(fn);
  1200. };
  1201. Object.defineProperty(appVm, '$locale', {
  1202. get: function get() {
  1203. return state.locale;
  1204. },
  1205. set: function set(v) {
  1206. state.locale = v;
  1207. localeWatchers.forEach(function (watch) {return watch(v);});
  1208. } });
  1209. }
  1210. var eventChannels = {};
  1211. var eventChannelStack = [];
  1212. function getEventChannel(id) {
  1213. if (id) {
  1214. var eventChannel = eventChannels[id];
  1215. delete eventChannels[id];
  1216. return eventChannel;
  1217. }
  1218. return eventChannelStack.shift();
  1219. }
  1220. var hooks = [
  1221. 'onShow',
  1222. 'onHide',
  1223. 'onError',
  1224. 'onPageNotFound',
  1225. 'onThemeChange',
  1226. 'onUnhandledRejection'];
  1227. function initEventChannel() {
  1228. _vue.default.prototype.getOpenerEventChannel = function () {
  1229. // 微信小程序使用自身getOpenerEventChannel
  1230. {
  1231. return this.$scope.getOpenerEventChannel();
  1232. }
  1233. };
  1234. var callHook = _vue.default.prototype.__call_hook;
  1235. _vue.default.prototype.__call_hook = function (hook, args) {
  1236. if (hook === 'onLoad' && args && args.__id__) {
  1237. this.__eventChannel__ = getEventChannel(args.__id__);
  1238. delete args.__id__;
  1239. }
  1240. return callHook.call(this, hook, args);
  1241. };
  1242. }
  1243. function initScopedSlotsParams() {
  1244. var center = {};
  1245. var parents = {};
  1246. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1247. var has = center[vueId];
  1248. if (!has) {
  1249. parents[vueId] = this;
  1250. this.$on('hook:destroyed', function () {
  1251. delete parents[vueId];
  1252. });
  1253. }
  1254. return has;
  1255. };
  1256. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1257. var data = center[vueId];
  1258. if (data) {
  1259. var object = data[name] || {};
  1260. return key ? object[key] : object;
  1261. } else {
  1262. parents[vueId] = this;
  1263. this.$on('hook:destroyed', function () {
  1264. delete parents[vueId];
  1265. });
  1266. }
  1267. };
  1268. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1269. var vueIds = this.$options.propsData.vueId;
  1270. if (vueIds) {
  1271. var vueId = vueIds.split(',')[0];
  1272. var object = center[vueId] = center[vueId] || {};
  1273. object[name] = value;
  1274. if (parents[vueId]) {
  1275. parents[vueId].$forceUpdate();
  1276. }
  1277. }
  1278. };
  1279. _vue.default.mixin({
  1280. destroyed: function destroyed() {
  1281. var propsData = this.$options.propsData;
  1282. var vueId = propsData && propsData.vueId;
  1283. if (vueId) {
  1284. delete center[vueId];
  1285. delete parents[vueId];
  1286. }
  1287. } });
  1288. }
  1289. function parseBaseApp(vm, _ref3)
  1290. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1291. initEventChannel();
  1292. {
  1293. initScopedSlotsParams();
  1294. }
  1295. if (vm.$options.store) {
  1296. _vue.default.prototype.$store = vm.$options.store;
  1297. }
  1298. uniIdMixin(_vue.default);
  1299. _vue.default.prototype.mpHost = "mp-weixin";
  1300. _vue.default.mixin({
  1301. beforeCreate: function beforeCreate() {
  1302. if (!this.$options.mpType) {
  1303. return;
  1304. }
  1305. this.mpType = this.$options.mpType;
  1306. this.$mp = _defineProperty({
  1307. data: {} },
  1308. this.mpType, this.$options.mpInstance);
  1309. this.$scope = this.$options.mpInstance;
  1310. delete this.$options.mpType;
  1311. delete this.$options.mpInstance;
  1312. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1313. var app = getApp();
  1314. if (app.$vm && app.$vm.$i18n) {
  1315. this._i18n = app.$vm.$i18n;
  1316. }
  1317. }
  1318. if (this.mpType !== 'app') {
  1319. initRefs(this);
  1320. initMocks(this, mocks);
  1321. }
  1322. } });
  1323. var appOptions = {
  1324. onLaunch: function onLaunch(args) {
  1325. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1326. return;
  1327. }
  1328. {
  1329. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1330. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1331. }
  1332. }
  1333. this.$vm = vm;
  1334. this.$vm.$mp = {
  1335. app: this };
  1336. this.$vm.$scope = this;
  1337. // vm 上也挂载 globalData
  1338. this.$vm.globalData = this.globalData;
  1339. this.$vm._isMounted = true;
  1340. this.$vm.__call_hook('mounted', args);
  1341. this.$vm.__call_hook('onLaunch', args);
  1342. } };
  1343. // 兼容旧版本 globalData
  1344. appOptions.globalData = vm.$options.globalData || {};
  1345. // 将 methods 中的方法挂在 getApp() 中
  1346. var methods = vm.$options.methods;
  1347. if (methods) {
  1348. Object.keys(methods).forEach(function (name) {
  1349. appOptions[name] = methods[name];
  1350. });
  1351. }
  1352. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1353. initHooks(appOptions, hooks);
  1354. return appOptions;
  1355. }
  1356. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1357. function findVmByVueId(vm, vuePid) {
  1358. var $children = vm.$children;
  1359. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1360. for (var i = $children.length - 1; i >= 0; i--) {
  1361. var childVm = $children[i];
  1362. if (childVm.$scope._$vueId === vuePid) {
  1363. return childVm;
  1364. }
  1365. }
  1366. // 反向递归查找
  1367. var parentVm;
  1368. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1369. parentVm = findVmByVueId($children[_i], vuePid);
  1370. if (parentVm) {
  1371. return parentVm;
  1372. }
  1373. }
  1374. }
  1375. function initBehavior(options) {
  1376. return Behavior(options);
  1377. }
  1378. function isPage() {
  1379. return !!this.route;
  1380. }
  1381. function initRelation(detail) {
  1382. this.triggerEvent('__l', detail);
  1383. }
  1384. function selectAllComponents(mpInstance, selector, $refs) {
  1385. var components = mpInstance.selectAllComponents(selector);
  1386. components.forEach(function (component) {
  1387. var ref = component.dataset.ref;
  1388. $refs[ref] = component.$vm || component;
  1389. {
  1390. if (component.dataset.vueGeneric === 'scoped') {
  1391. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1392. selectAllComponents(scopedComponent, selector, $refs);
  1393. });
  1394. }
  1395. }
  1396. });
  1397. }
  1398. function initRefs(vm) {
  1399. var mpInstance = vm.$scope;
  1400. Object.defineProperty(vm, '$refs', {
  1401. get: function get() {
  1402. var $refs = {};
  1403. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1404. // TODO 暂不考虑 for 中的 scoped
  1405. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1406. forComponents.forEach(function (component) {
  1407. var ref = component.dataset.ref;
  1408. if (!$refs[ref]) {
  1409. $refs[ref] = [];
  1410. }
  1411. $refs[ref].push(component.$vm || component);
  1412. });
  1413. return $refs;
  1414. } });
  1415. }
  1416. function handleLink(event) {var _ref4 =
  1417. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1418. var parentVm;
  1419. if (vuePid) {
  1420. parentVm = findVmByVueId(this.$vm, vuePid);
  1421. }
  1422. if (!parentVm) {
  1423. parentVm = this.$vm;
  1424. }
  1425. vueOptions.parent = parentVm;
  1426. }
  1427. function parseApp(vm) {
  1428. return parseBaseApp(vm, {
  1429. mocks: mocks,
  1430. initRefs: initRefs });
  1431. }
  1432. function createApp(vm) {
  1433. App(parseApp(vm));
  1434. return vm;
  1435. }
  1436. var encodeReserveRE = /[!'()*]/g;
  1437. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1438. var commaRE = /%2C/g;
  1439. // fixed encodeURIComponent which is more conformant to RFC3986:
  1440. // - escapes [!'()*]
  1441. // - preserve commas
  1442. var encode = function encode(str) {return encodeURIComponent(str).
  1443. replace(encodeReserveRE, encodeReserveReplacer).
  1444. replace(commaRE, ',');};
  1445. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1446. var res = obj ? Object.keys(obj).map(function (key) {
  1447. var val = obj[key];
  1448. if (val === undefined) {
  1449. return '';
  1450. }
  1451. if (val === null) {
  1452. return encodeStr(key);
  1453. }
  1454. if (Array.isArray(val)) {
  1455. var result = [];
  1456. val.forEach(function (val2) {
  1457. if (val2 === undefined) {
  1458. return;
  1459. }
  1460. if (val2 === null) {
  1461. result.push(encodeStr(key));
  1462. } else {
  1463. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1464. }
  1465. });
  1466. return result.join('&');
  1467. }
  1468. return encodeStr(key) + '=' + encodeStr(val);
  1469. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1470. return res ? "?".concat(res) : '';
  1471. }
  1472. function parseBaseComponent(vueComponentOptions)
  1473. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1474. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1475. var options = _objectSpread({
  1476. multipleSlots: true,
  1477. addGlobalClass: true },
  1478. vueOptions.options || {});
  1479. {
  1480. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1481. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1482. Object.assign(options, vueOptions['mp-weixin'].options);
  1483. }
  1484. }
  1485. var componentOptions = {
  1486. options: options,
  1487. data: initData(vueOptions, _vue.default.prototype),
  1488. behaviors: initBehaviors(vueOptions, initBehavior),
  1489. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1490. lifetimes: {
  1491. attached: function attached() {
  1492. var properties = this.properties;
  1493. var options = {
  1494. mpType: isPage.call(this) ? 'page' : 'component',
  1495. mpInstance: this,
  1496. propsData: properties };
  1497. initVueIds(properties.vueId, this);
  1498. // 处理父子关系
  1499. initRelation.call(this, {
  1500. vuePid: this._$vuePid,
  1501. vueOptions: options });
  1502. // 初始化 vue 实例
  1503. this.$vm = new VueComponent(options);
  1504. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1505. initSlots(this.$vm, properties.vueSlots);
  1506. // 触发首次 setData
  1507. this.$vm.$mount();
  1508. },
  1509. ready: function ready() {
  1510. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1511. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1512. if (this.$vm) {
  1513. this.$vm._isMounted = true;
  1514. this.$vm.__call_hook('mounted');
  1515. this.$vm.__call_hook('onReady');
  1516. }
  1517. },
  1518. detached: function detached() {
  1519. this.$vm && this.$vm.$destroy();
  1520. } },
  1521. pageLifetimes: {
  1522. show: function show(args) {
  1523. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1524. },
  1525. hide: function hide() {
  1526. this.$vm && this.$vm.__call_hook('onPageHide');
  1527. },
  1528. resize: function resize(size) {
  1529. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1530. } },
  1531. methods: {
  1532. __l: handleLink,
  1533. __e: handleEvent } };
  1534. // externalClasses
  1535. if (vueOptions.externalClasses) {
  1536. componentOptions.externalClasses = vueOptions.externalClasses;
  1537. }
  1538. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1539. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1540. componentOptions.methods[callMethod] = function (args) {
  1541. return this.$vm[callMethod](args);
  1542. };
  1543. });
  1544. }
  1545. if (isPage) {
  1546. return componentOptions;
  1547. }
  1548. return [componentOptions, VueComponent];
  1549. }
  1550. function parseComponent(vueComponentOptions) {
  1551. return parseBaseComponent(vueComponentOptions, {
  1552. isPage: isPage,
  1553. initRelation: initRelation });
  1554. }
  1555. var hooks$1 = [
  1556. 'onShow',
  1557. 'onHide',
  1558. 'onUnload'];
  1559. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1560. function parseBasePage(vuePageOptions, _ref6)
  1561. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1562. var pageOptions = parseComponent(vuePageOptions);
  1563. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1564. pageOptions.methods.onLoad = function (query) {
  1565. this.options = query;
  1566. var copyQuery = Object.assign({}, query);
  1567. delete copyQuery.__id__;
  1568. this.$page = {
  1569. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1570. this.$vm.$mp.query = query; // 兼容 mpvue
  1571. this.$vm.__call_hook('onLoad', query);
  1572. };
  1573. return pageOptions;
  1574. }
  1575. function parsePage(vuePageOptions) {
  1576. return parseBasePage(vuePageOptions, {
  1577. isPage: isPage,
  1578. initRelation: initRelation });
  1579. }
  1580. function createPage(vuePageOptions) {
  1581. {
  1582. return Component(parsePage(vuePageOptions));
  1583. }
  1584. }
  1585. function createComponent(vueOptions) {
  1586. {
  1587. return Component(parseComponent(vueOptions));
  1588. }
  1589. }
  1590. function createSubpackageApp(vm) {
  1591. var appOptions = parseApp(vm);
  1592. var app = getApp({
  1593. allowDefault: true });
  1594. vm.$scope = app;
  1595. var globalData = app.globalData;
  1596. if (globalData) {
  1597. Object.keys(appOptions.globalData).forEach(function (name) {
  1598. if (!hasOwn(globalData, name)) {
  1599. globalData[name] = appOptions.globalData[name];
  1600. }
  1601. });
  1602. }
  1603. Object.keys(appOptions).forEach(function (name) {
  1604. if (!hasOwn(app, name)) {
  1605. app[name] = appOptions[name];
  1606. }
  1607. });
  1608. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1609. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1610. vm.__call_hook('onShow', args);
  1611. });
  1612. }
  1613. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1614. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1615. vm.__call_hook('onHide', args);
  1616. });
  1617. }
  1618. if (isFn(appOptions.onLaunch)) {
  1619. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1620. vm.__call_hook('onLaunch', args);
  1621. }
  1622. return vm;
  1623. }
  1624. function createPlugin(vm) {
  1625. var appOptions = parseApp(vm);
  1626. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1627. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1628. appOptions.onShow.apply(vm, args);
  1629. });
  1630. }
  1631. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1632. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1633. appOptions.onHide.apply(vm, args);
  1634. });
  1635. }
  1636. if (isFn(appOptions.onLaunch)) {
  1637. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1638. appOptions.onLaunch.call(vm, args);
  1639. }
  1640. return vm;
  1641. }
  1642. todos.forEach(function (todoApi) {
  1643. protocols[todoApi] = false;
  1644. });
  1645. canIUses.forEach(function (canIUseApi) {
  1646. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1647. canIUseApi;
  1648. if (!wx.canIUse(apiName)) {
  1649. protocols[canIUseApi] = false;
  1650. }
  1651. });
  1652. var uni = {};
  1653. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1654. uni = new Proxy({}, {
  1655. get: function get(target, name) {
  1656. if (hasOwn(target, name)) {
  1657. return target[name];
  1658. }
  1659. if (baseApi[name]) {
  1660. return baseApi[name];
  1661. }
  1662. if (api[name]) {
  1663. return promisify(name, api[name]);
  1664. }
  1665. {
  1666. if (extraApi[name]) {
  1667. return promisify(name, extraApi[name]);
  1668. }
  1669. if (todoApis[name]) {
  1670. return promisify(name, todoApis[name]);
  1671. }
  1672. }
  1673. if (eventApi[name]) {
  1674. return eventApi[name];
  1675. }
  1676. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1677. return;
  1678. }
  1679. return promisify(name, wrapper(name, wx[name]));
  1680. },
  1681. set: function set(target, name, value) {
  1682. target[name] = value;
  1683. return true;
  1684. } });
  1685. } else {
  1686. Object.keys(baseApi).forEach(function (name) {
  1687. uni[name] = baseApi[name];
  1688. });
  1689. {
  1690. Object.keys(todoApis).forEach(function (name) {
  1691. uni[name] = promisify(name, todoApis[name]);
  1692. });
  1693. Object.keys(extraApi).forEach(function (name) {
  1694. uni[name] = promisify(name, todoApis[name]);
  1695. });
  1696. }
  1697. Object.keys(eventApi).forEach(function (name) {
  1698. uni[name] = eventApi[name];
  1699. });
  1700. Object.keys(api).forEach(function (name) {
  1701. uni[name] = promisify(name, api[name]);
  1702. });
  1703. Object.keys(wx).forEach(function (name) {
  1704. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1705. uni[name] = promisify(name, wrapper(name, wx[name]));
  1706. }
  1707. });
  1708. }
  1709. wx.createApp = createApp;
  1710. wx.createPage = createPage;
  1711. wx.createComponent = createComponent;
  1712. wx.createSubpackageApp = createSubpackageApp;
  1713. wx.createPlugin = createPlugin;
  1714. var uni$1 = uni;var _default =
  1715. uni$1;exports.default = _default;
  1716. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1717. /***/ }),
  1718. /***/ 11:
  1719. /*!**********************************************************************************************************!*\
  1720. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1721. \**********************************************************************************************************/
  1722. /*! exports provided: default */
  1723. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1724. "use strict";
  1725. __webpack_require__.r(__webpack_exports__);
  1726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1727. /* globals __VUE_SSR_CONTEXT__ */
  1728. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1729. // This module is a runtime utility for cleaner component module output and will
  1730. // be included in the final webpack user bundle.
  1731. function normalizeComponent (
  1732. scriptExports,
  1733. render,
  1734. staticRenderFns,
  1735. functionalTemplate,
  1736. injectStyles,
  1737. scopeId,
  1738. moduleIdentifier, /* server only */
  1739. shadowMode, /* vue-cli only */
  1740. components, // fixed by xxxxxx auto components
  1741. renderjs // fixed by xxxxxx renderjs
  1742. ) {
  1743. // Vue.extend constructor export interop
  1744. var options = typeof scriptExports === 'function'
  1745. ? scriptExports.options
  1746. : scriptExports
  1747. // fixed by xxxxxx auto components
  1748. if (components) {
  1749. if (!options.components) {
  1750. options.components = {}
  1751. }
  1752. var hasOwn = Object.prototype.hasOwnProperty
  1753. for (var name in components) {
  1754. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1755. options.components[name] = components[name]
  1756. }
  1757. }
  1758. }
  1759. // fixed by xxxxxx renderjs
  1760. if (renderjs) {
  1761. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1762. this[renderjs.__module] = this
  1763. });
  1764. (options.mixins || (options.mixins = [])).push(renderjs)
  1765. }
  1766. // render functions
  1767. if (render) {
  1768. options.render = render
  1769. options.staticRenderFns = staticRenderFns
  1770. options._compiled = true
  1771. }
  1772. // functional template
  1773. if (functionalTemplate) {
  1774. options.functional = true
  1775. }
  1776. // scopedId
  1777. if (scopeId) {
  1778. options._scopeId = 'data-v-' + scopeId
  1779. }
  1780. var hook
  1781. if (moduleIdentifier) { // server build
  1782. hook = function (context) {
  1783. // 2.3 injection
  1784. context =
  1785. context || // cached call
  1786. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1787. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1788. // 2.2 with runInNewContext: true
  1789. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1790. context = __VUE_SSR_CONTEXT__
  1791. }
  1792. // inject component styles
  1793. if (injectStyles) {
  1794. injectStyles.call(this, context)
  1795. }
  1796. // register component module identifier for async chunk inferrence
  1797. if (context && context._registeredComponents) {
  1798. context._registeredComponents.add(moduleIdentifier)
  1799. }
  1800. }
  1801. // used by ssr in case component is cached and beforeCreate
  1802. // never gets called
  1803. options._ssrRegister = hook
  1804. } else if (injectStyles) {
  1805. hook = shadowMode
  1806. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1807. : injectStyles
  1808. }
  1809. if (hook) {
  1810. if (options.functional) {
  1811. // for template-only hot-reload because in that case the render fn doesn't
  1812. // go through the normalizer
  1813. options._injectStyles = hook
  1814. // register for functioal component in vue file
  1815. var originalRender = options.render
  1816. options.render = function renderWithStyleInjection (h, context) {
  1817. hook.call(context)
  1818. return originalRender(h, context)
  1819. }
  1820. } else {
  1821. // inject component registration as beforeCreate hook
  1822. var existing = options.beforeCreate
  1823. options.beforeCreate = existing
  1824. ? [].concat(existing, hook)
  1825. : [hook]
  1826. }
  1827. }
  1828. return {
  1829. exports: scriptExports,
  1830. options: options
  1831. }
  1832. }
  1833. /***/ }),
  1834. /***/ 12:
  1835. /*!**************************************************!*\
  1836. !*** /Users/guo/Desktop/txCar/common/request.js ***!
  1837. \**************************************************/
  1838. /*! no static exports found */
  1839. /***/ (function(module, exports, __webpack_require__) {
  1840. "use strict";
  1841. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  1842. var _MD = _interopRequireDefault(__webpack_require__(/*! ./MD5.js */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}var baseUrl = 'http://58.56.15.138:20201/';var burl2 = 'http://58.56.15.138:20201/'; //const baseUrl = 'http://58.56.15.138:20132/'
  1843. // const baseUrl = 'https://api.dms.66km.com/'
  1844. /* const http = (url = '', date = {}, type = 'POST', header = {
  1845. }) => {
  1846. return new Promise((resolve, reject) => {
  1847. console.log(burl2 + url)
  1848. //header['Content-Type']='application/x-www-form-urlencoded';
  1849. header['actionFromMiniApp']=1;
  1850. uni.request({
  1851. method: type,
  1852. url: burl2 + url,
  1853. data: date,
  1854. header: header,
  1855. dataType: 'json',
  1856. }).then((response) => {
  1857. setTimeout(function() {
  1858. uni.hideLoading();
  1859. }, 200);
  1860. let [error, res] = response;
  1861. if(res.data.code==403){
  1862. uni.showToast({
  1863. title: res.data.msg,
  1864. icon:'none',
  1865. duration: 3000,
  1866. });
  1867. uni.clearStorageSync()
  1868. uni.navigateTo({
  1869. url:'../login/login'
  1870. })
  1871. }else if(res.data.code==409){
  1872. getToken(url,date,type,header)
  1873. }
  1874. resolve(res.data);
  1875. }).catch(error => {
  1876. let [err, res] = error;
  1877. reject(err)
  1878. })
  1879. });
  1880. }
  1881. */
  1882. var http = function http()
  1883. {var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'POST';var header = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1884. return new Promise(function (resolve, reject) {
  1885. console.log(burl2 + url);
  1886. header = {};
  1887. var logodata = uni.getStorageSync("logodata");
  1888. header['token'] = logodata.token;
  1889. header['uid'] = logodata.uid;
  1890. //header['token']='98A9FED8814B457288166BDF623F33D1';
  1891. //header['uid']='39415962-C9D3-466D-A73F-5B5429A8DB2A';
  1892. header['Content-Type'] = 'application/x-www-form-urlencoded';
  1893. //console.log(header)
  1894. uni.request({
  1895. method: type,
  1896. url: baseUrl + url,
  1897. data: date,
  1898. header: header,
  1899. dataType: 'json' }).
  1900. then(function (response) {
  1901. /* setTimeout(function() {
  1902. uni.hideLoading();
  1903. }, 200); */var _response = _slicedToArray(
  1904. response, 2),error = _response[0],res = _response[1];
  1905. if (res.data.code == 401 || res.data.code == 403) {
  1906. uni.showToast({
  1907. title: res.data.msg,
  1908. icon: 'none',
  1909. duration: 3000 });
  1910. uni.clearStorageSync();
  1911. uni.navigateTo({
  1912. url: '../login/login' });
  1913. } else if (res.data.code == 409) {
  1914. // getToken(url,date,type,header)
  1915. }
  1916. resolve(res.data);
  1917. }).catch(function (error) {var _error = _slicedToArray(
  1918. error, 2),err = _error[0],res = _error[1];
  1919. reject(err);
  1920. });
  1921. });
  1922. };
  1923. function getToken(url, date, type, header) {
  1924. var header = {};
  1925. //var userId=uni.getStorageSync("devData").userId;
  1926. //var devData=uni.getStorageSync("devData")
  1927. header['Content-Type'] = 'application/x-www-form-urlencoded';
  1928. uni.request({
  1929. method: "POST",
  1930. url: burl2 + '/sys/getTokenByUserID',
  1931. data: {
  1932. userId: userId },
  1933. header: header,
  1934. dataType: 'json' }).
  1935. then(function (response) {var _response2 = _slicedToArray(
  1936. response, 2),error = _response2[0],res = _response2[1];
  1937. var accessToken = res.data.data.accessToken.accessToken;
  1938. devData.accessToken = accessToken;
  1939. uni.setStorage({
  1940. key: 'devData',
  1941. data: devData,
  1942. success: function success() {
  1943. refresh(url, date, type, header); //刷新接口
  1944. } });
  1945. // console.log(accessToken)
  1946. }).catch(function (error) {
  1947. });
  1948. }
  1949. function refresh(url, date, type, header) {
  1950. uni.request({
  1951. method: type,
  1952. url: burl2 + url,
  1953. data: date,
  1954. header: header,
  1955. dataType: 'json' }).
  1956. then(function (response) {
  1957. setTimeout(function () {
  1958. uni.hideLoading();
  1959. }, 200);var _response3 = _slicedToArray(
  1960. response, 2),error = _response3[0],res = _response3[1];
  1961. if (res.data.code == 403) {
  1962. uni.showToast({
  1963. title: res.data.msg,
  1964. icon: 'none',
  1965. duration: 3000 });
  1966. uni.navigateTo({
  1967. url: '../login/login' });
  1968. }
  1969. resolve(res.data);
  1970. }).catch(function (error) {var _error2 = _slicedToArray(
  1971. error, 2),err = _error2[0],res = _error2[1];
  1972. reject(err);
  1973. });
  1974. }var _default =
  1975. {
  1976. http: http, baseUrl: baseUrl };exports.default = _default;
  1977. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1978. /***/ }),
  1979. /***/ 13:
  1980. /*!**********************************************!*\
  1981. !*** /Users/guo/Desktop/txCar/common/MD5.js ***!
  1982. \**********************************************/
  1983. /*! no static exports found */
  1984. /***/ (function(module, exports, __webpack_require__) {
  1985. "use strict";
  1986. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function md5(string) {
  1987. var x = Array();
  1988. var k, AA, BB, CC, DD, a, b, c, d;
  1989. var S11 = 7,S12 = 12,S13 = 17,S14 = 22;
  1990. var S21 = 5,S22 = 9,S23 = 14,S24 = 20;
  1991. var S31 = 4,S32 = 11,S33 = 16,S34 = 23;
  1992. var S41 = 6,S42 = 10,S43 = 15,S44 = 21;
  1993. string = Utf8Encode(string);
  1994. x = ConvertToWordArray(string);
  1995. a = 0x67452301;
  1996. b = 0xEFCDAB89;
  1997. c = 0x98BADCFE;
  1998. d = 0x10325476;
  1999. for (k = 0; k < x.length; k += 16) {
  2000. AA = a;
  2001. BB = b;
  2002. CC = c;
  2003. DD = d;
  2004. a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
  2005. d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
  2006. c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
  2007. b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
  2008. a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
  2009. d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
  2010. c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
  2011. b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
  2012. a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
  2013. d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
  2014. c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
  2015. b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
  2016. a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
  2017. d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
  2018. c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
  2019. b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
  2020. a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
  2021. d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
  2022. c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
  2023. b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
  2024. a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
  2025. d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
  2026. c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
  2027. b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
  2028. a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
  2029. d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
  2030. c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
  2031. b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
  2032. a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
  2033. d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
  2034. c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
  2035. b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
  2036. a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
  2037. d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
  2038. c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
  2039. b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
  2040. a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
  2041. d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
  2042. c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
  2043. b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
  2044. a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
  2045. d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
  2046. c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
  2047. b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
  2048. a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
  2049. d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
  2050. c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
  2051. b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
  2052. a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
  2053. d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
  2054. c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
  2055. b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
  2056. a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
  2057. d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
  2058. c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
  2059. b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
  2060. a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
  2061. d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
  2062. c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
  2063. b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
  2064. a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
  2065. d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
  2066. c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
  2067. b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
  2068. a = AddUnsigned(a, AA);
  2069. b = AddUnsigned(b, BB);
  2070. c = AddUnsigned(c, CC);
  2071. d = AddUnsigned(d, DD);
  2072. }
  2073. var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);
  2074. return temp.toUpperCase();
  2075. }
  2076. function RotateLeft(lValue, iShiftBits) {
  2077. return lValue << iShiftBits | lValue >>> 32 - iShiftBits;
  2078. }
  2079. function AddUnsigned(lX, lY) {
  2080. var lX4, lY4, lX8, lY8, lResult;
  2081. lX8 = lX & 0x80000000;
  2082. lY8 = lY & 0x80000000;
  2083. lX4 = lX & 0x40000000;
  2084. lY4 = lY & 0x40000000;
  2085. lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
  2086. if (lX4 & lY4) {
  2087. return lResult ^ 0x80000000 ^ lX8 ^ lY8;
  2088. }
  2089. if (lX4 | lY4) {
  2090. if (lResult & 0x40000000) {
  2091. return lResult ^ 0xC0000000 ^ lX8 ^ lY8;
  2092. } else {
  2093. return lResult ^ 0x40000000 ^ lX8 ^ lY8;
  2094. }
  2095. } else {
  2096. return lResult ^ lX8 ^ lY8;
  2097. }
  2098. }
  2099. function F(x, y, z) {
  2100. return x & y | ~x & z;
  2101. }
  2102. function G(x, y, z) {
  2103. return x & z | y & ~z;
  2104. }
  2105. function H(x, y, z) {
  2106. return x ^ y ^ z;
  2107. }
  2108. function I(x, y, z) {
  2109. return y ^ (x | ~z);
  2110. }
  2111. function FF(a, b, c, d, x, s, ac) {
  2112. a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
  2113. return AddUnsigned(RotateLeft(a, s), b);
  2114. }
  2115. function GG(a, b, c, d, x, s, ac) {
  2116. a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
  2117. return AddUnsigned(RotateLeft(a, s), b);
  2118. }
  2119. function HH(a, b, c, d, x, s, ac) {
  2120. a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
  2121. return AddUnsigned(RotateLeft(a, s), b);
  2122. }
  2123. function II(a, b, c, d, x, s, ac) {
  2124. a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
  2125. return AddUnsigned(RotateLeft(a, s), b);
  2126. }
  2127. function ConvertToWordArray(string) {
  2128. var lWordCount;
  2129. var lMessageLength = string.length;
  2130. var lNumberOfWords_temp1 = lMessageLength + 8;
  2131. var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - lNumberOfWords_temp1 % 64) / 64;
  2132. var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
  2133. var lWordArray = Array(lNumberOfWords - 1);
  2134. var lBytePosition = 0;
  2135. var lByteCount = 0;
  2136. while (lByteCount < lMessageLength) {
  2137. lWordCount = (lByteCount - lByteCount % 4) / 4;
  2138. lBytePosition = lByteCount % 4 * 8;
  2139. lWordArray[lWordCount] = lWordArray[lWordCount] | string.charCodeAt(lByteCount) << lBytePosition;
  2140. lByteCount++;
  2141. }
  2142. lWordCount = (lByteCount - lByteCount % 4) / 4;
  2143. lBytePosition = lByteCount % 4 * 8;
  2144. lWordArray[lWordCount] = lWordArray[lWordCount] | 0x80 << lBytePosition;
  2145. lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
  2146. lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
  2147. return lWordArray;
  2148. }
  2149. function WordToHex(lValue) {
  2150. var WordToHexValue = "",WordToHexValue_temp = "",lByte,lCount;
  2151. for (lCount = 0; lCount <= 3; lCount++) {
  2152. lByte = lValue >>> lCount * 8 & 255;
  2153. WordToHexValue_temp = "0" + lByte.toString(16);
  2154. WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
  2155. }
  2156. return WordToHexValue;
  2157. }
  2158. function Utf8Encode(string) {
  2159. var utftext = "";
  2160. for (var n = 0; n < string.length; n++) {
  2161. var c = string.charCodeAt(n);
  2162. if (c < 128) {
  2163. utftext += String.fromCharCode(c);
  2164. } else if (c > 127 && c < 2048) {
  2165. utftext += String.fromCharCode(c >> 6 | 192);
  2166. utftext += String.fromCharCode(c & 63 | 128);
  2167. } else {
  2168. utftext += String.fromCharCode(c >> 12 | 224);
  2169. utftext += String.fromCharCode(c >> 6 & 63 | 128);
  2170. utftext += String.fromCharCode(c & 63 | 128);
  2171. }
  2172. }
  2173. return utftext;
  2174. }var _default =
  2175. {
  2176. md5: md5 };exports.default = _default;
  2177. /***/ }),
  2178. /***/ 14:
  2179. /*!*************************************************!*\
  2180. !*** /Users/guo/Desktop/txCar/common/common.js ***!
  2181. \*************************************************/
  2182. /*! no static exports found */
  2183. /***/ (function(module, exports, __webpack_require__) {
  2184. "use strict";
  2185. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2186. var isUserId = function isUserId() {
  2187. var userId = uni.getStorageSync("logodata").uid;
  2188. //console.log("userId---"+userId)
  2189. if (!userId) {
  2190. uni.navigateTo({
  2191. url: '../login/login' });
  2192. }
  2193. };
  2194. /* const uid =function() {
  2195. var userId=uni.getStorageSync("logodata").uid;
  2196. return
  2197. } */var _default =
  2198. {
  2199. commonData: {
  2200. companyType: 1 },
  2201. isUserId: isUserId };exports.default = _default;
  2202. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2203. /***/ }),
  2204. /***/ 195:
  2205. /*!****************************************************************!*\
  2206. !*** /Users/guo/Desktop/txCar/components/tki-qrcode/qrcode.js ***!
  2207. \****************************************************************/
  2208. /*! no static exports found */
  2209. /***/ (function(module, exports, __webpack_require__) {
  2210. "use strict";
  2211. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var QRCode = {};
  2212. (function () {
  2213. /**
  2214. * 获取单个字符的utf8编码
  2215. * unicode BMP平面约65535个字符
  2216. * @param {num} code
  2217. * return {array}
  2218. */
  2219. function unicodeFormat8(code) {
  2220. // 1 byte
  2221. var c0, c1, c2;
  2222. if (code < 128) {
  2223. return [code];
  2224. // 2 bytes
  2225. } else if (code < 2048) {
  2226. c0 = 192 + (code >> 6);
  2227. c1 = 128 + (code & 63);
  2228. return [c0, c1];
  2229. // 3 bytes
  2230. } else {
  2231. c0 = 224 + (code >> 12);
  2232. c1 = 128 + (code >> 6 & 63);
  2233. c2 = 128 + (code & 63);
  2234. return [c0, c1, c2];
  2235. }
  2236. }
  2237. /**
  2238. * 获取字符串的utf8编码字节串
  2239. * @param {string} string
  2240. * @return {array}
  2241. */
  2242. function getUTF8Bytes(string) {
  2243. var utf8codes = [];
  2244. for (var i = 0; i < string.length; i++) {
  2245. var code = string.charCodeAt(i);
  2246. var utf8 = unicodeFormat8(code);
  2247. for (var j = 0; j < utf8.length; j++) {
  2248. utf8codes.push(utf8[j]);
  2249. }
  2250. }
  2251. return utf8codes;
  2252. }
  2253. /**
  2254. * 二维码算法实现
  2255. * @param {string} data 要编码的信息字符串
  2256. * @param {num} errorCorrectLevel 纠错等级
  2257. */
  2258. function QRCodeAlg(data, errorCorrectLevel) {
  2259. this.typeNumber = -1; //版本
  2260. this.errorCorrectLevel = errorCorrectLevel;
  2261. this.modules = null; //二维矩阵,存放最终结果
  2262. this.moduleCount = 0; //矩阵大小
  2263. this.dataCache = null; //数据缓存
  2264. this.rsBlocks = null; //版本数据信息
  2265. this.totalDataCount = -1; //可使用的数据量
  2266. this.data = data;
  2267. this.utf8bytes = getUTF8Bytes(data);
  2268. this.make();
  2269. }
  2270. QRCodeAlg.prototype = {
  2271. constructor: QRCodeAlg,
  2272. /**
  2273. * 获取二维码矩阵大小
  2274. * @return {num} 矩阵大小
  2275. */
  2276. getModuleCount: function getModuleCount() {
  2277. return this.moduleCount;
  2278. },
  2279. /**
  2280. * 编码
  2281. */
  2282. make: function make() {
  2283. this.getRightType();
  2284. this.dataCache = this.createData();
  2285. this.createQrcode();
  2286. },
  2287. /**
  2288. * 设置二位矩阵功能图形
  2289. * @param {bool} test 表示是否在寻找最好掩膜阶段
  2290. * @param {num} maskPattern 掩膜的版本
  2291. */
  2292. makeImpl: function makeImpl(maskPattern) {
  2293. this.moduleCount = this.typeNumber * 4 + 17;
  2294. this.modules = new Array(this.moduleCount);
  2295. for (var row = 0; row < this.moduleCount; row++) {
  2296. this.modules[row] = new Array(this.moduleCount);
  2297. }
  2298. this.setupPositionProbePattern(0, 0);
  2299. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  2300. this.setupPositionProbePattern(0, this.moduleCount - 7);
  2301. this.setupPositionAdjustPattern();
  2302. this.setupTimingPattern();
  2303. this.setupTypeInfo(true, maskPattern);
  2304. if (this.typeNumber >= 7) {
  2305. this.setupTypeNumber(true);
  2306. }
  2307. this.mapData(this.dataCache, maskPattern);
  2308. },
  2309. /**
  2310. * 设置二维码的位置探测图形
  2311. * @param {num} row 探测图形的中心横坐标
  2312. * @param {num} col 探测图形的中心纵坐标
  2313. */
  2314. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  2315. for (var r = -1; r <= 7; r++) {
  2316. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  2317. for (var c = -1; c <= 7; c++) {
  2318. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  2319. if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  2320. this.modules[row + r][col + c] = true;
  2321. } else {
  2322. this.modules[row + r][col + c] = false;
  2323. }
  2324. }
  2325. }
  2326. },
  2327. /**
  2328. * 创建二维码
  2329. * @return {[type]} [description]
  2330. */
  2331. createQrcode: function createQrcode() {
  2332. var minLostPoint = 0;
  2333. var pattern = 0;
  2334. var bestModules = null;
  2335. for (var i = 0; i < 8; i++) {
  2336. this.makeImpl(i);
  2337. var lostPoint = QRUtil.getLostPoint(this);
  2338. if (i == 0 || minLostPoint > lostPoint) {
  2339. minLostPoint = lostPoint;
  2340. pattern = i;
  2341. bestModules = this.modules;
  2342. }
  2343. }
  2344. this.modules = bestModules;
  2345. this.setupTypeInfo(false, pattern);
  2346. if (this.typeNumber >= 7) {
  2347. this.setupTypeNumber(false);
  2348. }
  2349. },
  2350. /**
  2351. * 设置定位图形
  2352. * @return {[type]} [description]
  2353. */
  2354. setupTimingPattern: function setupTimingPattern() {
  2355. for (var r = 8; r < this.moduleCount - 8; r++) {
  2356. if (this.modules[r][6] != null) {
  2357. continue;
  2358. }
  2359. this.modules[r][6] = r % 2 == 0;
  2360. if (this.modules[6][r] != null) {
  2361. continue;
  2362. }
  2363. this.modules[6][r] = r % 2 == 0;
  2364. }
  2365. },
  2366. /**
  2367. * 设置矫正图形
  2368. * @return {[type]} [description]
  2369. */
  2370. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  2371. var pos = QRUtil.getPatternPosition(this.typeNumber);
  2372. for (var i = 0; i < pos.length; i++) {
  2373. for (var j = 0; j < pos.length; j++) {
  2374. var row = pos[i];
  2375. var col = pos[j];
  2376. if (this.modules[row][col] != null) {
  2377. continue;
  2378. }
  2379. for (var r = -2; r <= 2; r++) {
  2380. for (var c = -2; c <= 2; c++) {
  2381. if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
  2382. this.modules[row + r][col + c] = true;
  2383. } else {
  2384. this.modules[row + r][col + c] = false;
  2385. }
  2386. }
  2387. }
  2388. }
  2389. }
  2390. },
  2391. /**
  2392. * 设置版本信息(7以上版本才有)
  2393. * @param {bool} test 是否处于判断最佳掩膜阶段
  2394. * @return {[type]} [description]
  2395. */
  2396. setupTypeNumber: function setupTypeNumber(test) {
  2397. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  2398. for (var i = 0; i < 18; i++) {
  2399. var mod = !test && (bits >> i & 1) == 1;
  2400. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  2401. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  2402. }
  2403. },
  2404. /**
  2405. * 设置格式信息(纠错等级和掩膜版本)
  2406. * @param {bool} test
  2407. * @param {num} maskPattern 掩膜版本
  2408. * @return {}
  2409. */
  2410. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  2411. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  2412. var bits = QRUtil.getBCHTypeInfo(data);
  2413. // vertical
  2414. for (var i = 0; i < 15; i++) {
  2415. var mod = !test && (bits >> i & 1) == 1;
  2416. if (i < 6) {
  2417. this.modules[i][8] = mod;
  2418. } else if (i < 8) {
  2419. this.modules[i + 1][8] = mod;
  2420. } else {
  2421. this.modules[this.moduleCount - 15 + i][8] = mod;
  2422. }
  2423. // horizontal
  2424. var mod = !test && (bits >> i & 1) == 1;
  2425. if (i < 8) {
  2426. this.modules[8][this.moduleCount - i - 1] = mod;
  2427. } else if (i < 9) {
  2428. this.modules[8][15 - i - 1 + 1] = mod;
  2429. } else {
  2430. this.modules[8][15 - i - 1] = mod;
  2431. }
  2432. }
  2433. // fixed module
  2434. this.modules[this.moduleCount - 8][8] = !test;
  2435. },
  2436. /**
  2437. * 数据编码
  2438. * @return {[type]} [description]
  2439. */
  2440. createData: function createData() {
  2441. var buffer = new QRBitBuffer();
  2442. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  2443. buffer.put(4, 4); //添加模式
  2444. buffer.put(this.utf8bytes.length, lengthBits);
  2445. for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
  2446. buffer.put(this.utf8bytes[i], 8);
  2447. }
  2448. if (buffer.length + 4 <= this.totalDataCount * 8) {
  2449. buffer.put(0, 4);
  2450. }
  2451. // padding
  2452. while (buffer.length % 8 != 0) {
  2453. buffer.putBit(false);
  2454. }
  2455. // padding
  2456. while (true) {
  2457. if (buffer.length >= this.totalDataCount * 8) {
  2458. break;
  2459. }
  2460. buffer.put(QRCodeAlg.PAD0, 8);
  2461. if (buffer.length >= this.totalDataCount * 8) {
  2462. break;
  2463. }
  2464. buffer.put(QRCodeAlg.PAD1, 8);
  2465. }
  2466. return this.createBytes(buffer);
  2467. },
  2468. /**
  2469. * 纠错码编码
  2470. * @param {buffer} buffer 数据编码
  2471. * @return {[type]}
  2472. */
  2473. createBytes: function createBytes(buffer) {
  2474. var offset = 0;
  2475. var maxDcCount = 0;
  2476. var maxEcCount = 0;
  2477. var length = this.rsBlock.length / 3;
  2478. var rsBlocks = new Array();
  2479. for (var i = 0; i < length; i++) {
  2480. var count = this.rsBlock[i * 3 + 0];
  2481. var totalCount = this.rsBlock[i * 3 + 1];
  2482. var dataCount = this.rsBlock[i * 3 + 2];
  2483. for (var j = 0; j < count; j++) {
  2484. rsBlocks.push([dataCount, totalCount]);
  2485. }
  2486. }
  2487. var dcdata = new Array(rsBlocks.length);
  2488. var ecdata = new Array(rsBlocks.length);
  2489. for (var r = 0; r < rsBlocks.length; r++) {
  2490. var dcCount = rsBlocks[r][0];
  2491. var ecCount = rsBlocks[r][1] - dcCount;
  2492. maxDcCount = Math.max(maxDcCount, dcCount);
  2493. maxEcCount = Math.max(maxEcCount, ecCount);
  2494. dcdata[r] = new Array(dcCount);
  2495. for (var i = 0; i < dcdata[r].length; i++) {
  2496. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  2497. }
  2498. offset += dcCount;
  2499. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  2500. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  2501. var modPoly = rawPoly.mod(rsPoly);
  2502. ecdata[r] = new Array(rsPoly.getLength() - 1);
  2503. for (var i = 0; i < ecdata[r].length; i++) {
  2504. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  2505. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  2506. }
  2507. }
  2508. var data = new Array(this.totalDataCount);
  2509. var index = 0;
  2510. for (var i = 0; i < maxDcCount; i++) {
  2511. for (var r = 0; r < rsBlocks.length; r++) {
  2512. if (i < dcdata[r].length) {
  2513. data[index++] = dcdata[r][i];
  2514. }
  2515. }
  2516. }
  2517. for (var i = 0; i < maxEcCount; i++) {
  2518. for (var r = 0; r < rsBlocks.length; r++) {
  2519. if (i < ecdata[r].length) {
  2520. data[index++] = ecdata[r][i];
  2521. }
  2522. }
  2523. }
  2524. return data;
  2525. },
  2526. /**
  2527. * 布置模块,构建最终信息
  2528. * @param {} data
  2529. * @param {} maskPattern
  2530. * @return {}
  2531. */
  2532. mapData: function mapData(data, maskPattern) {
  2533. var inc = -1;
  2534. var row = this.moduleCount - 1;
  2535. var bitIndex = 7;
  2536. var byteIndex = 0;
  2537. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  2538. if (col == 6) col--;
  2539. while (true) {
  2540. for (var c = 0; c < 2; c++) {
  2541. if (this.modules[row][col - c] == null) {
  2542. var dark = false;
  2543. if (byteIndex < data.length) {
  2544. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  2545. }
  2546. var mask = QRUtil.getMask(maskPattern, row, col - c);
  2547. if (mask) {
  2548. dark = !dark;
  2549. }
  2550. this.modules[row][col - c] = dark;
  2551. bitIndex--;
  2552. if (bitIndex == -1) {
  2553. byteIndex++;
  2554. bitIndex = 7;
  2555. }
  2556. }
  2557. }
  2558. row += inc;
  2559. if (row < 0 || this.moduleCount <= row) {
  2560. row -= inc;
  2561. inc = -inc;
  2562. break;
  2563. }
  2564. }
  2565. }
  2566. } };
  2567. /**
  2568. * 填充字段
  2569. */
  2570. QRCodeAlg.PAD0 = 0xEC;
  2571. QRCodeAlg.PAD1 = 0x11;
  2572. //---------------------------------------------------------------------
  2573. // 纠错等级对应的编码
  2574. //---------------------------------------------------------------------
  2575. var QRErrorCorrectLevel = [1, 0, 3, 2];
  2576. //---------------------------------------------------------------------
  2577. // 掩膜版本
  2578. //---------------------------------------------------------------------
  2579. var QRMaskPattern = {
  2580. PATTERN000: 0,
  2581. PATTERN001: 1,
  2582. PATTERN010: 2,
  2583. PATTERN011: 3,
  2584. PATTERN100: 4,
  2585. PATTERN101: 5,
  2586. PATTERN110: 6,
  2587. PATTERN111: 7 };
  2588. //---------------------------------------------------------------------
  2589. // 工具类
  2590. //---------------------------------------------------------------------
  2591. var QRUtil = {
  2592. /*
  2593. 每个版本矫正图形的位置
  2594. */
  2595. PATTERN_POSITION_TABLE: [
  2596. [],
  2597. [6, 18],
  2598. [6, 22],
  2599. [6, 26],
  2600. [6, 30],
  2601. [6, 34],
  2602. [6, 22, 38],
  2603. [6, 24, 42],
  2604. [6, 26, 46],
  2605. [6, 28, 50],
  2606. [6, 30, 54],
  2607. [6, 32, 58],
  2608. [6, 34, 62],
  2609. [6, 26, 46, 66],
  2610. [6, 26, 48, 70],
  2611. [6, 26, 50, 74],
  2612. [6, 30, 54, 78],
  2613. [6, 30, 56, 82],
  2614. [6, 30, 58, 86],
  2615. [6, 34, 62, 90],
  2616. [6, 28, 50, 72, 94],
  2617. [6, 26, 50, 74, 98],
  2618. [6, 30, 54, 78, 102],
  2619. [6, 28, 54, 80, 106],
  2620. [6, 32, 58, 84, 110],
  2621. [6, 30, 58, 86, 114],
  2622. [6, 34, 62, 90, 118],
  2623. [6, 26, 50, 74, 98, 122],
  2624. [6, 30, 54, 78, 102, 126],
  2625. [6, 26, 52, 78, 104, 130],
  2626. [6, 30, 56, 82, 108, 134],
  2627. [6, 34, 60, 86, 112, 138],
  2628. [6, 30, 58, 86, 114, 142],
  2629. [6, 34, 62, 90, 118, 146],
  2630. [6, 30, 54, 78, 102, 126, 150],
  2631. [6, 24, 50, 76, 102, 128, 154],
  2632. [6, 28, 54, 80, 106, 132, 158],
  2633. [6, 32, 58, 84, 110, 136, 162],
  2634. [6, 26, 54, 82, 110, 138, 166],
  2635. [6, 30, 58, 86, 114, 142, 170]],
  2636. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  2637. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  2638. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  2639. /*
  2640. BCH编码格式信息
  2641. */
  2642. getBCHTypeInfo: function getBCHTypeInfo(data) {
  2643. var d = data << 10;
  2644. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  2645. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  2646. }
  2647. return (data << 10 | d) ^ QRUtil.G15_MASK;
  2648. },
  2649. /*
  2650. BCH编码版本信息
  2651. */
  2652. getBCHTypeNumber: function getBCHTypeNumber(data) {
  2653. var d = data << 12;
  2654. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  2655. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  2656. }
  2657. return data << 12 | d;
  2658. },
  2659. /*
  2660. 获取BCH位信息
  2661. */
  2662. getBCHDigit: function getBCHDigit(data) {
  2663. var digit = 0;
  2664. while (data != 0) {
  2665. digit++;
  2666. data >>>= 1;
  2667. }
  2668. return digit;
  2669. },
  2670. /*
  2671. 获取版本对应的矫正图形位置
  2672. */
  2673. getPatternPosition: function getPatternPosition(typeNumber) {
  2674. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  2675. },
  2676. /*
  2677. 掩膜算法
  2678. */
  2679. getMask: function getMask(maskPattern, i, j) {
  2680. switch (maskPattern) {
  2681. case QRMaskPattern.PATTERN000:
  2682. return (i + j) % 2 == 0;
  2683. case QRMaskPattern.PATTERN001:
  2684. return i % 2 == 0;
  2685. case QRMaskPattern.PATTERN010:
  2686. return j % 3 == 0;
  2687. case QRMaskPattern.PATTERN011:
  2688. return (i + j) % 3 == 0;
  2689. case QRMaskPattern.PATTERN100:
  2690. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  2691. case QRMaskPattern.PATTERN101:
  2692. return i * j % 2 + i * j % 3 == 0;
  2693. case QRMaskPattern.PATTERN110:
  2694. return (i * j % 2 + i * j % 3) % 2 == 0;
  2695. case QRMaskPattern.PATTERN111:
  2696. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  2697. default:
  2698. throw new Error("bad maskPattern:" + maskPattern);}
  2699. },
  2700. /*
  2701. 获取RS的纠错多项式
  2702. */
  2703. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  2704. var a = new QRPolynomial([1], 0);
  2705. for (var i = 0; i < errorCorrectLength; i++) {
  2706. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  2707. }
  2708. return a;
  2709. },
  2710. /*
  2711. 获取评价
  2712. */
  2713. getLostPoint: function getLostPoint(qrCode) {
  2714. var moduleCount = qrCode.getModuleCount(),
  2715. lostPoint = 0,
  2716. darkCount = 0;
  2717. for (var row = 0; row < moduleCount; row++) {
  2718. var sameCount = 0;
  2719. var head = qrCode.modules[row][0];
  2720. for (var col = 0; col < moduleCount; col++) {
  2721. var current = qrCode.modules[row][col];
  2722. //level 3 评价
  2723. if (col < moduleCount - 6) {
  2724. if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
  2725. if (col < moduleCount - 10) {
  2726. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  2727. lostPoint += 40;
  2728. }
  2729. } else if (col > 3) {
  2730. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  2731. lostPoint += 40;
  2732. }
  2733. }
  2734. }
  2735. }
  2736. //level 2 评价
  2737. if (row < moduleCount - 1 && col < moduleCount - 1) {
  2738. var count = 0;
  2739. if (current) count++;
  2740. if (qrCode.modules[row + 1][col]) count++;
  2741. if (qrCode.modules[row][col + 1]) count++;
  2742. if (qrCode.modules[row + 1][col + 1]) count++;
  2743. if (count == 0 || count == 4) {
  2744. lostPoint += 3;
  2745. }
  2746. }
  2747. //level 1 评价
  2748. if (head ^ current) {
  2749. sameCount++;
  2750. } else {
  2751. head = current;
  2752. if (sameCount >= 5) {
  2753. lostPoint += 3 + sameCount - 5;
  2754. }
  2755. sameCount = 1;
  2756. }
  2757. //level 4 评价
  2758. if (current) {
  2759. darkCount++;
  2760. }
  2761. }
  2762. }
  2763. for (var col = 0; col < moduleCount; col++) {
  2764. var sameCount = 0;
  2765. var head = qrCode.modules[0][col];
  2766. for (var row = 0; row < moduleCount; row++) {
  2767. var current = qrCode.modules[row][col];
  2768. //level 3 评价
  2769. if (row < moduleCount - 6) {
  2770. if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
  2771. if (row < moduleCount - 10) {
  2772. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  2773. lostPoint += 40;
  2774. }
  2775. } else if (row > 3) {
  2776. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  2777. lostPoint += 40;
  2778. }
  2779. }
  2780. }
  2781. }
  2782. //level 1 评价
  2783. if (head ^ current) {
  2784. sameCount++;
  2785. } else {
  2786. head = current;
  2787. if (sameCount >= 5) {
  2788. lostPoint += 3 + sameCount - 5;
  2789. }
  2790. sameCount = 1;
  2791. }
  2792. }
  2793. }
  2794. // LEVEL4
  2795. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  2796. lostPoint += ratio * 10;
  2797. return lostPoint;
  2798. } };
  2799. //---------------------------------------------------------------------
  2800. // QRMath使用的数学工具
  2801. //---------------------------------------------------------------------
  2802. var QRMath = {
  2803. /*
  2804. 将n转化为a^m
  2805. */
  2806. glog: function glog(n) {
  2807. if (n < 1) {
  2808. throw new Error("glog(" + n + ")");
  2809. }
  2810. return QRMath.LOG_TABLE[n];
  2811. },
  2812. /*
  2813. 将a^m转化为n
  2814. */
  2815. gexp: function gexp(n) {
  2816. while (n < 0) {
  2817. n += 255;
  2818. }
  2819. while (n >= 256) {
  2820. n -= 255;
  2821. }
  2822. return QRMath.EXP_TABLE[n];
  2823. },
  2824. EXP_TABLE: new Array(256),
  2825. LOG_TABLE: new Array(256) };
  2826. for (var i = 0; i < 8; i++) {
  2827. QRMath.EXP_TABLE[i] = 1 << i;
  2828. }
  2829. for (var i = 8; i < 256; i++) {
  2830. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
  2831. }
  2832. for (var i = 0; i < 255; i++) {
  2833. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  2834. }
  2835. //---------------------------------------------------------------------
  2836. // QRPolynomial 多项式
  2837. //---------------------------------------------------------------------
  2838. /**
  2839. * 多项式类
  2840. * @param {Array} num 系数
  2841. * @param {num} shift a^shift
  2842. */
  2843. function QRPolynomial(num, shift) {
  2844. if (num.length == undefined) {
  2845. throw new Error(num.length + "/" + shift);
  2846. }
  2847. var offset = 0;
  2848. while (offset < num.length && num[offset] == 0) {
  2849. offset++;
  2850. }
  2851. this.num = new Array(num.length - offset + shift);
  2852. for (var i = 0; i < num.length - offset; i++) {
  2853. this.num[i] = num[i + offset];
  2854. }
  2855. }
  2856. QRPolynomial.prototype = {
  2857. get: function get(index) {
  2858. return this.num[index];
  2859. },
  2860. getLength: function getLength() {
  2861. return this.num.length;
  2862. },
  2863. /**
  2864. * 多项式乘法
  2865. * @param {QRPolynomial} e 被乘多项式
  2866. * @return {[type]} [description]
  2867. */
  2868. multiply: function multiply(e) {
  2869. var num = new Array(this.getLength() + e.getLength() - 1);
  2870. for (var i = 0; i < this.getLength(); i++) {
  2871. for (var j = 0; j < e.getLength(); j++) {
  2872. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  2873. }
  2874. }
  2875. return new QRPolynomial(num, 0);
  2876. },
  2877. /**
  2878. * 多项式模运算
  2879. * @param {QRPolynomial} e 模多项式
  2880. * @return {}
  2881. */
  2882. mod: function mod(e) {
  2883. var tl = this.getLength(),
  2884. el = e.getLength();
  2885. if (tl - el < 0) {
  2886. return this;
  2887. }
  2888. var num = new Array(tl);
  2889. for (var i = 0; i < tl; i++) {
  2890. num[i] = this.get(i);
  2891. }
  2892. while (num.length >= el) {
  2893. var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
  2894. for (var i = 0; i < e.getLength(); i++) {
  2895. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  2896. }
  2897. while (num[0] == 0) {
  2898. num.shift();
  2899. }
  2900. }
  2901. return new QRPolynomial(num, 0);
  2902. } };
  2903. //---------------------------------------------------------------------
  2904. // RS_BLOCK_TABLE
  2905. //---------------------------------------------------------------------
  2906. /*
  2907. 二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
  2908. */
  2909. var RS_BLOCK_TABLE = [
  2910. // L
  2911. // M
  2912. // Q
  2913. // H
  2914. // 1
  2915. [1, 26, 19],
  2916. [1, 26, 16],
  2917. [1, 26, 13],
  2918. [1, 26, 9],
  2919. // 2
  2920. [1, 44, 34],
  2921. [1, 44, 28],
  2922. [1, 44, 22],
  2923. [1, 44, 16],
  2924. // 3
  2925. [1, 70, 55],
  2926. [1, 70, 44],
  2927. [2, 35, 17],
  2928. [2, 35, 13],
  2929. // 4
  2930. [1, 100, 80],
  2931. [2, 50, 32],
  2932. [2, 50, 24],
  2933. [4, 25, 9],
  2934. // 5
  2935. [1, 134, 108],
  2936. [2, 67, 43],
  2937. [2, 33, 15, 2, 34, 16],
  2938. [2, 33, 11, 2, 34, 12],
  2939. // 6
  2940. [2, 86, 68],
  2941. [4, 43, 27],
  2942. [4, 43, 19],
  2943. [4, 43, 15],
  2944. // 7
  2945. [2, 98, 78],
  2946. [4, 49, 31],
  2947. [2, 32, 14, 4, 33, 15],
  2948. [4, 39, 13, 1, 40, 14],
  2949. // 8
  2950. [2, 121, 97],
  2951. [2, 60, 38, 2, 61, 39],
  2952. [4, 40, 18, 2, 41, 19],
  2953. [4, 40, 14, 2, 41, 15],
  2954. // 9
  2955. [2, 146, 116],
  2956. [3, 58, 36, 2, 59, 37],
  2957. [4, 36, 16, 4, 37, 17],
  2958. [4, 36, 12, 4, 37, 13],
  2959. // 10
  2960. [2, 86, 68, 2, 87, 69],
  2961. [4, 69, 43, 1, 70, 44],
  2962. [6, 43, 19, 2, 44, 20],
  2963. [6, 43, 15, 2, 44, 16],
  2964. // 11
  2965. [4, 101, 81],
  2966. [1, 80, 50, 4, 81, 51],
  2967. [4, 50, 22, 4, 51, 23],
  2968. [3, 36, 12, 8, 37, 13],
  2969. // 12
  2970. [2, 116, 92, 2, 117, 93],
  2971. [6, 58, 36, 2, 59, 37],
  2972. [4, 46, 20, 6, 47, 21],
  2973. [7, 42, 14, 4, 43, 15],
  2974. // 13
  2975. [4, 133, 107],
  2976. [8, 59, 37, 1, 60, 38],
  2977. [8, 44, 20, 4, 45, 21],
  2978. [12, 33, 11, 4, 34, 12],
  2979. // 14
  2980. [3, 145, 115, 1, 146, 116],
  2981. [4, 64, 40, 5, 65, 41],
  2982. [11, 36, 16, 5, 37, 17],
  2983. [11, 36, 12, 5, 37, 13],
  2984. // 15
  2985. [5, 109, 87, 1, 110, 88],
  2986. [5, 65, 41, 5, 66, 42],
  2987. [5, 54, 24, 7, 55, 25],
  2988. [11, 36, 12],
  2989. // 16
  2990. [5, 122, 98, 1, 123, 99],
  2991. [7, 73, 45, 3, 74, 46],
  2992. [15, 43, 19, 2, 44, 20],
  2993. [3, 45, 15, 13, 46, 16],
  2994. // 17
  2995. [1, 135, 107, 5, 136, 108],
  2996. [10, 74, 46, 1, 75, 47],
  2997. [1, 50, 22, 15, 51, 23],
  2998. [2, 42, 14, 17, 43, 15],
  2999. // 18
  3000. [5, 150, 120, 1, 151, 121],
  3001. [9, 69, 43, 4, 70, 44],
  3002. [17, 50, 22, 1, 51, 23],
  3003. [2, 42, 14, 19, 43, 15],
  3004. // 19
  3005. [3, 141, 113, 4, 142, 114],
  3006. [3, 70, 44, 11, 71, 45],
  3007. [17, 47, 21, 4, 48, 22],
  3008. [9, 39, 13, 16, 40, 14],
  3009. // 20
  3010. [3, 135, 107, 5, 136, 108],
  3011. [3, 67, 41, 13, 68, 42],
  3012. [15, 54, 24, 5, 55, 25],
  3013. [15, 43, 15, 10, 44, 16],
  3014. // 21
  3015. [4, 144, 116, 4, 145, 117],
  3016. [17, 68, 42],
  3017. [17, 50, 22, 6, 51, 23],
  3018. [19, 46, 16, 6, 47, 17],
  3019. // 22
  3020. [2, 139, 111, 7, 140, 112],
  3021. [17, 74, 46],
  3022. [7, 54, 24, 16, 55, 25],
  3023. [34, 37, 13],
  3024. // 23
  3025. [4, 151, 121, 5, 152, 122],
  3026. [4, 75, 47, 14, 76, 48],
  3027. [11, 54, 24, 14, 55, 25],
  3028. [16, 45, 15, 14, 46, 16],
  3029. // 24
  3030. [6, 147, 117, 4, 148, 118],
  3031. [6, 73, 45, 14, 74, 46],
  3032. [11, 54, 24, 16, 55, 25],
  3033. [30, 46, 16, 2, 47, 17],
  3034. // 25
  3035. [8, 132, 106, 4, 133, 107],
  3036. [8, 75, 47, 13, 76, 48],
  3037. [7, 54, 24, 22, 55, 25],
  3038. [22, 45, 15, 13, 46, 16],
  3039. // 26
  3040. [10, 142, 114, 2, 143, 115],
  3041. [19, 74, 46, 4, 75, 47],
  3042. [28, 50, 22, 6, 51, 23],
  3043. [33, 46, 16, 4, 47, 17],
  3044. // 27
  3045. [8, 152, 122, 4, 153, 123],
  3046. [22, 73, 45, 3, 74, 46],
  3047. [8, 53, 23, 26, 54, 24],
  3048. [12, 45, 15, 28, 46, 16],
  3049. // 28
  3050. [3, 147, 117, 10, 148, 118],
  3051. [3, 73, 45, 23, 74, 46],
  3052. [4, 54, 24, 31, 55, 25],
  3053. [11, 45, 15, 31, 46, 16],
  3054. // 29
  3055. [7, 146, 116, 7, 147, 117],
  3056. [21, 73, 45, 7, 74, 46],
  3057. [1, 53, 23, 37, 54, 24],
  3058. [19, 45, 15, 26, 46, 16],
  3059. // 30
  3060. [5, 145, 115, 10, 146, 116],
  3061. [19, 75, 47, 10, 76, 48],
  3062. [15, 54, 24, 25, 55, 25],
  3063. [23, 45, 15, 25, 46, 16],
  3064. // 31
  3065. [13, 145, 115, 3, 146, 116],
  3066. [2, 74, 46, 29, 75, 47],
  3067. [42, 54, 24, 1, 55, 25],
  3068. [23, 45, 15, 28, 46, 16],
  3069. // 32
  3070. [17, 145, 115],
  3071. [10, 74, 46, 23, 75, 47],
  3072. [10, 54, 24, 35, 55, 25],
  3073. [19, 45, 15, 35, 46, 16],
  3074. // 33
  3075. [17, 145, 115, 1, 146, 116],
  3076. [14, 74, 46, 21, 75, 47],
  3077. [29, 54, 24, 19, 55, 25],
  3078. [11, 45, 15, 46, 46, 16],
  3079. // 34
  3080. [13, 145, 115, 6, 146, 116],
  3081. [14, 74, 46, 23, 75, 47],
  3082. [44, 54, 24, 7, 55, 25],
  3083. [59, 46, 16, 1, 47, 17],
  3084. // 35
  3085. [12, 151, 121, 7, 152, 122],
  3086. [12, 75, 47, 26, 76, 48],
  3087. [39, 54, 24, 14, 55, 25],
  3088. [22, 45, 15, 41, 46, 16],
  3089. // 36
  3090. [6, 151, 121, 14, 152, 122],
  3091. [6, 75, 47, 34, 76, 48],
  3092. [46, 54, 24, 10, 55, 25],
  3093. [2, 45, 15, 64, 46, 16],
  3094. // 37
  3095. [17, 152, 122, 4, 153, 123],
  3096. [29, 74, 46, 14, 75, 47],
  3097. [49, 54, 24, 10, 55, 25],
  3098. [24, 45, 15, 46, 46, 16],
  3099. // 38
  3100. [4, 152, 122, 18, 153, 123],
  3101. [13, 74, 46, 32, 75, 47],
  3102. [48, 54, 24, 14, 55, 25],
  3103. [42, 45, 15, 32, 46, 16],
  3104. // 39
  3105. [20, 147, 117, 4, 148, 118],
  3106. [40, 75, 47, 7, 76, 48],
  3107. [43, 54, 24, 22, 55, 25],
  3108. [10, 45, 15, 67, 46, 16],
  3109. // 40
  3110. [19, 148, 118, 6, 149, 119],
  3111. [18, 75, 47, 31, 76, 48],
  3112. [34, 54, 24, 34, 55, 25],
  3113. [20, 45, 15, 61, 46, 16]];
  3114. /**
  3115. * 根据数据获取对应版本
  3116. * @return {[type]} [description]
  3117. */
  3118. QRCodeAlg.prototype.getRightType = function () {
  3119. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  3120. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  3121. if (rsBlock == undefined) {
  3122. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  3123. }
  3124. var length = rsBlock.length / 3;
  3125. var totalDataCount = 0;
  3126. for (var i = 0; i < length; i++) {
  3127. var count = rsBlock[i * 3 + 0];
  3128. var dataCount = rsBlock[i * 3 + 2];
  3129. totalDataCount += dataCount * count;
  3130. }
  3131. var lengthBytes = typeNumber > 9 ? 2 : 1;
  3132. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  3133. this.typeNumber = typeNumber;
  3134. this.rsBlock = rsBlock;
  3135. this.totalDataCount = totalDataCount;
  3136. break;
  3137. }
  3138. }
  3139. };
  3140. //---------------------------------------------------------------------
  3141. // QRBitBuffer
  3142. //---------------------------------------------------------------------
  3143. function QRBitBuffer() {
  3144. this.buffer = new Array();
  3145. this.length = 0;
  3146. }
  3147. QRBitBuffer.prototype = {
  3148. get: function get(index) {
  3149. var bufIndex = Math.floor(index / 8);
  3150. return this.buffer[bufIndex] >>> 7 - index % 8 & 1;
  3151. },
  3152. put: function put(num, length) {
  3153. for (var i = 0; i < length; i++) {
  3154. this.putBit(num >>> length - i - 1 & 1);
  3155. }
  3156. },
  3157. putBit: function putBit(bit) {
  3158. var bufIndex = Math.floor(this.length / 8);
  3159. if (this.buffer.length <= bufIndex) {
  3160. this.buffer.push(0);
  3161. }
  3162. if (bit) {
  3163. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  3164. }
  3165. this.length++;
  3166. } };
  3167. // xzedit
  3168. var qrcodeAlgObjCache = [];
  3169. /**
  3170. * 二维码构造函数,主要用于绘制
  3171. * @param {参数列表} opt 传递参数
  3172. * @return {}
  3173. */
  3174. QRCode = function QRCode(opt) {
  3175. //设置默认参数
  3176. this.options = {
  3177. text: '',
  3178. size: 256,
  3179. correctLevel: 3,
  3180. background: '#ffffff',
  3181. foreground: '#000000',
  3182. pdground: '#000000',
  3183. image: '',
  3184. imageSize: 30,
  3185. canvasId: opt.canvasId,
  3186. context: opt.context,
  3187. usingComponents: opt.usingComponents,
  3188. showLoading: opt.showLoading,
  3189. loadingText: opt.loadingText };
  3190. if (typeof opt === 'string') {// 只编码ASCII字符串
  3191. opt = {
  3192. text: opt };
  3193. }
  3194. if (opt) {
  3195. for (var i in opt) {
  3196. this.options[i] = opt[i];
  3197. }
  3198. }
  3199. //使用QRCodeAlg创建二维码结构
  3200. var qrCodeAlg = null;
  3201. for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
  3202. if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
  3203. qrCodeAlg = qrcodeAlgObjCache[i].obj;
  3204. break;
  3205. }
  3206. }
  3207. if (i == l) {
  3208. qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
  3209. qrcodeAlgObjCache.push({
  3210. text: this.options.text,
  3211. correctLevel: this.options.correctLevel,
  3212. obj: qrCodeAlg });
  3213. }
  3214. /**
  3215. * 计算矩阵点的前景色
  3216. * @param {Obj} config
  3217. * @param {Number} config.row 点x坐标
  3218. * @param {Number} config.col 点y坐标
  3219. * @param {Number} config.count 矩阵大小
  3220. * @param {Number} config.options 组件的options
  3221. * @return {String}
  3222. */
  3223. var getForeGround = function getForeGround(config) {
  3224. var options = config.options;
  3225. if (options.pdground && (
  3226. config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 ||
  3227. config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 ||
  3228. config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2))
  3229. {
  3230. return options.pdground;
  3231. }
  3232. return options.foreground;
  3233. };
  3234. // 创建canvas
  3235. var createCanvas = function createCanvas(options) {
  3236. if (options.showLoading) {
  3237. uni.showLoading({
  3238. title: options.loadingText,
  3239. mask: true });
  3240. }
  3241. var ctx = uni.createCanvasContext(options.canvasId, options.context);
  3242. var count = qrCodeAlg.getModuleCount();
  3243. var ratioSize = options.size;
  3244. var ratioImgSize = options.imageSize;
  3245. //计算每个点的长宽
  3246. var tileW = (ratioSize / count).toPrecision(4);
  3247. var tileH = (ratioSize / count).toPrecision(4);
  3248. //绘制
  3249. for (var row = 0; row < count; row++) {
  3250. for (var col = 0; col < count; col++) {
  3251. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  3252. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  3253. var foreground = getForeGround({
  3254. row: row,
  3255. col: col,
  3256. count: count,
  3257. options: options });
  3258. ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
  3259. ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
  3260. }
  3261. }
  3262. if (options.image) {
  3263. // 画圆角矩形
  3264. var drawRoundedRect = function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
  3265. ctxi.setLineWidth(lineWidth);
  3266. ctxi.setFillStyle(options.background);
  3267. ctxi.setStrokeStyle(options.background);
  3268. ctxi.beginPath(); // draw top and top right corner
  3269. ctxi.moveTo(x + r, y);
  3270. ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
  3271. ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
  3272. ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
  3273. ctxi.arcTo(x, y, x + r, y, r);
  3274. ctxi.closePath();
  3275. if (fill) {
  3276. ctxi.fill();
  3277. }
  3278. if (stroke) {
  3279. ctxi.stroke();
  3280. }
  3281. };var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true);ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
  3282. }
  3283. setTimeout(function () {
  3284. ctx.draw(true, function () {
  3285. // 保存到临时区域
  3286. setTimeout(function () {
  3287. uni.canvasToTempFilePath({
  3288. width: options.width,
  3289. height: options.height,
  3290. destWidth: options.width,
  3291. destHeight: options.height,
  3292. canvasId: options.canvasId,
  3293. quality: Number(1),
  3294. success: function success(res) {
  3295. if (options.cbResult) {
  3296. options.cbResult(res.tempFilePath);
  3297. }
  3298. },
  3299. fail: function fail(res) {
  3300. if (options.cbResult) {
  3301. options.cbResult(res);
  3302. }
  3303. },
  3304. complete: function complete() {
  3305. if (options.showLoading) {
  3306. uni.hideLoading();
  3307. }
  3308. } },
  3309. options.context);
  3310. }, options.text.length + 100);
  3311. });
  3312. }, options.usingComponents ? 0 : 150);
  3313. };
  3314. createCanvas(this.options);
  3315. // 空判定
  3316. var empty = function empty(v) {
  3317. var tp = typeof v,
  3318. rt = false;
  3319. if (tp == "number" && String(v) == "") {
  3320. rt = true;
  3321. } else if (tp == "undefined") {
  3322. rt = true;
  3323. } else if (tp == "object") {
  3324. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true;
  3325. } else if (tp == "string") {
  3326. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true;
  3327. } else if (tp == "function") {
  3328. rt = false;
  3329. }
  3330. return rt;
  3331. };
  3332. };
  3333. QRCode.prototype.clear = function (fn) {
  3334. var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context);
  3335. ctx.clearRect(0, 0, this.options.size, this.options.size);
  3336. ctx.draw(false, function () {
  3337. if (fn) {
  3338. fn();
  3339. }
  3340. });
  3341. };
  3342. })();var _default =
  3343. QRCode;exports.default = _default;
  3344. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3345. /***/ }),
  3346. /***/ 2:
  3347. /*!***********************************!*\
  3348. !*** (webpack)/buildin/global.js ***!
  3349. \***********************************/
  3350. /*! no static exports found */
  3351. /***/ (function(module, exports) {
  3352. var g;
  3353. // This works in non-strict mode
  3354. g = (function() {
  3355. return this;
  3356. })();
  3357. try {
  3358. // This works if eval is allowed (see CSP)
  3359. g = g || new Function("return this")();
  3360. } catch (e) {
  3361. // This works if the window reference is available
  3362. if (typeof window === "object") g = window;
  3363. }
  3364. // g can still be undefined, but nothing to do about it...
  3365. // We return undefined, instead of nothing here, so it's
  3366. // easier to handle this case. if(!global) { ...}
  3367. module.exports = g;
  3368. /***/ }),
  3369. /***/ 3:
  3370. /*!******************************************************************************************!*\
  3371. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3372. \******************************************************************************************/
  3373. /*! exports provided: default */
  3374. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3375. "use strict";
  3376. __webpack_require__.r(__webpack_exports__);
  3377. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3378. * Vue.js v2.6.11
  3379. * (c) 2014-2021 Evan You
  3380. * Released under the MIT License.
  3381. */
  3382. /* */
  3383. var emptyObject = Object.freeze({});
  3384. // These helpers produce better VM code in JS engines due to their
  3385. // explicitness and function inlining.
  3386. function isUndef (v) {
  3387. return v === undefined || v === null
  3388. }
  3389. function isDef (v) {
  3390. return v !== undefined && v !== null
  3391. }
  3392. function isTrue (v) {
  3393. return v === true
  3394. }
  3395. function isFalse (v) {
  3396. return v === false
  3397. }
  3398. /**
  3399. * Check if value is primitive.
  3400. */
  3401. function isPrimitive (value) {
  3402. return (
  3403. typeof value === 'string' ||
  3404. typeof value === 'number' ||
  3405. // $flow-disable-line
  3406. typeof value === 'symbol' ||
  3407. typeof value === 'boolean'
  3408. )
  3409. }
  3410. /**
  3411. * Quick object check - this is primarily used to tell
  3412. * Objects from primitive values when we know the value
  3413. * is a JSON-compliant type.
  3414. */
  3415. function isObject (obj) {
  3416. return obj !== null && typeof obj === 'object'
  3417. }
  3418. /**
  3419. * Get the raw type string of a value, e.g., [object Object].
  3420. */
  3421. var _toString = Object.prototype.toString;
  3422. function toRawType (value) {
  3423. return _toString.call(value).slice(8, -1)
  3424. }
  3425. /**
  3426. * Strict object type check. Only returns true
  3427. * for plain JavaScript objects.
  3428. */
  3429. function isPlainObject (obj) {
  3430. return _toString.call(obj) === '[object Object]'
  3431. }
  3432. function isRegExp (v) {
  3433. return _toString.call(v) === '[object RegExp]'
  3434. }
  3435. /**
  3436. * Check if val is a valid array index.
  3437. */
  3438. function isValidArrayIndex (val) {
  3439. var n = parseFloat(String(val));
  3440. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3441. }
  3442. function isPromise (val) {
  3443. return (
  3444. isDef(val) &&
  3445. typeof val.then === 'function' &&
  3446. typeof val.catch === 'function'
  3447. )
  3448. }
  3449. /**
  3450. * Convert a value to a string that is actually rendered.
  3451. */
  3452. function toString (val) {
  3453. return val == null
  3454. ? ''
  3455. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3456. ? JSON.stringify(val, null, 2)
  3457. : String(val)
  3458. }
  3459. /**
  3460. * Convert an input value to a number for persistence.
  3461. * If the conversion fails, return original string.
  3462. */
  3463. function toNumber (val) {
  3464. var n = parseFloat(val);
  3465. return isNaN(n) ? val : n
  3466. }
  3467. /**
  3468. * Make a map and return a function for checking if a key
  3469. * is in that map.
  3470. */
  3471. function makeMap (
  3472. str,
  3473. expectsLowerCase
  3474. ) {
  3475. var map = Object.create(null);
  3476. var list = str.split(',');
  3477. for (var i = 0; i < list.length; i++) {
  3478. map[list[i]] = true;
  3479. }
  3480. return expectsLowerCase
  3481. ? function (val) { return map[val.toLowerCase()]; }
  3482. : function (val) { return map[val]; }
  3483. }
  3484. /**
  3485. * Check if a tag is a built-in tag.
  3486. */
  3487. var isBuiltInTag = makeMap('slot,component', true);
  3488. /**
  3489. * Check if an attribute is a reserved attribute.
  3490. */
  3491. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3492. /**
  3493. * Remove an item from an array.
  3494. */
  3495. function remove (arr, item) {
  3496. if (arr.length) {
  3497. var index = arr.indexOf(item);
  3498. if (index > -1) {
  3499. return arr.splice(index, 1)
  3500. }
  3501. }
  3502. }
  3503. /**
  3504. * Check whether an object has the property.
  3505. */
  3506. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3507. function hasOwn (obj, key) {
  3508. return hasOwnProperty.call(obj, key)
  3509. }
  3510. /**
  3511. * Create a cached version of a pure function.
  3512. */
  3513. function cached (fn) {
  3514. var cache = Object.create(null);
  3515. return (function cachedFn (str) {
  3516. var hit = cache[str];
  3517. return hit || (cache[str] = fn(str))
  3518. })
  3519. }
  3520. /**
  3521. * Camelize a hyphen-delimited string.
  3522. */
  3523. var camelizeRE = /-(\w)/g;
  3524. var camelize = cached(function (str) {
  3525. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3526. });
  3527. /**
  3528. * Capitalize a string.
  3529. */
  3530. var capitalize = cached(function (str) {
  3531. return str.charAt(0).toUpperCase() + str.slice(1)
  3532. });
  3533. /**
  3534. * Hyphenate a camelCase string.
  3535. */
  3536. var hyphenateRE = /\B([A-Z])/g;
  3537. var hyphenate = cached(function (str) {
  3538. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3539. });
  3540. /**
  3541. * Simple bind polyfill for environments that do not support it,
  3542. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3543. * since native bind is now performant enough in most browsers.
  3544. * But removing it would mean breaking code that was able to run in
  3545. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3546. */
  3547. /* istanbul ignore next */
  3548. function polyfillBind (fn, ctx) {
  3549. function boundFn (a) {
  3550. var l = arguments.length;
  3551. return l
  3552. ? l > 1
  3553. ? fn.apply(ctx, arguments)
  3554. : fn.call(ctx, a)
  3555. : fn.call(ctx)
  3556. }
  3557. boundFn._length = fn.length;
  3558. return boundFn
  3559. }
  3560. function nativeBind (fn, ctx) {
  3561. return fn.bind(ctx)
  3562. }
  3563. var bind = Function.prototype.bind
  3564. ? nativeBind
  3565. : polyfillBind;
  3566. /**
  3567. * Convert an Array-like object to a real Array.
  3568. */
  3569. function toArray (list, start) {
  3570. start = start || 0;
  3571. var i = list.length - start;
  3572. var ret = new Array(i);
  3573. while (i--) {
  3574. ret[i] = list[i + start];
  3575. }
  3576. return ret
  3577. }
  3578. /**
  3579. * Mix properties into target object.
  3580. */
  3581. function extend (to, _from) {
  3582. for (var key in _from) {
  3583. to[key] = _from[key];
  3584. }
  3585. return to
  3586. }
  3587. /**
  3588. * Merge an Array of Objects into a single Object.
  3589. */
  3590. function toObject (arr) {
  3591. var res = {};
  3592. for (var i = 0; i < arr.length; i++) {
  3593. if (arr[i]) {
  3594. extend(res, arr[i]);
  3595. }
  3596. }
  3597. return res
  3598. }
  3599. /* eslint-disable no-unused-vars */
  3600. /**
  3601. * Perform no operation.
  3602. * Stubbing args to make Flow happy without leaving useless transpiled code
  3603. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3604. */
  3605. function noop (a, b, c) {}
  3606. /**
  3607. * Always return false.
  3608. */
  3609. var no = function (a, b, c) { return false; };
  3610. /* eslint-enable no-unused-vars */
  3611. /**
  3612. * Return the same value.
  3613. */
  3614. var identity = function (_) { return _; };
  3615. /**
  3616. * Check if two values are loosely equal - that is,
  3617. * if they are plain objects, do they have the same shape?
  3618. */
  3619. function looseEqual (a, b) {
  3620. if (a === b) { return true }
  3621. var isObjectA = isObject(a);
  3622. var isObjectB = isObject(b);
  3623. if (isObjectA && isObjectB) {
  3624. try {
  3625. var isArrayA = Array.isArray(a);
  3626. var isArrayB = Array.isArray(b);
  3627. if (isArrayA && isArrayB) {
  3628. return a.length === b.length && a.every(function (e, i) {
  3629. return looseEqual(e, b[i])
  3630. })
  3631. } else if (a instanceof Date && b instanceof Date) {
  3632. return a.getTime() === b.getTime()
  3633. } else if (!isArrayA && !isArrayB) {
  3634. var keysA = Object.keys(a);
  3635. var keysB = Object.keys(b);
  3636. return keysA.length === keysB.length && keysA.every(function (key) {
  3637. return looseEqual(a[key], b[key])
  3638. })
  3639. } else {
  3640. /* istanbul ignore next */
  3641. return false
  3642. }
  3643. } catch (e) {
  3644. /* istanbul ignore next */
  3645. return false
  3646. }
  3647. } else if (!isObjectA && !isObjectB) {
  3648. return String(a) === String(b)
  3649. } else {
  3650. return false
  3651. }
  3652. }
  3653. /**
  3654. * Return the first index at which a loosely equal value can be
  3655. * found in the array (if value is a plain object, the array must
  3656. * contain an object of the same shape), or -1 if it is not present.
  3657. */
  3658. function looseIndexOf (arr, val) {
  3659. for (var i = 0; i < arr.length; i++) {
  3660. if (looseEqual(arr[i], val)) { return i }
  3661. }
  3662. return -1
  3663. }
  3664. /**
  3665. * Ensure a function is called only once.
  3666. */
  3667. function once (fn) {
  3668. var called = false;
  3669. return function () {
  3670. if (!called) {
  3671. called = true;
  3672. fn.apply(this, arguments);
  3673. }
  3674. }
  3675. }
  3676. var ASSET_TYPES = [
  3677. 'component',
  3678. 'directive',
  3679. 'filter'
  3680. ];
  3681. var LIFECYCLE_HOOKS = [
  3682. 'beforeCreate',
  3683. 'created',
  3684. 'beforeMount',
  3685. 'mounted',
  3686. 'beforeUpdate',
  3687. 'updated',
  3688. 'beforeDestroy',
  3689. 'destroyed',
  3690. 'activated',
  3691. 'deactivated',
  3692. 'errorCaptured',
  3693. 'serverPrefetch'
  3694. ];
  3695. /* */
  3696. var config = ({
  3697. /**
  3698. * Option merge strategies (used in core/util/options)
  3699. */
  3700. // $flow-disable-line
  3701. optionMergeStrategies: Object.create(null),
  3702. /**
  3703. * Whether to suppress warnings.
  3704. */
  3705. silent: false,
  3706. /**
  3707. * Show production mode tip message on boot?
  3708. */
  3709. productionTip: "development" !== 'production',
  3710. /**
  3711. * Whether to enable devtools
  3712. */
  3713. devtools: "development" !== 'production',
  3714. /**
  3715. * Whether to record perf
  3716. */
  3717. performance: false,
  3718. /**
  3719. * Error handler for watcher errors
  3720. */
  3721. errorHandler: null,
  3722. /**
  3723. * Warn handler for watcher warns
  3724. */
  3725. warnHandler: null,
  3726. /**
  3727. * Ignore certain custom elements
  3728. */
  3729. ignoredElements: [],
  3730. /**
  3731. * Custom user key aliases for v-on
  3732. */
  3733. // $flow-disable-line
  3734. keyCodes: Object.create(null),
  3735. /**
  3736. * Check if a tag is reserved so that it cannot be registered as a
  3737. * component. This is platform-dependent and may be overwritten.
  3738. */
  3739. isReservedTag: no,
  3740. /**
  3741. * Check if an attribute is reserved so that it cannot be used as a component
  3742. * prop. This is platform-dependent and may be overwritten.
  3743. */
  3744. isReservedAttr: no,
  3745. /**
  3746. * Check if a tag is an unknown element.
  3747. * Platform-dependent.
  3748. */
  3749. isUnknownElement: no,
  3750. /**
  3751. * Get the namespace of an element
  3752. */
  3753. getTagNamespace: noop,
  3754. /**
  3755. * Parse the real tag name for the specific platform.
  3756. */
  3757. parsePlatformTagName: identity,
  3758. /**
  3759. * Check if an attribute must be bound using property, e.g. value
  3760. * Platform-dependent.
  3761. */
  3762. mustUseProp: no,
  3763. /**
  3764. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3765. * This will significantly reduce performance if set to false.
  3766. */
  3767. async: true,
  3768. /**
  3769. * Exposed for legacy reasons
  3770. */
  3771. _lifecycleHooks: LIFECYCLE_HOOKS
  3772. });
  3773. /* */
  3774. /**
  3775. * unicode letters used for parsing html tags, component names and property paths.
  3776. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3777. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3778. */
  3779. 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/;
  3780. /**
  3781. * Check if a string starts with $ or _
  3782. */
  3783. function isReserved (str) {
  3784. var c = (str + '').charCodeAt(0);
  3785. return c === 0x24 || c === 0x5F
  3786. }
  3787. /**
  3788. * Define a property.
  3789. */
  3790. function def (obj, key, val, enumerable) {
  3791. Object.defineProperty(obj, key, {
  3792. value: val,
  3793. enumerable: !!enumerable,
  3794. writable: true,
  3795. configurable: true
  3796. });
  3797. }
  3798. /**
  3799. * Parse simple path.
  3800. */
  3801. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3802. function parsePath (path) {
  3803. if (bailRE.test(path)) {
  3804. return
  3805. }
  3806. var segments = path.split('.');
  3807. return function (obj) {
  3808. for (var i = 0; i < segments.length; i++) {
  3809. if (!obj) { return }
  3810. obj = obj[segments[i]];
  3811. }
  3812. return obj
  3813. }
  3814. }
  3815. /* */
  3816. // can we use __proto__?
  3817. var hasProto = '__proto__' in {};
  3818. // Browser environment sniffing
  3819. var inBrowser = typeof window !== 'undefined';
  3820. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3821. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3822. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3823. var isIE = UA && /msie|trident/.test(UA);
  3824. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3825. var isEdge = UA && UA.indexOf('edge/') > 0;
  3826. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3827. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3828. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3829. var isPhantomJS = UA && /phantomjs/.test(UA);
  3830. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3831. // Firefox has a "watch" function on Object.prototype...
  3832. var nativeWatch = ({}).watch;
  3833. if (inBrowser) {
  3834. try {
  3835. var opts = {};
  3836. Object.defineProperty(opts, 'passive', ({
  3837. get: function get () {
  3838. }
  3839. })); // https://github.com/facebook/flow/issues/285
  3840. window.addEventListener('test-passive', null, opts);
  3841. } catch (e) {}
  3842. }
  3843. // this needs to be lazy-evaled because vue may be required before
  3844. // vue-server-renderer can set VUE_ENV
  3845. var _isServer;
  3846. var isServerRendering = function () {
  3847. if (_isServer === undefined) {
  3848. /* istanbul ignore if */
  3849. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3850. // detect presence of vue-server-renderer and avoid
  3851. // Webpack shimming the process
  3852. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3853. } else {
  3854. _isServer = false;
  3855. }
  3856. }
  3857. return _isServer
  3858. };
  3859. // detect devtools
  3860. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3861. /* istanbul ignore next */
  3862. function isNative (Ctor) {
  3863. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3864. }
  3865. var hasSymbol =
  3866. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3867. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3868. var _Set;
  3869. /* istanbul ignore if */ // $flow-disable-line
  3870. if (typeof Set !== 'undefined' && isNative(Set)) {
  3871. // use native Set when available.
  3872. _Set = Set;
  3873. } else {
  3874. // a non-standard Set polyfill that only works with primitive keys.
  3875. _Set = /*@__PURE__*/(function () {
  3876. function Set () {
  3877. this.set = Object.create(null);
  3878. }
  3879. Set.prototype.has = function has (key) {
  3880. return this.set[key] === true
  3881. };
  3882. Set.prototype.add = function add (key) {
  3883. this.set[key] = true;
  3884. };
  3885. Set.prototype.clear = function clear () {
  3886. this.set = Object.create(null);
  3887. };
  3888. return Set;
  3889. }());
  3890. }
  3891. /* */
  3892. var warn = noop;
  3893. var tip = noop;
  3894. var generateComponentTrace = (noop); // work around flow check
  3895. var formatComponentName = (noop);
  3896. if (true) {
  3897. var hasConsole = typeof console !== 'undefined';
  3898. var classifyRE = /(?:^|[-_])(\w)/g;
  3899. var classify = function (str) { return str
  3900. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3901. .replace(/[-_]/g, ''); };
  3902. warn = function (msg, vm) {
  3903. var trace = vm ? generateComponentTrace(vm) : '';
  3904. if (config.warnHandler) {
  3905. config.warnHandler.call(null, msg, vm, trace);
  3906. } else if (hasConsole && (!config.silent)) {
  3907. console.error(("[Vue warn]: " + msg + trace));
  3908. }
  3909. };
  3910. tip = function (msg, vm) {
  3911. if (hasConsole && (!config.silent)) {
  3912. console.warn("[Vue tip]: " + msg + (
  3913. vm ? generateComponentTrace(vm) : ''
  3914. ));
  3915. }
  3916. };
  3917. formatComponentName = function (vm, includeFile) {
  3918. if (vm.$root === vm) {
  3919. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3920. return ('') + vm.$options.__file
  3921. }
  3922. return '<Root>'
  3923. }
  3924. var options = typeof vm === 'function' && vm.cid != null
  3925. ? vm.options
  3926. : vm._isVue
  3927. ? vm.$options || vm.constructor.options
  3928. : vm;
  3929. var name = options.name || options._componentTag;
  3930. var file = options.__file;
  3931. if (!name && file) {
  3932. var match = file.match(/([^/\\]+)\.vue$/);
  3933. name = match && match[1];
  3934. }
  3935. return (
  3936. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3937. (file && includeFile !== false ? (" at " + file) : '')
  3938. )
  3939. };
  3940. var repeat = function (str, n) {
  3941. var res = '';
  3942. while (n) {
  3943. if (n % 2 === 1) { res += str; }
  3944. if (n > 1) { str += str; }
  3945. n >>= 1;
  3946. }
  3947. return res
  3948. };
  3949. generateComponentTrace = function (vm) {
  3950. if (vm._isVue && vm.$parent) {
  3951. var tree = [];
  3952. var currentRecursiveSequence = 0;
  3953. while (vm && vm.$options.name !== 'PageBody') {
  3954. if (tree.length > 0) {
  3955. var last = tree[tree.length - 1];
  3956. if (last.constructor === vm.constructor) {
  3957. currentRecursiveSequence++;
  3958. vm = vm.$parent;
  3959. continue
  3960. } else if (currentRecursiveSequence > 0) {
  3961. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3962. currentRecursiveSequence = 0;
  3963. }
  3964. }
  3965. !vm.$options.isReserved && tree.push(vm);
  3966. vm = vm.$parent;
  3967. }
  3968. return '\n\nfound in\n\n' + tree
  3969. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3970. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3971. : formatComponentName(vm))); })
  3972. .join('\n')
  3973. } else {
  3974. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3975. }
  3976. };
  3977. }
  3978. /* */
  3979. var uid = 0;
  3980. /**
  3981. * A dep is an observable that can have multiple
  3982. * directives subscribing to it.
  3983. */
  3984. var Dep = function Dep () {
  3985. this.id = uid++;
  3986. this.subs = [];
  3987. };
  3988. Dep.prototype.addSub = function addSub (sub) {
  3989. this.subs.push(sub);
  3990. };
  3991. Dep.prototype.removeSub = function removeSub (sub) {
  3992. remove(this.subs, sub);
  3993. };
  3994. Dep.prototype.depend = function depend () {
  3995. if (Dep.SharedObject.target) {
  3996. Dep.SharedObject.target.addDep(this);
  3997. }
  3998. };
  3999. Dep.prototype.notify = function notify () {
  4000. // stabilize the subscriber list first
  4001. var subs = this.subs.slice();
  4002. if ( true && !config.async) {
  4003. // subs aren't sorted in scheduler if not running async
  4004. // we need to sort them now to make sure they fire in correct
  4005. // order
  4006. subs.sort(function (a, b) { return a.id - b.id; });
  4007. }
  4008. for (var i = 0, l = subs.length; i < l; i++) {
  4009. subs[i].update();
  4010. }
  4011. };
  4012. // The current target watcher being evaluated.
  4013. // This is globally unique because only one watcher
  4014. // can be evaluated at a time.
  4015. // fixed by xxxxxx (nvue shared vuex)
  4016. /* eslint-disable no-undef */
  4017. Dep.SharedObject = {};
  4018. Dep.SharedObject.target = null;
  4019. Dep.SharedObject.targetStack = [];
  4020. function pushTarget (target) {
  4021. Dep.SharedObject.targetStack.push(target);
  4022. Dep.SharedObject.target = target;
  4023. Dep.target = target;
  4024. }
  4025. function popTarget () {
  4026. Dep.SharedObject.targetStack.pop();
  4027. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4028. Dep.target = Dep.SharedObject.target;
  4029. }
  4030. /* */
  4031. var VNode = function VNode (
  4032. tag,
  4033. data,
  4034. children,
  4035. text,
  4036. elm,
  4037. context,
  4038. componentOptions,
  4039. asyncFactory
  4040. ) {
  4041. this.tag = tag;
  4042. this.data = data;
  4043. this.children = children;
  4044. this.text = text;
  4045. this.elm = elm;
  4046. this.ns = undefined;
  4047. this.context = context;
  4048. this.fnContext = undefined;
  4049. this.fnOptions = undefined;
  4050. this.fnScopeId = undefined;
  4051. this.key = data && data.key;
  4052. this.componentOptions = componentOptions;
  4053. this.componentInstance = undefined;
  4054. this.parent = undefined;
  4055. this.raw = false;
  4056. this.isStatic = false;
  4057. this.isRootInsert = true;
  4058. this.isComment = false;
  4059. this.isCloned = false;
  4060. this.isOnce = false;
  4061. this.asyncFactory = asyncFactory;
  4062. this.asyncMeta = undefined;
  4063. this.isAsyncPlaceholder = false;
  4064. };
  4065. var prototypeAccessors = { child: { configurable: true } };
  4066. // DEPRECATED: alias for componentInstance for backwards compat.
  4067. /* istanbul ignore next */
  4068. prototypeAccessors.child.get = function () {
  4069. return this.componentInstance
  4070. };
  4071. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4072. var createEmptyVNode = function (text) {
  4073. if ( text === void 0 ) text = '';
  4074. var node = new VNode();
  4075. node.text = text;
  4076. node.isComment = true;
  4077. return node
  4078. };
  4079. function createTextVNode (val) {
  4080. return new VNode(undefined, undefined, undefined, String(val))
  4081. }
  4082. // optimized shallow clone
  4083. // used for static nodes and slot nodes because they may be reused across
  4084. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4085. // on their elm reference.
  4086. function cloneVNode (vnode) {
  4087. var cloned = new VNode(
  4088. vnode.tag,
  4089. vnode.data,
  4090. // #7975
  4091. // clone children array to avoid mutating original in case of cloning
  4092. // a child.
  4093. vnode.children && vnode.children.slice(),
  4094. vnode.text,
  4095. vnode.elm,
  4096. vnode.context,
  4097. vnode.componentOptions,
  4098. vnode.asyncFactory
  4099. );
  4100. cloned.ns = vnode.ns;
  4101. cloned.isStatic = vnode.isStatic;
  4102. cloned.key = vnode.key;
  4103. cloned.isComment = vnode.isComment;
  4104. cloned.fnContext = vnode.fnContext;
  4105. cloned.fnOptions = vnode.fnOptions;
  4106. cloned.fnScopeId = vnode.fnScopeId;
  4107. cloned.asyncMeta = vnode.asyncMeta;
  4108. cloned.isCloned = true;
  4109. return cloned
  4110. }
  4111. /*
  4112. * not type checking this file because flow doesn't play well with
  4113. * dynamically accessing methods on Array prototype
  4114. */
  4115. var arrayProto = Array.prototype;
  4116. var arrayMethods = Object.create(arrayProto);
  4117. var methodsToPatch = [
  4118. 'push',
  4119. 'pop',
  4120. 'shift',
  4121. 'unshift',
  4122. 'splice',
  4123. 'sort',
  4124. 'reverse'
  4125. ];
  4126. /**
  4127. * Intercept mutating methods and emit events
  4128. */
  4129. methodsToPatch.forEach(function (method) {
  4130. // cache original method
  4131. var original = arrayProto[method];
  4132. def(arrayMethods, method, function mutator () {
  4133. var args = [], len = arguments.length;
  4134. while ( len-- ) args[ len ] = arguments[ len ];
  4135. var result = original.apply(this, args);
  4136. var ob = this.__ob__;
  4137. var inserted;
  4138. switch (method) {
  4139. case 'push':
  4140. case 'unshift':
  4141. inserted = args;
  4142. break
  4143. case 'splice':
  4144. inserted = args.slice(2);
  4145. break
  4146. }
  4147. if (inserted) { ob.observeArray(inserted); }
  4148. // notify change
  4149. ob.dep.notify();
  4150. return result
  4151. });
  4152. });
  4153. /* */
  4154. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4155. /**
  4156. * In some cases we may want to disable observation inside a component's
  4157. * update computation.
  4158. */
  4159. var shouldObserve = true;
  4160. function toggleObserving (value) {
  4161. shouldObserve = value;
  4162. }
  4163. /**
  4164. * Observer class that is attached to each observed
  4165. * object. Once attached, the observer converts the target
  4166. * object's property keys into getter/setters that
  4167. * collect dependencies and dispatch updates.
  4168. */
  4169. var Observer = function Observer (value) {
  4170. this.value = value;
  4171. this.dep = new Dep();
  4172. this.vmCount = 0;
  4173. def(value, '__ob__', this);
  4174. if (Array.isArray(value)) {
  4175. if (hasProto) {
  4176. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4177. if(value.push !== value.__proto__.push){
  4178. copyAugment(value, arrayMethods, arrayKeys);
  4179. } else {
  4180. protoAugment(value, arrayMethods);
  4181. }
  4182. }
  4183. } else {
  4184. copyAugment(value, arrayMethods, arrayKeys);
  4185. }
  4186. this.observeArray(value);
  4187. } else {
  4188. this.walk(value);
  4189. }
  4190. };
  4191. /**
  4192. * Walk through all properties and convert them into
  4193. * getter/setters. This method should only be called when
  4194. * value type is Object.
  4195. */
  4196. Observer.prototype.walk = function walk (obj) {
  4197. var keys = Object.keys(obj);
  4198. for (var i = 0; i < keys.length; i++) {
  4199. defineReactive$$1(obj, keys[i]);
  4200. }
  4201. };
  4202. /**
  4203. * Observe a list of Array items.
  4204. */
  4205. Observer.prototype.observeArray = function observeArray (items) {
  4206. for (var i = 0, l = items.length; i < l; i++) {
  4207. observe(items[i]);
  4208. }
  4209. };
  4210. // helpers
  4211. /**
  4212. * Augment a target Object or Array by intercepting
  4213. * the prototype chain using __proto__
  4214. */
  4215. function protoAugment (target, src) {
  4216. /* eslint-disable no-proto */
  4217. target.__proto__ = src;
  4218. /* eslint-enable no-proto */
  4219. }
  4220. /**
  4221. * Augment a target Object or Array by defining
  4222. * hidden properties.
  4223. */
  4224. /* istanbul ignore next */
  4225. function copyAugment (target, src, keys) {
  4226. for (var i = 0, l = keys.length; i < l; i++) {
  4227. var key = keys[i];
  4228. def(target, key, src[key]);
  4229. }
  4230. }
  4231. /**
  4232. * Attempt to create an observer instance for a value,
  4233. * returns the new observer if successfully observed,
  4234. * or the existing observer if the value already has one.
  4235. */
  4236. function observe (value, asRootData) {
  4237. if (!isObject(value) || value instanceof VNode) {
  4238. return
  4239. }
  4240. var ob;
  4241. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4242. ob = value.__ob__;
  4243. } else if (
  4244. shouldObserve &&
  4245. !isServerRendering() &&
  4246. (Array.isArray(value) || isPlainObject(value)) &&
  4247. Object.isExtensible(value) &&
  4248. !value._isVue
  4249. ) {
  4250. ob = new Observer(value);
  4251. }
  4252. if (asRootData && ob) {
  4253. ob.vmCount++;
  4254. }
  4255. return ob
  4256. }
  4257. /**
  4258. * Define a reactive property on an Object.
  4259. */
  4260. function defineReactive$$1 (
  4261. obj,
  4262. key,
  4263. val,
  4264. customSetter,
  4265. shallow
  4266. ) {
  4267. var dep = new Dep();
  4268. var property = Object.getOwnPropertyDescriptor(obj, key);
  4269. if (property && property.configurable === false) {
  4270. return
  4271. }
  4272. // cater for pre-defined getter/setters
  4273. var getter = property && property.get;
  4274. var setter = property && property.set;
  4275. if ((!getter || setter) && arguments.length === 2) {
  4276. val = obj[key];
  4277. }
  4278. var childOb = !shallow && observe(val);
  4279. Object.defineProperty(obj, key, {
  4280. enumerable: true,
  4281. configurable: true,
  4282. get: function reactiveGetter () {
  4283. var value = getter ? getter.call(obj) : val;
  4284. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4285. dep.depend();
  4286. if (childOb) {
  4287. childOb.dep.depend();
  4288. if (Array.isArray(value)) {
  4289. dependArray(value);
  4290. }
  4291. }
  4292. }
  4293. return value
  4294. },
  4295. set: function reactiveSetter (newVal) {
  4296. var value = getter ? getter.call(obj) : val;
  4297. /* eslint-disable no-self-compare */
  4298. if (newVal === value || (newVal !== newVal && value !== value)) {
  4299. return
  4300. }
  4301. /* eslint-enable no-self-compare */
  4302. if ( true && customSetter) {
  4303. customSetter();
  4304. }
  4305. // #7981: for accessor properties without setter
  4306. if (getter && !setter) { return }
  4307. if (setter) {
  4308. setter.call(obj, newVal);
  4309. } else {
  4310. val = newVal;
  4311. }
  4312. childOb = !shallow && observe(newVal);
  4313. dep.notify();
  4314. }
  4315. });
  4316. }
  4317. /**
  4318. * Set a property on an object. Adds the new property and
  4319. * triggers change notification if the property doesn't
  4320. * already exist.
  4321. */
  4322. function set (target, key, val) {
  4323. if ( true &&
  4324. (isUndef(target) || isPrimitive(target))
  4325. ) {
  4326. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4327. }
  4328. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4329. target.length = Math.max(target.length, key);
  4330. target.splice(key, 1, val);
  4331. return val
  4332. }
  4333. if (key in target && !(key in Object.prototype)) {
  4334. target[key] = val;
  4335. return val
  4336. }
  4337. var ob = (target).__ob__;
  4338. if (target._isVue || (ob && ob.vmCount)) {
  4339. true && warn(
  4340. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4341. 'at runtime - declare it upfront in the data option.'
  4342. );
  4343. return val
  4344. }
  4345. if (!ob) {
  4346. target[key] = val;
  4347. return val
  4348. }
  4349. defineReactive$$1(ob.value, key, val);
  4350. ob.dep.notify();
  4351. return val
  4352. }
  4353. /**
  4354. * Delete a property and trigger change if necessary.
  4355. */
  4356. function del (target, key) {
  4357. if ( true &&
  4358. (isUndef(target) || isPrimitive(target))
  4359. ) {
  4360. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4361. }
  4362. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4363. target.splice(key, 1);
  4364. return
  4365. }
  4366. var ob = (target).__ob__;
  4367. if (target._isVue || (ob && ob.vmCount)) {
  4368. true && warn(
  4369. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4370. '- just set it to null.'
  4371. );
  4372. return
  4373. }
  4374. if (!hasOwn(target, key)) {
  4375. return
  4376. }
  4377. delete target[key];
  4378. if (!ob) {
  4379. return
  4380. }
  4381. ob.dep.notify();
  4382. }
  4383. /**
  4384. * Collect dependencies on array elements when the array is touched, since
  4385. * we cannot intercept array element access like property getters.
  4386. */
  4387. function dependArray (value) {
  4388. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4389. e = value[i];
  4390. e && e.__ob__ && e.__ob__.dep.depend();
  4391. if (Array.isArray(e)) {
  4392. dependArray(e);
  4393. }
  4394. }
  4395. }
  4396. /* */
  4397. /**
  4398. * Option overwriting strategies are functions that handle
  4399. * how to merge a parent option value and a child option
  4400. * value into the final value.
  4401. */
  4402. var strats = config.optionMergeStrategies;
  4403. /**
  4404. * Options with restrictions
  4405. */
  4406. if (true) {
  4407. strats.el = strats.propsData = function (parent, child, vm, key) {
  4408. if (!vm) {
  4409. warn(
  4410. "option \"" + key + "\" can only be used during instance " +
  4411. 'creation with the `new` keyword.'
  4412. );
  4413. }
  4414. return defaultStrat(parent, child)
  4415. };
  4416. }
  4417. /**
  4418. * Helper that recursively merges two data objects together.
  4419. */
  4420. function mergeData (to, from) {
  4421. if (!from) { return to }
  4422. var key, toVal, fromVal;
  4423. var keys = hasSymbol
  4424. ? Reflect.ownKeys(from)
  4425. : Object.keys(from);
  4426. for (var i = 0; i < keys.length; i++) {
  4427. key = keys[i];
  4428. // in case the object is already observed...
  4429. if (key === '__ob__') { continue }
  4430. toVal = to[key];
  4431. fromVal = from[key];
  4432. if (!hasOwn(to, key)) {
  4433. set(to, key, fromVal);
  4434. } else if (
  4435. toVal !== fromVal &&
  4436. isPlainObject(toVal) &&
  4437. isPlainObject(fromVal)
  4438. ) {
  4439. mergeData(toVal, fromVal);
  4440. }
  4441. }
  4442. return to
  4443. }
  4444. /**
  4445. * Data
  4446. */
  4447. function mergeDataOrFn (
  4448. parentVal,
  4449. childVal,
  4450. vm
  4451. ) {
  4452. if (!vm) {
  4453. // in a Vue.extend merge, both should be functions
  4454. if (!childVal) {
  4455. return parentVal
  4456. }
  4457. if (!parentVal) {
  4458. return childVal
  4459. }
  4460. // when parentVal & childVal are both present,
  4461. // we need to return a function that returns the
  4462. // merged result of both functions... no need to
  4463. // check if parentVal is a function here because
  4464. // it has to be a function to pass previous merges.
  4465. return function mergedDataFn () {
  4466. return mergeData(
  4467. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4468. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4469. )
  4470. }
  4471. } else {
  4472. return function mergedInstanceDataFn () {
  4473. // instance merge
  4474. var instanceData = typeof childVal === 'function'
  4475. ? childVal.call(vm, vm)
  4476. : childVal;
  4477. var defaultData = typeof parentVal === 'function'
  4478. ? parentVal.call(vm, vm)
  4479. : parentVal;
  4480. if (instanceData) {
  4481. return mergeData(instanceData, defaultData)
  4482. } else {
  4483. return defaultData
  4484. }
  4485. }
  4486. }
  4487. }
  4488. strats.data = function (
  4489. parentVal,
  4490. childVal,
  4491. vm
  4492. ) {
  4493. if (!vm) {
  4494. if (childVal && typeof childVal !== 'function') {
  4495. true && warn(
  4496. 'The "data" option should be a function ' +
  4497. 'that returns a per-instance value in component ' +
  4498. 'definitions.',
  4499. vm
  4500. );
  4501. return parentVal
  4502. }
  4503. return mergeDataOrFn(parentVal, childVal)
  4504. }
  4505. return mergeDataOrFn(parentVal, childVal, vm)
  4506. };
  4507. /**
  4508. * Hooks and props are merged as arrays.
  4509. */
  4510. function mergeHook (
  4511. parentVal,
  4512. childVal
  4513. ) {
  4514. var res = childVal
  4515. ? parentVal
  4516. ? parentVal.concat(childVal)
  4517. : Array.isArray(childVal)
  4518. ? childVal
  4519. : [childVal]
  4520. : parentVal;
  4521. return res
  4522. ? dedupeHooks(res)
  4523. : res
  4524. }
  4525. function dedupeHooks (hooks) {
  4526. var res = [];
  4527. for (var i = 0; i < hooks.length; i++) {
  4528. if (res.indexOf(hooks[i]) === -1) {
  4529. res.push(hooks[i]);
  4530. }
  4531. }
  4532. return res
  4533. }
  4534. LIFECYCLE_HOOKS.forEach(function (hook) {
  4535. strats[hook] = mergeHook;
  4536. });
  4537. /**
  4538. * Assets
  4539. *
  4540. * When a vm is present (instance creation), we need to do
  4541. * a three-way merge between constructor options, instance
  4542. * options and parent options.
  4543. */
  4544. function mergeAssets (
  4545. parentVal,
  4546. childVal,
  4547. vm,
  4548. key
  4549. ) {
  4550. var res = Object.create(parentVal || null);
  4551. if (childVal) {
  4552. true && assertObjectType(key, childVal, vm);
  4553. return extend(res, childVal)
  4554. } else {
  4555. return res
  4556. }
  4557. }
  4558. ASSET_TYPES.forEach(function (type) {
  4559. strats[type + 's'] = mergeAssets;
  4560. });
  4561. /**
  4562. * Watchers.
  4563. *
  4564. * Watchers hashes should not overwrite one
  4565. * another, so we merge them as arrays.
  4566. */
  4567. strats.watch = function (
  4568. parentVal,
  4569. childVal,
  4570. vm,
  4571. key
  4572. ) {
  4573. // work around Firefox's Object.prototype.watch...
  4574. if (parentVal === nativeWatch) { parentVal = undefined; }
  4575. if (childVal === nativeWatch) { childVal = undefined; }
  4576. /* istanbul ignore if */
  4577. if (!childVal) { return Object.create(parentVal || null) }
  4578. if (true) {
  4579. assertObjectType(key, childVal, vm);
  4580. }
  4581. if (!parentVal) { return childVal }
  4582. var ret = {};
  4583. extend(ret, parentVal);
  4584. for (var key$1 in childVal) {
  4585. var parent = ret[key$1];
  4586. var child = childVal[key$1];
  4587. if (parent && !Array.isArray(parent)) {
  4588. parent = [parent];
  4589. }
  4590. ret[key$1] = parent
  4591. ? parent.concat(child)
  4592. : Array.isArray(child) ? child : [child];
  4593. }
  4594. return ret
  4595. };
  4596. /**
  4597. * Other object hashes.
  4598. */
  4599. strats.props =
  4600. strats.methods =
  4601. strats.inject =
  4602. strats.computed = function (
  4603. parentVal,
  4604. childVal,
  4605. vm,
  4606. key
  4607. ) {
  4608. if (childVal && "development" !== 'production') {
  4609. assertObjectType(key, childVal, vm);
  4610. }
  4611. if (!parentVal) { return childVal }
  4612. var ret = Object.create(null);
  4613. extend(ret, parentVal);
  4614. if (childVal) { extend(ret, childVal); }
  4615. return ret
  4616. };
  4617. strats.provide = mergeDataOrFn;
  4618. /**
  4619. * Default strategy.
  4620. */
  4621. var defaultStrat = function (parentVal, childVal) {
  4622. return childVal === undefined
  4623. ? parentVal
  4624. : childVal
  4625. };
  4626. /**
  4627. * Validate component names
  4628. */
  4629. function checkComponents (options) {
  4630. for (var key in options.components) {
  4631. validateComponentName(key);
  4632. }
  4633. }
  4634. function validateComponentName (name) {
  4635. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4636. warn(
  4637. 'Invalid component name: "' + name + '". Component names ' +
  4638. 'should conform to valid custom element name in html5 specification.'
  4639. );
  4640. }
  4641. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4642. warn(
  4643. 'Do not use built-in or reserved HTML elements as component ' +
  4644. 'id: ' + name
  4645. );
  4646. }
  4647. }
  4648. /**
  4649. * Ensure all props option syntax are normalized into the
  4650. * Object-based format.
  4651. */
  4652. function normalizeProps (options, vm) {
  4653. var props = options.props;
  4654. if (!props) { return }
  4655. var res = {};
  4656. var i, val, name;
  4657. if (Array.isArray(props)) {
  4658. i = props.length;
  4659. while (i--) {
  4660. val = props[i];
  4661. if (typeof val === 'string') {
  4662. name = camelize(val);
  4663. res[name] = { type: null };
  4664. } else if (true) {
  4665. warn('props must be strings when using array syntax.');
  4666. }
  4667. }
  4668. } else if (isPlainObject(props)) {
  4669. for (var key in props) {
  4670. val = props[key];
  4671. name = camelize(key);
  4672. res[name] = isPlainObject(val)
  4673. ? val
  4674. : { type: val };
  4675. }
  4676. } else if (true) {
  4677. warn(
  4678. "Invalid value for option \"props\": expected an Array or an Object, " +
  4679. "but got " + (toRawType(props)) + ".",
  4680. vm
  4681. );
  4682. }
  4683. options.props = res;
  4684. }
  4685. /**
  4686. * Normalize all injections into Object-based format
  4687. */
  4688. function normalizeInject (options, vm) {
  4689. var inject = options.inject;
  4690. if (!inject) { return }
  4691. var normalized = options.inject = {};
  4692. if (Array.isArray(inject)) {
  4693. for (var i = 0; i < inject.length; i++) {
  4694. normalized[inject[i]] = { from: inject[i] };
  4695. }
  4696. } else if (isPlainObject(inject)) {
  4697. for (var key in inject) {
  4698. var val = inject[key];
  4699. normalized[key] = isPlainObject(val)
  4700. ? extend({ from: key }, val)
  4701. : { from: val };
  4702. }
  4703. } else if (true) {
  4704. warn(
  4705. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4706. "but got " + (toRawType(inject)) + ".",
  4707. vm
  4708. );
  4709. }
  4710. }
  4711. /**
  4712. * Normalize raw function directives into object format.
  4713. */
  4714. function normalizeDirectives (options) {
  4715. var dirs = options.directives;
  4716. if (dirs) {
  4717. for (var key in dirs) {
  4718. var def$$1 = dirs[key];
  4719. if (typeof def$$1 === 'function') {
  4720. dirs[key] = { bind: def$$1, update: def$$1 };
  4721. }
  4722. }
  4723. }
  4724. }
  4725. function assertObjectType (name, value, vm) {
  4726. if (!isPlainObject(value)) {
  4727. warn(
  4728. "Invalid value for option \"" + name + "\": expected an Object, " +
  4729. "but got " + (toRawType(value)) + ".",
  4730. vm
  4731. );
  4732. }
  4733. }
  4734. /**
  4735. * Merge two option objects into a new one.
  4736. * Core utility used in both instantiation and inheritance.
  4737. */
  4738. function mergeOptions (
  4739. parent,
  4740. child,
  4741. vm
  4742. ) {
  4743. if (true) {
  4744. checkComponents(child);
  4745. }
  4746. if (typeof child === 'function') {
  4747. child = child.options;
  4748. }
  4749. normalizeProps(child, vm);
  4750. normalizeInject(child, vm);
  4751. normalizeDirectives(child);
  4752. // Apply extends and mixins on the child options,
  4753. // but only if it is a raw options object that isn't
  4754. // the result of another mergeOptions call.
  4755. // Only merged options has the _base property.
  4756. if (!child._base) {
  4757. if (child.extends) {
  4758. parent = mergeOptions(parent, child.extends, vm);
  4759. }
  4760. if (child.mixins) {
  4761. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4762. parent = mergeOptions(parent, child.mixins[i], vm);
  4763. }
  4764. }
  4765. }
  4766. var options = {};
  4767. var key;
  4768. for (key in parent) {
  4769. mergeField(key);
  4770. }
  4771. for (key in child) {
  4772. if (!hasOwn(parent, key)) {
  4773. mergeField(key);
  4774. }
  4775. }
  4776. function mergeField (key) {
  4777. var strat = strats[key] || defaultStrat;
  4778. options[key] = strat(parent[key], child[key], vm, key);
  4779. }
  4780. return options
  4781. }
  4782. /**
  4783. * Resolve an asset.
  4784. * This function is used because child instances need access
  4785. * to assets defined in its ancestor chain.
  4786. */
  4787. function resolveAsset (
  4788. options,
  4789. type,
  4790. id,
  4791. warnMissing
  4792. ) {
  4793. /* istanbul ignore if */
  4794. if (typeof id !== 'string') {
  4795. return
  4796. }
  4797. var assets = options[type];
  4798. // check local registration variations first
  4799. if (hasOwn(assets, id)) { return assets[id] }
  4800. var camelizedId = camelize(id);
  4801. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4802. var PascalCaseId = capitalize(camelizedId);
  4803. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4804. // fallback to prototype chain
  4805. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4806. if ( true && warnMissing && !res) {
  4807. warn(
  4808. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4809. options
  4810. );
  4811. }
  4812. return res
  4813. }
  4814. /* */
  4815. function validateProp (
  4816. key,
  4817. propOptions,
  4818. propsData,
  4819. vm
  4820. ) {
  4821. var prop = propOptions[key];
  4822. var absent = !hasOwn(propsData, key);
  4823. var value = propsData[key];
  4824. // boolean casting
  4825. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4826. if (booleanIndex > -1) {
  4827. if (absent && !hasOwn(prop, 'default')) {
  4828. value = false;
  4829. } else if (value === '' || value === hyphenate(key)) {
  4830. // only cast empty string / same name to boolean if
  4831. // boolean has higher priority
  4832. var stringIndex = getTypeIndex(String, prop.type);
  4833. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4834. value = true;
  4835. }
  4836. }
  4837. }
  4838. // check default value
  4839. if (value === undefined) {
  4840. value = getPropDefaultValue(vm, prop, key);
  4841. // since the default value is a fresh copy,
  4842. // make sure to observe it.
  4843. var prevShouldObserve = shouldObserve;
  4844. toggleObserving(true);
  4845. observe(value);
  4846. toggleObserving(prevShouldObserve);
  4847. }
  4848. if (
  4849. true
  4850. ) {
  4851. assertProp(prop, key, value, vm, absent);
  4852. }
  4853. return value
  4854. }
  4855. /**
  4856. * Get the default value of a prop.
  4857. */
  4858. function getPropDefaultValue (vm, prop, key) {
  4859. // no default, return undefined
  4860. if (!hasOwn(prop, 'default')) {
  4861. return undefined
  4862. }
  4863. var def = prop.default;
  4864. // warn against non-factory defaults for Object & Array
  4865. if ( true && isObject(def)) {
  4866. warn(
  4867. 'Invalid default value for prop "' + key + '": ' +
  4868. 'Props with type Object/Array must use a factory function ' +
  4869. 'to return the default value.',
  4870. vm
  4871. );
  4872. }
  4873. // the raw prop value was also undefined from previous render,
  4874. // return previous default value to avoid unnecessary watcher trigger
  4875. if (vm && vm.$options.propsData &&
  4876. vm.$options.propsData[key] === undefined &&
  4877. vm._props[key] !== undefined
  4878. ) {
  4879. return vm._props[key]
  4880. }
  4881. // call factory function for non-Function types
  4882. // a value is Function if its prototype is function even across different execution context
  4883. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4884. ? def.call(vm)
  4885. : def
  4886. }
  4887. /**
  4888. * Assert whether a prop is valid.
  4889. */
  4890. function assertProp (
  4891. prop,
  4892. name,
  4893. value,
  4894. vm,
  4895. absent
  4896. ) {
  4897. if (prop.required && absent) {
  4898. warn(
  4899. 'Missing required prop: "' + name + '"',
  4900. vm
  4901. );
  4902. return
  4903. }
  4904. if (value == null && !prop.required) {
  4905. return
  4906. }
  4907. var type = prop.type;
  4908. var valid = !type || type === true;
  4909. var expectedTypes = [];
  4910. if (type) {
  4911. if (!Array.isArray(type)) {
  4912. type = [type];
  4913. }
  4914. for (var i = 0; i < type.length && !valid; i++) {
  4915. var assertedType = assertType(value, type[i]);
  4916. expectedTypes.push(assertedType.expectedType || '');
  4917. valid = assertedType.valid;
  4918. }
  4919. }
  4920. if (!valid) {
  4921. warn(
  4922. getInvalidTypeMessage(name, value, expectedTypes),
  4923. vm
  4924. );
  4925. return
  4926. }
  4927. var validator = prop.validator;
  4928. if (validator) {
  4929. if (!validator(value)) {
  4930. warn(
  4931. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4932. vm
  4933. );
  4934. }
  4935. }
  4936. }
  4937. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4938. function assertType (value, type) {
  4939. var valid;
  4940. var expectedType = getType(type);
  4941. if (simpleCheckRE.test(expectedType)) {
  4942. var t = typeof value;
  4943. valid = t === expectedType.toLowerCase();
  4944. // for primitive wrapper objects
  4945. if (!valid && t === 'object') {
  4946. valid = value instanceof type;
  4947. }
  4948. } else if (expectedType === 'Object') {
  4949. valid = isPlainObject(value);
  4950. } else if (expectedType === 'Array') {
  4951. valid = Array.isArray(value);
  4952. } else {
  4953. valid = value instanceof type;
  4954. }
  4955. return {
  4956. valid: valid,
  4957. expectedType: expectedType
  4958. }
  4959. }
  4960. /**
  4961. * Use function string name to check built-in types,
  4962. * because a simple equality check will fail when running
  4963. * across different vms / iframes.
  4964. */
  4965. function getType (fn) {
  4966. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4967. return match ? match[1] : ''
  4968. }
  4969. function isSameType (a, b) {
  4970. return getType(a) === getType(b)
  4971. }
  4972. function getTypeIndex (type, expectedTypes) {
  4973. if (!Array.isArray(expectedTypes)) {
  4974. return isSameType(expectedTypes, type) ? 0 : -1
  4975. }
  4976. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4977. if (isSameType(expectedTypes[i], type)) {
  4978. return i
  4979. }
  4980. }
  4981. return -1
  4982. }
  4983. function getInvalidTypeMessage (name, value, expectedTypes) {
  4984. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4985. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4986. var expectedType = expectedTypes[0];
  4987. var receivedType = toRawType(value);
  4988. var expectedValue = styleValue(value, expectedType);
  4989. var receivedValue = styleValue(value, receivedType);
  4990. // check if we need to specify expected value
  4991. if (expectedTypes.length === 1 &&
  4992. isExplicable(expectedType) &&
  4993. !isBoolean(expectedType, receivedType)) {
  4994. message += " with value " + expectedValue;
  4995. }
  4996. message += ", got " + receivedType + " ";
  4997. // check if we need to specify received value
  4998. if (isExplicable(receivedType)) {
  4999. message += "with value " + receivedValue + ".";
  5000. }
  5001. return message
  5002. }
  5003. function styleValue (value, type) {
  5004. if (type === 'String') {
  5005. return ("\"" + value + "\"")
  5006. } else if (type === 'Number') {
  5007. return ("" + (Number(value)))
  5008. } else {
  5009. return ("" + value)
  5010. }
  5011. }
  5012. function isExplicable (value) {
  5013. var explicitTypes = ['string', 'number', 'boolean'];
  5014. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5015. }
  5016. function isBoolean () {
  5017. var args = [], len = arguments.length;
  5018. while ( len-- ) args[ len ] = arguments[ len ];
  5019. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5020. }
  5021. /* */
  5022. function handleError (err, vm, info) {
  5023. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5024. // See: https://github.com/vuejs/vuex/issues/1505
  5025. pushTarget();
  5026. try {
  5027. if (vm) {
  5028. var cur = vm;
  5029. while ((cur = cur.$parent)) {
  5030. var hooks = cur.$options.errorCaptured;
  5031. if (hooks) {
  5032. for (var i = 0; i < hooks.length; i++) {
  5033. try {
  5034. var capture = hooks[i].call(cur, err, vm, info) === false;
  5035. if (capture) { return }
  5036. } catch (e) {
  5037. globalHandleError(e, cur, 'errorCaptured hook');
  5038. }
  5039. }
  5040. }
  5041. }
  5042. }
  5043. globalHandleError(err, vm, info);
  5044. } finally {
  5045. popTarget();
  5046. }
  5047. }
  5048. function invokeWithErrorHandling (
  5049. handler,
  5050. context,
  5051. args,
  5052. vm,
  5053. info
  5054. ) {
  5055. var res;
  5056. try {
  5057. res = args ? handler.apply(context, args) : handler.call(context);
  5058. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5059. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5060. // issue #9511
  5061. // avoid catch triggering multiple times when nested calls
  5062. res._handled = true;
  5063. }
  5064. } catch (e) {
  5065. handleError(e, vm, info);
  5066. }
  5067. return res
  5068. }
  5069. function globalHandleError (err, vm, info) {
  5070. if (config.errorHandler) {
  5071. try {
  5072. return config.errorHandler.call(null, err, vm, info)
  5073. } catch (e) {
  5074. // if the user intentionally throws the original error in the handler,
  5075. // do not log it twice
  5076. if (e !== err) {
  5077. logError(e, null, 'config.errorHandler');
  5078. }
  5079. }
  5080. }
  5081. logError(err, vm, info);
  5082. }
  5083. function logError (err, vm, info) {
  5084. if (true) {
  5085. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5086. }
  5087. /* istanbul ignore else */
  5088. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5089. console.error(err);
  5090. } else {
  5091. throw err
  5092. }
  5093. }
  5094. /* */
  5095. var callbacks = [];
  5096. var pending = false;
  5097. function flushCallbacks () {
  5098. pending = false;
  5099. var copies = callbacks.slice(0);
  5100. callbacks.length = 0;
  5101. for (var i = 0; i < copies.length; i++) {
  5102. copies[i]();
  5103. }
  5104. }
  5105. // Here we have async deferring wrappers using microtasks.
  5106. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5107. // However, it has subtle problems when state is changed right before repaint
  5108. // (e.g. #6813, out-in transitions).
  5109. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5110. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5111. // So we now use microtasks everywhere, again.
  5112. // A major drawback of this tradeoff is that there are some scenarios
  5113. // where microtasks have too high a priority and fire in between supposedly
  5114. // sequential events (e.g. #4521, #6690, which have workarounds)
  5115. // or even between bubbling of the same event (#6566).
  5116. var timerFunc;
  5117. // The nextTick behavior leverages the microtask queue, which can be accessed
  5118. // via either native Promise.then or MutationObserver.
  5119. // MutationObserver has wider support, however it is seriously bugged in
  5120. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5121. // completely stops working after triggering a few times... so, if native
  5122. // Promise is available, we will use it:
  5123. /* istanbul ignore next, $flow-disable-line */
  5124. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5125. var p = Promise.resolve();
  5126. timerFunc = function () {
  5127. p.then(flushCallbacks);
  5128. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5129. // it can get stuck in a weird state where callbacks are pushed into the
  5130. // microtask queue but the queue isn't being flushed, until the browser
  5131. // needs to do some other work, e.g. handle a timer. Therefore we can
  5132. // "force" the microtask queue to be flushed by adding an empty timer.
  5133. if (isIOS) { setTimeout(noop); }
  5134. };
  5135. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5136. isNative(MutationObserver) ||
  5137. // PhantomJS and iOS 7.x
  5138. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5139. )) {
  5140. // Use MutationObserver where native Promise is not available,
  5141. // e.g. PhantomJS, iOS7, Android 4.4
  5142. // (#6466 MutationObserver is unreliable in IE11)
  5143. var counter = 1;
  5144. var observer = new MutationObserver(flushCallbacks);
  5145. var textNode = document.createTextNode(String(counter));
  5146. observer.observe(textNode, {
  5147. characterData: true
  5148. });
  5149. timerFunc = function () {
  5150. counter = (counter + 1) % 2;
  5151. textNode.data = String(counter);
  5152. };
  5153. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5154. // Fallback to setImmediate.
  5155. // Technically it leverages the (macro) task queue,
  5156. // but it is still a better choice than setTimeout.
  5157. timerFunc = function () {
  5158. setImmediate(flushCallbacks);
  5159. };
  5160. } else {
  5161. // Fallback to setTimeout.
  5162. timerFunc = function () {
  5163. setTimeout(flushCallbacks, 0);
  5164. };
  5165. }
  5166. function nextTick (cb, ctx) {
  5167. var _resolve;
  5168. callbacks.push(function () {
  5169. if (cb) {
  5170. try {
  5171. cb.call(ctx);
  5172. } catch (e) {
  5173. handleError(e, ctx, 'nextTick');
  5174. }
  5175. } else if (_resolve) {
  5176. _resolve(ctx);
  5177. }
  5178. });
  5179. if (!pending) {
  5180. pending = true;
  5181. timerFunc();
  5182. }
  5183. // $flow-disable-line
  5184. if (!cb && typeof Promise !== 'undefined') {
  5185. return new Promise(function (resolve) {
  5186. _resolve = resolve;
  5187. })
  5188. }
  5189. }
  5190. /* */
  5191. /* not type checking this file because flow doesn't play well with Proxy */
  5192. var initProxy;
  5193. if (true) {
  5194. var allowedGlobals = makeMap(
  5195. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5196. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5197. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5198. 'require' // for Webpack/Browserify
  5199. );
  5200. var warnNonPresent = function (target, key) {
  5201. warn(
  5202. "Property or method \"" + key + "\" is not defined on the instance but " +
  5203. 'referenced during render. Make sure that this property is reactive, ' +
  5204. 'either in the data option, or for class-based components, by ' +
  5205. 'initializing the property. ' +
  5206. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5207. target
  5208. );
  5209. };
  5210. var warnReservedPrefix = function (target, key) {
  5211. warn(
  5212. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5213. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5214. 'prevent conflicts with Vue internals. ' +
  5215. 'See: https://vuejs.org/v2/api/#data',
  5216. target
  5217. );
  5218. };
  5219. var hasProxy =
  5220. typeof Proxy !== 'undefined' && isNative(Proxy);
  5221. if (hasProxy) {
  5222. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5223. config.keyCodes = new Proxy(config.keyCodes, {
  5224. set: function set (target, key, value) {
  5225. if (isBuiltInModifier(key)) {
  5226. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5227. return false
  5228. } else {
  5229. target[key] = value;
  5230. return true
  5231. }
  5232. }
  5233. });
  5234. }
  5235. var hasHandler = {
  5236. has: function has (target, key) {
  5237. var has = key in target;
  5238. var isAllowed = allowedGlobals(key) ||
  5239. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5240. if (!has && !isAllowed) {
  5241. if (key in target.$data) { warnReservedPrefix(target, key); }
  5242. else { warnNonPresent(target, key); }
  5243. }
  5244. return has || !isAllowed
  5245. }
  5246. };
  5247. var getHandler = {
  5248. get: function get (target, key) {
  5249. if (typeof key === 'string' && !(key in target)) {
  5250. if (key in target.$data) { warnReservedPrefix(target, key); }
  5251. else { warnNonPresent(target, key); }
  5252. }
  5253. return target[key]
  5254. }
  5255. };
  5256. initProxy = function initProxy (vm) {
  5257. if (hasProxy) {
  5258. // determine which proxy handler to use
  5259. var options = vm.$options;
  5260. var handlers = options.render && options.render._withStripped
  5261. ? getHandler
  5262. : hasHandler;
  5263. vm._renderProxy = new Proxy(vm, handlers);
  5264. } else {
  5265. vm._renderProxy = vm;
  5266. }
  5267. };
  5268. }
  5269. /* */
  5270. var seenObjects = new _Set();
  5271. /**
  5272. * Recursively traverse an object to evoke all converted
  5273. * getters, so that every nested property inside the object
  5274. * is collected as a "deep" dependency.
  5275. */
  5276. function traverse (val) {
  5277. _traverse(val, seenObjects);
  5278. seenObjects.clear();
  5279. }
  5280. function _traverse (val, seen) {
  5281. var i, keys;
  5282. var isA = Array.isArray(val);
  5283. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5284. return
  5285. }
  5286. if (val.__ob__) {
  5287. var depId = val.__ob__.dep.id;
  5288. if (seen.has(depId)) {
  5289. return
  5290. }
  5291. seen.add(depId);
  5292. }
  5293. if (isA) {
  5294. i = val.length;
  5295. while (i--) { _traverse(val[i], seen); }
  5296. } else {
  5297. keys = Object.keys(val);
  5298. i = keys.length;
  5299. while (i--) { _traverse(val[keys[i]], seen); }
  5300. }
  5301. }
  5302. var mark;
  5303. var measure;
  5304. if (true) {
  5305. var perf = inBrowser && window.performance;
  5306. /* istanbul ignore if */
  5307. if (
  5308. perf &&
  5309. perf.mark &&
  5310. perf.measure &&
  5311. perf.clearMarks &&
  5312. perf.clearMeasures
  5313. ) {
  5314. mark = function (tag) { return perf.mark(tag); };
  5315. measure = function (name, startTag, endTag) {
  5316. perf.measure(name, startTag, endTag);
  5317. perf.clearMarks(startTag);
  5318. perf.clearMarks(endTag);
  5319. // perf.clearMeasures(name)
  5320. };
  5321. }
  5322. }
  5323. /* */
  5324. var normalizeEvent = cached(function (name) {
  5325. var passive = name.charAt(0) === '&';
  5326. name = passive ? name.slice(1) : name;
  5327. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5328. name = once$$1 ? name.slice(1) : name;
  5329. var capture = name.charAt(0) === '!';
  5330. name = capture ? name.slice(1) : name;
  5331. return {
  5332. name: name,
  5333. once: once$$1,
  5334. capture: capture,
  5335. passive: passive
  5336. }
  5337. });
  5338. function createFnInvoker (fns, vm) {
  5339. function invoker () {
  5340. var arguments$1 = arguments;
  5341. var fns = invoker.fns;
  5342. if (Array.isArray(fns)) {
  5343. var cloned = fns.slice();
  5344. for (var i = 0; i < cloned.length; i++) {
  5345. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5346. }
  5347. } else {
  5348. // return handler return value for single handlers
  5349. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5350. }
  5351. }
  5352. invoker.fns = fns;
  5353. return invoker
  5354. }
  5355. function updateListeners (
  5356. on,
  5357. oldOn,
  5358. add,
  5359. remove$$1,
  5360. createOnceHandler,
  5361. vm
  5362. ) {
  5363. var name, def$$1, cur, old, event;
  5364. for (name in on) {
  5365. def$$1 = cur = on[name];
  5366. old = oldOn[name];
  5367. event = normalizeEvent(name);
  5368. if (isUndef(cur)) {
  5369. true && warn(
  5370. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5371. vm
  5372. );
  5373. } else if (isUndef(old)) {
  5374. if (isUndef(cur.fns)) {
  5375. cur = on[name] = createFnInvoker(cur, vm);
  5376. }
  5377. if (isTrue(event.once)) {
  5378. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5379. }
  5380. add(event.name, cur, event.capture, event.passive, event.params);
  5381. } else if (cur !== old) {
  5382. old.fns = cur;
  5383. on[name] = old;
  5384. }
  5385. }
  5386. for (name in oldOn) {
  5387. if (isUndef(on[name])) {
  5388. event = normalizeEvent(name);
  5389. remove$$1(event.name, oldOn[name], event.capture);
  5390. }
  5391. }
  5392. }
  5393. /* */
  5394. /* */
  5395. // fixed by xxxxxx (mp properties)
  5396. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5397. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5398. if (isUndef(propOptions)) {
  5399. return res
  5400. }
  5401. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5402. var attrs = data.attrs;
  5403. var props = data.props;
  5404. if (isDef(attrs) || isDef(props)) {
  5405. for (var key in propOptions) {
  5406. var altKey = hyphenate(key);
  5407. var result = checkProp(res, props, key, altKey, true) ||
  5408. checkProp(res, attrs, key, altKey, false);
  5409. // externalClass
  5410. if (
  5411. result &&
  5412. res[key] &&
  5413. externalClasses.indexOf(altKey) !== -1 &&
  5414. context[camelize(res[key])]
  5415. ) {
  5416. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5417. res[key] = context[camelize(res[key])];
  5418. }
  5419. }
  5420. }
  5421. return res
  5422. }
  5423. function extractPropsFromVNodeData (
  5424. data,
  5425. Ctor,
  5426. tag,
  5427. context// fixed by xxxxxx
  5428. ) {
  5429. // we are only extracting raw values here.
  5430. // validation and default values are handled in the child
  5431. // component itself.
  5432. var propOptions = Ctor.options.props;
  5433. if (isUndef(propOptions)) {
  5434. // fixed by xxxxxx
  5435. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5436. }
  5437. var res = {};
  5438. var attrs = data.attrs;
  5439. var props = data.props;
  5440. if (isDef(attrs) || isDef(props)) {
  5441. for (var key in propOptions) {
  5442. var altKey = hyphenate(key);
  5443. if (true) {
  5444. var keyInLowerCase = key.toLowerCase();
  5445. if (
  5446. key !== keyInLowerCase &&
  5447. attrs && hasOwn(attrs, keyInLowerCase)
  5448. ) {
  5449. tip(
  5450. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5451. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5452. " \"" + key + "\". " +
  5453. "Note that HTML attributes are case-insensitive and camelCased " +
  5454. "props need to use their kebab-case equivalents when using in-DOM " +
  5455. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5456. );
  5457. }
  5458. }
  5459. checkProp(res, props, key, altKey, true) ||
  5460. checkProp(res, attrs, key, altKey, false);
  5461. }
  5462. }
  5463. // fixed by xxxxxx
  5464. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5465. }
  5466. function checkProp (
  5467. res,
  5468. hash,
  5469. key,
  5470. altKey,
  5471. preserve
  5472. ) {
  5473. if (isDef(hash)) {
  5474. if (hasOwn(hash, key)) {
  5475. res[key] = hash[key];
  5476. if (!preserve) {
  5477. delete hash[key];
  5478. }
  5479. return true
  5480. } else if (hasOwn(hash, altKey)) {
  5481. res[key] = hash[altKey];
  5482. if (!preserve) {
  5483. delete hash[altKey];
  5484. }
  5485. return true
  5486. }
  5487. }
  5488. return false
  5489. }
  5490. /* */
  5491. // The template compiler attempts to minimize the need for normalization by
  5492. // statically analyzing the template at compile time.
  5493. //
  5494. // For plain HTML markup, normalization can be completely skipped because the
  5495. // generated render function is guaranteed to return Array<VNode>. There are
  5496. // two cases where extra normalization is needed:
  5497. // 1. When the children contains components - because a functional component
  5498. // may return an Array instead of a single root. In this case, just a simple
  5499. // normalization is needed - if any child is an Array, we flatten the whole
  5500. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5501. // because functional components already normalize their own children.
  5502. function simpleNormalizeChildren (children) {
  5503. for (var i = 0; i < children.length; i++) {
  5504. if (Array.isArray(children[i])) {
  5505. return Array.prototype.concat.apply([], children)
  5506. }
  5507. }
  5508. return children
  5509. }
  5510. // 2. When the children contains constructs that always generated nested Arrays,
  5511. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5512. // with hand-written render functions / JSX. In such cases a full normalization
  5513. // is needed to cater to all possible types of children values.
  5514. function normalizeChildren (children) {
  5515. return isPrimitive(children)
  5516. ? [createTextVNode(children)]
  5517. : Array.isArray(children)
  5518. ? normalizeArrayChildren(children)
  5519. : undefined
  5520. }
  5521. function isTextNode (node) {
  5522. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5523. }
  5524. function normalizeArrayChildren (children, nestedIndex) {
  5525. var res = [];
  5526. var i, c, lastIndex, last;
  5527. for (i = 0; i < children.length; i++) {
  5528. c = children[i];
  5529. if (isUndef(c) || typeof c === 'boolean') { continue }
  5530. lastIndex = res.length - 1;
  5531. last = res[lastIndex];
  5532. // nested
  5533. if (Array.isArray(c)) {
  5534. if (c.length > 0) {
  5535. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5536. // merge adjacent text nodes
  5537. if (isTextNode(c[0]) && isTextNode(last)) {
  5538. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5539. c.shift();
  5540. }
  5541. res.push.apply(res, c);
  5542. }
  5543. } else if (isPrimitive(c)) {
  5544. if (isTextNode(last)) {
  5545. // merge adjacent text nodes
  5546. // this is necessary for SSR hydration because text nodes are
  5547. // essentially merged when rendered to HTML strings
  5548. res[lastIndex] = createTextVNode(last.text + c);
  5549. } else if (c !== '') {
  5550. // convert primitive to vnode
  5551. res.push(createTextVNode(c));
  5552. }
  5553. } else {
  5554. if (isTextNode(c) && isTextNode(last)) {
  5555. // merge adjacent text nodes
  5556. res[lastIndex] = createTextVNode(last.text + c.text);
  5557. } else {
  5558. // default key for nested array children (likely generated by v-for)
  5559. if (isTrue(children._isVList) &&
  5560. isDef(c.tag) &&
  5561. isUndef(c.key) &&
  5562. isDef(nestedIndex)) {
  5563. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5564. }
  5565. res.push(c);
  5566. }
  5567. }
  5568. }
  5569. return res
  5570. }
  5571. /* */
  5572. function initProvide (vm) {
  5573. var provide = vm.$options.provide;
  5574. if (provide) {
  5575. vm._provided = typeof provide === 'function'
  5576. ? provide.call(vm)
  5577. : provide;
  5578. }
  5579. }
  5580. function initInjections (vm) {
  5581. var result = resolveInject(vm.$options.inject, vm);
  5582. if (result) {
  5583. toggleObserving(false);
  5584. Object.keys(result).forEach(function (key) {
  5585. /* istanbul ignore else */
  5586. if (true) {
  5587. defineReactive$$1(vm, key, result[key], function () {
  5588. warn(
  5589. "Avoid mutating an injected value directly since the changes will be " +
  5590. "overwritten whenever the provided component re-renders. " +
  5591. "injection being mutated: \"" + key + "\"",
  5592. vm
  5593. );
  5594. });
  5595. } else {}
  5596. });
  5597. toggleObserving(true);
  5598. }
  5599. }
  5600. function resolveInject (inject, vm) {
  5601. if (inject) {
  5602. // inject is :any because flow is not smart enough to figure out cached
  5603. var result = Object.create(null);
  5604. var keys = hasSymbol
  5605. ? Reflect.ownKeys(inject)
  5606. : Object.keys(inject);
  5607. for (var i = 0; i < keys.length; i++) {
  5608. var key = keys[i];
  5609. // #6574 in case the inject object is observed...
  5610. if (key === '__ob__') { continue }
  5611. var provideKey = inject[key].from;
  5612. var source = vm;
  5613. while (source) {
  5614. if (source._provided && hasOwn(source._provided, provideKey)) {
  5615. result[key] = source._provided[provideKey];
  5616. break
  5617. }
  5618. source = source.$parent;
  5619. }
  5620. if (!source) {
  5621. if ('default' in inject[key]) {
  5622. var provideDefault = inject[key].default;
  5623. result[key] = typeof provideDefault === 'function'
  5624. ? provideDefault.call(vm)
  5625. : provideDefault;
  5626. } else if (true) {
  5627. warn(("Injection \"" + key + "\" not found"), vm);
  5628. }
  5629. }
  5630. }
  5631. return result
  5632. }
  5633. }
  5634. /* */
  5635. /**
  5636. * Runtime helper for resolving raw children VNodes into a slot object.
  5637. */
  5638. function resolveSlots (
  5639. children,
  5640. context
  5641. ) {
  5642. if (!children || !children.length) {
  5643. return {}
  5644. }
  5645. var slots = {};
  5646. for (var i = 0, l = children.length; i < l; i++) {
  5647. var child = children[i];
  5648. var data = child.data;
  5649. // remove slot attribute if the node is resolved as a Vue slot node
  5650. if (data && data.attrs && data.attrs.slot) {
  5651. delete data.attrs.slot;
  5652. }
  5653. // named slots should only be respected if the vnode was rendered in the
  5654. // same context.
  5655. if ((child.context === context || child.fnContext === context) &&
  5656. data && data.slot != null
  5657. ) {
  5658. var name = data.slot;
  5659. var slot = (slots[name] || (slots[name] = []));
  5660. if (child.tag === 'template') {
  5661. slot.push.apply(slot, child.children || []);
  5662. } else {
  5663. slot.push(child);
  5664. }
  5665. } else {
  5666. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5667. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5668. (slots['page'] || (slots['page'] = [])).push(child);
  5669. }else{
  5670. (slots.default || (slots.default = [])).push(child);
  5671. }
  5672. }
  5673. }
  5674. // ignore slots that contains only whitespace
  5675. for (var name$1 in slots) {
  5676. if (slots[name$1].every(isWhitespace)) {
  5677. delete slots[name$1];
  5678. }
  5679. }
  5680. return slots
  5681. }
  5682. function isWhitespace (node) {
  5683. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5684. }
  5685. /* */
  5686. function normalizeScopedSlots (
  5687. slots,
  5688. normalSlots,
  5689. prevSlots
  5690. ) {
  5691. var res;
  5692. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5693. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5694. var key = slots && slots.$key;
  5695. if (!slots) {
  5696. res = {};
  5697. } else if (slots._normalized) {
  5698. // fast path 1: child component re-render only, parent did not change
  5699. return slots._normalized
  5700. } else if (
  5701. isStable &&
  5702. prevSlots &&
  5703. prevSlots !== emptyObject &&
  5704. key === prevSlots.$key &&
  5705. !hasNormalSlots &&
  5706. !prevSlots.$hasNormal
  5707. ) {
  5708. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5709. // only need to normalize once
  5710. return prevSlots
  5711. } else {
  5712. res = {};
  5713. for (var key$1 in slots) {
  5714. if (slots[key$1] && key$1[0] !== '$') {
  5715. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5716. }
  5717. }
  5718. }
  5719. // expose normal slots on scopedSlots
  5720. for (var key$2 in normalSlots) {
  5721. if (!(key$2 in res)) {
  5722. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5723. }
  5724. }
  5725. // avoriaz seems to mock a non-extensible $scopedSlots object
  5726. // and when that is passed down this would cause an error
  5727. if (slots && Object.isExtensible(slots)) {
  5728. (slots)._normalized = res;
  5729. }
  5730. def(res, '$stable', isStable);
  5731. def(res, '$key', key);
  5732. def(res, '$hasNormal', hasNormalSlots);
  5733. return res
  5734. }
  5735. function normalizeScopedSlot(normalSlots, key, fn) {
  5736. var normalized = function () {
  5737. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5738. res = res && typeof res === 'object' && !Array.isArray(res)
  5739. ? [res] // single vnode
  5740. : normalizeChildren(res);
  5741. return res && (
  5742. res.length === 0 ||
  5743. (res.length === 1 && res[0].isComment) // #9658
  5744. ) ? undefined
  5745. : res
  5746. };
  5747. // this is a slot using the new v-slot syntax without scope. although it is
  5748. // compiled as a scoped slot, render fn users would expect it to be present
  5749. // on this.$slots because the usage is semantically a normal slot.
  5750. if (fn.proxy) {
  5751. Object.defineProperty(normalSlots, key, {
  5752. get: normalized,
  5753. enumerable: true,
  5754. configurable: true
  5755. });
  5756. }
  5757. return normalized
  5758. }
  5759. function proxyNormalSlot(slots, key) {
  5760. return function () { return slots[key]; }
  5761. }
  5762. /* */
  5763. /**
  5764. * Runtime helper for rendering v-for lists.
  5765. */
  5766. function renderList (
  5767. val,
  5768. render
  5769. ) {
  5770. var ret, i, l, keys, key;
  5771. if (Array.isArray(val) || typeof val === 'string') {
  5772. ret = new Array(val.length);
  5773. for (i = 0, l = val.length; i < l; i++) {
  5774. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5775. }
  5776. } else if (typeof val === 'number') {
  5777. ret = new Array(val);
  5778. for (i = 0; i < val; i++) {
  5779. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5780. }
  5781. } else if (isObject(val)) {
  5782. if (hasSymbol && val[Symbol.iterator]) {
  5783. ret = [];
  5784. var iterator = val[Symbol.iterator]();
  5785. var result = iterator.next();
  5786. while (!result.done) {
  5787. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5788. result = iterator.next();
  5789. }
  5790. } else {
  5791. keys = Object.keys(val);
  5792. ret = new Array(keys.length);
  5793. for (i = 0, l = keys.length; i < l; i++) {
  5794. key = keys[i];
  5795. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5796. }
  5797. }
  5798. }
  5799. if (!isDef(ret)) {
  5800. ret = [];
  5801. }
  5802. (ret)._isVList = true;
  5803. return ret
  5804. }
  5805. /* */
  5806. /**
  5807. * Runtime helper for rendering <slot>
  5808. */
  5809. function renderSlot (
  5810. name,
  5811. fallback,
  5812. props,
  5813. bindObject
  5814. ) {
  5815. var scopedSlotFn = this.$scopedSlots[name];
  5816. var nodes;
  5817. if (scopedSlotFn) { // scoped slot
  5818. props = props || {};
  5819. if (bindObject) {
  5820. if ( true && !isObject(bindObject)) {
  5821. warn(
  5822. 'slot v-bind without argument expects an Object',
  5823. this
  5824. );
  5825. }
  5826. props = extend(extend({}, bindObject), props);
  5827. }
  5828. // fixed by xxxxxx app-plus scopedSlot
  5829. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5830. } else {
  5831. nodes = this.$slots[name] || fallback;
  5832. }
  5833. var target = props && props.slot;
  5834. if (target) {
  5835. return this.$createElement('template', { slot: target }, nodes)
  5836. } else {
  5837. return nodes
  5838. }
  5839. }
  5840. /* */
  5841. /**
  5842. * Runtime helper for resolving filters
  5843. */
  5844. function resolveFilter (id) {
  5845. return resolveAsset(this.$options, 'filters', id, true) || identity
  5846. }
  5847. /* */
  5848. function isKeyNotMatch (expect, actual) {
  5849. if (Array.isArray(expect)) {
  5850. return expect.indexOf(actual) === -1
  5851. } else {
  5852. return expect !== actual
  5853. }
  5854. }
  5855. /**
  5856. * Runtime helper for checking keyCodes from config.
  5857. * exposed as Vue.prototype._k
  5858. * passing in eventKeyName as last argument separately for backwards compat
  5859. */
  5860. function checkKeyCodes (
  5861. eventKeyCode,
  5862. key,
  5863. builtInKeyCode,
  5864. eventKeyName,
  5865. builtInKeyName
  5866. ) {
  5867. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5868. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5869. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5870. } else if (mappedKeyCode) {
  5871. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5872. } else if (eventKeyName) {
  5873. return hyphenate(eventKeyName) !== key
  5874. }
  5875. }
  5876. /* */
  5877. /**
  5878. * Runtime helper for merging v-bind="object" into a VNode's data.
  5879. */
  5880. function bindObjectProps (
  5881. data,
  5882. tag,
  5883. value,
  5884. asProp,
  5885. isSync
  5886. ) {
  5887. if (value) {
  5888. if (!isObject(value)) {
  5889. true && warn(
  5890. 'v-bind without argument expects an Object or Array value',
  5891. this
  5892. );
  5893. } else {
  5894. if (Array.isArray(value)) {
  5895. value = toObject(value);
  5896. }
  5897. var hash;
  5898. var loop = function ( key ) {
  5899. if (
  5900. key === 'class' ||
  5901. key === 'style' ||
  5902. isReservedAttribute(key)
  5903. ) {
  5904. hash = data;
  5905. } else {
  5906. var type = data.attrs && data.attrs.type;
  5907. hash = asProp || config.mustUseProp(tag, type, key)
  5908. ? data.domProps || (data.domProps = {})
  5909. : data.attrs || (data.attrs = {});
  5910. }
  5911. var camelizedKey = camelize(key);
  5912. var hyphenatedKey = hyphenate(key);
  5913. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5914. hash[key] = value[key];
  5915. if (isSync) {
  5916. var on = data.on || (data.on = {});
  5917. on[("update:" + key)] = function ($event) {
  5918. value[key] = $event;
  5919. };
  5920. }
  5921. }
  5922. };
  5923. for (var key in value) loop( key );
  5924. }
  5925. }
  5926. return data
  5927. }
  5928. /* */
  5929. /**
  5930. * Runtime helper for rendering static trees.
  5931. */
  5932. function renderStatic (
  5933. index,
  5934. isInFor
  5935. ) {
  5936. var cached = this._staticTrees || (this._staticTrees = []);
  5937. var tree = cached[index];
  5938. // if has already-rendered static tree and not inside v-for,
  5939. // we can reuse the same tree.
  5940. if (tree && !isInFor) {
  5941. return tree
  5942. }
  5943. // otherwise, render a fresh tree.
  5944. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5945. this._renderProxy,
  5946. null,
  5947. this // for render fns generated for functional component templates
  5948. );
  5949. markStatic(tree, ("__static__" + index), false);
  5950. return tree
  5951. }
  5952. /**
  5953. * Runtime helper for v-once.
  5954. * Effectively it means marking the node as static with a unique key.
  5955. */
  5956. function markOnce (
  5957. tree,
  5958. index,
  5959. key
  5960. ) {
  5961. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5962. return tree
  5963. }
  5964. function markStatic (
  5965. tree,
  5966. key,
  5967. isOnce
  5968. ) {
  5969. if (Array.isArray(tree)) {
  5970. for (var i = 0; i < tree.length; i++) {
  5971. if (tree[i] && typeof tree[i] !== 'string') {
  5972. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5973. }
  5974. }
  5975. } else {
  5976. markStaticNode(tree, key, isOnce);
  5977. }
  5978. }
  5979. function markStaticNode (node, key, isOnce) {
  5980. node.isStatic = true;
  5981. node.key = key;
  5982. node.isOnce = isOnce;
  5983. }
  5984. /* */
  5985. function bindObjectListeners (data, value) {
  5986. if (value) {
  5987. if (!isPlainObject(value)) {
  5988. true && warn(
  5989. 'v-on without argument expects an Object value',
  5990. this
  5991. );
  5992. } else {
  5993. var on = data.on = data.on ? extend({}, data.on) : {};
  5994. for (var key in value) {
  5995. var existing = on[key];
  5996. var ours = value[key];
  5997. on[key] = existing ? [].concat(existing, ours) : ours;
  5998. }
  5999. }
  6000. }
  6001. return data
  6002. }
  6003. /* */
  6004. function resolveScopedSlots (
  6005. fns, // see flow/vnode
  6006. res,
  6007. // the following are added in 2.6
  6008. hasDynamicKeys,
  6009. contentHashKey
  6010. ) {
  6011. res = res || { $stable: !hasDynamicKeys };
  6012. for (var i = 0; i < fns.length; i++) {
  6013. var slot = fns[i];
  6014. if (Array.isArray(slot)) {
  6015. resolveScopedSlots(slot, res, hasDynamicKeys);
  6016. } else if (slot) {
  6017. // marker for reverse proxying v-slot without scope on this.$slots
  6018. if (slot.proxy) {
  6019. slot.fn.proxy = true;
  6020. }
  6021. res[slot.key] = slot.fn;
  6022. }
  6023. }
  6024. if (contentHashKey) {
  6025. (res).$key = contentHashKey;
  6026. }
  6027. return res
  6028. }
  6029. /* */
  6030. function bindDynamicKeys (baseObj, values) {
  6031. for (var i = 0; i < values.length; i += 2) {
  6032. var key = values[i];
  6033. if (typeof key === 'string' && key) {
  6034. baseObj[values[i]] = values[i + 1];
  6035. } else if ( true && key !== '' && key !== null) {
  6036. // null is a special value for explicitly removing a binding
  6037. warn(
  6038. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6039. this
  6040. );
  6041. }
  6042. }
  6043. return baseObj
  6044. }
  6045. // helper to dynamically append modifier runtime markers to event names.
  6046. // ensure only append when value is already string, otherwise it will be cast
  6047. // to string and cause the type check to miss.
  6048. function prependModifier (value, symbol) {
  6049. return typeof value === 'string' ? symbol + value : value
  6050. }
  6051. /* */
  6052. function installRenderHelpers (target) {
  6053. target._o = markOnce;
  6054. target._n = toNumber;
  6055. target._s = toString;
  6056. target._l = renderList;
  6057. target._t = renderSlot;
  6058. target._q = looseEqual;
  6059. target._i = looseIndexOf;
  6060. target._m = renderStatic;
  6061. target._f = resolveFilter;
  6062. target._k = checkKeyCodes;
  6063. target._b = bindObjectProps;
  6064. target._v = createTextVNode;
  6065. target._e = createEmptyVNode;
  6066. target._u = resolveScopedSlots;
  6067. target._g = bindObjectListeners;
  6068. target._d = bindDynamicKeys;
  6069. target._p = prependModifier;
  6070. }
  6071. /* */
  6072. function FunctionalRenderContext (
  6073. data,
  6074. props,
  6075. children,
  6076. parent,
  6077. Ctor
  6078. ) {
  6079. var this$1 = this;
  6080. var options = Ctor.options;
  6081. // ensure the createElement function in functional components
  6082. // gets a unique context - this is necessary for correct named slot check
  6083. var contextVm;
  6084. if (hasOwn(parent, '_uid')) {
  6085. contextVm = Object.create(parent);
  6086. // $flow-disable-line
  6087. contextVm._original = parent;
  6088. } else {
  6089. // the context vm passed in is a functional context as well.
  6090. // in this case we want to make sure we are able to get a hold to the
  6091. // real context instance.
  6092. contextVm = parent;
  6093. // $flow-disable-line
  6094. parent = parent._original;
  6095. }
  6096. var isCompiled = isTrue(options._compiled);
  6097. var needNormalization = !isCompiled;
  6098. this.data = data;
  6099. this.props = props;
  6100. this.children = children;
  6101. this.parent = parent;
  6102. this.listeners = data.on || emptyObject;
  6103. this.injections = resolveInject(options.inject, parent);
  6104. this.slots = function () {
  6105. if (!this$1.$slots) {
  6106. normalizeScopedSlots(
  6107. data.scopedSlots,
  6108. this$1.$slots = resolveSlots(children, parent)
  6109. );
  6110. }
  6111. return this$1.$slots
  6112. };
  6113. Object.defineProperty(this, 'scopedSlots', ({
  6114. enumerable: true,
  6115. get: function get () {
  6116. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6117. }
  6118. }));
  6119. // support for compiled functional template
  6120. if (isCompiled) {
  6121. // exposing $options for renderStatic()
  6122. this.$options = options;
  6123. // pre-resolve slots for renderSlot()
  6124. this.$slots = this.slots();
  6125. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6126. }
  6127. if (options._scopeId) {
  6128. this._c = function (a, b, c, d) {
  6129. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6130. if (vnode && !Array.isArray(vnode)) {
  6131. vnode.fnScopeId = options._scopeId;
  6132. vnode.fnContext = parent;
  6133. }
  6134. return vnode
  6135. };
  6136. } else {
  6137. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6138. }
  6139. }
  6140. installRenderHelpers(FunctionalRenderContext.prototype);
  6141. function createFunctionalComponent (
  6142. Ctor,
  6143. propsData,
  6144. data,
  6145. contextVm,
  6146. children
  6147. ) {
  6148. var options = Ctor.options;
  6149. var props = {};
  6150. var propOptions = options.props;
  6151. if (isDef(propOptions)) {
  6152. for (var key in propOptions) {
  6153. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6154. }
  6155. } else {
  6156. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6157. if (isDef(data.props)) { mergeProps(props, data.props); }
  6158. }
  6159. var renderContext = new FunctionalRenderContext(
  6160. data,
  6161. props,
  6162. children,
  6163. contextVm,
  6164. Ctor
  6165. );
  6166. var vnode = options.render.call(null, renderContext._c, renderContext);
  6167. if (vnode instanceof VNode) {
  6168. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6169. } else if (Array.isArray(vnode)) {
  6170. var vnodes = normalizeChildren(vnode) || [];
  6171. var res = new Array(vnodes.length);
  6172. for (var i = 0; i < vnodes.length; i++) {
  6173. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6174. }
  6175. return res
  6176. }
  6177. }
  6178. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6179. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6180. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6181. // that should not be matched to match.
  6182. var clone = cloneVNode(vnode);
  6183. clone.fnContext = contextVm;
  6184. clone.fnOptions = options;
  6185. if (true) {
  6186. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6187. }
  6188. if (data.slot) {
  6189. (clone.data || (clone.data = {})).slot = data.slot;
  6190. }
  6191. return clone
  6192. }
  6193. function mergeProps (to, from) {
  6194. for (var key in from) {
  6195. to[camelize(key)] = from[key];
  6196. }
  6197. }
  6198. /* */
  6199. /* */
  6200. /* */
  6201. /* */
  6202. // inline hooks to be invoked on component VNodes during patch
  6203. var componentVNodeHooks = {
  6204. init: function init (vnode, hydrating) {
  6205. if (
  6206. vnode.componentInstance &&
  6207. !vnode.componentInstance._isDestroyed &&
  6208. vnode.data.keepAlive
  6209. ) {
  6210. // kept-alive components, treat as a patch
  6211. var mountedNode = vnode; // work around flow
  6212. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6213. } else {
  6214. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6215. vnode,
  6216. activeInstance
  6217. );
  6218. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6219. }
  6220. },
  6221. prepatch: function prepatch (oldVnode, vnode) {
  6222. var options = vnode.componentOptions;
  6223. var child = vnode.componentInstance = oldVnode.componentInstance;
  6224. updateChildComponent(
  6225. child,
  6226. options.propsData, // updated props
  6227. options.listeners, // updated listeners
  6228. vnode, // new parent vnode
  6229. options.children // new children
  6230. );
  6231. },
  6232. insert: function insert (vnode) {
  6233. var context = vnode.context;
  6234. var componentInstance = vnode.componentInstance;
  6235. if (!componentInstance._isMounted) {
  6236. callHook(componentInstance, 'onServiceCreated');
  6237. callHook(componentInstance, 'onServiceAttached');
  6238. componentInstance._isMounted = true;
  6239. callHook(componentInstance, 'mounted');
  6240. }
  6241. if (vnode.data.keepAlive) {
  6242. if (context._isMounted) {
  6243. // vue-router#1212
  6244. // During updates, a kept-alive component's child components may
  6245. // change, so directly walking the tree here may call activated hooks
  6246. // on incorrect children. Instead we push them into a queue which will
  6247. // be processed after the whole patch process ended.
  6248. queueActivatedComponent(componentInstance);
  6249. } else {
  6250. activateChildComponent(componentInstance, true /* direct */);
  6251. }
  6252. }
  6253. },
  6254. destroy: function destroy (vnode) {
  6255. var componentInstance = vnode.componentInstance;
  6256. if (!componentInstance._isDestroyed) {
  6257. if (!vnode.data.keepAlive) {
  6258. componentInstance.$destroy();
  6259. } else {
  6260. deactivateChildComponent(componentInstance, true /* direct */);
  6261. }
  6262. }
  6263. }
  6264. };
  6265. var hooksToMerge = Object.keys(componentVNodeHooks);
  6266. function createComponent (
  6267. Ctor,
  6268. data,
  6269. context,
  6270. children,
  6271. tag
  6272. ) {
  6273. if (isUndef(Ctor)) {
  6274. return
  6275. }
  6276. var baseCtor = context.$options._base;
  6277. // plain options object: turn it into a constructor
  6278. if (isObject(Ctor)) {
  6279. Ctor = baseCtor.extend(Ctor);
  6280. }
  6281. // if at this stage it's not a constructor or an async component factory,
  6282. // reject.
  6283. if (typeof Ctor !== 'function') {
  6284. if (true) {
  6285. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6286. }
  6287. return
  6288. }
  6289. // async component
  6290. var asyncFactory;
  6291. if (isUndef(Ctor.cid)) {
  6292. asyncFactory = Ctor;
  6293. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6294. if (Ctor === undefined) {
  6295. // return a placeholder node for async component, which is rendered
  6296. // as a comment node but preserves all the raw information for the node.
  6297. // the information will be used for async server-rendering and hydration.
  6298. return createAsyncPlaceholder(
  6299. asyncFactory,
  6300. data,
  6301. context,
  6302. children,
  6303. tag
  6304. )
  6305. }
  6306. }
  6307. data = data || {};
  6308. // resolve constructor options in case global mixins are applied after
  6309. // component constructor creation
  6310. resolveConstructorOptions(Ctor);
  6311. // transform component v-model data into props & events
  6312. if (isDef(data.model)) {
  6313. transformModel(Ctor.options, data);
  6314. }
  6315. // extract props
  6316. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6317. // functional component
  6318. if (isTrue(Ctor.options.functional)) {
  6319. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6320. }
  6321. // extract listeners, since these needs to be treated as
  6322. // child component listeners instead of DOM listeners
  6323. var listeners = data.on;
  6324. // replace with listeners with .native modifier
  6325. // so it gets processed during parent component patch.
  6326. data.on = data.nativeOn;
  6327. if (isTrue(Ctor.options.abstract)) {
  6328. // abstract components do not keep anything
  6329. // other than props & listeners & slot
  6330. // work around flow
  6331. var slot = data.slot;
  6332. data = {};
  6333. if (slot) {
  6334. data.slot = slot;
  6335. }
  6336. }
  6337. // install component management hooks onto the placeholder node
  6338. installComponentHooks(data);
  6339. // return a placeholder vnode
  6340. var name = Ctor.options.name || tag;
  6341. var vnode = new VNode(
  6342. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6343. data, undefined, undefined, undefined, context,
  6344. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6345. asyncFactory
  6346. );
  6347. return vnode
  6348. }
  6349. function createComponentInstanceForVnode (
  6350. vnode, // we know it's MountedComponentVNode but flow doesn't
  6351. parent // activeInstance in lifecycle state
  6352. ) {
  6353. var options = {
  6354. _isComponent: true,
  6355. _parentVnode: vnode,
  6356. parent: parent
  6357. };
  6358. // check inline-template render functions
  6359. var inlineTemplate = vnode.data.inlineTemplate;
  6360. if (isDef(inlineTemplate)) {
  6361. options.render = inlineTemplate.render;
  6362. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6363. }
  6364. return new vnode.componentOptions.Ctor(options)
  6365. }
  6366. function installComponentHooks (data) {
  6367. var hooks = data.hook || (data.hook = {});
  6368. for (var i = 0; i < hooksToMerge.length; i++) {
  6369. var key = hooksToMerge[i];
  6370. var existing = hooks[key];
  6371. var toMerge = componentVNodeHooks[key];
  6372. if (existing !== toMerge && !(existing && existing._merged)) {
  6373. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6374. }
  6375. }
  6376. }
  6377. function mergeHook$1 (f1, f2) {
  6378. var merged = function (a, b) {
  6379. // flow complains about extra args which is why we use any
  6380. f1(a, b);
  6381. f2(a, b);
  6382. };
  6383. merged._merged = true;
  6384. return merged
  6385. }
  6386. // transform component v-model info (value and callback) into
  6387. // prop and event handler respectively.
  6388. function transformModel (options, data) {
  6389. var prop = (options.model && options.model.prop) || 'value';
  6390. var event = (options.model && options.model.event) || 'input'
  6391. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6392. var on = data.on || (data.on = {});
  6393. var existing = on[event];
  6394. var callback = data.model.callback;
  6395. if (isDef(existing)) {
  6396. if (
  6397. Array.isArray(existing)
  6398. ? existing.indexOf(callback) === -1
  6399. : existing !== callback
  6400. ) {
  6401. on[event] = [callback].concat(existing);
  6402. }
  6403. } else {
  6404. on[event] = callback;
  6405. }
  6406. }
  6407. /* */
  6408. var SIMPLE_NORMALIZE = 1;
  6409. var ALWAYS_NORMALIZE = 2;
  6410. // wrapper function for providing a more flexible interface
  6411. // without getting yelled at by flow
  6412. function createElement (
  6413. context,
  6414. tag,
  6415. data,
  6416. children,
  6417. normalizationType,
  6418. alwaysNormalize
  6419. ) {
  6420. if (Array.isArray(data) || isPrimitive(data)) {
  6421. normalizationType = children;
  6422. children = data;
  6423. data = undefined;
  6424. }
  6425. if (isTrue(alwaysNormalize)) {
  6426. normalizationType = ALWAYS_NORMALIZE;
  6427. }
  6428. return _createElement(context, tag, data, children, normalizationType)
  6429. }
  6430. function _createElement (
  6431. context,
  6432. tag,
  6433. data,
  6434. children,
  6435. normalizationType
  6436. ) {
  6437. if (isDef(data) && isDef((data).__ob__)) {
  6438. true && warn(
  6439. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6440. 'Always create fresh vnode data objects in each render!',
  6441. context
  6442. );
  6443. return createEmptyVNode()
  6444. }
  6445. // object syntax in v-bind
  6446. if (isDef(data) && isDef(data.is)) {
  6447. tag = data.is;
  6448. }
  6449. if (!tag) {
  6450. // in case of component :is set to falsy value
  6451. return createEmptyVNode()
  6452. }
  6453. // warn against non-primitive key
  6454. if ( true &&
  6455. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6456. ) {
  6457. {
  6458. warn(
  6459. 'Avoid using non-primitive value as key, ' +
  6460. 'use string/number value instead.',
  6461. context
  6462. );
  6463. }
  6464. }
  6465. // support single function children as default scoped slot
  6466. if (Array.isArray(children) &&
  6467. typeof children[0] === 'function'
  6468. ) {
  6469. data = data || {};
  6470. data.scopedSlots = { default: children[0] };
  6471. children.length = 0;
  6472. }
  6473. if (normalizationType === ALWAYS_NORMALIZE) {
  6474. children = normalizeChildren(children);
  6475. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6476. children = simpleNormalizeChildren(children);
  6477. }
  6478. var vnode, ns;
  6479. if (typeof tag === 'string') {
  6480. var Ctor;
  6481. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6482. if (config.isReservedTag(tag)) {
  6483. // platform built-in elements
  6484. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6485. warn(
  6486. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6487. context
  6488. );
  6489. }
  6490. vnode = new VNode(
  6491. config.parsePlatformTagName(tag), data, children,
  6492. undefined, undefined, context
  6493. );
  6494. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6495. // component
  6496. vnode = createComponent(Ctor, data, context, children, tag);
  6497. } else {
  6498. // unknown or unlisted namespaced elements
  6499. // check at runtime because it may get assigned a namespace when its
  6500. // parent normalizes children
  6501. vnode = new VNode(
  6502. tag, data, children,
  6503. undefined, undefined, context
  6504. );
  6505. }
  6506. } else {
  6507. // direct component options / constructor
  6508. vnode = createComponent(tag, data, context, children);
  6509. }
  6510. if (Array.isArray(vnode)) {
  6511. return vnode
  6512. } else if (isDef(vnode)) {
  6513. if (isDef(ns)) { applyNS(vnode, ns); }
  6514. if (isDef(data)) { registerDeepBindings(data); }
  6515. return vnode
  6516. } else {
  6517. return createEmptyVNode()
  6518. }
  6519. }
  6520. function applyNS (vnode, ns, force) {
  6521. vnode.ns = ns;
  6522. if (vnode.tag === 'foreignObject') {
  6523. // use default namespace inside foreignObject
  6524. ns = undefined;
  6525. force = true;
  6526. }
  6527. if (isDef(vnode.children)) {
  6528. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6529. var child = vnode.children[i];
  6530. if (isDef(child.tag) && (
  6531. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6532. applyNS(child, ns, force);
  6533. }
  6534. }
  6535. }
  6536. }
  6537. // ref #5318
  6538. // necessary to ensure parent re-render when deep bindings like :style and
  6539. // :class are used on slot nodes
  6540. function registerDeepBindings (data) {
  6541. if (isObject(data.style)) {
  6542. traverse(data.style);
  6543. }
  6544. if (isObject(data.class)) {
  6545. traverse(data.class);
  6546. }
  6547. }
  6548. /* */
  6549. function initRender (vm) {
  6550. vm._vnode = null; // the root of the child tree
  6551. vm._staticTrees = null; // v-once cached trees
  6552. var options = vm.$options;
  6553. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6554. var renderContext = parentVnode && parentVnode.context;
  6555. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6556. vm.$scopedSlots = emptyObject;
  6557. // bind the createElement fn to this instance
  6558. // so that we get proper render context inside it.
  6559. // args order: tag, data, children, normalizationType, alwaysNormalize
  6560. // internal version is used by render functions compiled from templates
  6561. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6562. // normalization is always applied for the public version, used in
  6563. // user-written render functions.
  6564. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6565. // $attrs & $listeners are exposed for easier HOC creation.
  6566. // they need to be reactive so that HOCs using them are always updated
  6567. var parentData = parentVnode && parentVnode.data;
  6568. /* istanbul ignore else */
  6569. if (true) {
  6570. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6571. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6572. }, true);
  6573. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6574. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6575. }, true);
  6576. } else {}
  6577. }
  6578. var currentRenderingInstance = null;
  6579. function renderMixin (Vue) {
  6580. // install runtime convenience helpers
  6581. installRenderHelpers(Vue.prototype);
  6582. Vue.prototype.$nextTick = function (fn) {
  6583. return nextTick(fn, this)
  6584. };
  6585. Vue.prototype._render = function () {
  6586. var vm = this;
  6587. var ref = vm.$options;
  6588. var render = ref.render;
  6589. var _parentVnode = ref._parentVnode;
  6590. if (_parentVnode) {
  6591. vm.$scopedSlots = normalizeScopedSlots(
  6592. _parentVnode.data.scopedSlots,
  6593. vm.$slots,
  6594. vm.$scopedSlots
  6595. );
  6596. }
  6597. // set parent vnode. this allows render functions to have access
  6598. // to the data on the placeholder node.
  6599. vm.$vnode = _parentVnode;
  6600. // render self
  6601. var vnode;
  6602. try {
  6603. // There's no need to maintain a stack because all render fns are called
  6604. // separately from one another. Nested component's render fns are called
  6605. // when parent component is patched.
  6606. currentRenderingInstance = vm;
  6607. vnode = render.call(vm._renderProxy, vm.$createElement);
  6608. } catch (e) {
  6609. handleError(e, vm, "render");
  6610. // return error render result,
  6611. // or previous vnode to prevent render error causing blank component
  6612. /* istanbul ignore else */
  6613. if ( true && vm.$options.renderError) {
  6614. try {
  6615. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6616. } catch (e) {
  6617. handleError(e, vm, "renderError");
  6618. vnode = vm._vnode;
  6619. }
  6620. } else {
  6621. vnode = vm._vnode;
  6622. }
  6623. } finally {
  6624. currentRenderingInstance = null;
  6625. }
  6626. // if the returned array contains only a single node, allow it
  6627. if (Array.isArray(vnode) && vnode.length === 1) {
  6628. vnode = vnode[0];
  6629. }
  6630. // return empty vnode in case the render function errored out
  6631. if (!(vnode instanceof VNode)) {
  6632. if ( true && Array.isArray(vnode)) {
  6633. warn(
  6634. 'Multiple root nodes returned from render function. Render function ' +
  6635. 'should return a single root node.',
  6636. vm
  6637. );
  6638. }
  6639. vnode = createEmptyVNode();
  6640. }
  6641. // set parent
  6642. vnode.parent = _parentVnode;
  6643. return vnode
  6644. };
  6645. }
  6646. /* */
  6647. function ensureCtor (comp, base) {
  6648. if (
  6649. comp.__esModule ||
  6650. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6651. ) {
  6652. comp = comp.default;
  6653. }
  6654. return isObject(comp)
  6655. ? base.extend(comp)
  6656. : comp
  6657. }
  6658. function createAsyncPlaceholder (
  6659. factory,
  6660. data,
  6661. context,
  6662. children,
  6663. tag
  6664. ) {
  6665. var node = createEmptyVNode();
  6666. node.asyncFactory = factory;
  6667. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6668. return node
  6669. }
  6670. function resolveAsyncComponent (
  6671. factory,
  6672. baseCtor
  6673. ) {
  6674. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6675. return factory.errorComp
  6676. }
  6677. if (isDef(factory.resolved)) {
  6678. return factory.resolved
  6679. }
  6680. var owner = currentRenderingInstance;
  6681. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6682. // already pending
  6683. factory.owners.push(owner);
  6684. }
  6685. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6686. return factory.loadingComp
  6687. }
  6688. if (owner && !isDef(factory.owners)) {
  6689. var owners = factory.owners = [owner];
  6690. var sync = true;
  6691. var timerLoading = null;
  6692. var timerTimeout = null
  6693. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6694. var forceRender = function (renderCompleted) {
  6695. for (var i = 0, l = owners.length; i < l; i++) {
  6696. (owners[i]).$forceUpdate();
  6697. }
  6698. if (renderCompleted) {
  6699. owners.length = 0;
  6700. if (timerLoading !== null) {
  6701. clearTimeout(timerLoading);
  6702. timerLoading = null;
  6703. }
  6704. if (timerTimeout !== null) {
  6705. clearTimeout(timerTimeout);
  6706. timerTimeout = null;
  6707. }
  6708. }
  6709. };
  6710. var resolve = once(function (res) {
  6711. // cache resolved
  6712. factory.resolved = ensureCtor(res, baseCtor);
  6713. // invoke callbacks only if this is not a synchronous resolve
  6714. // (async resolves are shimmed as synchronous during SSR)
  6715. if (!sync) {
  6716. forceRender(true);
  6717. } else {
  6718. owners.length = 0;
  6719. }
  6720. });
  6721. var reject = once(function (reason) {
  6722. true && warn(
  6723. "Failed to resolve async component: " + (String(factory)) +
  6724. (reason ? ("\nReason: " + reason) : '')
  6725. );
  6726. if (isDef(factory.errorComp)) {
  6727. factory.error = true;
  6728. forceRender(true);
  6729. }
  6730. });
  6731. var res = factory(resolve, reject);
  6732. if (isObject(res)) {
  6733. if (isPromise(res)) {
  6734. // () => Promise
  6735. if (isUndef(factory.resolved)) {
  6736. res.then(resolve, reject);
  6737. }
  6738. } else if (isPromise(res.component)) {
  6739. res.component.then(resolve, reject);
  6740. if (isDef(res.error)) {
  6741. factory.errorComp = ensureCtor(res.error, baseCtor);
  6742. }
  6743. if (isDef(res.loading)) {
  6744. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6745. if (res.delay === 0) {
  6746. factory.loading = true;
  6747. } else {
  6748. timerLoading = setTimeout(function () {
  6749. timerLoading = null;
  6750. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6751. factory.loading = true;
  6752. forceRender(false);
  6753. }
  6754. }, res.delay || 200);
  6755. }
  6756. }
  6757. if (isDef(res.timeout)) {
  6758. timerTimeout = setTimeout(function () {
  6759. timerTimeout = null;
  6760. if (isUndef(factory.resolved)) {
  6761. reject(
  6762. true
  6763. ? ("timeout (" + (res.timeout) + "ms)")
  6764. : undefined
  6765. );
  6766. }
  6767. }, res.timeout);
  6768. }
  6769. }
  6770. }
  6771. sync = false;
  6772. // return in case resolved synchronously
  6773. return factory.loading
  6774. ? factory.loadingComp
  6775. : factory.resolved
  6776. }
  6777. }
  6778. /* */
  6779. function isAsyncPlaceholder (node) {
  6780. return node.isComment && node.asyncFactory
  6781. }
  6782. /* */
  6783. function getFirstComponentChild (children) {
  6784. if (Array.isArray(children)) {
  6785. for (var i = 0; i < children.length; i++) {
  6786. var c = children[i];
  6787. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6788. return c
  6789. }
  6790. }
  6791. }
  6792. }
  6793. /* */
  6794. /* */
  6795. function initEvents (vm) {
  6796. vm._events = Object.create(null);
  6797. vm._hasHookEvent = false;
  6798. // init parent attached events
  6799. var listeners = vm.$options._parentListeners;
  6800. if (listeners) {
  6801. updateComponentListeners(vm, listeners);
  6802. }
  6803. }
  6804. var target;
  6805. function add (event, fn) {
  6806. target.$on(event, fn);
  6807. }
  6808. function remove$1 (event, fn) {
  6809. target.$off(event, fn);
  6810. }
  6811. function createOnceHandler (event, fn) {
  6812. var _target = target;
  6813. return function onceHandler () {
  6814. var res = fn.apply(null, arguments);
  6815. if (res !== null) {
  6816. _target.$off(event, onceHandler);
  6817. }
  6818. }
  6819. }
  6820. function updateComponentListeners (
  6821. vm,
  6822. listeners,
  6823. oldListeners
  6824. ) {
  6825. target = vm;
  6826. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6827. target = undefined;
  6828. }
  6829. function eventsMixin (Vue) {
  6830. var hookRE = /^hook:/;
  6831. Vue.prototype.$on = function (event, fn) {
  6832. var vm = this;
  6833. if (Array.isArray(event)) {
  6834. for (var i = 0, l = event.length; i < l; i++) {
  6835. vm.$on(event[i], fn);
  6836. }
  6837. } else {
  6838. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6839. // optimize hook:event cost by using a boolean flag marked at registration
  6840. // instead of a hash lookup
  6841. if (hookRE.test(event)) {
  6842. vm._hasHookEvent = true;
  6843. }
  6844. }
  6845. return vm
  6846. };
  6847. Vue.prototype.$once = function (event, fn) {
  6848. var vm = this;
  6849. function on () {
  6850. vm.$off(event, on);
  6851. fn.apply(vm, arguments);
  6852. }
  6853. on.fn = fn;
  6854. vm.$on(event, on);
  6855. return vm
  6856. };
  6857. Vue.prototype.$off = function (event, fn) {
  6858. var vm = this;
  6859. // all
  6860. if (!arguments.length) {
  6861. vm._events = Object.create(null);
  6862. return vm
  6863. }
  6864. // array of events
  6865. if (Array.isArray(event)) {
  6866. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6867. vm.$off(event[i$1], fn);
  6868. }
  6869. return vm
  6870. }
  6871. // specific event
  6872. var cbs = vm._events[event];
  6873. if (!cbs) {
  6874. return vm
  6875. }
  6876. if (!fn) {
  6877. vm._events[event] = null;
  6878. return vm
  6879. }
  6880. // specific handler
  6881. var cb;
  6882. var i = cbs.length;
  6883. while (i--) {
  6884. cb = cbs[i];
  6885. if (cb === fn || cb.fn === fn) {
  6886. cbs.splice(i, 1);
  6887. break
  6888. }
  6889. }
  6890. return vm
  6891. };
  6892. Vue.prototype.$emit = function (event) {
  6893. var vm = this;
  6894. if (true) {
  6895. var lowerCaseEvent = event.toLowerCase();
  6896. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6897. tip(
  6898. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6899. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6900. "Note that HTML attributes are case-insensitive and you cannot use " +
  6901. "v-on to listen to camelCase events when using in-DOM templates. " +
  6902. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6903. );
  6904. }
  6905. }
  6906. var cbs = vm._events[event];
  6907. if (cbs) {
  6908. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6909. var args = toArray(arguments, 1);
  6910. var info = "event handler for \"" + event + "\"";
  6911. for (var i = 0, l = cbs.length; i < l; i++) {
  6912. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6913. }
  6914. }
  6915. return vm
  6916. };
  6917. }
  6918. /* */
  6919. var activeInstance = null;
  6920. var isUpdatingChildComponent = false;
  6921. function setActiveInstance(vm) {
  6922. var prevActiveInstance = activeInstance;
  6923. activeInstance = vm;
  6924. return function () {
  6925. activeInstance = prevActiveInstance;
  6926. }
  6927. }
  6928. function initLifecycle (vm) {
  6929. var options = vm.$options;
  6930. // locate first non-abstract parent
  6931. var parent = options.parent;
  6932. if (parent && !options.abstract) {
  6933. while (parent.$options.abstract && parent.$parent) {
  6934. parent = parent.$parent;
  6935. }
  6936. parent.$children.push(vm);
  6937. }
  6938. vm.$parent = parent;
  6939. vm.$root = parent ? parent.$root : vm;
  6940. vm.$children = [];
  6941. vm.$refs = {};
  6942. vm._watcher = null;
  6943. vm._inactive = null;
  6944. vm._directInactive = false;
  6945. vm._isMounted = false;
  6946. vm._isDestroyed = false;
  6947. vm._isBeingDestroyed = false;
  6948. }
  6949. function lifecycleMixin (Vue) {
  6950. Vue.prototype._update = function (vnode, hydrating) {
  6951. var vm = this;
  6952. var prevEl = vm.$el;
  6953. var prevVnode = vm._vnode;
  6954. var restoreActiveInstance = setActiveInstance(vm);
  6955. vm._vnode = vnode;
  6956. // Vue.prototype.__patch__ is injected in entry points
  6957. // based on the rendering backend used.
  6958. if (!prevVnode) {
  6959. // initial render
  6960. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6961. } else {
  6962. // updates
  6963. vm.$el = vm.__patch__(prevVnode, vnode);
  6964. }
  6965. restoreActiveInstance();
  6966. // update __vue__ reference
  6967. if (prevEl) {
  6968. prevEl.__vue__ = null;
  6969. }
  6970. if (vm.$el) {
  6971. vm.$el.__vue__ = vm;
  6972. }
  6973. // if parent is an HOC, update its $el as well
  6974. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6975. vm.$parent.$el = vm.$el;
  6976. }
  6977. // updated hook is called by the scheduler to ensure that children are
  6978. // updated in a parent's updated hook.
  6979. };
  6980. Vue.prototype.$forceUpdate = function () {
  6981. var vm = this;
  6982. if (vm._watcher) {
  6983. vm._watcher.update();
  6984. }
  6985. };
  6986. Vue.prototype.$destroy = function () {
  6987. var vm = this;
  6988. if (vm._isBeingDestroyed) {
  6989. return
  6990. }
  6991. callHook(vm, 'beforeDestroy');
  6992. vm._isBeingDestroyed = true;
  6993. // remove self from parent
  6994. var parent = vm.$parent;
  6995. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6996. remove(parent.$children, vm);
  6997. }
  6998. // teardown watchers
  6999. if (vm._watcher) {
  7000. vm._watcher.teardown();
  7001. }
  7002. var i = vm._watchers.length;
  7003. while (i--) {
  7004. vm._watchers[i].teardown();
  7005. }
  7006. // remove reference from data ob
  7007. // frozen object may not have observer.
  7008. if (vm._data.__ob__) {
  7009. vm._data.__ob__.vmCount--;
  7010. }
  7011. // call the last hook...
  7012. vm._isDestroyed = true;
  7013. // invoke destroy hooks on current rendered tree
  7014. vm.__patch__(vm._vnode, null);
  7015. // fire destroyed hook
  7016. callHook(vm, 'destroyed');
  7017. // turn off all instance listeners.
  7018. vm.$off();
  7019. // remove __vue__ reference
  7020. if (vm.$el) {
  7021. vm.$el.__vue__ = null;
  7022. }
  7023. // release circular reference (#6759)
  7024. if (vm.$vnode) {
  7025. vm.$vnode.parent = null;
  7026. }
  7027. };
  7028. }
  7029. function updateChildComponent (
  7030. vm,
  7031. propsData,
  7032. listeners,
  7033. parentVnode,
  7034. renderChildren
  7035. ) {
  7036. if (true) {
  7037. isUpdatingChildComponent = true;
  7038. }
  7039. // determine whether component has slot children
  7040. // we need to do this before overwriting $options._renderChildren.
  7041. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7042. // dynamic slot names). Static scoped slots compiled from template has the
  7043. // "$stable" marker.
  7044. var newScopedSlots = parentVnode.data.scopedSlots;
  7045. var oldScopedSlots = vm.$scopedSlots;
  7046. var hasDynamicScopedSlot = !!(
  7047. (newScopedSlots && !newScopedSlots.$stable) ||
  7048. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7049. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7050. );
  7051. // Any static slot children from the parent may have changed during parent's
  7052. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7053. // update is necessary to ensure correctness.
  7054. var needsForceUpdate = !!(
  7055. renderChildren || // has new static slots
  7056. vm.$options._renderChildren || // has old static slots
  7057. hasDynamicScopedSlot
  7058. );
  7059. vm.$options._parentVnode = parentVnode;
  7060. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7061. if (vm._vnode) { // update child tree's parent
  7062. vm._vnode.parent = parentVnode;
  7063. }
  7064. vm.$options._renderChildren = renderChildren;
  7065. // update $attrs and $listeners hash
  7066. // these are also reactive so they may trigger child update if the child
  7067. // used them during render
  7068. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7069. vm.$listeners = listeners || emptyObject;
  7070. // update props
  7071. if (propsData && vm.$options.props) {
  7072. toggleObserving(false);
  7073. var props = vm._props;
  7074. var propKeys = vm.$options._propKeys || [];
  7075. for (var i = 0; i < propKeys.length; i++) {
  7076. var key = propKeys[i];
  7077. var propOptions = vm.$options.props; // wtf flow?
  7078. props[key] = validateProp(key, propOptions, propsData, vm);
  7079. }
  7080. toggleObserving(true);
  7081. // keep a copy of raw propsData
  7082. vm.$options.propsData = propsData;
  7083. }
  7084. // fixed by xxxxxx update properties(mp runtime)
  7085. vm._$updateProperties && vm._$updateProperties(vm);
  7086. // update listeners
  7087. listeners = listeners || emptyObject;
  7088. var oldListeners = vm.$options._parentListeners;
  7089. vm.$options._parentListeners = listeners;
  7090. updateComponentListeners(vm, listeners, oldListeners);
  7091. // resolve slots + force update if has children
  7092. if (needsForceUpdate) {
  7093. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7094. vm.$forceUpdate();
  7095. }
  7096. if (true) {
  7097. isUpdatingChildComponent = false;
  7098. }
  7099. }
  7100. function isInInactiveTree (vm) {
  7101. while (vm && (vm = vm.$parent)) {
  7102. if (vm._inactive) { return true }
  7103. }
  7104. return false
  7105. }
  7106. function activateChildComponent (vm, direct) {
  7107. if (direct) {
  7108. vm._directInactive = false;
  7109. if (isInInactiveTree(vm)) {
  7110. return
  7111. }
  7112. } else if (vm._directInactive) {
  7113. return
  7114. }
  7115. if (vm._inactive || vm._inactive === null) {
  7116. vm._inactive = false;
  7117. for (var i = 0; i < vm.$children.length; i++) {
  7118. activateChildComponent(vm.$children[i]);
  7119. }
  7120. callHook(vm, 'activated');
  7121. }
  7122. }
  7123. function deactivateChildComponent (vm, direct) {
  7124. if (direct) {
  7125. vm._directInactive = true;
  7126. if (isInInactiveTree(vm)) {
  7127. return
  7128. }
  7129. }
  7130. if (!vm._inactive) {
  7131. vm._inactive = true;
  7132. for (var i = 0; i < vm.$children.length; i++) {
  7133. deactivateChildComponent(vm.$children[i]);
  7134. }
  7135. callHook(vm, 'deactivated');
  7136. }
  7137. }
  7138. function callHook (vm, hook) {
  7139. // #7573 disable dep collection when invoking lifecycle hooks
  7140. pushTarget();
  7141. var handlers = vm.$options[hook];
  7142. var info = hook + " hook";
  7143. if (handlers) {
  7144. for (var i = 0, j = handlers.length; i < j; i++) {
  7145. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7146. }
  7147. }
  7148. if (vm._hasHookEvent) {
  7149. vm.$emit('hook:' + hook);
  7150. }
  7151. popTarget();
  7152. }
  7153. /* */
  7154. var MAX_UPDATE_COUNT = 100;
  7155. var queue = [];
  7156. var activatedChildren = [];
  7157. var has = {};
  7158. var circular = {};
  7159. var waiting = false;
  7160. var flushing = false;
  7161. var index = 0;
  7162. /**
  7163. * Reset the scheduler's state.
  7164. */
  7165. function resetSchedulerState () {
  7166. index = queue.length = activatedChildren.length = 0;
  7167. has = {};
  7168. if (true) {
  7169. circular = {};
  7170. }
  7171. waiting = flushing = false;
  7172. }
  7173. // Async edge case #6566 requires saving the timestamp when event listeners are
  7174. // attached. However, calling performance.now() has a perf overhead especially
  7175. // if the page has thousands of event listeners. Instead, we take a timestamp
  7176. // every time the scheduler flushes and use that for all event listeners
  7177. // attached during that flush.
  7178. var currentFlushTimestamp = 0;
  7179. // Async edge case fix requires storing an event listener's attach timestamp.
  7180. var getNow = Date.now;
  7181. // Determine what event timestamp the browser is using. Annoyingly, the
  7182. // timestamp can either be hi-res (relative to page load) or low-res
  7183. // (relative to UNIX epoch), so in order to compare time we have to use the
  7184. // same timestamp type when saving the flush timestamp.
  7185. // All IE versions use low-res event timestamps, and have problematic clock
  7186. // implementations (#9632)
  7187. if (inBrowser && !isIE) {
  7188. var performance = window.performance;
  7189. if (
  7190. performance &&
  7191. typeof performance.now === 'function' &&
  7192. getNow() > document.createEvent('Event').timeStamp
  7193. ) {
  7194. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7195. // smaller than it, it means the event is using a hi-res timestamp,
  7196. // and we need to use the hi-res version for event listener timestamps as
  7197. // well.
  7198. getNow = function () { return performance.now(); };
  7199. }
  7200. }
  7201. /**
  7202. * Flush both queues and run the watchers.
  7203. */
  7204. function flushSchedulerQueue () {
  7205. currentFlushTimestamp = getNow();
  7206. flushing = true;
  7207. var watcher, id;
  7208. // Sort queue before flush.
  7209. // This ensures that:
  7210. // 1. Components are updated from parent to child. (because parent is always
  7211. // created before the child)
  7212. // 2. A component's user watchers are run before its render watcher (because
  7213. // user watchers are created before the render watcher)
  7214. // 3. If a component is destroyed during a parent component's watcher run,
  7215. // its watchers can be skipped.
  7216. queue.sort(function (a, b) { return a.id - b.id; });
  7217. // do not cache length because more watchers might be pushed
  7218. // as we run existing watchers
  7219. for (index = 0; index < queue.length; index++) {
  7220. watcher = queue[index];
  7221. if (watcher.before) {
  7222. watcher.before();
  7223. }
  7224. id = watcher.id;
  7225. has[id] = null;
  7226. watcher.run();
  7227. // in dev build, check and stop circular updates.
  7228. if ( true && has[id] != null) {
  7229. circular[id] = (circular[id] || 0) + 1;
  7230. if (circular[id] > MAX_UPDATE_COUNT) {
  7231. warn(
  7232. 'You may have an infinite update loop ' + (
  7233. watcher.user
  7234. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7235. : "in a component render function."
  7236. ),
  7237. watcher.vm
  7238. );
  7239. break
  7240. }
  7241. }
  7242. }
  7243. // keep copies of post queues before resetting state
  7244. var activatedQueue = activatedChildren.slice();
  7245. var updatedQueue = queue.slice();
  7246. resetSchedulerState();
  7247. // call component updated and activated hooks
  7248. callActivatedHooks(activatedQueue);
  7249. callUpdatedHooks(updatedQueue);
  7250. // devtool hook
  7251. /* istanbul ignore if */
  7252. if (devtools && config.devtools) {
  7253. devtools.emit('flush');
  7254. }
  7255. }
  7256. function callUpdatedHooks (queue) {
  7257. var i = queue.length;
  7258. while (i--) {
  7259. var watcher = queue[i];
  7260. var vm = watcher.vm;
  7261. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7262. callHook(vm, 'updated');
  7263. }
  7264. }
  7265. }
  7266. /**
  7267. * Queue a kept-alive component that was activated during patch.
  7268. * The queue will be processed after the entire tree has been patched.
  7269. */
  7270. function queueActivatedComponent (vm) {
  7271. // setting _inactive to false here so that a render function can
  7272. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7273. vm._inactive = false;
  7274. activatedChildren.push(vm);
  7275. }
  7276. function callActivatedHooks (queue) {
  7277. for (var i = 0; i < queue.length; i++) {
  7278. queue[i]._inactive = true;
  7279. activateChildComponent(queue[i], true /* true */);
  7280. }
  7281. }
  7282. /**
  7283. * Push a watcher into the watcher queue.
  7284. * Jobs with duplicate IDs will be skipped unless it's
  7285. * pushed when the queue is being flushed.
  7286. */
  7287. function queueWatcher (watcher) {
  7288. var id = watcher.id;
  7289. if (has[id] == null) {
  7290. has[id] = true;
  7291. if (!flushing) {
  7292. queue.push(watcher);
  7293. } else {
  7294. // if already flushing, splice the watcher based on its id
  7295. // if already past its id, it will be run next immediately.
  7296. var i = queue.length - 1;
  7297. while (i > index && queue[i].id > watcher.id) {
  7298. i--;
  7299. }
  7300. queue.splice(i + 1, 0, watcher);
  7301. }
  7302. // queue the flush
  7303. if (!waiting) {
  7304. waiting = true;
  7305. if ( true && !config.async) {
  7306. flushSchedulerQueue();
  7307. return
  7308. }
  7309. nextTick(flushSchedulerQueue);
  7310. }
  7311. }
  7312. }
  7313. /* */
  7314. var uid$2 = 0;
  7315. /**
  7316. * A watcher parses an expression, collects dependencies,
  7317. * and fires callback when the expression value changes.
  7318. * This is used for both the $watch() api and directives.
  7319. */
  7320. var Watcher = function Watcher (
  7321. vm,
  7322. expOrFn,
  7323. cb,
  7324. options,
  7325. isRenderWatcher
  7326. ) {
  7327. this.vm = vm;
  7328. if (isRenderWatcher) {
  7329. vm._watcher = this;
  7330. }
  7331. vm._watchers.push(this);
  7332. // options
  7333. if (options) {
  7334. this.deep = !!options.deep;
  7335. this.user = !!options.user;
  7336. this.lazy = !!options.lazy;
  7337. this.sync = !!options.sync;
  7338. this.before = options.before;
  7339. } else {
  7340. this.deep = this.user = this.lazy = this.sync = false;
  7341. }
  7342. this.cb = cb;
  7343. this.id = ++uid$2; // uid for batching
  7344. this.active = true;
  7345. this.dirty = this.lazy; // for lazy watchers
  7346. this.deps = [];
  7347. this.newDeps = [];
  7348. this.depIds = new _Set();
  7349. this.newDepIds = new _Set();
  7350. this.expression = true
  7351. ? expOrFn.toString()
  7352. : undefined;
  7353. // parse expression for getter
  7354. if (typeof expOrFn === 'function') {
  7355. this.getter = expOrFn;
  7356. } else {
  7357. this.getter = parsePath(expOrFn);
  7358. if (!this.getter) {
  7359. this.getter = noop;
  7360. true && warn(
  7361. "Failed watching path: \"" + expOrFn + "\" " +
  7362. 'Watcher only accepts simple dot-delimited paths. ' +
  7363. 'For full control, use a function instead.',
  7364. vm
  7365. );
  7366. }
  7367. }
  7368. this.value = this.lazy
  7369. ? undefined
  7370. : this.get();
  7371. };
  7372. /**
  7373. * Evaluate the getter, and re-collect dependencies.
  7374. */
  7375. Watcher.prototype.get = function get () {
  7376. pushTarget(this);
  7377. var value;
  7378. var vm = this.vm;
  7379. try {
  7380. value = this.getter.call(vm, vm);
  7381. } catch (e) {
  7382. if (this.user) {
  7383. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7384. } else {
  7385. throw e
  7386. }
  7387. } finally {
  7388. // "touch" every property so they are all tracked as
  7389. // dependencies for deep watching
  7390. if (this.deep) {
  7391. traverse(value);
  7392. }
  7393. popTarget();
  7394. this.cleanupDeps();
  7395. }
  7396. return value
  7397. };
  7398. /**
  7399. * Add a dependency to this directive.
  7400. */
  7401. Watcher.prototype.addDep = function addDep (dep) {
  7402. var id = dep.id;
  7403. if (!this.newDepIds.has(id)) {
  7404. this.newDepIds.add(id);
  7405. this.newDeps.push(dep);
  7406. if (!this.depIds.has(id)) {
  7407. dep.addSub(this);
  7408. }
  7409. }
  7410. };
  7411. /**
  7412. * Clean up for dependency collection.
  7413. */
  7414. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7415. var i = this.deps.length;
  7416. while (i--) {
  7417. var dep = this.deps[i];
  7418. if (!this.newDepIds.has(dep.id)) {
  7419. dep.removeSub(this);
  7420. }
  7421. }
  7422. var tmp = this.depIds;
  7423. this.depIds = this.newDepIds;
  7424. this.newDepIds = tmp;
  7425. this.newDepIds.clear();
  7426. tmp = this.deps;
  7427. this.deps = this.newDeps;
  7428. this.newDeps = tmp;
  7429. this.newDeps.length = 0;
  7430. };
  7431. /**
  7432. * Subscriber interface.
  7433. * Will be called when a dependency changes.
  7434. */
  7435. Watcher.prototype.update = function update () {
  7436. /* istanbul ignore else */
  7437. if (this.lazy) {
  7438. this.dirty = true;
  7439. } else if (this.sync) {
  7440. this.run();
  7441. } else {
  7442. queueWatcher(this);
  7443. }
  7444. };
  7445. /**
  7446. * Scheduler job interface.
  7447. * Will be called by the scheduler.
  7448. */
  7449. Watcher.prototype.run = function run () {
  7450. if (this.active) {
  7451. var value = this.get();
  7452. if (
  7453. value !== this.value ||
  7454. // Deep watchers and watchers on Object/Arrays should fire even
  7455. // when the value is the same, because the value may
  7456. // have mutated.
  7457. isObject(value) ||
  7458. this.deep
  7459. ) {
  7460. // set new value
  7461. var oldValue = this.value;
  7462. this.value = value;
  7463. if (this.user) {
  7464. try {
  7465. this.cb.call(this.vm, value, oldValue);
  7466. } catch (e) {
  7467. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7468. }
  7469. } else {
  7470. this.cb.call(this.vm, value, oldValue);
  7471. }
  7472. }
  7473. }
  7474. };
  7475. /**
  7476. * Evaluate the value of the watcher.
  7477. * This only gets called for lazy watchers.
  7478. */
  7479. Watcher.prototype.evaluate = function evaluate () {
  7480. this.value = this.get();
  7481. this.dirty = false;
  7482. };
  7483. /**
  7484. * Depend on all deps collected by this watcher.
  7485. */
  7486. Watcher.prototype.depend = function depend () {
  7487. var i = this.deps.length;
  7488. while (i--) {
  7489. this.deps[i].depend();
  7490. }
  7491. };
  7492. /**
  7493. * Remove self from all dependencies' subscriber list.
  7494. */
  7495. Watcher.prototype.teardown = function teardown () {
  7496. if (this.active) {
  7497. // remove self from vm's watcher list
  7498. // this is a somewhat expensive operation so we skip it
  7499. // if the vm is being destroyed.
  7500. if (!this.vm._isBeingDestroyed) {
  7501. remove(this.vm._watchers, this);
  7502. }
  7503. var i = this.deps.length;
  7504. while (i--) {
  7505. this.deps[i].removeSub(this);
  7506. }
  7507. this.active = false;
  7508. }
  7509. };
  7510. /* */
  7511. var sharedPropertyDefinition = {
  7512. enumerable: true,
  7513. configurable: true,
  7514. get: noop,
  7515. set: noop
  7516. };
  7517. function proxy (target, sourceKey, key) {
  7518. sharedPropertyDefinition.get = function proxyGetter () {
  7519. return this[sourceKey][key]
  7520. };
  7521. sharedPropertyDefinition.set = function proxySetter (val) {
  7522. this[sourceKey][key] = val;
  7523. };
  7524. Object.defineProperty(target, key, sharedPropertyDefinition);
  7525. }
  7526. function initState (vm) {
  7527. vm._watchers = [];
  7528. var opts = vm.$options;
  7529. if (opts.props) { initProps(vm, opts.props); }
  7530. if (opts.methods) { initMethods(vm, opts.methods); }
  7531. if (opts.data) {
  7532. initData(vm);
  7533. } else {
  7534. observe(vm._data = {}, true /* asRootData */);
  7535. }
  7536. if (opts.computed) { initComputed(vm, opts.computed); }
  7537. if (opts.watch && opts.watch !== nativeWatch) {
  7538. initWatch(vm, opts.watch);
  7539. }
  7540. }
  7541. function initProps (vm, propsOptions) {
  7542. var propsData = vm.$options.propsData || {};
  7543. var props = vm._props = {};
  7544. // cache prop keys so that future props updates can iterate using Array
  7545. // instead of dynamic object key enumeration.
  7546. var keys = vm.$options._propKeys = [];
  7547. var isRoot = !vm.$parent;
  7548. // root instance props should be converted
  7549. if (!isRoot) {
  7550. toggleObserving(false);
  7551. }
  7552. var loop = function ( key ) {
  7553. keys.push(key);
  7554. var value = validateProp(key, propsOptions, propsData, vm);
  7555. /* istanbul ignore else */
  7556. if (true) {
  7557. var hyphenatedKey = hyphenate(key);
  7558. if (isReservedAttribute(hyphenatedKey) ||
  7559. config.isReservedAttr(hyphenatedKey)) {
  7560. warn(
  7561. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7562. vm
  7563. );
  7564. }
  7565. defineReactive$$1(props, key, value, function () {
  7566. if (!isRoot && !isUpdatingChildComponent) {
  7567. {
  7568. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  7569. return
  7570. }
  7571. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7572. if(
  7573. key === 'value' &&
  7574. Array.isArray(vm.$options.behaviors) &&
  7575. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7576. ){
  7577. return
  7578. }
  7579. if(vm._getFormData){
  7580. return
  7581. }
  7582. var $parent = vm.$parent;
  7583. while($parent){
  7584. if($parent.__next_tick_pending){
  7585. return
  7586. }
  7587. $parent = $parent.$parent;
  7588. }
  7589. }
  7590. warn(
  7591. "Avoid mutating a prop directly since the value will be " +
  7592. "overwritten whenever the parent component re-renders. " +
  7593. "Instead, use a data or computed property based on the prop's " +
  7594. "value. Prop being mutated: \"" + key + "\"",
  7595. vm
  7596. );
  7597. }
  7598. });
  7599. } else {}
  7600. // static props are already proxied on the component's prototype
  7601. // during Vue.extend(). We only need to proxy props defined at
  7602. // instantiation here.
  7603. if (!(key in vm)) {
  7604. proxy(vm, "_props", key);
  7605. }
  7606. };
  7607. for (var key in propsOptions) loop( key );
  7608. toggleObserving(true);
  7609. }
  7610. function initData (vm) {
  7611. var data = vm.$options.data;
  7612. data = vm._data = typeof data === 'function'
  7613. ? getData(data, vm)
  7614. : data || {};
  7615. if (!isPlainObject(data)) {
  7616. data = {};
  7617. true && warn(
  7618. 'data functions should return an object:\n' +
  7619. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7620. vm
  7621. );
  7622. }
  7623. // proxy data on instance
  7624. var keys = Object.keys(data);
  7625. var props = vm.$options.props;
  7626. var methods = vm.$options.methods;
  7627. var i = keys.length;
  7628. while (i--) {
  7629. var key = keys[i];
  7630. if (true) {
  7631. if (methods && hasOwn(methods, key)) {
  7632. warn(
  7633. ("Method \"" + key + "\" has already been defined as a data property."),
  7634. vm
  7635. );
  7636. }
  7637. }
  7638. if (props && hasOwn(props, key)) {
  7639. true && warn(
  7640. "The data property \"" + key + "\" is already declared as a prop. " +
  7641. "Use prop default value instead.",
  7642. vm
  7643. );
  7644. } else if (!isReserved(key)) {
  7645. proxy(vm, "_data", key);
  7646. }
  7647. }
  7648. // observe data
  7649. observe(data, true /* asRootData */);
  7650. }
  7651. function getData (data, vm) {
  7652. // #7573 disable dep collection when invoking data getters
  7653. pushTarget();
  7654. try {
  7655. return data.call(vm, vm)
  7656. } catch (e) {
  7657. handleError(e, vm, "data()");
  7658. return {}
  7659. } finally {
  7660. popTarget();
  7661. }
  7662. }
  7663. var computedWatcherOptions = { lazy: true };
  7664. function initComputed (vm, computed) {
  7665. // $flow-disable-line
  7666. var watchers = vm._computedWatchers = Object.create(null);
  7667. // computed properties are just getters during SSR
  7668. var isSSR = isServerRendering();
  7669. for (var key in computed) {
  7670. var userDef = computed[key];
  7671. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7672. if ( true && getter == null) {
  7673. warn(
  7674. ("Getter is missing for computed property \"" + key + "\"."),
  7675. vm
  7676. );
  7677. }
  7678. if (!isSSR) {
  7679. // create internal watcher for the computed property.
  7680. watchers[key] = new Watcher(
  7681. vm,
  7682. getter || noop,
  7683. noop,
  7684. computedWatcherOptions
  7685. );
  7686. }
  7687. // component-defined computed properties are already defined on the
  7688. // component prototype. We only need to define computed properties defined
  7689. // at instantiation here.
  7690. if (!(key in vm)) {
  7691. defineComputed(vm, key, userDef);
  7692. } else if (true) {
  7693. if (key in vm.$data) {
  7694. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7695. } else if (vm.$options.props && key in vm.$options.props) {
  7696. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7697. }
  7698. }
  7699. }
  7700. }
  7701. function defineComputed (
  7702. target,
  7703. key,
  7704. userDef
  7705. ) {
  7706. var shouldCache = !isServerRendering();
  7707. if (typeof userDef === 'function') {
  7708. sharedPropertyDefinition.get = shouldCache
  7709. ? createComputedGetter(key)
  7710. : createGetterInvoker(userDef);
  7711. sharedPropertyDefinition.set = noop;
  7712. } else {
  7713. sharedPropertyDefinition.get = userDef.get
  7714. ? shouldCache && userDef.cache !== false
  7715. ? createComputedGetter(key)
  7716. : createGetterInvoker(userDef.get)
  7717. : noop;
  7718. sharedPropertyDefinition.set = userDef.set || noop;
  7719. }
  7720. if ( true &&
  7721. sharedPropertyDefinition.set === noop) {
  7722. sharedPropertyDefinition.set = function () {
  7723. warn(
  7724. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7725. this
  7726. );
  7727. };
  7728. }
  7729. Object.defineProperty(target, key, sharedPropertyDefinition);
  7730. }
  7731. function createComputedGetter (key) {
  7732. return function computedGetter () {
  7733. var watcher = this._computedWatchers && this._computedWatchers[key];
  7734. if (watcher) {
  7735. if (watcher.dirty) {
  7736. watcher.evaluate();
  7737. }
  7738. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7739. watcher.depend();
  7740. }
  7741. return watcher.value
  7742. }
  7743. }
  7744. }
  7745. function createGetterInvoker(fn) {
  7746. return function computedGetter () {
  7747. return fn.call(this, this)
  7748. }
  7749. }
  7750. function initMethods (vm, methods) {
  7751. var props = vm.$options.props;
  7752. for (var key in methods) {
  7753. if (true) {
  7754. if (typeof methods[key] !== 'function') {
  7755. warn(
  7756. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7757. "Did you reference the function correctly?",
  7758. vm
  7759. );
  7760. }
  7761. if (props && hasOwn(props, key)) {
  7762. warn(
  7763. ("Method \"" + key + "\" has already been defined as a prop."),
  7764. vm
  7765. );
  7766. }
  7767. if ((key in vm) && isReserved(key)) {
  7768. warn(
  7769. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7770. "Avoid defining component methods that start with _ or $."
  7771. );
  7772. }
  7773. }
  7774. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7775. }
  7776. }
  7777. function initWatch (vm, watch) {
  7778. for (var key in watch) {
  7779. var handler = watch[key];
  7780. if (Array.isArray(handler)) {
  7781. for (var i = 0; i < handler.length; i++) {
  7782. createWatcher(vm, key, handler[i]);
  7783. }
  7784. } else {
  7785. createWatcher(vm, key, handler);
  7786. }
  7787. }
  7788. }
  7789. function createWatcher (
  7790. vm,
  7791. expOrFn,
  7792. handler,
  7793. options
  7794. ) {
  7795. if (isPlainObject(handler)) {
  7796. options = handler;
  7797. handler = handler.handler;
  7798. }
  7799. if (typeof handler === 'string') {
  7800. handler = vm[handler];
  7801. }
  7802. return vm.$watch(expOrFn, handler, options)
  7803. }
  7804. function stateMixin (Vue) {
  7805. // flow somehow has problems with directly declared definition object
  7806. // when using Object.defineProperty, so we have to procedurally build up
  7807. // the object here.
  7808. var dataDef = {};
  7809. dataDef.get = function () { return this._data };
  7810. var propsDef = {};
  7811. propsDef.get = function () { return this._props };
  7812. if (true) {
  7813. dataDef.set = function () {
  7814. warn(
  7815. 'Avoid replacing instance root $data. ' +
  7816. 'Use nested data properties instead.',
  7817. this
  7818. );
  7819. };
  7820. propsDef.set = function () {
  7821. warn("$props is readonly.", this);
  7822. };
  7823. }
  7824. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7825. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7826. Vue.prototype.$set = set;
  7827. Vue.prototype.$delete = del;
  7828. Vue.prototype.$watch = function (
  7829. expOrFn,
  7830. cb,
  7831. options
  7832. ) {
  7833. var vm = this;
  7834. if (isPlainObject(cb)) {
  7835. return createWatcher(vm, expOrFn, cb, options)
  7836. }
  7837. options = options || {};
  7838. options.user = true;
  7839. var watcher = new Watcher(vm, expOrFn, cb, options);
  7840. if (options.immediate) {
  7841. try {
  7842. cb.call(vm, watcher.value);
  7843. } catch (error) {
  7844. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7845. }
  7846. }
  7847. return function unwatchFn () {
  7848. watcher.teardown();
  7849. }
  7850. };
  7851. }
  7852. /* */
  7853. var uid$3 = 0;
  7854. function initMixin (Vue) {
  7855. Vue.prototype._init = function (options) {
  7856. var vm = this;
  7857. // a uid
  7858. vm._uid = uid$3++;
  7859. var startTag, endTag;
  7860. /* istanbul ignore if */
  7861. if ( true && config.performance && mark) {
  7862. startTag = "vue-perf-start:" + (vm._uid);
  7863. endTag = "vue-perf-end:" + (vm._uid);
  7864. mark(startTag);
  7865. }
  7866. // a flag to avoid this being observed
  7867. vm._isVue = true;
  7868. // merge options
  7869. if (options && options._isComponent) {
  7870. // optimize internal component instantiation
  7871. // since dynamic options merging is pretty slow, and none of the
  7872. // internal component options needs special treatment.
  7873. initInternalComponent(vm, options);
  7874. } else {
  7875. vm.$options = mergeOptions(
  7876. resolveConstructorOptions(vm.constructor),
  7877. options || {},
  7878. vm
  7879. );
  7880. }
  7881. /* istanbul ignore else */
  7882. if (true) {
  7883. initProxy(vm);
  7884. } else {}
  7885. // expose real self
  7886. vm._self = vm;
  7887. initLifecycle(vm);
  7888. initEvents(vm);
  7889. initRender(vm);
  7890. callHook(vm, 'beforeCreate');
  7891. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7892. initState(vm);
  7893. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7894. !vm._$fallback && callHook(vm, 'created');
  7895. /* istanbul ignore if */
  7896. if ( true && config.performance && mark) {
  7897. vm._name = formatComponentName(vm, false);
  7898. mark(endTag);
  7899. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7900. }
  7901. if (vm.$options.el) {
  7902. vm.$mount(vm.$options.el);
  7903. }
  7904. };
  7905. }
  7906. function initInternalComponent (vm, options) {
  7907. var opts = vm.$options = Object.create(vm.constructor.options);
  7908. // doing this because it's faster than dynamic enumeration.
  7909. var parentVnode = options._parentVnode;
  7910. opts.parent = options.parent;
  7911. opts._parentVnode = parentVnode;
  7912. var vnodeComponentOptions = parentVnode.componentOptions;
  7913. opts.propsData = vnodeComponentOptions.propsData;
  7914. opts._parentListeners = vnodeComponentOptions.listeners;
  7915. opts._renderChildren = vnodeComponentOptions.children;
  7916. opts._componentTag = vnodeComponentOptions.tag;
  7917. if (options.render) {
  7918. opts.render = options.render;
  7919. opts.staticRenderFns = options.staticRenderFns;
  7920. }
  7921. }
  7922. function resolveConstructorOptions (Ctor) {
  7923. var options = Ctor.options;
  7924. if (Ctor.super) {
  7925. var superOptions = resolveConstructorOptions(Ctor.super);
  7926. var cachedSuperOptions = Ctor.superOptions;
  7927. if (superOptions !== cachedSuperOptions) {
  7928. // super option changed,
  7929. // need to resolve new options.
  7930. Ctor.superOptions = superOptions;
  7931. // check if there are any late-modified/attached options (#4976)
  7932. var modifiedOptions = resolveModifiedOptions(Ctor);
  7933. // update base extend options
  7934. if (modifiedOptions) {
  7935. extend(Ctor.extendOptions, modifiedOptions);
  7936. }
  7937. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7938. if (options.name) {
  7939. options.components[options.name] = Ctor;
  7940. }
  7941. }
  7942. }
  7943. return options
  7944. }
  7945. function resolveModifiedOptions (Ctor) {
  7946. var modified;
  7947. var latest = Ctor.options;
  7948. var sealed = Ctor.sealedOptions;
  7949. for (var key in latest) {
  7950. if (latest[key] !== sealed[key]) {
  7951. if (!modified) { modified = {}; }
  7952. modified[key] = latest[key];
  7953. }
  7954. }
  7955. return modified
  7956. }
  7957. function Vue (options) {
  7958. if ( true &&
  7959. !(this instanceof Vue)
  7960. ) {
  7961. warn('Vue is a constructor and should be called with the `new` keyword');
  7962. }
  7963. this._init(options);
  7964. }
  7965. initMixin(Vue);
  7966. stateMixin(Vue);
  7967. eventsMixin(Vue);
  7968. lifecycleMixin(Vue);
  7969. renderMixin(Vue);
  7970. /* */
  7971. function initUse (Vue) {
  7972. Vue.use = function (plugin) {
  7973. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7974. if (installedPlugins.indexOf(plugin) > -1) {
  7975. return this
  7976. }
  7977. // additional parameters
  7978. var args = toArray(arguments, 1);
  7979. args.unshift(this);
  7980. if (typeof plugin.install === 'function') {
  7981. plugin.install.apply(plugin, args);
  7982. } else if (typeof plugin === 'function') {
  7983. plugin.apply(null, args);
  7984. }
  7985. installedPlugins.push(plugin);
  7986. return this
  7987. };
  7988. }
  7989. /* */
  7990. function initMixin$1 (Vue) {
  7991. Vue.mixin = function (mixin) {
  7992. this.options = mergeOptions(this.options, mixin);
  7993. return this
  7994. };
  7995. }
  7996. /* */
  7997. function initExtend (Vue) {
  7998. /**
  7999. * Each instance constructor, including Vue, has a unique
  8000. * cid. This enables us to create wrapped "child
  8001. * constructors" for prototypal inheritance and cache them.
  8002. */
  8003. Vue.cid = 0;
  8004. var cid = 1;
  8005. /**
  8006. * Class inheritance
  8007. */
  8008. Vue.extend = function (extendOptions) {
  8009. extendOptions = extendOptions || {};
  8010. var Super = this;
  8011. var SuperId = Super.cid;
  8012. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8013. if (cachedCtors[SuperId]) {
  8014. return cachedCtors[SuperId]
  8015. }
  8016. var name = extendOptions.name || Super.options.name;
  8017. if ( true && name) {
  8018. validateComponentName(name);
  8019. }
  8020. var Sub = function VueComponent (options) {
  8021. this._init(options);
  8022. };
  8023. Sub.prototype = Object.create(Super.prototype);
  8024. Sub.prototype.constructor = Sub;
  8025. Sub.cid = cid++;
  8026. Sub.options = mergeOptions(
  8027. Super.options,
  8028. extendOptions
  8029. );
  8030. Sub['super'] = Super;
  8031. // For props and computed properties, we define the proxy getters on
  8032. // the Vue instances at extension time, on the extended prototype. This
  8033. // avoids Object.defineProperty calls for each instance created.
  8034. if (Sub.options.props) {
  8035. initProps$1(Sub);
  8036. }
  8037. if (Sub.options.computed) {
  8038. initComputed$1(Sub);
  8039. }
  8040. // allow further extension/mixin/plugin usage
  8041. Sub.extend = Super.extend;
  8042. Sub.mixin = Super.mixin;
  8043. Sub.use = Super.use;
  8044. // create asset registers, so extended classes
  8045. // can have their private assets too.
  8046. ASSET_TYPES.forEach(function (type) {
  8047. Sub[type] = Super[type];
  8048. });
  8049. // enable recursive self-lookup
  8050. if (name) {
  8051. Sub.options.components[name] = Sub;
  8052. }
  8053. // keep a reference to the super options at extension time.
  8054. // later at instantiation we can check if Super's options have
  8055. // been updated.
  8056. Sub.superOptions = Super.options;
  8057. Sub.extendOptions = extendOptions;
  8058. Sub.sealedOptions = extend({}, Sub.options);
  8059. // cache constructor
  8060. cachedCtors[SuperId] = Sub;
  8061. return Sub
  8062. };
  8063. }
  8064. function initProps$1 (Comp) {
  8065. var props = Comp.options.props;
  8066. for (var key in props) {
  8067. proxy(Comp.prototype, "_props", key);
  8068. }
  8069. }
  8070. function initComputed$1 (Comp) {
  8071. var computed = Comp.options.computed;
  8072. for (var key in computed) {
  8073. defineComputed(Comp.prototype, key, computed[key]);
  8074. }
  8075. }
  8076. /* */
  8077. function initAssetRegisters (Vue) {
  8078. /**
  8079. * Create asset registration methods.
  8080. */
  8081. ASSET_TYPES.forEach(function (type) {
  8082. Vue[type] = function (
  8083. id,
  8084. definition
  8085. ) {
  8086. if (!definition) {
  8087. return this.options[type + 's'][id]
  8088. } else {
  8089. /* istanbul ignore if */
  8090. if ( true && type === 'component') {
  8091. validateComponentName(id);
  8092. }
  8093. if (type === 'component' && isPlainObject(definition)) {
  8094. definition.name = definition.name || id;
  8095. definition = this.options._base.extend(definition);
  8096. }
  8097. if (type === 'directive' && typeof definition === 'function') {
  8098. definition = { bind: definition, update: definition };
  8099. }
  8100. this.options[type + 's'][id] = definition;
  8101. return definition
  8102. }
  8103. };
  8104. });
  8105. }
  8106. /* */
  8107. function getComponentName (opts) {
  8108. return opts && (opts.Ctor.options.name || opts.tag)
  8109. }
  8110. function matches (pattern, name) {
  8111. if (Array.isArray(pattern)) {
  8112. return pattern.indexOf(name) > -1
  8113. } else if (typeof pattern === 'string') {
  8114. return pattern.split(',').indexOf(name) > -1
  8115. } else if (isRegExp(pattern)) {
  8116. return pattern.test(name)
  8117. }
  8118. /* istanbul ignore next */
  8119. return false
  8120. }
  8121. function pruneCache (keepAliveInstance, filter) {
  8122. var cache = keepAliveInstance.cache;
  8123. var keys = keepAliveInstance.keys;
  8124. var _vnode = keepAliveInstance._vnode;
  8125. for (var key in cache) {
  8126. var cachedNode = cache[key];
  8127. if (cachedNode) {
  8128. var name = getComponentName(cachedNode.componentOptions);
  8129. if (name && !filter(name)) {
  8130. pruneCacheEntry(cache, key, keys, _vnode);
  8131. }
  8132. }
  8133. }
  8134. }
  8135. function pruneCacheEntry (
  8136. cache,
  8137. key,
  8138. keys,
  8139. current
  8140. ) {
  8141. var cached$$1 = cache[key];
  8142. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8143. cached$$1.componentInstance.$destroy();
  8144. }
  8145. cache[key] = null;
  8146. remove(keys, key);
  8147. }
  8148. var patternTypes = [String, RegExp, Array];
  8149. var KeepAlive = {
  8150. name: 'keep-alive',
  8151. abstract: true,
  8152. props: {
  8153. include: patternTypes,
  8154. exclude: patternTypes,
  8155. max: [String, Number]
  8156. },
  8157. created: function created () {
  8158. this.cache = Object.create(null);
  8159. this.keys = [];
  8160. },
  8161. destroyed: function destroyed () {
  8162. for (var key in this.cache) {
  8163. pruneCacheEntry(this.cache, key, this.keys);
  8164. }
  8165. },
  8166. mounted: function mounted () {
  8167. var this$1 = this;
  8168. this.$watch('include', function (val) {
  8169. pruneCache(this$1, function (name) { return matches(val, name); });
  8170. });
  8171. this.$watch('exclude', function (val) {
  8172. pruneCache(this$1, function (name) { return !matches(val, name); });
  8173. });
  8174. },
  8175. render: function render () {
  8176. var slot = this.$slots.default;
  8177. var vnode = getFirstComponentChild(slot);
  8178. var componentOptions = vnode && vnode.componentOptions;
  8179. if (componentOptions) {
  8180. // check pattern
  8181. var name = getComponentName(componentOptions);
  8182. var ref = this;
  8183. var include = ref.include;
  8184. var exclude = ref.exclude;
  8185. if (
  8186. // not included
  8187. (include && (!name || !matches(include, name))) ||
  8188. // excluded
  8189. (exclude && name && matches(exclude, name))
  8190. ) {
  8191. return vnode
  8192. }
  8193. var ref$1 = this;
  8194. var cache = ref$1.cache;
  8195. var keys = ref$1.keys;
  8196. var key = vnode.key == null
  8197. // same constructor may get registered as different local components
  8198. // so cid alone is not enough (#3269)
  8199. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8200. : vnode.key;
  8201. if (cache[key]) {
  8202. vnode.componentInstance = cache[key].componentInstance;
  8203. // make current key freshest
  8204. remove(keys, key);
  8205. keys.push(key);
  8206. } else {
  8207. cache[key] = vnode;
  8208. keys.push(key);
  8209. // prune oldest entry
  8210. if (this.max && keys.length > parseInt(this.max)) {
  8211. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8212. }
  8213. }
  8214. vnode.data.keepAlive = true;
  8215. }
  8216. return vnode || (slot && slot[0])
  8217. }
  8218. };
  8219. var builtInComponents = {
  8220. KeepAlive: KeepAlive
  8221. };
  8222. /* */
  8223. function initGlobalAPI (Vue) {
  8224. // config
  8225. var configDef = {};
  8226. configDef.get = function () { return config; };
  8227. if (true) {
  8228. configDef.set = function () {
  8229. warn(
  8230. 'Do not replace the Vue.config object, set individual fields instead.'
  8231. );
  8232. };
  8233. }
  8234. Object.defineProperty(Vue, 'config', configDef);
  8235. // exposed util methods.
  8236. // NOTE: these are not considered part of the public API - avoid relying on
  8237. // them unless you are aware of the risk.
  8238. Vue.util = {
  8239. warn: warn,
  8240. extend: extend,
  8241. mergeOptions: mergeOptions,
  8242. defineReactive: defineReactive$$1
  8243. };
  8244. Vue.set = set;
  8245. Vue.delete = del;
  8246. Vue.nextTick = nextTick;
  8247. // 2.6 explicit observable API
  8248. Vue.observable = function (obj) {
  8249. observe(obj);
  8250. return obj
  8251. };
  8252. Vue.options = Object.create(null);
  8253. ASSET_TYPES.forEach(function (type) {
  8254. Vue.options[type + 's'] = Object.create(null);
  8255. });
  8256. // this is used to identify the "base" constructor to extend all plain-object
  8257. // components with in Weex's multi-instance scenarios.
  8258. Vue.options._base = Vue;
  8259. extend(Vue.options.components, builtInComponents);
  8260. initUse(Vue);
  8261. initMixin$1(Vue);
  8262. initExtend(Vue);
  8263. initAssetRegisters(Vue);
  8264. }
  8265. initGlobalAPI(Vue);
  8266. Object.defineProperty(Vue.prototype, '$isServer', {
  8267. get: isServerRendering
  8268. });
  8269. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8270. get: function get () {
  8271. /* istanbul ignore next */
  8272. return this.$vnode && this.$vnode.ssrContext
  8273. }
  8274. });
  8275. // expose FunctionalRenderContext for ssr runtime helper installation
  8276. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8277. value: FunctionalRenderContext
  8278. });
  8279. Vue.version = '2.6.11';
  8280. /**
  8281. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8282. */
  8283. var ARRAYTYPE = '[object Array]';
  8284. var OBJECTTYPE = '[object Object]';
  8285. // const FUNCTIONTYPE = '[object Function]'
  8286. function diff(current, pre) {
  8287. var result = {};
  8288. syncKeys(current, pre);
  8289. _diff(current, pre, '', result);
  8290. return result
  8291. }
  8292. function syncKeys(current, pre) {
  8293. if (current === pre) { return }
  8294. var rootCurrentType = type(current);
  8295. var rootPreType = type(pre);
  8296. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8297. if(Object.keys(current).length >= Object.keys(pre).length){
  8298. for (var key in pre) {
  8299. var currentValue = current[key];
  8300. if (currentValue === undefined) {
  8301. current[key] = null;
  8302. } else {
  8303. syncKeys(currentValue, pre[key]);
  8304. }
  8305. }
  8306. }
  8307. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8308. if (current.length >= pre.length) {
  8309. pre.forEach(function (item, index) {
  8310. syncKeys(current[index], item);
  8311. });
  8312. }
  8313. }
  8314. }
  8315. function _diff(current, pre, path, result) {
  8316. if (current === pre) { return }
  8317. var rootCurrentType = type(current);
  8318. var rootPreType = type(pre);
  8319. if (rootCurrentType == OBJECTTYPE) {
  8320. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8321. setResult(result, path, current);
  8322. } else {
  8323. var loop = function ( key ) {
  8324. var currentValue = current[key];
  8325. var preValue = pre[key];
  8326. var currentType = type(currentValue);
  8327. var preType = type(preValue);
  8328. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8329. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  8330. if (currentValue !== pre[key]) {
  8331. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8332. }
  8333. } else if (currentType == ARRAYTYPE) {
  8334. if (preType != ARRAYTYPE) {
  8335. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8336. } else {
  8337. if (currentValue.length < preValue.length) {
  8338. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8339. } else {
  8340. currentValue.forEach(function (item, index) {
  8341. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8342. });
  8343. }
  8344. }
  8345. } else if (currentType == OBJECTTYPE) {
  8346. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8347. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8348. } else {
  8349. for (var subKey in currentValue) {
  8350. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8351. }
  8352. }
  8353. }
  8354. };
  8355. for (var key in current) loop( key );
  8356. }
  8357. } else if (rootCurrentType == ARRAYTYPE) {
  8358. if (rootPreType != ARRAYTYPE) {
  8359. setResult(result, path, current);
  8360. } else {
  8361. if (current.length < pre.length) {
  8362. setResult(result, path, current);
  8363. } else {
  8364. current.forEach(function (item, index) {
  8365. _diff(item, pre[index], path + '[' + index + ']', result);
  8366. });
  8367. }
  8368. }
  8369. } else {
  8370. setResult(result, path, current);
  8371. }
  8372. }
  8373. function setResult(result, k, v) {
  8374. // if (type(v) != FUNCTIONTYPE) {
  8375. result[k] = v;
  8376. // }
  8377. }
  8378. function type(obj) {
  8379. return Object.prototype.toString.call(obj)
  8380. }
  8381. /* */
  8382. function flushCallbacks$1(vm) {
  8383. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8384. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8385. var mpInstance = vm.$scope;
  8386. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8387. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8388. }
  8389. var copies = vm.__next_tick_callbacks.slice(0);
  8390. vm.__next_tick_callbacks.length = 0;
  8391. for (var i = 0; i < copies.length; i++) {
  8392. copies[i]();
  8393. }
  8394. }
  8395. }
  8396. function hasRenderWatcher(vm) {
  8397. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8398. }
  8399. function nextTick$1(vm, cb) {
  8400. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8401. //2.nextTick 之前存在 render watcher
  8402. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8403. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8404. var mpInstance = vm.$scope;
  8405. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8406. ']:nextVueTick');
  8407. }
  8408. return nextTick(cb, vm)
  8409. }else{
  8410. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8411. var mpInstance$1 = vm.$scope;
  8412. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8413. ']:nextMPTick');
  8414. }
  8415. }
  8416. var _resolve;
  8417. if (!vm.__next_tick_callbacks) {
  8418. vm.__next_tick_callbacks = [];
  8419. }
  8420. vm.__next_tick_callbacks.push(function () {
  8421. if (cb) {
  8422. try {
  8423. cb.call(vm);
  8424. } catch (e) {
  8425. handleError(e, vm, 'nextTick');
  8426. }
  8427. } else if (_resolve) {
  8428. _resolve(vm);
  8429. }
  8430. });
  8431. // $flow-disable-line
  8432. if (!cb && typeof Promise !== 'undefined') {
  8433. return new Promise(function (resolve) {
  8434. _resolve = resolve;
  8435. })
  8436. }
  8437. }
  8438. /* */
  8439. function cloneWithData(vm) {
  8440. // 确保当前 vm 所有数据被同步
  8441. var ret = Object.create(null);
  8442. var dataKeys = [].concat(
  8443. Object.keys(vm._data || {}),
  8444. Object.keys(vm._computedWatchers || {}));
  8445. dataKeys.reduce(function(ret, key) {
  8446. ret[key] = vm[key];
  8447. return ret
  8448. }, ret);
  8449. // vue-composition-api
  8450. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8451. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8452. if (rawBindings) {
  8453. Object.keys(rawBindings).forEach(function (key) {
  8454. ret[key] = vm[key];
  8455. });
  8456. }
  8457. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8458. Object.assign(ret, vm.$mp.data || {});
  8459. if (
  8460. Array.isArray(vm.$options.behaviors) &&
  8461. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8462. ) { //form-field
  8463. ret['name'] = vm.name;
  8464. ret['value'] = vm.value;
  8465. }
  8466. return JSON.parse(JSON.stringify(ret))
  8467. }
  8468. var patch = function(oldVnode, vnode) {
  8469. var this$1 = this;
  8470. if (vnode === null) { //destroy
  8471. return
  8472. }
  8473. if (this.mpType === 'page' || this.mpType === 'component') {
  8474. var mpInstance = this.$scope;
  8475. var data = Object.create(null);
  8476. try {
  8477. data = cloneWithData(this);
  8478. } catch (err) {
  8479. console.error(err);
  8480. }
  8481. data.__webviewId__ = mpInstance.data.__webviewId__;
  8482. var mpData = Object.create(null);
  8483. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8484. mpData[key] = mpInstance.data[key];
  8485. });
  8486. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8487. if (Object.keys(diffData).length) {
  8488. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8489. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8490. ']差量更新',
  8491. JSON.stringify(diffData));
  8492. }
  8493. this.__next_tick_pending = true;
  8494. mpInstance.setData(diffData, function () {
  8495. this$1.__next_tick_pending = false;
  8496. flushCallbacks$1(this$1);
  8497. });
  8498. } else {
  8499. flushCallbacks$1(this);
  8500. }
  8501. }
  8502. };
  8503. /* */
  8504. function createEmptyRender() {
  8505. }
  8506. function mountComponent$1(
  8507. vm,
  8508. el,
  8509. hydrating
  8510. ) {
  8511. if (!vm.mpType) {//main.js 中的 new Vue
  8512. return vm
  8513. }
  8514. if (vm.mpType === 'app') {
  8515. vm.$options.render = createEmptyRender;
  8516. }
  8517. if (!vm.$options.render) {
  8518. vm.$options.render = createEmptyRender;
  8519. if (true) {
  8520. /* istanbul ignore if */
  8521. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8522. vm.$options.el || el) {
  8523. warn(
  8524. 'You are using the runtime-only build of Vue where the template ' +
  8525. 'compiler is not available. Either pre-compile the templates into ' +
  8526. 'render functions, or use the compiler-included build.',
  8527. vm
  8528. );
  8529. } else {
  8530. warn(
  8531. 'Failed to mount component: template or render function not defined.',
  8532. vm
  8533. );
  8534. }
  8535. }
  8536. }
  8537. !vm._$fallback && callHook(vm, 'beforeMount');
  8538. var updateComponent = function () {
  8539. vm._update(vm._render(), hydrating);
  8540. };
  8541. // we set this to vm._watcher inside the watcher's constructor
  8542. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8543. // component's mounted hook), which relies on vm._watcher being already defined
  8544. new Watcher(vm, updateComponent, noop, {
  8545. before: function before() {
  8546. if (vm._isMounted && !vm._isDestroyed) {
  8547. callHook(vm, 'beforeUpdate');
  8548. }
  8549. }
  8550. }, true /* isRenderWatcher */);
  8551. hydrating = false;
  8552. return vm
  8553. }
  8554. /* */
  8555. function renderClass (
  8556. staticClass,
  8557. dynamicClass
  8558. ) {
  8559. if (isDef(staticClass) || isDef(dynamicClass)) {
  8560. return concat(staticClass, stringifyClass(dynamicClass))
  8561. }
  8562. /* istanbul ignore next */
  8563. return ''
  8564. }
  8565. function concat (a, b) {
  8566. return a ? b ? (a + ' ' + b) : a : (b || '')
  8567. }
  8568. function stringifyClass (value) {
  8569. if (Array.isArray(value)) {
  8570. return stringifyArray(value)
  8571. }
  8572. if (isObject(value)) {
  8573. return stringifyObject(value)
  8574. }
  8575. if (typeof value === 'string') {
  8576. return value
  8577. }
  8578. /* istanbul ignore next */
  8579. return ''
  8580. }
  8581. function stringifyArray (value) {
  8582. var res = '';
  8583. var stringified;
  8584. for (var i = 0, l = value.length; i < l; i++) {
  8585. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8586. if (res) { res += ' '; }
  8587. res += stringified;
  8588. }
  8589. }
  8590. return res
  8591. }
  8592. function stringifyObject (value) {
  8593. var res = '';
  8594. for (var key in value) {
  8595. if (value[key]) {
  8596. if (res) { res += ' '; }
  8597. res += key;
  8598. }
  8599. }
  8600. return res
  8601. }
  8602. /* */
  8603. var parseStyleText = cached(function (cssText) {
  8604. var res = {};
  8605. var listDelimiter = /;(?![^(]*\))/g;
  8606. var propertyDelimiter = /:(.+)/;
  8607. cssText.split(listDelimiter).forEach(function (item) {
  8608. if (item) {
  8609. var tmp = item.split(propertyDelimiter);
  8610. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8611. }
  8612. });
  8613. return res
  8614. });
  8615. // normalize possible array / string values into Object
  8616. function normalizeStyleBinding (bindingStyle) {
  8617. if (Array.isArray(bindingStyle)) {
  8618. return toObject(bindingStyle)
  8619. }
  8620. if (typeof bindingStyle === 'string') {
  8621. return parseStyleText(bindingStyle)
  8622. }
  8623. return bindingStyle
  8624. }
  8625. /* */
  8626. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8627. function getTarget(obj, path) {
  8628. var parts = path.split('.');
  8629. var key = parts[0];
  8630. if (key.indexOf('__$n') === 0) { //number index
  8631. key = parseInt(key.replace('__$n', ''));
  8632. }
  8633. if (parts.length === 1) {
  8634. return obj[key]
  8635. }
  8636. return getTarget(obj[key], parts.slice(1).join('.'))
  8637. }
  8638. function internalMixin(Vue) {
  8639. Vue.config.errorHandler = function(err, vm, info) {
  8640. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8641. console.error(err);
  8642. /* eslint-disable no-undef */
  8643. var app = typeof getApp === 'function' && getApp();
  8644. if (app && app.onError) {
  8645. app.onError(err);
  8646. }
  8647. };
  8648. var oldEmit = Vue.prototype.$emit;
  8649. Vue.prototype.$emit = function(event) {
  8650. if (this.$scope && event) {
  8651. this.$scope['triggerEvent'](event, {
  8652. __args__: toArray(arguments, 1)
  8653. });
  8654. }
  8655. return oldEmit.apply(this, arguments)
  8656. };
  8657. Vue.prototype.$nextTick = function(fn) {
  8658. return nextTick$1(this, fn)
  8659. };
  8660. MP_METHODS.forEach(function (method) {
  8661. Vue.prototype[method] = function(args) {
  8662. if (this.$scope && this.$scope[method]) {
  8663. return this.$scope[method](args)
  8664. }
  8665. // mp-alipay
  8666. if (typeof my === 'undefined') {
  8667. return
  8668. }
  8669. if (method === 'createSelectorQuery') {
  8670. /* eslint-disable no-undef */
  8671. return my.createSelectorQuery(args)
  8672. } else if (method === 'createIntersectionObserver') {
  8673. /* eslint-disable no-undef */
  8674. return my.createIntersectionObserver(args)
  8675. }
  8676. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8677. };
  8678. });
  8679. Vue.prototype.__init_provide = initProvide;
  8680. Vue.prototype.__init_injections = initInjections;
  8681. Vue.prototype.__call_hook = function(hook, args) {
  8682. var vm = this;
  8683. // #7573 disable dep collection when invoking lifecycle hooks
  8684. pushTarget();
  8685. var handlers = vm.$options[hook];
  8686. var info = hook + " hook";
  8687. var ret;
  8688. if (handlers) {
  8689. for (var i = 0, j = handlers.length; i < j; i++) {
  8690. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8691. }
  8692. }
  8693. if (vm._hasHookEvent) {
  8694. vm.$emit('hook:' + hook, args);
  8695. }
  8696. popTarget();
  8697. return ret
  8698. };
  8699. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8700. if (Array.isArray(modifiers)) {
  8701. if (modifiers.indexOf('trim') !== -1) {
  8702. value = value.trim();
  8703. }
  8704. if (modifiers.indexOf('number') !== -1) {
  8705. value = this._n(value);
  8706. }
  8707. }
  8708. if (!target) {
  8709. target = this;
  8710. }
  8711. target[key] = value;
  8712. };
  8713. Vue.prototype.__set_sync = function(target, key, value) {
  8714. if (!target) {
  8715. target = this;
  8716. }
  8717. target[key] = value;
  8718. };
  8719. Vue.prototype.__get_orig = function(item) {
  8720. if (isPlainObject(item)) {
  8721. return item['$orig'] || item
  8722. }
  8723. return item
  8724. };
  8725. Vue.prototype.__get_value = function(dataPath, target) {
  8726. return getTarget(target || this, dataPath)
  8727. };
  8728. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8729. return renderClass(staticClass, dynamicClass)
  8730. };
  8731. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8732. if (!dynamicStyle && !staticStyle) {
  8733. return ''
  8734. }
  8735. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8736. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8737. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8738. };
  8739. Vue.prototype.__map = function(val, iteratee) {
  8740. //TODO 暂不考虑 string
  8741. var ret, i, l, keys, key;
  8742. if (Array.isArray(val)) {
  8743. ret = new Array(val.length);
  8744. for (i = 0, l = val.length; i < l; i++) {
  8745. ret[i] = iteratee(val[i], i);
  8746. }
  8747. return ret
  8748. } else if (isObject(val)) {
  8749. keys = Object.keys(val);
  8750. ret = Object.create(null);
  8751. for (i = 0, l = keys.length; i < l; i++) {
  8752. key = keys[i];
  8753. ret[key] = iteratee(val[key], key, i);
  8754. }
  8755. return ret
  8756. } else if (typeof val === 'number') {
  8757. ret = new Array(val);
  8758. for (i = 0, l = val; i < l; i++) {
  8759. // 第一个参数暂时仍和小程序一致
  8760. ret[i] = iteratee(i, i);
  8761. }
  8762. return ret
  8763. }
  8764. return []
  8765. };
  8766. }
  8767. /* */
  8768. var LIFECYCLE_HOOKS$1 = [
  8769. //App
  8770. 'onLaunch',
  8771. 'onShow',
  8772. 'onHide',
  8773. 'onUniNViewMessage',
  8774. 'onPageNotFound',
  8775. 'onThemeChange',
  8776. 'onError',
  8777. 'onUnhandledRejection',
  8778. //Page
  8779. 'onInit',
  8780. 'onLoad',
  8781. // 'onShow',
  8782. 'onReady',
  8783. // 'onHide',
  8784. 'onUnload',
  8785. 'onPullDownRefresh',
  8786. 'onReachBottom',
  8787. 'onTabItemTap',
  8788. 'onAddToFavorites',
  8789. 'onShareTimeline',
  8790. 'onShareAppMessage',
  8791. 'onResize',
  8792. 'onPageScroll',
  8793. 'onNavigationBarButtonTap',
  8794. 'onBackPress',
  8795. 'onNavigationBarSearchInputChanged',
  8796. 'onNavigationBarSearchInputConfirmed',
  8797. 'onNavigationBarSearchInputClicked',
  8798. //Component
  8799. // 'onReady', // 兼容旧版本,应该移除该事件
  8800. 'onPageShow',
  8801. 'onPageHide',
  8802. 'onPageResize'
  8803. ];
  8804. function lifecycleMixin$1(Vue) {
  8805. //fixed vue-class-component
  8806. var oldExtend = Vue.extend;
  8807. Vue.extend = function(extendOptions) {
  8808. extendOptions = extendOptions || {};
  8809. var methods = extendOptions.methods;
  8810. if (methods) {
  8811. Object.keys(methods).forEach(function (methodName) {
  8812. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8813. extendOptions[methodName] = methods[methodName];
  8814. delete methods[methodName];
  8815. }
  8816. });
  8817. }
  8818. return oldExtend.call(this, extendOptions)
  8819. };
  8820. var strategies = Vue.config.optionMergeStrategies;
  8821. var mergeHook = strategies.created;
  8822. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8823. strategies[hook] = mergeHook;
  8824. });
  8825. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8826. }
  8827. /* */
  8828. // install platform patch function
  8829. Vue.prototype.__patch__ = patch;
  8830. // public mount method
  8831. Vue.prototype.$mount = function(
  8832. el ,
  8833. hydrating
  8834. ) {
  8835. return mountComponent$1(this, el, hydrating)
  8836. };
  8837. lifecycleMixin$1(Vue);
  8838. internalMixin(Vue);
  8839. /* */
  8840. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8841. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8842. /***/ }),
  8843. /***/ 4:
  8844. /*!*************************************************************!*\
  8845. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  8846. \*************************************************************/
  8847. /*! no static exports found */
  8848. /***/ (function(module, exports, __webpack_require__) {
  8849. "use strict";
  8850. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  8851. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  8852. var defaultDelimiters = ['{', '}'];var
  8853. BaseFormatter = /*#__PURE__*/function () {
  8854. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  8855. this._caches = Object.create(null);
  8856. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  8857. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  8858. if (!values) {
  8859. return [message];
  8860. }
  8861. var tokens = this._caches[message];
  8862. if (!tokens) {
  8863. tokens = parse(message, delimiters);
  8864. this._caches[message] = tokens;
  8865. }
  8866. return compile(tokens, values);
  8867. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  8868. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  8869. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  8870. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  8871. var tokens = [];
  8872. var position = 0;
  8873. var text = '';
  8874. while (position < format.length) {
  8875. var char = format[position++];
  8876. if (char === startDelimiter) {
  8877. if (text) {
  8878. tokens.push({ type: 'text', value: text });
  8879. }
  8880. text = '';
  8881. var sub = '';
  8882. char = format[position++];
  8883. while (char !== undefined && char !== endDelimiter) {
  8884. sub += char;
  8885. char = format[position++];
  8886. }
  8887. var isClosed = char === endDelimiter;
  8888. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  8889. 'list' :
  8890. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  8891. 'named' :
  8892. 'unknown';
  8893. tokens.push({ value: sub, type: type });
  8894. }
  8895. // else if (char === '%') {
  8896. // // when found rails i18n syntax, skip text capture
  8897. // if (format[position] !== '{') {
  8898. // text += char
  8899. // }
  8900. // }
  8901. else {
  8902. text += char;
  8903. }
  8904. }
  8905. text && tokens.push({ type: 'text', value: text });
  8906. return tokens;
  8907. }
  8908. function compile(tokens, values) {
  8909. var compiled = [];
  8910. var index = 0;
  8911. var mode = isArray(values) ?
  8912. 'list' :
  8913. isObject(values) ?
  8914. 'named' :
  8915. 'unknown';
  8916. if (mode === 'unknown') {
  8917. return compiled;
  8918. }
  8919. while (index < tokens.length) {
  8920. var token = tokens[index];
  8921. switch (token.type) {
  8922. case 'text':
  8923. compiled.push(token.value);
  8924. break;
  8925. case 'list':
  8926. compiled.push(values[parseInt(token.value, 10)]);
  8927. break;
  8928. case 'named':
  8929. if (mode === 'named') {
  8930. compiled.push(values[token.value]);
  8931. } else
  8932. {
  8933. if (true) {
  8934. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  8935. }
  8936. }
  8937. break;
  8938. case 'unknown':
  8939. if (true) {
  8940. console.warn("Detect 'unknown' type of token!");
  8941. }
  8942. break;}
  8943. index++;
  8944. }
  8945. return compiled;
  8946. }
  8947. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  8948. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  8949. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  8950. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  8951. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  8952. var hasOwnProperty = Object.prototype.hasOwnProperty;
  8953. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  8954. var defaultFormatter = new BaseFormatter();
  8955. function include(str, parts) {
  8956. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  8957. }
  8958. function startsWith(str, parts) {
  8959. return parts.find(function (part) {return str.indexOf(part) === 0;});
  8960. }
  8961. function normalizeLocale(locale, messages) {
  8962. if (!locale) {
  8963. return;
  8964. }
  8965. locale = locale.trim().replace(/_/g, '-');
  8966. if (messages && messages[locale]) {
  8967. return locale;
  8968. }
  8969. locale = locale.toLowerCase();
  8970. if (locale.indexOf('zh') === 0) {
  8971. if (locale.indexOf('-hans') > -1) {
  8972. return LOCALE_ZH_HANS;
  8973. }
  8974. if (locale.indexOf('-hant') > -1) {
  8975. return LOCALE_ZH_HANT;
  8976. }
  8977. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  8978. return LOCALE_ZH_HANT;
  8979. }
  8980. return LOCALE_ZH_HANS;
  8981. }
  8982. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  8983. if (lang) {
  8984. return lang;
  8985. }
  8986. }var
  8987. I18n = /*#__PURE__*/function () {
  8988. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  8989. this.locale = LOCALE_EN;
  8990. this.fallbackLocale = LOCALE_EN;
  8991. this.message = {};
  8992. this.messages = {};
  8993. this.watchers = [];
  8994. if (fallbackLocale) {
  8995. this.fallbackLocale = fallbackLocale;
  8996. }
  8997. this.formater = formater || defaultFormatter;
  8998. this.messages = messages || {};
  8999. this.setLocale(locale || LOCALE_EN);
  9000. if (watcher) {
  9001. this.watchLocale(watcher);
  9002. }
  9003. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  9004. locale) {var _this = this;
  9005. var oldLocale = this.locale;
  9006. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  9007. if (!this.messages[this.locale]) {
  9008. // 可能初始化时不存在
  9009. this.messages[this.locale] = {};
  9010. }
  9011. this.message = this.messages[this.locale];
  9012. // 仅发生变化时,通知
  9013. if (oldLocale !== this.locale) {
  9014. this.watchers.forEach(function (watcher) {
  9015. watcher(_this.locale, oldLocale);
  9016. });
  9017. }
  9018. } }, { key: "getLocale", value: function getLocale()
  9019. {
  9020. return this.locale;
  9021. } }, { key: "watchLocale", value: function watchLocale(
  9022. fn) {var _this2 = this;
  9023. var index = this.watchers.push(fn) - 1;
  9024. return function () {
  9025. _this2.watchers.splice(index, 1);
  9026. };
  9027. } }, { key: "add", value: function add(
  9028. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9029. var curMessages = this.messages[locale];
  9030. if (curMessages) {
  9031. if (override) {
  9032. Object.assign(curMessages, message);
  9033. } else
  9034. {
  9035. Object.keys(message).forEach(function (key) {
  9036. if (!hasOwn(curMessages, key)) {
  9037. curMessages[key] = message[key];
  9038. }
  9039. });
  9040. }
  9041. } else
  9042. {
  9043. this.messages[locale] = message;
  9044. }
  9045. } }, { key: "f", value: function f(
  9046. message, values, delimiters) {
  9047. return this.formater.interpolate(message, values, delimiters).join('');
  9048. } }, { key: "t", value: function t(
  9049. key, locale, values) {
  9050. var message = this.message;
  9051. if (typeof locale === 'string') {
  9052. locale = normalizeLocale(locale, this.messages);
  9053. locale && (message = this.messages[locale]);
  9054. } else
  9055. {
  9056. values = locale;
  9057. }
  9058. if (!hasOwn(message, key)) {
  9059. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  9060. return key;
  9061. }
  9062. return this.formater.interpolate(message[key], values).join('');
  9063. } }]);return I18n;}();exports.I18n = I18n;
  9064. function watchAppLocale(appVm, i18n) {
  9065. // 需要保证 watch 的触发在组件渲染之前
  9066. if (appVm.$watchLocale) {
  9067. // vue2
  9068. appVm.$watchLocale(function (newLocale) {
  9069. i18n.setLocale(newLocale);
  9070. });
  9071. } else
  9072. {
  9073. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  9074. i18n.setLocale(newLocale);
  9075. });
  9076. }
  9077. }
  9078. function getDefaultLocale() {
  9079. if (typeof uni !== 'undefined' && uni.getLocale) {
  9080. return uni.getLocale();
  9081. }
  9082. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  9083. if (typeof global !== 'undefined' && global.getLocale) {
  9084. return global.getLocale();
  9085. }
  9086. return LOCALE_EN;
  9087. }
  9088. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  9089. // 兼容旧版本入参
  9090. if (typeof locale !== 'string') {var _ref4 =
  9091. [
  9092. messages,
  9093. locale];locale = _ref4[0];messages = _ref4[1];
  9094. }
  9095. if (typeof locale !== 'string') {
  9096. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  9097. locale = getDefaultLocale();
  9098. }
  9099. if (typeof fallbackLocale !== 'string') {
  9100. fallbackLocale =
  9101. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  9102. LOCALE_EN;
  9103. }
  9104. var i18n = new I18n({
  9105. locale: locale,
  9106. fallbackLocale: fallbackLocale,
  9107. messages: messages,
  9108. watcher: watcher });
  9109. var _t = function t(key, values) {
  9110. if (typeof getApp !== 'function') {
  9111. // app view
  9112. /* eslint-disable no-func-assign */
  9113. _t = function t(key, values) {
  9114. return i18n.t(key, values);
  9115. };
  9116. } else
  9117. {
  9118. var isWatchedAppLocale = false;
  9119. _t = function t(key, values) {
  9120. var appVm = getApp().$vm;
  9121. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  9122. // options: {
  9123. // type: Array,
  9124. // default () {
  9125. // return [{
  9126. // icon: 'shop',
  9127. // text: t("uni-goods-nav.options.shop"),
  9128. // }, {
  9129. // icon: 'cart',
  9130. // text: t("uni-goods-nav.options.cart")
  9131. // }]
  9132. // }
  9133. // },
  9134. if (appVm) {
  9135. // 触发响应式
  9136. appVm.$locale;
  9137. if (!isWatchedAppLocale) {
  9138. isWatchedAppLocale = true;
  9139. watchAppLocale(appVm, i18n);
  9140. }
  9141. }
  9142. return i18n.t(key, values);
  9143. };
  9144. }
  9145. return _t(key, values);
  9146. };
  9147. return {
  9148. i18n: i18n,
  9149. f: function f(message, values, delimiters) {
  9150. return i18n.f(message, values, delimiters);
  9151. },
  9152. t: function t(key, values) {
  9153. return _t(key, values);
  9154. },
  9155. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9156. return i18n.add(locale, message, override);
  9157. },
  9158. watch: function watch(fn) {
  9159. return i18n.watchLocale(fn);
  9160. },
  9161. getLocale: function getLocale() {
  9162. return i18n.getLocale();
  9163. },
  9164. setLocale: function setLocale(newLocale) {
  9165. return i18n.setLocale(newLocale);
  9166. } };
  9167. }
  9168. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  9169. var formater;
  9170. function hasI18nJson(jsonObj, delimiters) {
  9171. if (!formater) {
  9172. formater = new BaseFormatter();
  9173. }
  9174. return walkJsonObj(jsonObj, function (jsonObj, key) {
  9175. var value = jsonObj[key];
  9176. if (isString(value)) {
  9177. if (isI18nStr(value, delimiters)) {
  9178. return true;
  9179. }
  9180. } else
  9181. {
  9182. return hasI18nJson(value, delimiters);
  9183. }
  9184. });
  9185. }
  9186. function parseI18nJson(jsonObj, values, delimiters) {
  9187. if (!formater) {
  9188. formater = new BaseFormatter();
  9189. }
  9190. walkJsonObj(jsonObj, function (jsonObj, key) {
  9191. var value = jsonObj[key];
  9192. if (isString(value)) {
  9193. if (isI18nStr(value, delimiters)) {
  9194. jsonObj[key] = compileStr(value, values, delimiters);
  9195. }
  9196. } else
  9197. {
  9198. parseI18nJson(value, values, delimiters);
  9199. }
  9200. });
  9201. return jsonObj;
  9202. }
  9203. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  9204. if (!isI18nStr(jsonStr, delimiters)) {
  9205. return jsonStr;
  9206. }
  9207. if (!formater) {
  9208. formater = new BaseFormatter();
  9209. }
  9210. var localeValues = [];
  9211. Object.keys(locales).forEach(function (name) {
  9212. if (name !== locale) {
  9213. localeValues.push({
  9214. locale: name,
  9215. values: locales[name] });
  9216. }
  9217. });
  9218. localeValues.unshift({ locale: locale, values: locales[locale] });
  9219. try {
  9220. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  9221. }
  9222. catch (e) {}
  9223. return jsonStr;
  9224. }
  9225. function isI18nStr(value, delimiters) {
  9226. return value.indexOf(delimiters[0]) > -1;
  9227. }
  9228. function compileStr(value, values, delimiters) {
  9229. return formater.interpolate(value, values, delimiters).join('');
  9230. }
  9231. function compileValue(jsonObj, key, localeValues, delimiters) {
  9232. var value = jsonObj[key];
  9233. if (isString(value)) {
  9234. // 存在国际化
  9235. if (isI18nStr(value, delimiters)) {
  9236. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  9237. if (localeValues.length > 1) {
  9238. // 格式化国际化语言
  9239. var valueLocales = jsonObj[key + 'Locales'] = {};
  9240. localeValues.forEach(function (localValue) {
  9241. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  9242. });
  9243. }
  9244. }
  9245. } else
  9246. {
  9247. compileJsonObj(value, localeValues, delimiters);
  9248. }
  9249. }
  9250. function compileJsonObj(jsonObj, localeValues, delimiters) {
  9251. walkJsonObj(jsonObj, function (jsonObj, key) {
  9252. compileValue(jsonObj, key, localeValues, delimiters);
  9253. });
  9254. return jsonObj;
  9255. }
  9256. function walkJsonObj(jsonObj, walk) {
  9257. if (isArray(jsonObj)) {
  9258. for (var i = 0; i < jsonObj.length; i++) {
  9259. if (walk(jsonObj, i)) {
  9260. return true;
  9261. }
  9262. }
  9263. } else
  9264. if (isObject(jsonObj)) {
  9265. for (var key in jsonObj) {
  9266. if (walk(jsonObj, key)) {
  9267. return true;
  9268. }
  9269. }
  9270. }
  9271. return false;
  9272. }
  9273. function resolveLocale(locales) {
  9274. return function (locale) {
  9275. if (!locale) {
  9276. return locale;
  9277. }
  9278. locale = normalizeLocale(locale) || locale;
  9279. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  9280. };
  9281. }
  9282. function resolveLocaleChain(locale) {
  9283. var chain = [];
  9284. var tokens = locale.split('-');
  9285. while (tokens.length) {
  9286. chain.push(tokens.join('-'));
  9287. tokens.pop();
  9288. }
  9289. return chain;
  9290. }
  9291. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  9292. /***/ }),
  9293. /***/ 5:
  9294. /*!*******************************************!*\
  9295. !*** /Users/guo/Desktop/txCar/pages.json ***!
  9296. \*******************************************/
  9297. /*! no static exports found */
  9298. /***/ (function(module, exports) {
  9299. /***/ }),
  9300. /***/ 68:
  9301. /*!**********************************************************!*\
  9302. !*** /Users/guo/Desktop/txCar/static/dataJson/city.json ***!
  9303. \**********************************************************/
  9304. /*! exports provided: data, statistics, code, message, messageType, default */
  9305. /***/ (function(module) {
  9306. module.exports = JSON.parse("{\"data\":{\"list\":[{\"citycode\":513200,\"name\":\"阿坝\",\"pinyin\":\"AB\",\"ishot\":false},{\"citycode\":610900,\"name\":\"安康\",\"pinyin\":\"AK\",\"ishot\":false},{\"citycode\":652901,\"name\":\"阿克苏\",\"pinyin\":\"AKS\",\"ishot\":false},{\"citycode\":152900,\"name\":\"阿拉善\",\"pinyin\":\"ALS\",\"ishot\":false},{\"citycode\":340800,\"name\":\"安庆\",\"pinyin\":\"AQ\",\"ishot\":false},{\"citycode\":520400,\"name\":\"安顺\",\"pinyin\":\"AS\",\"ishot\":false},{\"citycode\":210300,\"name\":\"鞍山\",\"pinyin\":\"AS\",\"ishot\":false},{\"citycode\":410500,\"name\":\"安阳\",\"pinyin\":\"AY\",\"ishot\":false},{\"citycode\":340300,\"name\":\"蚌埠\",\"pinyin\":\"BB\",\"ishot\":false},{\"citycode\":220800,\"name\":\"白城\",\"pinyin\":\"BC\",\"ishot\":false},{\"citycode\":130600,\"name\":\"保定\",\"pinyin\":\"BD\",\"ishot\":false},{\"citycode\":450500,\"name\":\"北海\",\"pinyin\":\"BH\",\"ishot\":false},{\"citycode\":110100,\"name\":\"北京\",\"pinyin\":\"BJ\",\"ishot\":true},{\"citycode\":610300,\"name\":\"宝鸡\",\"pinyin\":\"BJ\",\"ishot\":false},{\"citycode\":522401,\"name\":\"毕节\",\"pinyin\":\"BJ\",\"ishot\":false},{\"citycode\":451000,\"name\":\"百色\",\"pinyin\":\"BS\",\"ishot\":false},{\"citycode\":220600,\"name\":\"白山\",\"pinyin\":\"BS\",\"ishot\":false},{\"citycode\":530500,\"name\":\"保山\",\"pinyin\":\"BS\",\"ishot\":false},{\"citycode\":150200,\"name\":\"包头\",\"pinyin\":\"BT\",\"ishot\":false},{\"citycode\":210500,\"name\":\"本溪\",\"pinyin\":\"BX\",\"ishot\":false},{\"citycode\":620400,\"name\":\"白银\",\"pinyin\":\"BY\",\"ishot\":false},{\"citycode\":652800,\"name\":\"巴音郭楞\",\"pinyin\":\"BYGL\",\"ishot\":false},{\"citycode\":150800,\"name\":\"巴彦淖尔\",\"pinyin\":\"BYNE\",\"ishot\":false},{\"citycode\":371600,\"name\":\"滨州\",\"pinyin\":\"BZ\",\"ishot\":false},{\"citycode\":511900,\"name\":\"巴中\",\"pinyin\":\"BZ\",\"ishot\":false},{\"citycode\":341600,\"name\":\"亳州\",\"pinyin\":\"BZ\",\"ishot\":false},{\"citycode\":220100,\"name\":\"长春\",\"pinyin\":\"CC\",\"ishot\":false},{\"citycode\":510100,\"name\":\"成都\",\"pinyin\":\"CD\",\"ishot\":true},{\"citycode\":130800,\"name\":\"承德\",\"pinyin\":\"CD\",\"ishot\":false},{\"citycode\":430700,\"name\":\"常德\",\"pinyin\":\"CD\",\"ishot\":false},{\"citycode\":150400,\"name\":\"赤峰\",\"pinyin\":\"CF\",\"ishot\":false},{\"citycode\":652301,\"name\":\"昌吉\",\"pinyin\":\"CJ\",\"ishot\":false},{\"citycode\":360202,\"name\":\"昌江\",\"pinyin\":\"CJ\",\"ishot\":false},{\"citycode\":469023,\"name\":\"澄迈县\",\"pinyin\":\"CMX\",\"ishot\":false},{\"citycode\":500100,\"name\":\"重庆\",\"pinyin\":\"CQ\",\"ishot\":true},{\"citycode\":430100,\"name\":\"长沙\",\"pinyin\":\"CS\",\"ishot\":false},{\"citycode\":532301,\"name\":\"楚雄\",\"pinyin\":\"CX\",\"ishot\":false},{\"citycode\":211300,\"name\":\"朝阳\",\"pinyin\":\"CY\",\"ishot\":false},{\"citycode\":341700,\"name\":\"池州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":341100,\"name\":\"滁州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":130900,\"name\":\"沧州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":431000,\"name\":\"郴州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":320400,\"name\":\"常州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":445100,\"name\":\"潮州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":451400,\"name\":\"崇左\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":210600,\"name\":\"丹东\",\"pinyin\":\"DD\",\"ishot\":false},{\"citycode\":469007,\"name\":\"东方\",\"pinyin\":\"DF\",\"ishot\":false},{\"citycode\":441900,\"name\":\"东莞\",\"pinyin\":\"DG\",\"ishot\":false},{\"citycode\":533100,\"name\":\"德宏\",\"pinyin\":\"DH\",\"ishot\":false},{\"citycode\":210200,\"name\":\"大连\",\"pinyin\":\"DL\",\"ishot\":false},{\"citycode\":532901,\"name\":\"大理\",\"pinyin\":\"DL\",\"ishot\":false},{\"citycode\":230600,\"name\":\"大庆\",\"pinyin\":\"DQ\",\"ishot\":false},{\"citycode\":140200,\"name\":\"大同\",\"pinyin\":\"DT\",\"ishot\":false},{\"citycode\":621100,\"name\":\"定西\",\"pinyin\":\"DX\",\"ishot\":false},{\"citycode\":232700,\"name\":\"大兴安岭\",\"pinyin\":\"DXAL\",\"ishot\":false},{\"citycode\":370500,\"name\":\"东营\",\"pinyin\":\"DY\",\"ishot\":false},{\"citycode\":510600,\"name\":\"德阳\",\"pinyin\":\"DY\",\"ishot\":false},{\"citycode\":371400,\"name\":\"德州\",\"pinyin\":\"DZ\",\"ishot\":false},{\"citycode\":511700,\"name\":\"达州\",\"pinyin\":\"DZ\",\"ishot\":false},{\"citycode\":469003,\"name\":\"儋州\",\"pinyin\":\"DZ\",\"ishot\":false},{\"citycode\":150600,\"name\":\"鄂尔多斯\",\"pinyin\":\"EEDS\",\"ishot\":false},{\"citycode\":422800,\"name\":\"恩施\",\"pinyin\":\"ES\",\"ishot\":false},{\"citycode\":420700,\"name\":\"鄂州\",\"pinyin\":\"EZ\",\"ishot\":false},{\"citycode\":450600,\"name\":\"防城港\",\"pinyin\":\"FCG\",\"ishot\":false},{\"citycode\":440600,\"name\":\"佛山\",\"pinyin\":\"FS\",\"ishot\":false},{\"citycode\":210400,\"name\":\"抚顺\",\"pinyin\":\"FS\",\"ishot\":false},{\"citycode\":210900,\"name\":\"阜新\",\"pinyin\":\"FX\",\"ishot\":false},{\"citycode\":341200,\"name\":\"阜阳\",\"pinyin\":\"FY\",\"ishot\":false},{\"citycode\":350100,\"name\":\"福州\",\"pinyin\":\"FZ\",\"ishot\":false},{\"citycode\":361000,\"name\":\"抚州\",\"pinyin\":\"FZ\",\"ishot\":false},{\"citycode\":511600,\"name\":\"广安\",\"pinyin\":\"GA\",\"ishot\":false},{\"citycode\":450800,\"name\":\"贵港\",\"pinyin\":\"GG\",\"ishot\":false},{\"citycode\":450300,\"name\":\"桂林\",\"pinyin\":\"GL\",\"ishot\":false},{\"citycode\":623000,\"name\":\"甘南\",\"pinyin\":\"GN\",\"ishot\":false},{\"citycode\":520100,\"name\":\"贵阳\",\"pinyin\":\"GY\",\"ishot\":false},{\"citycode\":640400,\"name\":\"固原\",\"pinyin\":\"GY\",\"ishot\":false},{\"citycode\":510800,\"name\":\"广元\",\"pinyin\":\"GY\",\"ishot\":false},{\"citycode\":440100,\"name\":\"广州\",\"pinyin\":\"GZ\",\"ishot\":true},{\"citycode\":360700,\"name\":\"赣州\",\"pinyin\":\"GZ\",\"ishot\":false},{\"citycode\":513300,\"name\":\"甘孜\",\"pinyin\":\"GZ\",\"ishot\":false},{\"citycode\":320800,\"name\":\"淮安\",\"pinyin\":\"HA\",\"ishot\":false},{\"citycode\":410600,\"name\":\"鹤壁\",\"pinyin\":\"HB\",\"ishot\":false},{\"citycode\":340600,\"name\":\"淮北\",\"pinyin\":\"HB\",\"ishot\":false},{\"citycode\":451200,\"name\":\"河池\",\"pinyin\":\"HC\",\"ishot\":false},{\"citycode\":130400,\"name\":\"邯郸\",\"pinyin\":\"HD\",\"ishot\":false},{\"citycode\":630200,\"name\":\"海东\",\"pinyin\":\"HD\",\"ishot\":false},{\"citycode\":230100,\"name\":\"哈尔滨\",\"pinyin\":\"HEB\",\"ishot\":false},{\"citycode\":340100,\"name\":\"合肥\",\"pinyin\":\"HF\",\"ishot\":false},{\"citycode\":421100,\"name\":\"黄冈\",\"pinyin\":\"HG\",\"ishot\":false},{\"citycode\":230400,\"name\":\"鹤岗\",\"pinyin\":\"HG\",\"ishot\":false},{\"citycode\":431200,\"name\":\"怀化\",\"pinyin\":\"HH\",\"ishot\":false},{\"citycode\":532500,\"name\":\"红河\",\"pinyin\":\"HH\",\"ishot\":false},{\"citycode\":231100,\"name\":\"黑河\",\"pinyin\":\"HH\",\"ishot\":false},{\"citycode\":150100,\"name\":\"呼和浩特\",\"pinyin\":\"HHHT\",\"ishot\":false},{\"citycode\":460100,\"name\":\"海口\",\"pinyin\":\"HK\",\"ishot\":false},{\"citycode\":150700,\"name\":\"呼伦贝尔\",\"pinyin\":\"HLBE\",\"ishot\":false},{\"citycode\":211400,\"name\":\"葫芦岛\",\"pinyin\":\"HLD\",\"ishot\":false},{\"citycode\":652200,\"name\":\"哈密\",\"pinyin\":\"HM\",\"ishot\":false},{\"citycode\":340400,\"name\":\"淮南\",\"pinyin\":\"HN\",\"ishot\":false},{\"citycode\":632500,\"name\":\"海南州\",\"pinyin\":\"HNZ\",\"ishot\":false},{\"citycode\":341000,\"name\":\"黄山\",\"pinyin\":\"HS\",\"ishot\":false},{\"citycode\":420200,\"name\":\"黄石\",\"pinyin\":\"HS\",\"ishot\":false},{\"citycode\":131100,\"name\":\"衡水\",\"pinyin\":\"HS\",\"ishot\":false},{\"citycode\":653200,\"name\":\"和田\",\"pinyin\":\"HT\",\"ishot\":false},{\"citycode\":632800,\"name\":\"海西\",\"pinyin\":\"HX\",\"ishot\":false},{\"citycode\":441600,\"name\":\"河源\",\"pinyin\":\"HY\",\"ishot\":false},{\"citycode\":430400,\"name\":\"衡阳\",\"pinyin\":\"HY\",\"ishot\":false},{\"citycode\":330100,\"name\":\"杭州\",\"pinyin\":\"HZ\",\"ishot\":true},{\"citycode\":441300,\"name\":\"惠州\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":330500,\"name\":\"湖州\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":451100,\"name\":\"贺州\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":371700,\"name\":\"菏泽\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":610700,\"name\":\"汉中\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":360800,\"name\":\"吉安\",\"pinyin\":\"JA\",\"ishot\":false},{\"citycode\":140500,\"name\":\"晋城\",\"pinyin\":\"JC\",\"ishot\":false},{\"citycode\":620300,\"name\":\"金昌\",\"pinyin\":\"JC\",\"ishot\":false},{\"citycode\":360200,\"name\":\"景德镇\",\"pinyin\":\"JDZ\",\"ishot\":false},{\"citycode\":330700,\"name\":\"金华\",\"pinyin\":\"JH\",\"ishot\":false},{\"citycode\":360400,\"name\":\"九江\",\"pinyin\":\"JJ\",\"ishot\":false},{\"citycode\":220200,\"name\":\"吉林\",\"pinyin\":\"JL\",\"ishot\":false},{\"citycode\":440700,\"name\":\"江门\",\"pinyin\":\"JM\",\"ishot\":false},{\"citycode\":420800,\"name\":\"荆门\",\"pinyin\":\"JM\",\"ishot\":false},{\"citycode\":230800,\"name\":\"佳木斯\",\"pinyin\":\"JMS\",\"ishot\":false},{\"citycode\":370100,\"name\":\"济南\",\"pinyin\":\"JN\",\"ishot\":false},{\"citycode\":370800,\"name\":\"济宁\",\"pinyin\":\"JN\",\"ishot\":false},{\"citycode\":620900,\"name\":\"酒泉\",\"pinyin\":\"JQ\",\"ishot\":false},{\"citycode\":330400,\"name\":\"嘉兴\",\"pinyin\":\"JX\",\"ishot\":false},{\"citycode\":230300,\"name\":\"鸡西\",\"pinyin\":\"JX\",\"ishot\":false},{\"citycode\":445200,\"name\":\"揭阳\",\"pinyin\":\"JY\",\"ishot\":false},{\"citycode\":410881,\"name\":\"济源\",\"pinyin\":\"JY\",\"ishot\":false},{\"citycode\":620200,\"name\":\"嘉峪关\",\"pinyin\":\"JYG\",\"ishot\":false},{\"citycode\":410800,\"name\":\"焦作\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":421000,\"name\":\"荆州\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":210700,\"name\":\"锦州\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":140700,\"name\":\"晋中\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":410200,\"name\":\"开封\",\"pinyin\":\"KF\",\"ishot\":false},{\"citycode\":650200,\"name\":\"克拉玛依\",\"pinyin\":\"KLMY\",\"ishot\":false},{\"citycode\":530100,\"name\":\"昆明\",\"pinyin\":\"KM\",\"ishot\":false},{\"citycode\":653000,\"name\":\"克孜勒苏柯尔克孜\",\"pinyin\":\"KZLSKEKZ\",\"ishot\":false},{\"citycode\":341500,\"name\":\"六安\",\"pinyin\":\"LA\",\"ishot\":false},{\"citycode\":451300,\"name\":\"来宾\",\"pinyin\":\"LB\",\"ishot\":false},{\"citycode\":371500,\"name\":\"聊城\",\"pinyin\":\"LC\",\"ishot\":false},{\"citycode\":530900,\"name\":\"临沧\",\"pinyin\":\"LC\",\"ishot\":false},{\"citycode\":431300,\"name\":\"娄底\",\"pinyin\":\"LD\",\"ishot\":false},{\"citycode\":131000,\"name\":\"廊坊\",\"pinyin\":\"LF\",\"ishot\":false},{\"citycode\":141000,\"name\":\"临汾\",\"pinyin\":\"LF\",\"ishot\":false},{\"citycode\":469024,\"name\":\"临高\",\"pinyin\":\"LG\",\"ishot\":false},{\"citycode\":411100,\"name\":\"漯河\",\"pinyin\":\"LH\",\"ishot\":false},{\"citycode\":530700,\"name\":\"丽江\",\"pinyin\":\"LJ\",\"ishot\":false},{\"citycode\":141100,\"name\":\"吕梁\",\"pinyin\":\"LL\",\"ishot\":false},{\"citycode\":621200,\"name\":\"陇南\",\"pinyin\":\"LN\",\"ishot\":false},{\"citycode\":520200,\"name\":\"六盘水\",\"pinyin\":\"LPS\",\"ishot\":false},{\"citycode\":511100,\"name\":\"乐山\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":540100,\"name\":\"拉萨\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":331100,\"name\":\"丽水\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":513400,\"name\":\"凉山\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":469028,\"name\":\"陵水\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":622900,\"name\":\"临夏\",\"pinyin\":\"LX\",\"ishot\":false},{\"citycode\":350800,\"name\":\"龙岩\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":410300,\"name\":\"洛阳\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":220400,\"name\":\"辽源\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":371300,\"name\":\"临沂\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":211000,\"name\":\"辽阳\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":320700,\"name\":\"连云港\",\"pinyin\":\"LYG\",\"ishot\":false},{\"citycode\":620100,\"name\":\"兰州\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":450200,\"name\":\"柳州\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":510500,\"name\":\"泸州\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":542600,\"name\":\"林芝\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":340500,\"name\":\"马鞍山\",\"pinyin\":\"MAS\",\"ishot\":false},{\"citycode\":231000,\"name\":\"牡丹江\",\"pinyin\":\"MDJ\",\"ishot\":false},{\"citycode\":440900,\"name\":\"茂名\",\"pinyin\":\"MM\",\"ishot\":false},{\"citycode\":511400,\"name\":\"眉山\",\"pinyin\":\"MS\",\"ishot\":false},{\"citycode\":510700,\"name\":\"绵阳\",\"pinyin\":\"MY\",\"ishot\":false},{\"citycode\":441400,\"name\":\"梅州\",\"pinyin\":\"MZ\",\"ishot\":false},{\"citycode\":330200,\"name\":\"宁波\",\"pinyin\":\"NB\",\"ishot\":false},{\"citycode\":360100,\"name\":\"南昌\",\"pinyin\":\"NC\",\"ishot\":false},{\"citycode\":511300,\"name\":\"南充\",\"pinyin\":\"NC\",\"ishot\":false},{\"citycode\":350900,\"name\":\"宁德\",\"pinyin\":\"ND\",\"ishot\":false},{\"citycode\":320100,\"name\":\"南京\",\"pinyin\":\"NJ\",\"ishot\":true},{\"citycode\":511000,\"name\":\"内江\",\"pinyin\":\"NJ\",\"ishot\":false},{\"citycode\":533300,\"name\":\"怒江\",\"pinyin\":\"NJ\",\"ishot\":false},{\"citycode\":450100,\"name\":\"南宁\",\"pinyin\":\"NN\",\"ishot\":false},{\"citycode\":350700,\"name\":\"南平\",\"pinyin\":\"NP\",\"ishot\":false},{\"citycode\":320600,\"name\":\"南通\",\"pinyin\":\"NT\",\"ishot\":false},{\"citycode\":411300,\"name\":\"南阳\",\"pinyin\":\"NY\",\"ishot\":false},{\"citycode\":410400,\"name\":\"平顶山\",\"pinyin\":\"PDS\",\"ishot\":false},{\"citycode\":530800,\"name\":\"普洱\",\"pinyin\":\"PE\",\"ishot\":false},{\"citycode\":211100,\"name\":\"盘锦\",\"pinyin\":\"PJ\",\"ishot\":false},{\"citycode\":620800,\"name\":\"平凉\",\"pinyin\":\"PL\",\"ishot\":false},{\"citycode\":350300,\"name\":\"莆田\",\"pinyin\":\"PT\",\"ishot\":false},{\"citycode\":360300,\"name\":\"萍乡\",\"pinyin\":\"PX\",\"ishot\":false},{\"citycode\":410900,\"name\":\"濮阳\",\"pinyin\":\"PY\",\"ishot\":false},{\"citycode\":510400,\"name\":\"攀枝花\",\"pinyin\":\"PZH\",\"ishot\":false},{\"citycode\":370200,\"name\":\"青岛\",\"pinyin\":\"QD\",\"ishot\":false},{\"citycode\":522600,\"name\":\"黔东南\",\"pinyin\":\"QDN\",\"ishot\":false},{\"citycode\":469002,\"name\":\"琼海\",\"pinyin\":\"QH\",\"ishot\":false},{\"citycode\":130300,\"name\":\"秦皇岛\",\"pinyin\":\"QHD\",\"ishot\":false},{\"citycode\":530300,\"name\":\"曲靖\",\"pinyin\":\"QJ\",\"ishot\":false},{\"citycode\":429005,\"name\":\"潜江\",\"pinyin\":\"QJ\",\"ishot\":false},{\"citycode\":522700,\"name\":\"黔南\",\"pinyin\":\"QN\",\"ishot\":false},{\"citycode\":230200,\"name\":\"齐齐哈尔\",\"pinyin\":\"QQHE\",\"ishot\":false},{\"citycode\":522300,\"name\":\"黔西南\",\"pinyin\":\"QXN\",\"ishot\":false},{\"citycode\":441800,\"name\":\"清远\",\"pinyin\":\"QY\",\"ishot\":false},{\"citycode\":621000,\"name\":\"庆阳\",\"pinyin\":\"QY\",\"ishot\":false},{\"citycode\":330800,\"name\":\"衢州\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":350500,\"name\":\"泉州\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":450700,\"name\":\"钦州\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":469030,\"name\":\"琼中\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":542300,\"name\":\"日喀则\",\"pinyin\":\"RKZ\",\"ishot\":false},{\"citycode\":371100,\"name\":\"日照\",\"pinyin\":\"RZ\",\"ishot\":false},{\"citycode\":440200,\"name\":\"韶关\",\"pinyin\":\"SG\",\"ishot\":false},{\"citycode\":310100,\"name\":\"上海\",\"pinyin\":\"SH\",\"ishot\":true},{\"citycode\":231200,\"name\":\"绥化\",\"pinyin\":\"SH\",\"ishot\":false},{\"citycode\":659001,\"name\":\"石河子\",\"pinyin\":\"SHZ\",\"ishot\":false},{\"citycode\":130100,\"name\":\"石家庄\",\"pinyin\":\"SJZ\",\"ishot\":false},{\"citycode\":611000,\"name\":\"商洛\",\"pinyin\":\"SL\",\"ishot\":false},{\"citycode\":350400,\"name\":\"三明\",\"pinyin\":\"SM\",\"ishot\":false},{\"citycode\":411200,\"name\":\"三门峡\",\"pinyin\":\"SMX\",\"ishot\":false},{\"citycode\":510900,\"name\":\"遂宁\",\"pinyin\":\"SN\",\"ishot\":false},{\"citycode\":220300,\"name\":\"四平\",\"pinyin\":\"SP\",\"ishot\":false},{\"citycode\":411400,\"name\":\"商丘\",\"pinyin\":\"SQ\",\"ishot\":false},{\"citycode\":321300,\"name\":\"宿迁\",\"pinyin\":\"SQ\",\"ishot\":false},{\"citycode\":361100,\"name\":\"上饶\",\"pinyin\":\"SR\",\"ishot\":false},{\"citycode\":440500,\"name\":\"汕头\",\"pinyin\":\"ST\",\"ishot\":false},{\"citycode\":441500,\"name\":\"汕尾\",\"pinyin\":\"SW\",\"ishot\":false},{\"citycode\":330600,\"name\":\"绍兴\",\"pinyin\":\"SX\",\"ishot\":false},{\"citycode\":420300,\"name\":\"十堰\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":210100,\"name\":\"沈阳\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":460200,\"name\":\"三亚\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":430500,\"name\":\"邵阳\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":220700,\"name\":\"松原\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":230500,\"name\":\"双鸭山\",\"pinyin\":\"SYS\",\"ishot\":false},{\"citycode\":440300,\"name\":\"深圳\",\"pinyin\":\"SZ\",\"ishot\":true},{\"citycode\":320500,\"name\":\"苏州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":341300,\"name\":\"宿州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":421300,\"name\":\"随州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":140600,\"name\":\"朔州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":640200,\"name\":\"石嘴山\",\"pinyin\":\"SZS\",\"ishot\":false},{\"citycode\":370900,\"name\":\"泰安\",\"pinyin\":\"TA\",\"ishot\":false},{\"citycode\":610200,\"name\":\"铜川\",\"pinyin\":\"TC\",\"ishot\":false},{\"citycode\":654200,\"name\":\"塔城\",\"pinyin\":\"TC\",\"ishot\":false},{\"citycode\":220500,\"name\":\"通化\",\"pinyin\":\"TH\",\"ishot\":false},{\"citycode\":120100,\"name\":\"天津\",\"pinyin\":\"TJ\",\"ishot\":false},{\"citycode\":340700,\"name\":\"铜陵\",\"pinyin\":\"TL\",\"ishot\":false},{\"citycode\":150500,\"name\":\"通辽\",\"pinyin\":\"TL\",\"ishot\":false},{\"citycode\":211200,\"name\":\"铁岭\",\"pinyin\":\"TL\",\"ishot\":false},{\"citycode\":652100,\"name\":\"吐鲁番\",\"pinyin\":\"TLF\",\"ishot\":false},{\"citycode\":429006,\"name\":\"天门\",\"pinyin\":\"TM\",\"ishot\":false},{\"citycode\":522201,\"name\":\"铜仁\",\"pinyin\":\"TR\",\"ishot\":false},{\"citycode\":130200,\"name\":\"唐山\",\"pinyin\":\"TS\",\"ishot\":false},{\"citycode\":620500,\"name\":\"天水\",\"pinyin\":\"TS\",\"ishot\":false},{\"citycode\":140100,\"name\":\"太原\",\"pinyin\":\"TY\",\"ishot\":false},{\"citycode\":331000,\"name\":\"台州\",\"pinyin\":\"TZ\",\"ishot\":false},{\"citycode\":321200,\"name\":\"泰州\",\"pinyin\":\"TZ\",\"ishot\":false},{\"citycode\":469005,\"name\":\"文昌\",\"pinyin\":\"WC\",\"ishot\":false},{\"citycode\":370700,\"name\":\"潍坊\",\"pinyin\":\"WF\",\"ishot\":false},{\"citycode\":420100,\"name\":\"武汉\",\"pinyin\":\"WH\",\"ishot\":true},{\"citycode\":340200,\"name\":\"芜湖\",\"pinyin\":\"WH\",\"ishot\":false},{\"citycode\":150300,\"name\":\"乌海\",\"pinyin\":\"WH\",\"ishot\":false},{\"citycode\":371000,\"name\":\"威海\",\"pinyin\":\"WH\",\"ishot\":false},{\"citycode\":659004,\"name\":\"五家渠\",\"pinyin\":\"WJQ\",\"ishot\":false},{\"citycode\":150900,\"name\":\"乌兰察布\",\"pinyin\":\"WLCB\",\"ishot\":false},{\"citycode\":650100,\"name\":\"乌鲁木齐\",\"pinyin\":\"WLMQ\",\"ishot\":false},{\"citycode\":610500,\"name\":\"渭南\",\"pinyin\":\"WN\",\"ishot\":false},{\"citycode\":469006,\"name\":\"万宁\",\"pinyin\":\"WN\",\"ishot\":false},{\"citycode\":532621,\"name\":\"文山\",\"pinyin\":\"WS\",\"ishot\":false},{\"citycode\":620600,\"name\":\"武威\",\"pinyin\":\"WW\",\"ishot\":false},{\"citycode\":320200,\"name\":\"无锡\",\"pinyin\":\"WX\",\"ishot\":false},{\"citycode\":450400,\"name\":\"梧州\",\"pinyin\":\"WZ\",\"ishot\":false},{\"citycode\":330300,\"name\":\"温州\",\"pinyin\":\"WZ\",\"ishot\":false},{\"citycode\":640300,\"name\":\"吴忠\",\"pinyin\":\"WZ\",\"ishot\":false},{\"citycode\":610100,\"name\":\"西安\",\"pinyin\":\"XA\",\"ishot\":true},{\"citycode\":152200,\"name\":\"兴安盟\",\"pinyin\":\"XAM\",\"ishot\":false},{\"citycode\":341800,\"name\":\"宣城\",\"pinyin\":\"XC\",\"ishot\":false},{\"citycode\":411000,\"name\":\"许昌\",\"pinyin\":\"XC\",\"ishot\":false},{\"citycode\":420900,\"name\":\"孝感\",\"pinyin\":\"XG\",\"ishot\":false},{\"citycode\":152500,\"name\":\"锡林郭勒\",\"pinyin\":\"XLGL\",\"ishot\":false},{\"citycode\":350200,\"name\":\"厦门\",\"pinyin\":\"XM\",\"ishot\":false},{\"citycode\":421200,\"name\":\"咸宁\",\"pinyin\":\"XN\",\"ishot\":false},{\"citycode\":630100,\"name\":\"西宁\",\"pinyin\":\"XN\",\"ishot\":false},{\"citycode\":532800,\"name\":\"西双版纳\",\"pinyin\":\"XSBN\",\"ishot\":false},{\"citycode\":130500,\"name\":\"邢台\",\"pinyin\":\"XT\",\"ishot\":false},{\"citycode\":429004,\"name\":\"仙桃\",\"pinyin\":\"XT\",\"ishot\":false},{\"citycode\":430300,\"name\":\"湘潭\",\"pinyin\":\"XT\",\"ishot\":false},{\"citycode\":410700,\"name\":\"新乡\",\"pinyin\":\"XX\",\"ishot\":false},{\"citycode\":433100,\"name\":\"湘西\",\"pinyin\":\"XX\",\"ishot\":false},{\"citycode\":411500,\"name\":\"信阳\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":420600,\"name\":\"襄阳\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":360500,\"name\":\"新余\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":610400,\"name\":\"咸阳\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":320300,\"name\":\"徐州\",\"pinyin\":\"XZ\",\"ishot\":false},{\"citycode\":140900,\"name\":\"忻州\",\"pinyin\":\"XZ\",\"ishot\":false},{\"citycode\":610600,\"name\":\"延安\",\"pinyin\":\"YA\",\"ishot\":false},{\"citycode\":511800,\"name\":\"雅安\",\"pinyin\":\"YA\",\"ishot\":false},{\"citycode\":511500,\"name\":\"宜宾\",\"pinyin\":\"YB\",\"ishot\":false},{\"citycode\":222400,\"name\":\"延边\",\"pinyin\":\"YB\",\"ishot\":false},{\"citycode\":420500,\"name\":\"宜昌\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":320900,\"name\":\"盐城\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":360900,\"name\":\"宜春\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":640100,\"name\":\"银川\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":140800,\"name\":\"运城\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":230700,\"name\":\"伊春\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":445300,\"name\":\"云浮\",\"pinyin\":\"YF\",\"ishot\":false},{\"citycode\":441700,\"name\":\"阳江\",\"pinyin\":\"YJ\",\"ishot\":false},{\"citycode\":210800,\"name\":\"营口\",\"pinyin\":\"YK\",\"ishot\":false},{\"citycode\":450900,\"name\":\"玉林\",\"pinyin\":\"YL\",\"ishot\":false},{\"citycode\":610800,\"name\":\"榆林\",\"pinyin\":\"YL\",\"ishot\":false},{\"citycode\":654000,\"name\":\"伊犁\",\"pinyin\":\"YL\",\"ishot\":false},{\"citycode\":140300,\"name\":\"阳泉\",\"pinyin\":\"YQ\",\"ishot\":false},{\"citycode\":370600,\"name\":\"烟台\",\"pinyin\":\"YT\",\"ishot\":false},{\"citycode\":360600,\"name\":\"鹰潭\",\"pinyin\":\"YT\",\"ishot\":false},{\"citycode\":530400,\"name\":\"玉溪\",\"pinyin\":\"YX\",\"ishot\":false},{\"citycode\":430900,\"name\":\"益阳\",\"pinyin\":\"YY\",\"ishot\":false},{\"citycode\":430600,\"name\":\"岳阳\",\"pinyin\":\"YY\",\"ishot\":false},{\"citycode\":321000,\"name\":\"扬州\",\"pinyin\":\"YZ\",\"ishot\":false},{\"citycode\":431100,\"name\":\"永州\",\"pinyin\":\"YZ\",\"ishot\":false},{\"citycode\":370300,\"name\":\"淄博\",\"pinyin\":\"ZB\",\"ishot\":false},{\"citycode\":510300,\"name\":\"自贡\",\"pinyin\":\"ZG\",\"ishot\":false},{\"citycode\":440400,\"name\":\"珠海\",\"pinyin\":\"ZH\",\"ishot\":false},{\"citycode\":440800,\"name\":\"湛江\",\"pinyin\":\"ZJ\",\"ishot\":false},{\"citycode\":321100,\"name\":\"镇江\",\"pinyin\":\"ZJ\",\"ishot\":false},{\"citycode\":430800,\"name\":\"张家界\",\"pinyin\":\"ZJJ\",\"ishot\":false},{\"citycode\":130700,\"name\":\"张家口\",\"pinyin\":\"ZJK\",\"ishot\":false},{\"citycode\":411600,\"name\":\"周口\",\"pinyin\":\"ZK\",\"ishot\":false},{\"citycode\":411700,\"name\":\"驻马店\",\"pinyin\":\"ZMD\",\"ishot\":false},{\"citycode\":441200,\"name\":\"肇庆\",\"pinyin\":\"ZQ\",\"ishot\":false},{\"citycode\":442000,\"name\":\"中山\",\"pinyin\":\"ZS\",\"ishot\":false},{\"citycode\":330900,\"name\":\"舟山\",\"pinyin\":\"ZS\",\"ishot\":false},{\"citycode\":530600,\"name\":\"昭通\",\"pinyin\":\"ZT\",\"ishot\":false},{\"citycode\":640500,\"name\":\"中卫\",\"pinyin\":\"ZW\",\"ishot\":false},{\"citycode\":620700,\"name\":\"张掖\",\"pinyin\":\"ZY\",\"ishot\":false},{\"citycode\":520300,\"name\":\"遵义\",\"pinyin\":\"ZY\",\"ishot\":false},{\"citycode\":512000,\"name\":\"资阳\",\"pinyin\":\"ZY\",\"ishot\":false},{\"citycode\":410100,\"name\":\"郑州\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":350600,\"name\":\"漳州\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":430200,\"name\":\"株洲\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":370400,\"name\":\"枣庄\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":140400,\"name\":\"长治\",\"pinyin\":\"ZZ\",\"ishot\":false}],\"recordList\":[{\"citycode\":420100,\"name\":\"武汉\"},{\"citycode\":330100,\"name\":\"杭州\"}],\"alphabet\":[\"area\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"W\",\"X\",\"Y\",\"Z\"]},\"statistics\":{\"total\":338},\"code\":\"1000\",\"message\":\"获取数据成功\",\"messageType\":1}");
  9307. /***/ })
  9308. }]);
  9309. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map