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. /***/ 2:
  2205. /*!***********************************!*\
  2206. !*** (webpack)/buildin/global.js ***!
  2207. \***********************************/
  2208. /*! no static exports found */
  2209. /***/ (function(module, exports) {
  2210. var g;
  2211. // This works in non-strict mode
  2212. g = (function() {
  2213. return this;
  2214. })();
  2215. try {
  2216. // This works if eval is allowed (see CSP)
  2217. g = g || new Function("return this")();
  2218. } catch (e) {
  2219. // This works if the window reference is available
  2220. if (typeof window === "object") g = window;
  2221. }
  2222. // g can still be undefined, but nothing to do about it...
  2223. // We return undefined, instead of nothing here, so it's
  2224. // easier to handle this case. if(!global) { ...}
  2225. module.exports = g;
  2226. /***/ }),
  2227. /***/ 212:
  2228. /*!**********************************************************!*\
  2229. !*** /Users/guo/Desktop/txCar/static/dataJson/city.json ***!
  2230. \**********************************************************/
  2231. /*! exports provided: data, statistics, code, message, messageType, default */
  2232. /***/ (function(module) {
  2233. 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}");
  2234. /***/ }),
  2235. /***/ 234:
  2236. /*!****************************************************************!*\
  2237. !*** /Users/guo/Desktop/txCar/components/tki-qrcode/qrcode.js ***!
  2238. \****************************************************************/
  2239. /*! no static exports found */
  2240. /***/ (function(module, exports, __webpack_require__) {
  2241. "use strict";
  2242. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var QRCode = {};
  2243. (function () {
  2244. /**
  2245. * 获取单个字符的utf8编码
  2246. * unicode BMP平面约65535个字符
  2247. * @param {num} code
  2248. * return {array}
  2249. */
  2250. function unicodeFormat8(code) {
  2251. // 1 byte
  2252. var c0, c1, c2;
  2253. if (code < 128) {
  2254. return [code];
  2255. // 2 bytes
  2256. } else if (code < 2048) {
  2257. c0 = 192 + (code >> 6);
  2258. c1 = 128 + (code & 63);
  2259. return [c0, c1];
  2260. // 3 bytes
  2261. } else {
  2262. c0 = 224 + (code >> 12);
  2263. c1 = 128 + (code >> 6 & 63);
  2264. c2 = 128 + (code & 63);
  2265. return [c0, c1, c2];
  2266. }
  2267. }
  2268. /**
  2269. * 获取字符串的utf8编码字节串
  2270. * @param {string} string
  2271. * @return {array}
  2272. */
  2273. function getUTF8Bytes(string) {
  2274. var utf8codes = [];
  2275. for (var i = 0; i < string.length; i++) {
  2276. var code = string.charCodeAt(i);
  2277. var utf8 = unicodeFormat8(code);
  2278. for (var j = 0; j < utf8.length; j++) {
  2279. utf8codes.push(utf8[j]);
  2280. }
  2281. }
  2282. return utf8codes;
  2283. }
  2284. /**
  2285. * 二维码算法实现
  2286. * @param {string} data 要编码的信息字符串
  2287. * @param {num} errorCorrectLevel 纠错等级
  2288. */
  2289. function QRCodeAlg(data, errorCorrectLevel) {
  2290. this.typeNumber = -1; //版本
  2291. this.errorCorrectLevel = errorCorrectLevel;
  2292. this.modules = null; //二维矩阵,存放最终结果
  2293. this.moduleCount = 0; //矩阵大小
  2294. this.dataCache = null; //数据缓存
  2295. this.rsBlocks = null; //版本数据信息
  2296. this.totalDataCount = -1; //可使用的数据量
  2297. this.data = data;
  2298. this.utf8bytes = getUTF8Bytes(data);
  2299. this.make();
  2300. }
  2301. QRCodeAlg.prototype = {
  2302. constructor: QRCodeAlg,
  2303. /**
  2304. * 获取二维码矩阵大小
  2305. * @return {num} 矩阵大小
  2306. */
  2307. getModuleCount: function getModuleCount() {
  2308. return this.moduleCount;
  2309. },
  2310. /**
  2311. * 编码
  2312. */
  2313. make: function make() {
  2314. this.getRightType();
  2315. this.dataCache = this.createData();
  2316. this.createQrcode();
  2317. },
  2318. /**
  2319. * 设置二位矩阵功能图形
  2320. * @param {bool} test 表示是否在寻找最好掩膜阶段
  2321. * @param {num} maskPattern 掩膜的版本
  2322. */
  2323. makeImpl: function makeImpl(maskPattern) {
  2324. this.moduleCount = this.typeNumber * 4 + 17;
  2325. this.modules = new Array(this.moduleCount);
  2326. for (var row = 0; row < this.moduleCount; row++) {
  2327. this.modules[row] = new Array(this.moduleCount);
  2328. }
  2329. this.setupPositionProbePattern(0, 0);
  2330. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  2331. this.setupPositionProbePattern(0, this.moduleCount - 7);
  2332. this.setupPositionAdjustPattern();
  2333. this.setupTimingPattern();
  2334. this.setupTypeInfo(true, maskPattern);
  2335. if (this.typeNumber >= 7) {
  2336. this.setupTypeNumber(true);
  2337. }
  2338. this.mapData(this.dataCache, maskPattern);
  2339. },
  2340. /**
  2341. * 设置二维码的位置探测图形
  2342. * @param {num} row 探测图形的中心横坐标
  2343. * @param {num} col 探测图形的中心纵坐标
  2344. */
  2345. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  2346. for (var r = -1; r <= 7; r++) {
  2347. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  2348. for (var c = -1; c <= 7; c++) {
  2349. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  2350. 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) {
  2351. this.modules[row + r][col + c] = true;
  2352. } else {
  2353. this.modules[row + r][col + c] = false;
  2354. }
  2355. }
  2356. }
  2357. },
  2358. /**
  2359. * 创建二维码
  2360. * @return {[type]} [description]
  2361. */
  2362. createQrcode: function createQrcode() {
  2363. var minLostPoint = 0;
  2364. var pattern = 0;
  2365. var bestModules = null;
  2366. for (var i = 0; i < 8; i++) {
  2367. this.makeImpl(i);
  2368. var lostPoint = QRUtil.getLostPoint(this);
  2369. if (i == 0 || minLostPoint > lostPoint) {
  2370. minLostPoint = lostPoint;
  2371. pattern = i;
  2372. bestModules = this.modules;
  2373. }
  2374. }
  2375. this.modules = bestModules;
  2376. this.setupTypeInfo(false, pattern);
  2377. if (this.typeNumber >= 7) {
  2378. this.setupTypeNumber(false);
  2379. }
  2380. },
  2381. /**
  2382. * 设置定位图形
  2383. * @return {[type]} [description]
  2384. */
  2385. setupTimingPattern: function setupTimingPattern() {
  2386. for (var r = 8; r < this.moduleCount - 8; r++) {
  2387. if (this.modules[r][6] != null) {
  2388. continue;
  2389. }
  2390. this.modules[r][6] = r % 2 == 0;
  2391. if (this.modules[6][r] != null) {
  2392. continue;
  2393. }
  2394. this.modules[6][r] = r % 2 == 0;
  2395. }
  2396. },
  2397. /**
  2398. * 设置矫正图形
  2399. * @return {[type]} [description]
  2400. */
  2401. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  2402. var pos = QRUtil.getPatternPosition(this.typeNumber);
  2403. for (var i = 0; i < pos.length; i++) {
  2404. for (var j = 0; j < pos.length; j++) {
  2405. var row = pos[i];
  2406. var col = pos[j];
  2407. if (this.modules[row][col] != null) {
  2408. continue;
  2409. }
  2410. for (var r = -2; r <= 2; r++) {
  2411. for (var c = -2; c <= 2; c++) {
  2412. if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
  2413. this.modules[row + r][col + c] = true;
  2414. } else {
  2415. this.modules[row + r][col + c] = false;
  2416. }
  2417. }
  2418. }
  2419. }
  2420. }
  2421. },
  2422. /**
  2423. * 设置版本信息(7以上版本才有)
  2424. * @param {bool} test 是否处于判断最佳掩膜阶段
  2425. * @return {[type]} [description]
  2426. */
  2427. setupTypeNumber: function setupTypeNumber(test) {
  2428. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  2429. for (var i = 0; i < 18; i++) {
  2430. var mod = !test && (bits >> i & 1) == 1;
  2431. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  2432. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  2433. }
  2434. },
  2435. /**
  2436. * 设置格式信息(纠错等级和掩膜版本)
  2437. * @param {bool} test
  2438. * @param {num} maskPattern 掩膜版本
  2439. * @return {}
  2440. */
  2441. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  2442. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  2443. var bits = QRUtil.getBCHTypeInfo(data);
  2444. // vertical
  2445. for (var i = 0; i < 15; i++) {
  2446. var mod = !test && (bits >> i & 1) == 1;
  2447. if (i < 6) {
  2448. this.modules[i][8] = mod;
  2449. } else if (i < 8) {
  2450. this.modules[i + 1][8] = mod;
  2451. } else {
  2452. this.modules[this.moduleCount - 15 + i][8] = mod;
  2453. }
  2454. // horizontal
  2455. var mod = !test && (bits >> i & 1) == 1;
  2456. if (i < 8) {
  2457. this.modules[8][this.moduleCount - i - 1] = mod;
  2458. } else if (i < 9) {
  2459. this.modules[8][15 - i - 1 + 1] = mod;
  2460. } else {
  2461. this.modules[8][15 - i - 1] = mod;
  2462. }
  2463. }
  2464. // fixed module
  2465. this.modules[this.moduleCount - 8][8] = !test;
  2466. },
  2467. /**
  2468. * 数据编码
  2469. * @return {[type]} [description]
  2470. */
  2471. createData: function createData() {
  2472. var buffer = new QRBitBuffer();
  2473. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  2474. buffer.put(4, 4); //添加模式
  2475. buffer.put(this.utf8bytes.length, lengthBits);
  2476. for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
  2477. buffer.put(this.utf8bytes[i], 8);
  2478. }
  2479. if (buffer.length + 4 <= this.totalDataCount * 8) {
  2480. buffer.put(0, 4);
  2481. }
  2482. // padding
  2483. while (buffer.length % 8 != 0) {
  2484. buffer.putBit(false);
  2485. }
  2486. // padding
  2487. while (true) {
  2488. if (buffer.length >= this.totalDataCount * 8) {
  2489. break;
  2490. }
  2491. buffer.put(QRCodeAlg.PAD0, 8);
  2492. if (buffer.length >= this.totalDataCount * 8) {
  2493. break;
  2494. }
  2495. buffer.put(QRCodeAlg.PAD1, 8);
  2496. }
  2497. return this.createBytes(buffer);
  2498. },
  2499. /**
  2500. * 纠错码编码
  2501. * @param {buffer} buffer 数据编码
  2502. * @return {[type]}
  2503. */
  2504. createBytes: function createBytes(buffer) {
  2505. var offset = 0;
  2506. var maxDcCount = 0;
  2507. var maxEcCount = 0;
  2508. var length = this.rsBlock.length / 3;
  2509. var rsBlocks = new Array();
  2510. for (var i = 0; i < length; i++) {
  2511. var count = this.rsBlock[i * 3 + 0];
  2512. var totalCount = this.rsBlock[i * 3 + 1];
  2513. var dataCount = this.rsBlock[i * 3 + 2];
  2514. for (var j = 0; j < count; j++) {
  2515. rsBlocks.push([dataCount, totalCount]);
  2516. }
  2517. }
  2518. var dcdata = new Array(rsBlocks.length);
  2519. var ecdata = new Array(rsBlocks.length);
  2520. for (var r = 0; r < rsBlocks.length; r++) {
  2521. var dcCount = rsBlocks[r][0];
  2522. var ecCount = rsBlocks[r][1] - dcCount;
  2523. maxDcCount = Math.max(maxDcCount, dcCount);
  2524. maxEcCount = Math.max(maxEcCount, ecCount);
  2525. dcdata[r] = new Array(dcCount);
  2526. for (var i = 0; i < dcdata[r].length; i++) {
  2527. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  2528. }
  2529. offset += dcCount;
  2530. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  2531. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  2532. var modPoly = rawPoly.mod(rsPoly);
  2533. ecdata[r] = new Array(rsPoly.getLength() - 1);
  2534. for (var i = 0; i < ecdata[r].length; i++) {
  2535. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  2536. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  2537. }
  2538. }
  2539. var data = new Array(this.totalDataCount);
  2540. var index = 0;
  2541. for (var i = 0; i < maxDcCount; i++) {
  2542. for (var r = 0; r < rsBlocks.length; r++) {
  2543. if (i < dcdata[r].length) {
  2544. data[index++] = dcdata[r][i];
  2545. }
  2546. }
  2547. }
  2548. for (var i = 0; i < maxEcCount; i++) {
  2549. for (var r = 0; r < rsBlocks.length; r++) {
  2550. if (i < ecdata[r].length) {
  2551. data[index++] = ecdata[r][i];
  2552. }
  2553. }
  2554. }
  2555. return data;
  2556. },
  2557. /**
  2558. * 布置模块,构建最终信息
  2559. * @param {} data
  2560. * @param {} maskPattern
  2561. * @return {}
  2562. */
  2563. mapData: function mapData(data, maskPattern) {
  2564. var inc = -1;
  2565. var row = this.moduleCount - 1;
  2566. var bitIndex = 7;
  2567. var byteIndex = 0;
  2568. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  2569. if (col == 6) col--;
  2570. while (true) {
  2571. for (var c = 0; c < 2; c++) {
  2572. if (this.modules[row][col - c] == null) {
  2573. var dark = false;
  2574. if (byteIndex < data.length) {
  2575. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  2576. }
  2577. var mask = QRUtil.getMask(maskPattern, row, col - c);
  2578. if (mask) {
  2579. dark = !dark;
  2580. }
  2581. this.modules[row][col - c] = dark;
  2582. bitIndex--;
  2583. if (bitIndex == -1) {
  2584. byteIndex++;
  2585. bitIndex = 7;
  2586. }
  2587. }
  2588. }
  2589. row += inc;
  2590. if (row < 0 || this.moduleCount <= row) {
  2591. row -= inc;
  2592. inc = -inc;
  2593. break;
  2594. }
  2595. }
  2596. }
  2597. } };
  2598. /**
  2599. * 填充字段
  2600. */
  2601. QRCodeAlg.PAD0 = 0xEC;
  2602. QRCodeAlg.PAD1 = 0x11;
  2603. //---------------------------------------------------------------------
  2604. // 纠错等级对应的编码
  2605. //---------------------------------------------------------------------
  2606. var QRErrorCorrectLevel = [1, 0, 3, 2];
  2607. //---------------------------------------------------------------------
  2608. // 掩膜版本
  2609. //---------------------------------------------------------------------
  2610. var QRMaskPattern = {
  2611. PATTERN000: 0,
  2612. PATTERN001: 1,
  2613. PATTERN010: 2,
  2614. PATTERN011: 3,
  2615. PATTERN100: 4,
  2616. PATTERN101: 5,
  2617. PATTERN110: 6,
  2618. PATTERN111: 7 };
  2619. //---------------------------------------------------------------------
  2620. // 工具类
  2621. //---------------------------------------------------------------------
  2622. var QRUtil = {
  2623. /*
  2624. 每个版本矫正图形的位置
  2625. */
  2626. PATTERN_POSITION_TABLE: [
  2627. [],
  2628. [6, 18],
  2629. [6, 22],
  2630. [6, 26],
  2631. [6, 30],
  2632. [6, 34],
  2633. [6, 22, 38],
  2634. [6, 24, 42],
  2635. [6, 26, 46],
  2636. [6, 28, 50],
  2637. [6, 30, 54],
  2638. [6, 32, 58],
  2639. [6, 34, 62],
  2640. [6, 26, 46, 66],
  2641. [6, 26, 48, 70],
  2642. [6, 26, 50, 74],
  2643. [6, 30, 54, 78],
  2644. [6, 30, 56, 82],
  2645. [6, 30, 58, 86],
  2646. [6, 34, 62, 90],
  2647. [6, 28, 50, 72, 94],
  2648. [6, 26, 50, 74, 98],
  2649. [6, 30, 54, 78, 102],
  2650. [6, 28, 54, 80, 106],
  2651. [6, 32, 58, 84, 110],
  2652. [6, 30, 58, 86, 114],
  2653. [6, 34, 62, 90, 118],
  2654. [6, 26, 50, 74, 98, 122],
  2655. [6, 30, 54, 78, 102, 126],
  2656. [6, 26, 52, 78, 104, 130],
  2657. [6, 30, 56, 82, 108, 134],
  2658. [6, 34, 60, 86, 112, 138],
  2659. [6, 30, 58, 86, 114, 142],
  2660. [6, 34, 62, 90, 118, 146],
  2661. [6, 30, 54, 78, 102, 126, 150],
  2662. [6, 24, 50, 76, 102, 128, 154],
  2663. [6, 28, 54, 80, 106, 132, 158],
  2664. [6, 32, 58, 84, 110, 136, 162],
  2665. [6, 26, 54, 82, 110, 138, 166],
  2666. [6, 30, 58, 86, 114, 142, 170]],
  2667. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  2668. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  2669. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  2670. /*
  2671. BCH编码格式信息
  2672. */
  2673. getBCHTypeInfo: function getBCHTypeInfo(data) {
  2674. var d = data << 10;
  2675. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  2676. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  2677. }
  2678. return (data << 10 | d) ^ QRUtil.G15_MASK;
  2679. },
  2680. /*
  2681. BCH编码版本信息
  2682. */
  2683. getBCHTypeNumber: function getBCHTypeNumber(data) {
  2684. var d = data << 12;
  2685. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  2686. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  2687. }
  2688. return data << 12 | d;
  2689. },
  2690. /*
  2691. 获取BCH位信息
  2692. */
  2693. getBCHDigit: function getBCHDigit(data) {
  2694. var digit = 0;
  2695. while (data != 0) {
  2696. digit++;
  2697. data >>>= 1;
  2698. }
  2699. return digit;
  2700. },
  2701. /*
  2702. 获取版本对应的矫正图形位置
  2703. */
  2704. getPatternPosition: function getPatternPosition(typeNumber) {
  2705. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  2706. },
  2707. /*
  2708. 掩膜算法
  2709. */
  2710. getMask: function getMask(maskPattern, i, j) {
  2711. switch (maskPattern) {
  2712. case QRMaskPattern.PATTERN000:
  2713. return (i + j) % 2 == 0;
  2714. case QRMaskPattern.PATTERN001:
  2715. return i % 2 == 0;
  2716. case QRMaskPattern.PATTERN010:
  2717. return j % 3 == 0;
  2718. case QRMaskPattern.PATTERN011:
  2719. return (i + j) % 3 == 0;
  2720. case QRMaskPattern.PATTERN100:
  2721. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  2722. case QRMaskPattern.PATTERN101:
  2723. return i * j % 2 + i * j % 3 == 0;
  2724. case QRMaskPattern.PATTERN110:
  2725. return (i * j % 2 + i * j % 3) % 2 == 0;
  2726. case QRMaskPattern.PATTERN111:
  2727. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  2728. default:
  2729. throw new Error("bad maskPattern:" + maskPattern);}
  2730. },
  2731. /*
  2732. 获取RS的纠错多项式
  2733. */
  2734. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  2735. var a = new QRPolynomial([1], 0);
  2736. for (var i = 0; i < errorCorrectLength; i++) {
  2737. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  2738. }
  2739. return a;
  2740. },
  2741. /*
  2742. 获取评价
  2743. */
  2744. getLostPoint: function getLostPoint(qrCode) {
  2745. var moduleCount = qrCode.getModuleCount(),
  2746. lostPoint = 0,
  2747. darkCount = 0;
  2748. for (var row = 0; row < moduleCount; row++) {
  2749. var sameCount = 0;
  2750. var head = qrCode.modules[row][0];
  2751. for (var col = 0; col < moduleCount; col++) {
  2752. var current = qrCode.modules[row][col];
  2753. //level 3 评价
  2754. if (col < moduleCount - 6) {
  2755. 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]) {
  2756. if (col < moduleCount - 10) {
  2757. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  2758. lostPoint += 40;
  2759. }
  2760. } else if (col > 3) {
  2761. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  2762. lostPoint += 40;
  2763. }
  2764. }
  2765. }
  2766. }
  2767. //level 2 评价
  2768. if (row < moduleCount - 1 && col < moduleCount - 1) {
  2769. var count = 0;
  2770. if (current) count++;
  2771. if (qrCode.modules[row + 1][col]) count++;
  2772. if (qrCode.modules[row][col + 1]) count++;
  2773. if (qrCode.modules[row + 1][col + 1]) count++;
  2774. if (count == 0 || count == 4) {
  2775. lostPoint += 3;
  2776. }
  2777. }
  2778. //level 1 评价
  2779. if (head ^ current) {
  2780. sameCount++;
  2781. } else {
  2782. head = current;
  2783. if (sameCount >= 5) {
  2784. lostPoint += 3 + sameCount - 5;
  2785. }
  2786. sameCount = 1;
  2787. }
  2788. //level 4 评价
  2789. if (current) {
  2790. darkCount++;
  2791. }
  2792. }
  2793. }
  2794. for (var col = 0; col < moduleCount; col++) {
  2795. var sameCount = 0;
  2796. var head = qrCode.modules[0][col];
  2797. for (var row = 0; row < moduleCount; row++) {
  2798. var current = qrCode.modules[row][col];
  2799. //level 3 评价
  2800. if (row < moduleCount - 6) {
  2801. 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]) {
  2802. if (row < moduleCount - 10) {
  2803. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  2804. lostPoint += 40;
  2805. }
  2806. } else if (row > 3) {
  2807. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  2808. lostPoint += 40;
  2809. }
  2810. }
  2811. }
  2812. }
  2813. //level 1 评价
  2814. if (head ^ current) {
  2815. sameCount++;
  2816. } else {
  2817. head = current;
  2818. if (sameCount >= 5) {
  2819. lostPoint += 3 + sameCount - 5;
  2820. }
  2821. sameCount = 1;
  2822. }
  2823. }
  2824. }
  2825. // LEVEL4
  2826. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  2827. lostPoint += ratio * 10;
  2828. return lostPoint;
  2829. } };
  2830. //---------------------------------------------------------------------
  2831. // QRMath使用的数学工具
  2832. //---------------------------------------------------------------------
  2833. var QRMath = {
  2834. /*
  2835. 将n转化为a^m
  2836. */
  2837. glog: function glog(n) {
  2838. if (n < 1) {
  2839. throw new Error("glog(" + n + ")");
  2840. }
  2841. return QRMath.LOG_TABLE[n];
  2842. },
  2843. /*
  2844. 将a^m转化为n
  2845. */
  2846. gexp: function gexp(n) {
  2847. while (n < 0) {
  2848. n += 255;
  2849. }
  2850. while (n >= 256) {
  2851. n -= 255;
  2852. }
  2853. return QRMath.EXP_TABLE[n];
  2854. },
  2855. EXP_TABLE: new Array(256),
  2856. LOG_TABLE: new Array(256) };
  2857. for (var i = 0; i < 8; i++) {
  2858. QRMath.EXP_TABLE[i] = 1 << i;
  2859. }
  2860. for (var i = 8; i < 256; i++) {
  2861. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
  2862. }
  2863. for (var i = 0; i < 255; i++) {
  2864. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  2865. }
  2866. //---------------------------------------------------------------------
  2867. // QRPolynomial 多项式
  2868. //---------------------------------------------------------------------
  2869. /**
  2870. * 多项式类
  2871. * @param {Array} num 系数
  2872. * @param {num} shift a^shift
  2873. */
  2874. function QRPolynomial(num, shift) {
  2875. if (num.length == undefined) {
  2876. throw new Error(num.length + "/" + shift);
  2877. }
  2878. var offset = 0;
  2879. while (offset < num.length && num[offset] == 0) {
  2880. offset++;
  2881. }
  2882. this.num = new Array(num.length - offset + shift);
  2883. for (var i = 0; i < num.length - offset; i++) {
  2884. this.num[i] = num[i + offset];
  2885. }
  2886. }
  2887. QRPolynomial.prototype = {
  2888. get: function get(index) {
  2889. return this.num[index];
  2890. },
  2891. getLength: function getLength() {
  2892. return this.num.length;
  2893. },
  2894. /**
  2895. * 多项式乘法
  2896. * @param {QRPolynomial} e 被乘多项式
  2897. * @return {[type]} [description]
  2898. */
  2899. multiply: function multiply(e) {
  2900. var num = new Array(this.getLength() + e.getLength() - 1);
  2901. for (var i = 0; i < this.getLength(); i++) {
  2902. for (var j = 0; j < e.getLength(); j++) {
  2903. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  2904. }
  2905. }
  2906. return new QRPolynomial(num, 0);
  2907. },
  2908. /**
  2909. * 多项式模运算
  2910. * @param {QRPolynomial} e 模多项式
  2911. * @return {}
  2912. */
  2913. mod: function mod(e) {
  2914. var tl = this.getLength(),
  2915. el = e.getLength();
  2916. if (tl - el < 0) {
  2917. return this;
  2918. }
  2919. var num = new Array(tl);
  2920. for (var i = 0; i < tl; i++) {
  2921. num[i] = this.get(i);
  2922. }
  2923. while (num.length >= el) {
  2924. var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
  2925. for (var i = 0; i < e.getLength(); i++) {
  2926. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  2927. }
  2928. while (num[0] == 0) {
  2929. num.shift();
  2930. }
  2931. }
  2932. return new QRPolynomial(num, 0);
  2933. } };
  2934. //---------------------------------------------------------------------
  2935. // RS_BLOCK_TABLE
  2936. //---------------------------------------------------------------------
  2937. /*
  2938. 二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
  2939. */
  2940. var RS_BLOCK_TABLE = [
  2941. // L
  2942. // M
  2943. // Q
  2944. // H
  2945. // 1
  2946. [1, 26, 19],
  2947. [1, 26, 16],
  2948. [1, 26, 13],
  2949. [1, 26, 9],
  2950. // 2
  2951. [1, 44, 34],
  2952. [1, 44, 28],
  2953. [1, 44, 22],
  2954. [1, 44, 16],
  2955. // 3
  2956. [1, 70, 55],
  2957. [1, 70, 44],
  2958. [2, 35, 17],
  2959. [2, 35, 13],
  2960. // 4
  2961. [1, 100, 80],
  2962. [2, 50, 32],
  2963. [2, 50, 24],
  2964. [4, 25, 9],
  2965. // 5
  2966. [1, 134, 108],
  2967. [2, 67, 43],
  2968. [2, 33, 15, 2, 34, 16],
  2969. [2, 33, 11, 2, 34, 12],
  2970. // 6
  2971. [2, 86, 68],
  2972. [4, 43, 27],
  2973. [4, 43, 19],
  2974. [4, 43, 15],
  2975. // 7
  2976. [2, 98, 78],
  2977. [4, 49, 31],
  2978. [2, 32, 14, 4, 33, 15],
  2979. [4, 39, 13, 1, 40, 14],
  2980. // 8
  2981. [2, 121, 97],
  2982. [2, 60, 38, 2, 61, 39],
  2983. [4, 40, 18, 2, 41, 19],
  2984. [4, 40, 14, 2, 41, 15],
  2985. // 9
  2986. [2, 146, 116],
  2987. [3, 58, 36, 2, 59, 37],
  2988. [4, 36, 16, 4, 37, 17],
  2989. [4, 36, 12, 4, 37, 13],
  2990. // 10
  2991. [2, 86, 68, 2, 87, 69],
  2992. [4, 69, 43, 1, 70, 44],
  2993. [6, 43, 19, 2, 44, 20],
  2994. [6, 43, 15, 2, 44, 16],
  2995. // 11
  2996. [4, 101, 81],
  2997. [1, 80, 50, 4, 81, 51],
  2998. [4, 50, 22, 4, 51, 23],
  2999. [3, 36, 12, 8, 37, 13],
  3000. // 12
  3001. [2, 116, 92, 2, 117, 93],
  3002. [6, 58, 36, 2, 59, 37],
  3003. [4, 46, 20, 6, 47, 21],
  3004. [7, 42, 14, 4, 43, 15],
  3005. // 13
  3006. [4, 133, 107],
  3007. [8, 59, 37, 1, 60, 38],
  3008. [8, 44, 20, 4, 45, 21],
  3009. [12, 33, 11, 4, 34, 12],
  3010. // 14
  3011. [3, 145, 115, 1, 146, 116],
  3012. [4, 64, 40, 5, 65, 41],
  3013. [11, 36, 16, 5, 37, 17],
  3014. [11, 36, 12, 5, 37, 13],
  3015. // 15
  3016. [5, 109, 87, 1, 110, 88],
  3017. [5, 65, 41, 5, 66, 42],
  3018. [5, 54, 24, 7, 55, 25],
  3019. [11, 36, 12],
  3020. // 16
  3021. [5, 122, 98, 1, 123, 99],
  3022. [7, 73, 45, 3, 74, 46],
  3023. [15, 43, 19, 2, 44, 20],
  3024. [3, 45, 15, 13, 46, 16],
  3025. // 17
  3026. [1, 135, 107, 5, 136, 108],
  3027. [10, 74, 46, 1, 75, 47],
  3028. [1, 50, 22, 15, 51, 23],
  3029. [2, 42, 14, 17, 43, 15],
  3030. // 18
  3031. [5, 150, 120, 1, 151, 121],
  3032. [9, 69, 43, 4, 70, 44],
  3033. [17, 50, 22, 1, 51, 23],
  3034. [2, 42, 14, 19, 43, 15],
  3035. // 19
  3036. [3, 141, 113, 4, 142, 114],
  3037. [3, 70, 44, 11, 71, 45],
  3038. [17, 47, 21, 4, 48, 22],
  3039. [9, 39, 13, 16, 40, 14],
  3040. // 20
  3041. [3, 135, 107, 5, 136, 108],
  3042. [3, 67, 41, 13, 68, 42],
  3043. [15, 54, 24, 5, 55, 25],
  3044. [15, 43, 15, 10, 44, 16],
  3045. // 21
  3046. [4, 144, 116, 4, 145, 117],
  3047. [17, 68, 42],
  3048. [17, 50, 22, 6, 51, 23],
  3049. [19, 46, 16, 6, 47, 17],
  3050. // 22
  3051. [2, 139, 111, 7, 140, 112],
  3052. [17, 74, 46],
  3053. [7, 54, 24, 16, 55, 25],
  3054. [34, 37, 13],
  3055. // 23
  3056. [4, 151, 121, 5, 152, 122],
  3057. [4, 75, 47, 14, 76, 48],
  3058. [11, 54, 24, 14, 55, 25],
  3059. [16, 45, 15, 14, 46, 16],
  3060. // 24
  3061. [6, 147, 117, 4, 148, 118],
  3062. [6, 73, 45, 14, 74, 46],
  3063. [11, 54, 24, 16, 55, 25],
  3064. [30, 46, 16, 2, 47, 17],
  3065. // 25
  3066. [8, 132, 106, 4, 133, 107],
  3067. [8, 75, 47, 13, 76, 48],
  3068. [7, 54, 24, 22, 55, 25],
  3069. [22, 45, 15, 13, 46, 16],
  3070. // 26
  3071. [10, 142, 114, 2, 143, 115],
  3072. [19, 74, 46, 4, 75, 47],
  3073. [28, 50, 22, 6, 51, 23],
  3074. [33, 46, 16, 4, 47, 17],
  3075. // 27
  3076. [8, 152, 122, 4, 153, 123],
  3077. [22, 73, 45, 3, 74, 46],
  3078. [8, 53, 23, 26, 54, 24],
  3079. [12, 45, 15, 28, 46, 16],
  3080. // 28
  3081. [3, 147, 117, 10, 148, 118],
  3082. [3, 73, 45, 23, 74, 46],
  3083. [4, 54, 24, 31, 55, 25],
  3084. [11, 45, 15, 31, 46, 16],
  3085. // 29
  3086. [7, 146, 116, 7, 147, 117],
  3087. [21, 73, 45, 7, 74, 46],
  3088. [1, 53, 23, 37, 54, 24],
  3089. [19, 45, 15, 26, 46, 16],
  3090. // 30
  3091. [5, 145, 115, 10, 146, 116],
  3092. [19, 75, 47, 10, 76, 48],
  3093. [15, 54, 24, 25, 55, 25],
  3094. [23, 45, 15, 25, 46, 16],
  3095. // 31
  3096. [13, 145, 115, 3, 146, 116],
  3097. [2, 74, 46, 29, 75, 47],
  3098. [42, 54, 24, 1, 55, 25],
  3099. [23, 45, 15, 28, 46, 16],
  3100. // 32
  3101. [17, 145, 115],
  3102. [10, 74, 46, 23, 75, 47],
  3103. [10, 54, 24, 35, 55, 25],
  3104. [19, 45, 15, 35, 46, 16],
  3105. // 33
  3106. [17, 145, 115, 1, 146, 116],
  3107. [14, 74, 46, 21, 75, 47],
  3108. [29, 54, 24, 19, 55, 25],
  3109. [11, 45, 15, 46, 46, 16],
  3110. // 34
  3111. [13, 145, 115, 6, 146, 116],
  3112. [14, 74, 46, 23, 75, 47],
  3113. [44, 54, 24, 7, 55, 25],
  3114. [59, 46, 16, 1, 47, 17],
  3115. // 35
  3116. [12, 151, 121, 7, 152, 122],
  3117. [12, 75, 47, 26, 76, 48],
  3118. [39, 54, 24, 14, 55, 25],
  3119. [22, 45, 15, 41, 46, 16],
  3120. // 36
  3121. [6, 151, 121, 14, 152, 122],
  3122. [6, 75, 47, 34, 76, 48],
  3123. [46, 54, 24, 10, 55, 25],
  3124. [2, 45, 15, 64, 46, 16],
  3125. // 37
  3126. [17, 152, 122, 4, 153, 123],
  3127. [29, 74, 46, 14, 75, 47],
  3128. [49, 54, 24, 10, 55, 25],
  3129. [24, 45, 15, 46, 46, 16],
  3130. // 38
  3131. [4, 152, 122, 18, 153, 123],
  3132. [13, 74, 46, 32, 75, 47],
  3133. [48, 54, 24, 14, 55, 25],
  3134. [42, 45, 15, 32, 46, 16],
  3135. // 39
  3136. [20, 147, 117, 4, 148, 118],
  3137. [40, 75, 47, 7, 76, 48],
  3138. [43, 54, 24, 22, 55, 25],
  3139. [10, 45, 15, 67, 46, 16],
  3140. // 40
  3141. [19, 148, 118, 6, 149, 119],
  3142. [18, 75, 47, 31, 76, 48],
  3143. [34, 54, 24, 34, 55, 25],
  3144. [20, 45, 15, 61, 46, 16]];
  3145. /**
  3146. * 根据数据获取对应版本
  3147. * @return {[type]} [description]
  3148. */
  3149. QRCodeAlg.prototype.getRightType = function () {
  3150. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  3151. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  3152. if (rsBlock == undefined) {
  3153. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  3154. }
  3155. var length = rsBlock.length / 3;
  3156. var totalDataCount = 0;
  3157. for (var i = 0; i < length; i++) {
  3158. var count = rsBlock[i * 3 + 0];
  3159. var dataCount = rsBlock[i * 3 + 2];
  3160. totalDataCount += dataCount * count;
  3161. }
  3162. var lengthBytes = typeNumber > 9 ? 2 : 1;
  3163. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  3164. this.typeNumber = typeNumber;
  3165. this.rsBlock = rsBlock;
  3166. this.totalDataCount = totalDataCount;
  3167. break;
  3168. }
  3169. }
  3170. };
  3171. //---------------------------------------------------------------------
  3172. // QRBitBuffer
  3173. //---------------------------------------------------------------------
  3174. function QRBitBuffer() {
  3175. this.buffer = new Array();
  3176. this.length = 0;
  3177. }
  3178. QRBitBuffer.prototype = {
  3179. get: function get(index) {
  3180. var bufIndex = Math.floor(index / 8);
  3181. return this.buffer[bufIndex] >>> 7 - index % 8 & 1;
  3182. },
  3183. put: function put(num, length) {
  3184. for (var i = 0; i < length; i++) {
  3185. this.putBit(num >>> length - i - 1 & 1);
  3186. }
  3187. },
  3188. putBit: function putBit(bit) {
  3189. var bufIndex = Math.floor(this.length / 8);
  3190. if (this.buffer.length <= bufIndex) {
  3191. this.buffer.push(0);
  3192. }
  3193. if (bit) {
  3194. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  3195. }
  3196. this.length++;
  3197. } };
  3198. // xzedit
  3199. var qrcodeAlgObjCache = [];
  3200. /**
  3201. * 二维码构造函数,主要用于绘制
  3202. * @param {参数列表} opt 传递参数
  3203. * @return {}
  3204. */
  3205. QRCode = function QRCode(opt) {
  3206. //设置默认参数
  3207. this.options = {
  3208. text: '',
  3209. size: 256,
  3210. correctLevel: 3,
  3211. background: '#ffffff',
  3212. foreground: '#000000',
  3213. pdground: '#000000',
  3214. image: '',
  3215. imageSize: 30,
  3216. canvasId: opt.canvasId,
  3217. context: opt.context,
  3218. usingComponents: opt.usingComponents,
  3219. showLoading: opt.showLoading,
  3220. loadingText: opt.loadingText };
  3221. if (typeof opt === 'string') {// 只编码ASCII字符串
  3222. opt = {
  3223. text: opt };
  3224. }
  3225. if (opt) {
  3226. for (var i in opt) {
  3227. this.options[i] = opt[i];
  3228. }
  3229. }
  3230. //使用QRCodeAlg创建二维码结构
  3231. var qrCodeAlg = null;
  3232. for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
  3233. if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
  3234. qrCodeAlg = qrcodeAlgObjCache[i].obj;
  3235. break;
  3236. }
  3237. }
  3238. if (i == l) {
  3239. qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
  3240. qrcodeAlgObjCache.push({
  3241. text: this.options.text,
  3242. correctLevel: this.options.correctLevel,
  3243. obj: qrCodeAlg });
  3244. }
  3245. /**
  3246. * 计算矩阵点的前景色
  3247. * @param {Obj} config
  3248. * @param {Number} config.row 点x坐标
  3249. * @param {Number} config.col 点y坐标
  3250. * @param {Number} config.count 矩阵大小
  3251. * @param {Number} config.options 组件的options
  3252. * @return {String}
  3253. */
  3254. var getForeGround = function getForeGround(config) {
  3255. var options = config.options;
  3256. if (options.pdground && (
  3257. config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 ||
  3258. config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 ||
  3259. config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2))
  3260. {
  3261. return options.pdground;
  3262. }
  3263. return options.foreground;
  3264. };
  3265. // 创建canvas
  3266. var createCanvas = function createCanvas(options) {
  3267. if (options.showLoading) {
  3268. uni.showLoading({
  3269. title: options.loadingText,
  3270. mask: true });
  3271. }
  3272. var ctx = uni.createCanvasContext(options.canvasId, options.context);
  3273. var count = qrCodeAlg.getModuleCount();
  3274. var ratioSize = options.size;
  3275. var ratioImgSize = options.imageSize;
  3276. //计算每个点的长宽
  3277. var tileW = (ratioSize / count).toPrecision(4);
  3278. var tileH = (ratioSize / count).toPrecision(4);
  3279. //绘制
  3280. for (var row = 0; row < count; row++) {
  3281. for (var col = 0; col < count; col++) {
  3282. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  3283. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  3284. var foreground = getForeGround({
  3285. row: row,
  3286. col: col,
  3287. count: count,
  3288. options: options });
  3289. ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
  3290. ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
  3291. }
  3292. }
  3293. if (options.image) {
  3294. // 画圆角矩形
  3295. var drawRoundedRect = function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
  3296. ctxi.setLineWidth(lineWidth);
  3297. ctxi.setFillStyle(options.background);
  3298. ctxi.setStrokeStyle(options.background);
  3299. ctxi.beginPath(); // draw top and top right corner
  3300. ctxi.moveTo(x + r, y);
  3301. ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
  3302. ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
  3303. ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
  3304. ctxi.arcTo(x, y, x + r, y, r);
  3305. ctxi.closePath();
  3306. if (fill) {
  3307. ctxi.fill();
  3308. }
  3309. if (stroke) {
  3310. ctxi.stroke();
  3311. }
  3312. };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);
  3313. }
  3314. setTimeout(function () {
  3315. ctx.draw(true, function () {
  3316. // 保存到临时区域
  3317. setTimeout(function () {
  3318. uni.canvasToTempFilePath({
  3319. width: options.width,
  3320. height: options.height,
  3321. destWidth: options.width,
  3322. destHeight: options.height,
  3323. canvasId: options.canvasId,
  3324. quality: Number(1),
  3325. success: function success(res) {
  3326. if (options.cbResult) {
  3327. options.cbResult(res.tempFilePath);
  3328. }
  3329. },
  3330. fail: function fail(res) {
  3331. if (options.cbResult) {
  3332. options.cbResult(res);
  3333. }
  3334. },
  3335. complete: function complete() {
  3336. if (options.showLoading) {
  3337. uni.hideLoading();
  3338. }
  3339. } },
  3340. options.context);
  3341. }, options.text.length + 100);
  3342. });
  3343. }, options.usingComponents ? 0 : 150);
  3344. };
  3345. createCanvas(this.options);
  3346. // 空判定
  3347. var empty = function empty(v) {
  3348. var tp = typeof v,
  3349. rt = false;
  3350. if (tp == "number" && String(v) == "") {
  3351. rt = true;
  3352. } else if (tp == "undefined") {
  3353. rt = true;
  3354. } else if (tp == "object") {
  3355. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true;
  3356. } else if (tp == "string") {
  3357. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true;
  3358. } else if (tp == "function") {
  3359. rt = false;
  3360. }
  3361. return rt;
  3362. };
  3363. };
  3364. QRCode.prototype.clear = function (fn) {
  3365. var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context);
  3366. ctx.clearRect(0, 0, this.options.size, this.options.size);
  3367. ctx.draw(false, function () {
  3368. if (fn) {
  3369. fn();
  3370. }
  3371. });
  3372. };
  3373. })();var _default =
  3374. QRCode;exports.default = _default;
  3375. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3376. /***/ }),
  3377. /***/ 3:
  3378. /*!******************************************************************************************!*\
  3379. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3380. \******************************************************************************************/
  3381. /*! exports provided: default */
  3382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3383. "use strict";
  3384. __webpack_require__.r(__webpack_exports__);
  3385. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3386. * Vue.js v2.6.11
  3387. * (c) 2014-2021 Evan You
  3388. * Released under the MIT License.
  3389. */
  3390. /* */
  3391. var emptyObject = Object.freeze({});
  3392. // These helpers produce better VM code in JS engines due to their
  3393. // explicitness and function inlining.
  3394. function isUndef (v) {
  3395. return v === undefined || v === null
  3396. }
  3397. function isDef (v) {
  3398. return v !== undefined && v !== null
  3399. }
  3400. function isTrue (v) {
  3401. return v === true
  3402. }
  3403. function isFalse (v) {
  3404. return v === false
  3405. }
  3406. /**
  3407. * Check if value is primitive.
  3408. */
  3409. function isPrimitive (value) {
  3410. return (
  3411. typeof value === 'string' ||
  3412. typeof value === 'number' ||
  3413. // $flow-disable-line
  3414. typeof value === 'symbol' ||
  3415. typeof value === 'boolean'
  3416. )
  3417. }
  3418. /**
  3419. * Quick object check - this is primarily used to tell
  3420. * Objects from primitive values when we know the value
  3421. * is a JSON-compliant type.
  3422. */
  3423. function isObject (obj) {
  3424. return obj !== null && typeof obj === 'object'
  3425. }
  3426. /**
  3427. * Get the raw type string of a value, e.g., [object Object].
  3428. */
  3429. var _toString = Object.prototype.toString;
  3430. function toRawType (value) {
  3431. return _toString.call(value).slice(8, -1)
  3432. }
  3433. /**
  3434. * Strict object type check. Only returns true
  3435. * for plain JavaScript objects.
  3436. */
  3437. function isPlainObject (obj) {
  3438. return _toString.call(obj) === '[object Object]'
  3439. }
  3440. function isRegExp (v) {
  3441. return _toString.call(v) === '[object RegExp]'
  3442. }
  3443. /**
  3444. * Check if val is a valid array index.
  3445. */
  3446. function isValidArrayIndex (val) {
  3447. var n = parseFloat(String(val));
  3448. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3449. }
  3450. function isPromise (val) {
  3451. return (
  3452. isDef(val) &&
  3453. typeof val.then === 'function' &&
  3454. typeof val.catch === 'function'
  3455. )
  3456. }
  3457. /**
  3458. * Convert a value to a string that is actually rendered.
  3459. */
  3460. function toString (val) {
  3461. return val == null
  3462. ? ''
  3463. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3464. ? JSON.stringify(val, null, 2)
  3465. : String(val)
  3466. }
  3467. /**
  3468. * Convert an input value to a number for persistence.
  3469. * If the conversion fails, return original string.
  3470. */
  3471. function toNumber (val) {
  3472. var n = parseFloat(val);
  3473. return isNaN(n) ? val : n
  3474. }
  3475. /**
  3476. * Make a map and return a function for checking if a key
  3477. * is in that map.
  3478. */
  3479. function makeMap (
  3480. str,
  3481. expectsLowerCase
  3482. ) {
  3483. var map = Object.create(null);
  3484. var list = str.split(',');
  3485. for (var i = 0; i < list.length; i++) {
  3486. map[list[i]] = true;
  3487. }
  3488. return expectsLowerCase
  3489. ? function (val) { return map[val.toLowerCase()]; }
  3490. : function (val) { return map[val]; }
  3491. }
  3492. /**
  3493. * Check if a tag is a built-in tag.
  3494. */
  3495. var isBuiltInTag = makeMap('slot,component', true);
  3496. /**
  3497. * Check if an attribute is a reserved attribute.
  3498. */
  3499. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3500. /**
  3501. * Remove an item from an array.
  3502. */
  3503. function remove (arr, item) {
  3504. if (arr.length) {
  3505. var index = arr.indexOf(item);
  3506. if (index > -1) {
  3507. return arr.splice(index, 1)
  3508. }
  3509. }
  3510. }
  3511. /**
  3512. * Check whether an object has the property.
  3513. */
  3514. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3515. function hasOwn (obj, key) {
  3516. return hasOwnProperty.call(obj, key)
  3517. }
  3518. /**
  3519. * Create a cached version of a pure function.
  3520. */
  3521. function cached (fn) {
  3522. var cache = Object.create(null);
  3523. return (function cachedFn (str) {
  3524. var hit = cache[str];
  3525. return hit || (cache[str] = fn(str))
  3526. })
  3527. }
  3528. /**
  3529. * Camelize a hyphen-delimited string.
  3530. */
  3531. var camelizeRE = /-(\w)/g;
  3532. var camelize = cached(function (str) {
  3533. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3534. });
  3535. /**
  3536. * Capitalize a string.
  3537. */
  3538. var capitalize = cached(function (str) {
  3539. return str.charAt(0).toUpperCase() + str.slice(1)
  3540. });
  3541. /**
  3542. * Hyphenate a camelCase string.
  3543. */
  3544. var hyphenateRE = /\B([A-Z])/g;
  3545. var hyphenate = cached(function (str) {
  3546. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3547. });
  3548. /**
  3549. * Simple bind polyfill for environments that do not support it,
  3550. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3551. * since native bind is now performant enough in most browsers.
  3552. * But removing it would mean breaking code that was able to run in
  3553. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3554. */
  3555. /* istanbul ignore next */
  3556. function polyfillBind (fn, ctx) {
  3557. function boundFn (a) {
  3558. var l = arguments.length;
  3559. return l
  3560. ? l > 1
  3561. ? fn.apply(ctx, arguments)
  3562. : fn.call(ctx, a)
  3563. : fn.call(ctx)
  3564. }
  3565. boundFn._length = fn.length;
  3566. return boundFn
  3567. }
  3568. function nativeBind (fn, ctx) {
  3569. return fn.bind(ctx)
  3570. }
  3571. var bind = Function.prototype.bind
  3572. ? nativeBind
  3573. : polyfillBind;
  3574. /**
  3575. * Convert an Array-like object to a real Array.
  3576. */
  3577. function toArray (list, start) {
  3578. start = start || 0;
  3579. var i = list.length - start;
  3580. var ret = new Array(i);
  3581. while (i--) {
  3582. ret[i] = list[i + start];
  3583. }
  3584. return ret
  3585. }
  3586. /**
  3587. * Mix properties into target object.
  3588. */
  3589. function extend (to, _from) {
  3590. for (var key in _from) {
  3591. to[key] = _from[key];
  3592. }
  3593. return to
  3594. }
  3595. /**
  3596. * Merge an Array of Objects into a single Object.
  3597. */
  3598. function toObject (arr) {
  3599. var res = {};
  3600. for (var i = 0; i < arr.length; i++) {
  3601. if (arr[i]) {
  3602. extend(res, arr[i]);
  3603. }
  3604. }
  3605. return res
  3606. }
  3607. /* eslint-disable no-unused-vars */
  3608. /**
  3609. * Perform no operation.
  3610. * Stubbing args to make Flow happy without leaving useless transpiled code
  3611. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3612. */
  3613. function noop (a, b, c) {}
  3614. /**
  3615. * Always return false.
  3616. */
  3617. var no = function (a, b, c) { return false; };
  3618. /* eslint-enable no-unused-vars */
  3619. /**
  3620. * Return the same value.
  3621. */
  3622. var identity = function (_) { return _; };
  3623. /**
  3624. * Check if two values are loosely equal - that is,
  3625. * if they are plain objects, do they have the same shape?
  3626. */
  3627. function looseEqual (a, b) {
  3628. if (a === b) { return true }
  3629. var isObjectA = isObject(a);
  3630. var isObjectB = isObject(b);
  3631. if (isObjectA && isObjectB) {
  3632. try {
  3633. var isArrayA = Array.isArray(a);
  3634. var isArrayB = Array.isArray(b);
  3635. if (isArrayA && isArrayB) {
  3636. return a.length === b.length && a.every(function (e, i) {
  3637. return looseEqual(e, b[i])
  3638. })
  3639. } else if (a instanceof Date && b instanceof Date) {
  3640. return a.getTime() === b.getTime()
  3641. } else if (!isArrayA && !isArrayB) {
  3642. var keysA = Object.keys(a);
  3643. var keysB = Object.keys(b);
  3644. return keysA.length === keysB.length && keysA.every(function (key) {
  3645. return looseEqual(a[key], b[key])
  3646. })
  3647. } else {
  3648. /* istanbul ignore next */
  3649. return false
  3650. }
  3651. } catch (e) {
  3652. /* istanbul ignore next */
  3653. return false
  3654. }
  3655. } else if (!isObjectA && !isObjectB) {
  3656. return String(a) === String(b)
  3657. } else {
  3658. return false
  3659. }
  3660. }
  3661. /**
  3662. * Return the first index at which a loosely equal value can be
  3663. * found in the array (if value is a plain object, the array must
  3664. * contain an object of the same shape), or -1 if it is not present.
  3665. */
  3666. function looseIndexOf (arr, val) {
  3667. for (var i = 0; i < arr.length; i++) {
  3668. if (looseEqual(arr[i], val)) { return i }
  3669. }
  3670. return -1
  3671. }
  3672. /**
  3673. * Ensure a function is called only once.
  3674. */
  3675. function once (fn) {
  3676. var called = false;
  3677. return function () {
  3678. if (!called) {
  3679. called = true;
  3680. fn.apply(this, arguments);
  3681. }
  3682. }
  3683. }
  3684. var ASSET_TYPES = [
  3685. 'component',
  3686. 'directive',
  3687. 'filter'
  3688. ];
  3689. var LIFECYCLE_HOOKS = [
  3690. 'beforeCreate',
  3691. 'created',
  3692. 'beforeMount',
  3693. 'mounted',
  3694. 'beforeUpdate',
  3695. 'updated',
  3696. 'beforeDestroy',
  3697. 'destroyed',
  3698. 'activated',
  3699. 'deactivated',
  3700. 'errorCaptured',
  3701. 'serverPrefetch'
  3702. ];
  3703. /* */
  3704. var config = ({
  3705. /**
  3706. * Option merge strategies (used in core/util/options)
  3707. */
  3708. // $flow-disable-line
  3709. optionMergeStrategies: Object.create(null),
  3710. /**
  3711. * Whether to suppress warnings.
  3712. */
  3713. silent: false,
  3714. /**
  3715. * Show production mode tip message on boot?
  3716. */
  3717. productionTip: "development" !== 'production',
  3718. /**
  3719. * Whether to enable devtools
  3720. */
  3721. devtools: "development" !== 'production',
  3722. /**
  3723. * Whether to record perf
  3724. */
  3725. performance: false,
  3726. /**
  3727. * Error handler for watcher errors
  3728. */
  3729. errorHandler: null,
  3730. /**
  3731. * Warn handler for watcher warns
  3732. */
  3733. warnHandler: null,
  3734. /**
  3735. * Ignore certain custom elements
  3736. */
  3737. ignoredElements: [],
  3738. /**
  3739. * Custom user key aliases for v-on
  3740. */
  3741. // $flow-disable-line
  3742. keyCodes: Object.create(null),
  3743. /**
  3744. * Check if a tag is reserved so that it cannot be registered as a
  3745. * component. This is platform-dependent and may be overwritten.
  3746. */
  3747. isReservedTag: no,
  3748. /**
  3749. * Check if an attribute is reserved so that it cannot be used as a component
  3750. * prop. This is platform-dependent and may be overwritten.
  3751. */
  3752. isReservedAttr: no,
  3753. /**
  3754. * Check if a tag is an unknown element.
  3755. * Platform-dependent.
  3756. */
  3757. isUnknownElement: no,
  3758. /**
  3759. * Get the namespace of an element
  3760. */
  3761. getTagNamespace: noop,
  3762. /**
  3763. * Parse the real tag name for the specific platform.
  3764. */
  3765. parsePlatformTagName: identity,
  3766. /**
  3767. * Check if an attribute must be bound using property, e.g. value
  3768. * Platform-dependent.
  3769. */
  3770. mustUseProp: no,
  3771. /**
  3772. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3773. * This will significantly reduce performance if set to false.
  3774. */
  3775. async: true,
  3776. /**
  3777. * Exposed for legacy reasons
  3778. */
  3779. _lifecycleHooks: LIFECYCLE_HOOKS
  3780. });
  3781. /* */
  3782. /**
  3783. * unicode letters used for parsing html tags, component names and property paths.
  3784. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3785. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3786. */
  3787. 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/;
  3788. /**
  3789. * Check if a string starts with $ or _
  3790. */
  3791. function isReserved (str) {
  3792. var c = (str + '').charCodeAt(0);
  3793. return c === 0x24 || c === 0x5F
  3794. }
  3795. /**
  3796. * Define a property.
  3797. */
  3798. function def (obj, key, val, enumerable) {
  3799. Object.defineProperty(obj, key, {
  3800. value: val,
  3801. enumerable: !!enumerable,
  3802. writable: true,
  3803. configurable: true
  3804. });
  3805. }
  3806. /**
  3807. * Parse simple path.
  3808. */
  3809. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3810. function parsePath (path) {
  3811. if (bailRE.test(path)) {
  3812. return
  3813. }
  3814. var segments = path.split('.');
  3815. return function (obj) {
  3816. for (var i = 0; i < segments.length; i++) {
  3817. if (!obj) { return }
  3818. obj = obj[segments[i]];
  3819. }
  3820. return obj
  3821. }
  3822. }
  3823. /* */
  3824. // can we use __proto__?
  3825. var hasProto = '__proto__' in {};
  3826. // Browser environment sniffing
  3827. var inBrowser = typeof window !== 'undefined';
  3828. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3829. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3830. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3831. var isIE = UA && /msie|trident/.test(UA);
  3832. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3833. var isEdge = UA && UA.indexOf('edge/') > 0;
  3834. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3835. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3836. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3837. var isPhantomJS = UA && /phantomjs/.test(UA);
  3838. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3839. // Firefox has a "watch" function on Object.prototype...
  3840. var nativeWatch = ({}).watch;
  3841. if (inBrowser) {
  3842. try {
  3843. var opts = {};
  3844. Object.defineProperty(opts, 'passive', ({
  3845. get: function get () {
  3846. }
  3847. })); // https://github.com/facebook/flow/issues/285
  3848. window.addEventListener('test-passive', null, opts);
  3849. } catch (e) {}
  3850. }
  3851. // this needs to be lazy-evaled because vue may be required before
  3852. // vue-server-renderer can set VUE_ENV
  3853. var _isServer;
  3854. var isServerRendering = function () {
  3855. if (_isServer === undefined) {
  3856. /* istanbul ignore if */
  3857. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3858. // detect presence of vue-server-renderer and avoid
  3859. // Webpack shimming the process
  3860. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3861. } else {
  3862. _isServer = false;
  3863. }
  3864. }
  3865. return _isServer
  3866. };
  3867. // detect devtools
  3868. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3869. /* istanbul ignore next */
  3870. function isNative (Ctor) {
  3871. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3872. }
  3873. var hasSymbol =
  3874. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3875. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3876. var _Set;
  3877. /* istanbul ignore if */ // $flow-disable-line
  3878. if (typeof Set !== 'undefined' && isNative(Set)) {
  3879. // use native Set when available.
  3880. _Set = Set;
  3881. } else {
  3882. // a non-standard Set polyfill that only works with primitive keys.
  3883. _Set = /*@__PURE__*/(function () {
  3884. function Set () {
  3885. this.set = Object.create(null);
  3886. }
  3887. Set.prototype.has = function has (key) {
  3888. return this.set[key] === true
  3889. };
  3890. Set.prototype.add = function add (key) {
  3891. this.set[key] = true;
  3892. };
  3893. Set.prototype.clear = function clear () {
  3894. this.set = Object.create(null);
  3895. };
  3896. return Set;
  3897. }());
  3898. }
  3899. /* */
  3900. var warn = noop;
  3901. var tip = noop;
  3902. var generateComponentTrace = (noop); // work around flow check
  3903. var formatComponentName = (noop);
  3904. if (true) {
  3905. var hasConsole = typeof console !== 'undefined';
  3906. var classifyRE = /(?:^|[-_])(\w)/g;
  3907. var classify = function (str) { return str
  3908. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3909. .replace(/[-_]/g, ''); };
  3910. warn = function (msg, vm) {
  3911. var trace = vm ? generateComponentTrace(vm) : '';
  3912. if (config.warnHandler) {
  3913. config.warnHandler.call(null, msg, vm, trace);
  3914. } else if (hasConsole && (!config.silent)) {
  3915. console.error(("[Vue warn]: " + msg + trace));
  3916. }
  3917. };
  3918. tip = function (msg, vm) {
  3919. if (hasConsole && (!config.silent)) {
  3920. console.warn("[Vue tip]: " + msg + (
  3921. vm ? generateComponentTrace(vm) : ''
  3922. ));
  3923. }
  3924. };
  3925. formatComponentName = function (vm, includeFile) {
  3926. if (vm.$root === vm) {
  3927. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3928. return ('') + vm.$options.__file
  3929. }
  3930. return '<Root>'
  3931. }
  3932. var options = typeof vm === 'function' && vm.cid != null
  3933. ? vm.options
  3934. : vm._isVue
  3935. ? vm.$options || vm.constructor.options
  3936. : vm;
  3937. var name = options.name || options._componentTag;
  3938. var file = options.__file;
  3939. if (!name && file) {
  3940. var match = file.match(/([^/\\]+)\.vue$/);
  3941. name = match && match[1];
  3942. }
  3943. return (
  3944. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3945. (file && includeFile !== false ? (" at " + file) : '')
  3946. )
  3947. };
  3948. var repeat = function (str, n) {
  3949. var res = '';
  3950. while (n) {
  3951. if (n % 2 === 1) { res += str; }
  3952. if (n > 1) { str += str; }
  3953. n >>= 1;
  3954. }
  3955. return res
  3956. };
  3957. generateComponentTrace = function (vm) {
  3958. if (vm._isVue && vm.$parent) {
  3959. var tree = [];
  3960. var currentRecursiveSequence = 0;
  3961. while (vm && vm.$options.name !== 'PageBody') {
  3962. if (tree.length > 0) {
  3963. var last = tree[tree.length - 1];
  3964. if (last.constructor === vm.constructor) {
  3965. currentRecursiveSequence++;
  3966. vm = vm.$parent;
  3967. continue
  3968. } else if (currentRecursiveSequence > 0) {
  3969. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3970. currentRecursiveSequence = 0;
  3971. }
  3972. }
  3973. !vm.$options.isReserved && tree.push(vm);
  3974. vm = vm.$parent;
  3975. }
  3976. return '\n\nfound in\n\n' + tree
  3977. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3978. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3979. : formatComponentName(vm))); })
  3980. .join('\n')
  3981. } else {
  3982. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3983. }
  3984. };
  3985. }
  3986. /* */
  3987. var uid = 0;
  3988. /**
  3989. * A dep is an observable that can have multiple
  3990. * directives subscribing to it.
  3991. */
  3992. var Dep = function Dep () {
  3993. this.id = uid++;
  3994. this.subs = [];
  3995. };
  3996. Dep.prototype.addSub = function addSub (sub) {
  3997. this.subs.push(sub);
  3998. };
  3999. Dep.prototype.removeSub = function removeSub (sub) {
  4000. remove(this.subs, sub);
  4001. };
  4002. Dep.prototype.depend = function depend () {
  4003. if (Dep.SharedObject.target) {
  4004. Dep.SharedObject.target.addDep(this);
  4005. }
  4006. };
  4007. Dep.prototype.notify = function notify () {
  4008. // stabilize the subscriber list first
  4009. var subs = this.subs.slice();
  4010. if ( true && !config.async) {
  4011. // subs aren't sorted in scheduler if not running async
  4012. // we need to sort them now to make sure they fire in correct
  4013. // order
  4014. subs.sort(function (a, b) { return a.id - b.id; });
  4015. }
  4016. for (var i = 0, l = subs.length; i < l; i++) {
  4017. subs[i].update();
  4018. }
  4019. };
  4020. // The current target watcher being evaluated.
  4021. // This is globally unique because only one watcher
  4022. // can be evaluated at a time.
  4023. // fixed by xxxxxx (nvue shared vuex)
  4024. /* eslint-disable no-undef */
  4025. Dep.SharedObject = {};
  4026. Dep.SharedObject.target = null;
  4027. Dep.SharedObject.targetStack = [];
  4028. function pushTarget (target) {
  4029. Dep.SharedObject.targetStack.push(target);
  4030. Dep.SharedObject.target = target;
  4031. Dep.target = target;
  4032. }
  4033. function popTarget () {
  4034. Dep.SharedObject.targetStack.pop();
  4035. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4036. Dep.target = Dep.SharedObject.target;
  4037. }
  4038. /* */
  4039. var VNode = function VNode (
  4040. tag,
  4041. data,
  4042. children,
  4043. text,
  4044. elm,
  4045. context,
  4046. componentOptions,
  4047. asyncFactory
  4048. ) {
  4049. this.tag = tag;
  4050. this.data = data;
  4051. this.children = children;
  4052. this.text = text;
  4053. this.elm = elm;
  4054. this.ns = undefined;
  4055. this.context = context;
  4056. this.fnContext = undefined;
  4057. this.fnOptions = undefined;
  4058. this.fnScopeId = undefined;
  4059. this.key = data && data.key;
  4060. this.componentOptions = componentOptions;
  4061. this.componentInstance = undefined;
  4062. this.parent = undefined;
  4063. this.raw = false;
  4064. this.isStatic = false;
  4065. this.isRootInsert = true;
  4066. this.isComment = false;
  4067. this.isCloned = false;
  4068. this.isOnce = false;
  4069. this.asyncFactory = asyncFactory;
  4070. this.asyncMeta = undefined;
  4071. this.isAsyncPlaceholder = false;
  4072. };
  4073. var prototypeAccessors = { child: { configurable: true } };
  4074. // DEPRECATED: alias for componentInstance for backwards compat.
  4075. /* istanbul ignore next */
  4076. prototypeAccessors.child.get = function () {
  4077. return this.componentInstance
  4078. };
  4079. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4080. var createEmptyVNode = function (text) {
  4081. if ( text === void 0 ) text = '';
  4082. var node = new VNode();
  4083. node.text = text;
  4084. node.isComment = true;
  4085. return node
  4086. };
  4087. function createTextVNode (val) {
  4088. return new VNode(undefined, undefined, undefined, String(val))
  4089. }
  4090. // optimized shallow clone
  4091. // used for static nodes and slot nodes because they may be reused across
  4092. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4093. // on their elm reference.
  4094. function cloneVNode (vnode) {
  4095. var cloned = new VNode(
  4096. vnode.tag,
  4097. vnode.data,
  4098. // #7975
  4099. // clone children array to avoid mutating original in case of cloning
  4100. // a child.
  4101. vnode.children && vnode.children.slice(),
  4102. vnode.text,
  4103. vnode.elm,
  4104. vnode.context,
  4105. vnode.componentOptions,
  4106. vnode.asyncFactory
  4107. );
  4108. cloned.ns = vnode.ns;
  4109. cloned.isStatic = vnode.isStatic;
  4110. cloned.key = vnode.key;
  4111. cloned.isComment = vnode.isComment;
  4112. cloned.fnContext = vnode.fnContext;
  4113. cloned.fnOptions = vnode.fnOptions;
  4114. cloned.fnScopeId = vnode.fnScopeId;
  4115. cloned.asyncMeta = vnode.asyncMeta;
  4116. cloned.isCloned = true;
  4117. return cloned
  4118. }
  4119. /*
  4120. * not type checking this file because flow doesn't play well with
  4121. * dynamically accessing methods on Array prototype
  4122. */
  4123. var arrayProto = Array.prototype;
  4124. var arrayMethods = Object.create(arrayProto);
  4125. var methodsToPatch = [
  4126. 'push',
  4127. 'pop',
  4128. 'shift',
  4129. 'unshift',
  4130. 'splice',
  4131. 'sort',
  4132. 'reverse'
  4133. ];
  4134. /**
  4135. * Intercept mutating methods and emit events
  4136. */
  4137. methodsToPatch.forEach(function (method) {
  4138. // cache original method
  4139. var original = arrayProto[method];
  4140. def(arrayMethods, method, function mutator () {
  4141. var args = [], len = arguments.length;
  4142. while ( len-- ) args[ len ] = arguments[ len ];
  4143. var result = original.apply(this, args);
  4144. var ob = this.__ob__;
  4145. var inserted;
  4146. switch (method) {
  4147. case 'push':
  4148. case 'unshift':
  4149. inserted = args;
  4150. break
  4151. case 'splice':
  4152. inserted = args.slice(2);
  4153. break
  4154. }
  4155. if (inserted) { ob.observeArray(inserted); }
  4156. // notify change
  4157. ob.dep.notify();
  4158. return result
  4159. });
  4160. });
  4161. /* */
  4162. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4163. /**
  4164. * In some cases we may want to disable observation inside a component's
  4165. * update computation.
  4166. */
  4167. var shouldObserve = true;
  4168. function toggleObserving (value) {
  4169. shouldObserve = value;
  4170. }
  4171. /**
  4172. * Observer class that is attached to each observed
  4173. * object. Once attached, the observer converts the target
  4174. * object's property keys into getter/setters that
  4175. * collect dependencies and dispatch updates.
  4176. */
  4177. var Observer = function Observer (value) {
  4178. this.value = value;
  4179. this.dep = new Dep();
  4180. this.vmCount = 0;
  4181. def(value, '__ob__', this);
  4182. if (Array.isArray(value)) {
  4183. if (hasProto) {
  4184. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4185. if(value.push !== value.__proto__.push){
  4186. copyAugment(value, arrayMethods, arrayKeys);
  4187. } else {
  4188. protoAugment(value, arrayMethods);
  4189. }
  4190. }
  4191. } else {
  4192. copyAugment(value, arrayMethods, arrayKeys);
  4193. }
  4194. this.observeArray(value);
  4195. } else {
  4196. this.walk(value);
  4197. }
  4198. };
  4199. /**
  4200. * Walk through all properties and convert them into
  4201. * getter/setters. This method should only be called when
  4202. * value type is Object.
  4203. */
  4204. Observer.prototype.walk = function walk (obj) {
  4205. var keys = Object.keys(obj);
  4206. for (var i = 0; i < keys.length; i++) {
  4207. defineReactive$$1(obj, keys[i]);
  4208. }
  4209. };
  4210. /**
  4211. * Observe a list of Array items.
  4212. */
  4213. Observer.prototype.observeArray = function observeArray (items) {
  4214. for (var i = 0, l = items.length; i < l; i++) {
  4215. observe(items[i]);
  4216. }
  4217. };
  4218. // helpers
  4219. /**
  4220. * Augment a target Object or Array by intercepting
  4221. * the prototype chain using __proto__
  4222. */
  4223. function protoAugment (target, src) {
  4224. /* eslint-disable no-proto */
  4225. target.__proto__ = src;
  4226. /* eslint-enable no-proto */
  4227. }
  4228. /**
  4229. * Augment a target Object or Array by defining
  4230. * hidden properties.
  4231. */
  4232. /* istanbul ignore next */
  4233. function copyAugment (target, src, keys) {
  4234. for (var i = 0, l = keys.length; i < l; i++) {
  4235. var key = keys[i];
  4236. def(target, key, src[key]);
  4237. }
  4238. }
  4239. /**
  4240. * Attempt to create an observer instance for a value,
  4241. * returns the new observer if successfully observed,
  4242. * or the existing observer if the value already has one.
  4243. */
  4244. function observe (value, asRootData) {
  4245. if (!isObject(value) || value instanceof VNode) {
  4246. return
  4247. }
  4248. var ob;
  4249. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4250. ob = value.__ob__;
  4251. } else if (
  4252. shouldObserve &&
  4253. !isServerRendering() &&
  4254. (Array.isArray(value) || isPlainObject(value)) &&
  4255. Object.isExtensible(value) &&
  4256. !value._isVue
  4257. ) {
  4258. ob = new Observer(value);
  4259. }
  4260. if (asRootData && ob) {
  4261. ob.vmCount++;
  4262. }
  4263. return ob
  4264. }
  4265. /**
  4266. * Define a reactive property on an Object.
  4267. */
  4268. function defineReactive$$1 (
  4269. obj,
  4270. key,
  4271. val,
  4272. customSetter,
  4273. shallow
  4274. ) {
  4275. var dep = new Dep();
  4276. var property = Object.getOwnPropertyDescriptor(obj, key);
  4277. if (property && property.configurable === false) {
  4278. return
  4279. }
  4280. // cater for pre-defined getter/setters
  4281. var getter = property && property.get;
  4282. var setter = property && property.set;
  4283. if ((!getter || setter) && arguments.length === 2) {
  4284. val = obj[key];
  4285. }
  4286. var childOb = !shallow && observe(val);
  4287. Object.defineProperty(obj, key, {
  4288. enumerable: true,
  4289. configurable: true,
  4290. get: function reactiveGetter () {
  4291. var value = getter ? getter.call(obj) : val;
  4292. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4293. dep.depend();
  4294. if (childOb) {
  4295. childOb.dep.depend();
  4296. if (Array.isArray(value)) {
  4297. dependArray(value);
  4298. }
  4299. }
  4300. }
  4301. return value
  4302. },
  4303. set: function reactiveSetter (newVal) {
  4304. var value = getter ? getter.call(obj) : val;
  4305. /* eslint-disable no-self-compare */
  4306. if (newVal === value || (newVal !== newVal && value !== value)) {
  4307. return
  4308. }
  4309. /* eslint-enable no-self-compare */
  4310. if ( true && customSetter) {
  4311. customSetter();
  4312. }
  4313. // #7981: for accessor properties without setter
  4314. if (getter && !setter) { return }
  4315. if (setter) {
  4316. setter.call(obj, newVal);
  4317. } else {
  4318. val = newVal;
  4319. }
  4320. childOb = !shallow && observe(newVal);
  4321. dep.notify();
  4322. }
  4323. });
  4324. }
  4325. /**
  4326. * Set a property on an object. Adds the new property and
  4327. * triggers change notification if the property doesn't
  4328. * already exist.
  4329. */
  4330. function set (target, key, val) {
  4331. if ( true &&
  4332. (isUndef(target) || isPrimitive(target))
  4333. ) {
  4334. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4335. }
  4336. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4337. target.length = Math.max(target.length, key);
  4338. target.splice(key, 1, val);
  4339. return val
  4340. }
  4341. if (key in target && !(key in Object.prototype)) {
  4342. target[key] = val;
  4343. return val
  4344. }
  4345. var ob = (target).__ob__;
  4346. if (target._isVue || (ob && ob.vmCount)) {
  4347. true && warn(
  4348. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4349. 'at runtime - declare it upfront in the data option.'
  4350. );
  4351. return val
  4352. }
  4353. if (!ob) {
  4354. target[key] = val;
  4355. return val
  4356. }
  4357. defineReactive$$1(ob.value, key, val);
  4358. ob.dep.notify();
  4359. return val
  4360. }
  4361. /**
  4362. * Delete a property and trigger change if necessary.
  4363. */
  4364. function del (target, key) {
  4365. if ( true &&
  4366. (isUndef(target) || isPrimitive(target))
  4367. ) {
  4368. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4369. }
  4370. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4371. target.splice(key, 1);
  4372. return
  4373. }
  4374. var ob = (target).__ob__;
  4375. if (target._isVue || (ob && ob.vmCount)) {
  4376. true && warn(
  4377. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4378. '- just set it to null.'
  4379. );
  4380. return
  4381. }
  4382. if (!hasOwn(target, key)) {
  4383. return
  4384. }
  4385. delete target[key];
  4386. if (!ob) {
  4387. return
  4388. }
  4389. ob.dep.notify();
  4390. }
  4391. /**
  4392. * Collect dependencies on array elements when the array is touched, since
  4393. * we cannot intercept array element access like property getters.
  4394. */
  4395. function dependArray (value) {
  4396. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4397. e = value[i];
  4398. e && e.__ob__ && e.__ob__.dep.depend();
  4399. if (Array.isArray(e)) {
  4400. dependArray(e);
  4401. }
  4402. }
  4403. }
  4404. /* */
  4405. /**
  4406. * Option overwriting strategies are functions that handle
  4407. * how to merge a parent option value and a child option
  4408. * value into the final value.
  4409. */
  4410. var strats = config.optionMergeStrategies;
  4411. /**
  4412. * Options with restrictions
  4413. */
  4414. if (true) {
  4415. strats.el = strats.propsData = function (parent, child, vm, key) {
  4416. if (!vm) {
  4417. warn(
  4418. "option \"" + key + "\" can only be used during instance " +
  4419. 'creation with the `new` keyword.'
  4420. );
  4421. }
  4422. return defaultStrat(parent, child)
  4423. };
  4424. }
  4425. /**
  4426. * Helper that recursively merges two data objects together.
  4427. */
  4428. function mergeData (to, from) {
  4429. if (!from) { return to }
  4430. var key, toVal, fromVal;
  4431. var keys = hasSymbol
  4432. ? Reflect.ownKeys(from)
  4433. : Object.keys(from);
  4434. for (var i = 0; i < keys.length; i++) {
  4435. key = keys[i];
  4436. // in case the object is already observed...
  4437. if (key === '__ob__') { continue }
  4438. toVal = to[key];
  4439. fromVal = from[key];
  4440. if (!hasOwn(to, key)) {
  4441. set(to, key, fromVal);
  4442. } else if (
  4443. toVal !== fromVal &&
  4444. isPlainObject(toVal) &&
  4445. isPlainObject(fromVal)
  4446. ) {
  4447. mergeData(toVal, fromVal);
  4448. }
  4449. }
  4450. return to
  4451. }
  4452. /**
  4453. * Data
  4454. */
  4455. function mergeDataOrFn (
  4456. parentVal,
  4457. childVal,
  4458. vm
  4459. ) {
  4460. if (!vm) {
  4461. // in a Vue.extend merge, both should be functions
  4462. if (!childVal) {
  4463. return parentVal
  4464. }
  4465. if (!parentVal) {
  4466. return childVal
  4467. }
  4468. // when parentVal & childVal are both present,
  4469. // we need to return a function that returns the
  4470. // merged result of both functions... no need to
  4471. // check if parentVal is a function here because
  4472. // it has to be a function to pass previous merges.
  4473. return function mergedDataFn () {
  4474. return mergeData(
  4475. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4476. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4477. )
  4478. }
  4479. } else {
  4480. return function mergedInstanceDataFn () {
  4481. // instance merge
  4482. var instanceData = typeof childVal === 'function'
  4483. ? childVal.call(vm, vm)
  4484. : childVal;
  4485. var defaultData = typeof parentVal === 'function'
  4486. ? parentVal.call(vm, vm)
  4487. : parentVal;
  4488. if (instanceData) {
  4489. return mergeData(instanceData, defaultData)
  4490. } else {
  4491. return defaultData
  4492. }
  4493. }
  4494. }
  4495. }
  4496. strats.data = function (
  4497. parentVal,
  4498. childVal,
  4499. vm
  4500. ) {
  4501. if (!vm) {
  4502. if (childVal && typeof childVal !== 'function') {
  4503. true && warn(
  4504. 'The "data" option should be a function ' +
  4505. 'that returns a per-instance value in component ' +
  4506. 'definitions.',
  4507. vm
  4508. );
  4509. return parentVal
  4510. }
  4511. return mergeDataOrFn(parentVal, childVal)
  4512. }
  4513. return mergeDataOrFn(parentVal, childVal, vm)
  4514. };
  4515. /**
  4516. * Hooks and props are merged as arrays.
  4517. */
  4518. function mergeHook (
  4519. parentVal,
  4520. childVal
  4521. ) {
  4522. var res = childVal
  4523. ? parentVal
  4524. ? parentVal.concat(childVal)
  4525. : Array.isArray(childVal)
  4526. ? childVal
  4527. : [childVal]
  4528. : parentVal;
  4529. return res
  4530. ? dedupeHooks(res)
  4531. : res
  4532. }
  4533. function dedupeHooks (hooks) {
  4534. var res = [];
  4535. for (var i = 0; i < hooks.length; i++) {
  4536. if (res.indexOf(hooks[i]) === -1) {
  4537. res.push(hooks[i]);
  4538. }
  4539. }
  4540. return res
  4541. }
  4542. LIFECYCLE_HOOKS.forEach(function (hook) {
  4543. strats[hook] = mergeHook;
  4544. });
  4545. /**
  4546. * Assets
  4547. *
  4548. * When a vm is present (instance creation), we need to do
  4549. * a three-way merge between constructor options, instance
  4550. * options and parent options.
  4551. */
  4552. function mergeAssets (
  4553. parentVal,
  4554. childVal,
  4555. vm,
  4556. key
  4557. ) {
  4558. var res = Object.create(parentVal || null);
  4559. if (childVal) {
  4560. true && assertObjectType(key, childVal, vm);
  4561. return extend(res, childVal)
  4562. } else {
  4563. return res
  4564. }
  4565. }
  4566. ASSET_TYPES.forEach(function (type) {
  4567. strats[type + 's'] = mergeAssets;
  4568. });
  4569. /**
  4570. * Watchers.
  4571. *
  4572. * Watchers hashes should not overwrite one
  4573. * another, so we merge them as arrays.
  4574. */
  4575. strats.watch = function (
  4576. parentVal,
  4577. childVal,
  4578. vm,
  4579. key
  4580. ) {
  4581. // work around Firefox's Object.prototype.watch...
  4582. if (parentVal === nativeWatch) { parentVal = undefined; }
  4583. if (childVal === nativeWatch) { childVal = undefined; }
  4584. /* istanbul ignore if */
  4585. if (!childVal) { return Object.create(parentVal || null) }
  4586. if (true) {
  4587. assertObjectType(key, childVal, vm);
  4588. }
  4589. if (!parentVal) { return childVal }
  4590. var ret = {};
  4591. extend(ret, parentVal);
  4592. for (var key$1 in childVal) {
  4593. var parent = ret[key$1];
  4594. var child = childVal[key$1];
  4595. if (parent && !Array.isArray(parent)) {
  4596. parent = [parent];
  4597. }
  4598. ret[key$1] = parent
  4599. ? parent.concat(child)
  4600. : Array.isArray(child) ? child : [child];
  4601. }
  4602. return ret
  4603. };
  4604. /**
  4605. * Other object hashes.
  4606. */
  4607. strats.props =
  4608. strats.methods =
  4609. strats.inject =
  4610. strats.computed = function (
  4611. parentVal,
  4612. childVal,
  4613. vm,
  4614. key
  4615. ) {
  4616. if (childVal && "development" !== 'production') {
  4617. assertObjectType(key, childVal, vm);
  4618. }
  4619. if (!parentVal) { return childVal }
  4620. var ret = Object.create(null);
  4621. extend(ret, parentVal);
  4622. if (childVal) { extend(ret, childVal); }
  4623. return ret
  4624. };
  4625. strats.provide = mergeDataOrFn;
  4626. /**
  4627. * Default strategy.
  4628. */
  4629. var defaultStrat = function (parentVal, childVal) {
  4630. return childVal === undefined
  4631. ? parentVal
  4632. : childVal
  4633. };
  4634. /**
  4635. * Validate component names
  4636. */
  4637. function checkComponents (options) {
  4638. for (var key in options.components) {
  4639. validateComponentName(key);
  4640. }
  4641. }
  4642. function validateComponentName (name) {
  4643. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4644. warn(
  4645. 'Invalid component name: "' + name + '". Component names ' +
  4646. 'should conform to valid custom element name in html5 specification.'
  4647. );
  4648. }
  4649. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4650. warn(
  4651. 'Do not use built-in or reserved HTML elements as component ' +
  4652. 'id: ' + name
  4653. );
  4654. }
  4655. }
  4656. /**
  4657. * Ensure all props option syntax are normalized into the
  4658. * Object-based format.
  4659. */
  4660. function normalizeProps (options, vm) {
  4661. var props = options.props;
  4662. if (!props) { return }
  4663. var res = {};
  4664. var i, val, name;
  4665. if (Array.isArray(props)) {
  4666. i = props.length;
  4667. while (i--) {
  4668. val = props[i];
  4669. if (typeof val === 'string') {
  4670. name = camelize(val);
  4671. res[name] = { type: null };
  4672. } else if (true) {
  4673. warn('props must be strings when using array syntax.');
  4674. }
  4675. }
  4676. } else if (isPlainObject(props)) {
  4677. for (var key in props) {
  4678. val = props[key];
  4679. name = camelize(key);
  4680. res[name] = isPlainObject(val)
  4681. ? val
  4682. : { type: val };
  4683. }
  4684. } else if (true) {
  4685. warn(
  4686. "Invalid value for option \"props\": expected an Array or an Object, " +
  4687. "but got " + (toRawType(props)) + ".",
  4688. vm
  4689. );
  4690. }
  4691. options.props = res;
  4692. }
  4693. /**
  4694. * Normalize all injections into Object-based format
  4695. */
  4696. function normalizeInject (options, vm) {
  4697. var inject = options.inject;
  4698. if (!inject) { return }
  4699. var normalized = options.inject = {};
  4700. if (Array.isArray(inject)) {
  4701. for (var i = 0; i < inject.length; i++) {
  4702. normalized[inject[i]] = { from: inject[i] };
  4703. }
  4704. } else if (isPlainObject(inject)) {
  4705. for (var key in inject) {
  4706. var val = inject[key];
  4707. normalized[key] = isPlainObject(val)
  4708. ? extend({ from: key }, val)
  4709. : { from: val };
  4710. }
  4711. } else if (true) {
  4712. warn(
  4713. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4714. "but got " + (toRawType(inject)) + ".",
  4715. vm
  4716. );
  4717. }
  4718. }
  4719. /**
  4720. * Normalize raw function directives into object format.
  4721. */
  4722. function normalizeDirectives (options) {
  4723. var dirs = options.directives;
  4724. if (dirs) {
  4725. for (var key in dirs) {
  4726. var def$$1 = dirs[key];
  4727. if (typeof def$$1 === 'function') {
  4728. dirs[key] = { bind: def$$1, update: def$$1 };
  4729. }
  4730. }
  4731. }
  4732. }
  4733. function assertObjectType (name, value, vm) {
  4734. if (!isPlainObject(value)) {
  4735. warn(
  4736. "Invalid value for option \"" + name + "\": expected an Object, " +
  4737. "but got " + (toRawType(value)) + ".",
  4738. vm
  4739. );
  4740. }
  4741. }
  4742. /**
  4743. * Merge two option objects into a new one.
  4744. * Core utility used in both instantiation and inheritance.
  4745. */
  4746. function mergeOptions (
  4747. parent,
  4748. child,
  4749. vm
  4750. ) {
  4751. if (true) {
  4752. checkComponents(child);
  4753. }
  4754. if (typeof child === 'function') {
  4755. child = child.options;
  4756. }
  4757. normalizeProps(child, vm);
  4758. normalizeInject(child, vm);
  4759. normalizeDirectives(child);
  4760. // Apply extends and mixins on the child options,
  4761. // but only if it is a raw options object that isn't
  4762. // the result of another mergeOptions call.
  4763. // Only merged options has the _base property.
  4764. if (!child._base) {
  4765. if (child.extends) {
  4766. parent = mergeOptions(parent, child.extends, vm);
  4767. }
  4768. if (child.mixins) {
  4769. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4770. parent = mergeOptions(parent, child.mixins[i], vm);
  4771. }
  4772. }
  4773. }
  4774. var options = {};
  4775. var key;
  4776. for (key in parent) {
  4777. mergeField(key);
  4778. }
  4779. for (key in child) {
  4780. if (!hasOwn(parent, key)) {
  4781. mergeField(key);
  4782. }
  4783. }
  4784. function mergeField (key) {
  4785. var strat = strats[key] || defaultStrat;
  4786. options[key] = strat(parent[key], child[key], vm, key);
  4787. }
  4788. return options
  4789. }
  4790. /**
  4791. * Resolve an asset.
  4792. * This function is used because child instances need access
  4793. * to assets defined in its ancestor chain.
  4794. */
  4795. function resolveAsset (
  4796. options,
  4797. type,
  4798. id,
  4799. warnMissing
  4800. ) {
  4801. /* istanbul ignore if */
  4802. if (typeof id !== 'string') {
  4803. return
  4804. }
  4805. var assets = options[type];
  4806. // check local registration variations first
  4807. if (hasOwn(assets, id)) { return assets[id] }
  4808. var camelizedId = camelize(id);
  4809. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4810. var PascalCaseId = capitalize(camelizedId);
  4811. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4812. // fallback to prototype chain
  4813. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4814. if ( true && warnMissing && !res) {
  4815. warn(
  4816. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4817. options
  4818. );
  4819. }
  4820. return res
  4821. }
  4822. /* */
  4823. function validateProp (
  4824. key,
  4825. propOptions,
  4826. propsData,
  4827. vm
  4828. ) {
  4829. var prop = propOptions[key];
  4830. var absent = !hasOwn(propsData, key);
  4831. var value = propsData[key];
  4832. // boolean casting
  4833. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4834. if (booleanIndex > -1) {
  4835. if (absent && !hasOwn(prop, 'default')) {
  4836. value = false;
  4837. } else if (value === '' || value === hyphenate(key)) {
  4838. // only cast empty string / same name to boolean if
  4839. // boolean has higher priority
  4840. var stringIndex = getTypeIndex(String, prop.type);
  4841. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4842. value = true;
  4843. }
  4844. }
  4845. }
  4846. // check default value
  4847. if (value === undefined) {
  4848. value = getPropDefaultValue(vm, prop, key);
  4849. // since the default value is a fresh copy,
  4850. // make sure to observe it.
  4851. var prevShouldObserve = shouldObserve;
  4852. toggleObserving(true);
  4853. observe(value);
  4854. toggleObserving(prevShouldObserve);
  4855. }
  4856. if (
  4857. true
  4858. ) {
  4859. assertProp(prop, key, value, vm, absent);
  4860. }
  4861. return value
  4862. }
  4863. /**
  4864. * Get the default value of a prop.
  4865. */
  4866. function getPropDefaultValue (vm, prop, key) {
  4867. // no default, return undefined
  4868. if (!hasOwn(prop, 'default')) {
  4869. return undefined
  4870. }
  4871. var def = prop.default;
  4872. // warn against non-factory defaults for Object & Array
  4873. if ( true && isObject(def)) {
  4874. warn(
  4875. 'Invalid default value for prop "' + key + '": ' +
  4876. 'Props with type Object/Array must use a factory function ' +
  4877. 'to return the default value.',
  4878. vm
  4879. );
  4880. }
  4881. // the raw prop value was also undefined from previous render,
  4882. // return previous default value to avoid unnecessary watcher trigger
  4883. if (vm && vm.$options.propsData &&
  4884. vm.$options.propsData[key] === undefined &&
  4885. vm._props[key] !== undefined
  4886. ) {
  4887. return vm._props[key]
  4888. }
  4889. // call factory function for non-Function types
  4890. // a value is Function if its prototype is function even across different execution context
  4891. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4892. ? def.call(vm)
  4893. : def
  4894. }
  4895. /**
  4896. * Assert whether a prop is valid.
  4897. */
  4898. function assertProp (
  4899. prop,
  4900. name,
  4901. value,
  4902. vm,
  4903. absent
  4904. ) {
  4905. if (prop.required && absent) {
  4906. warn(
  4907. 'Missing required prop: "' + name + '"',
  4908. vm
  4909. );
  4910. return
  4911. }
  4912. if (value == null && !prop.required) {
  4913. return
  4914. }
  4915. var type = prop.type;
  4916. var valid = !type || type === true;
  4917. var expectedTypes = [];
  4918. if (type) {
  4919. if (!Array.isArray(type)) {
  4920. type = [type];
  4921. }
  4922. for (var i = 0; i < type.length && !valid; i++) {
  4923. var assertedType = assertType(value, type[i]);
  4924. expectedTypes.push(assertedType.expectedType || '');
  4925. valid = assertedType.valid;
  4926. }
  4927. }
  4928. if (!valid) {
  4929. warn(
  4930. getInvalidTypeMessage(name, value, expectedTypes),
  4931. vm
  4932. );
  4933. return
  4934. }
  4935. var validator = prop.validator;
  4936. if (validator) {
  4937. if (!validator(value)) {
  4938. warn(
  4939. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4940. vm
  4941. );
  4942. }
  4943. }
  4944. }
  4945. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4946. function assertType (value, type) {
  4947. var valid;
  4948. var expectedType = getType(type);
  4949. if (simpleCheckRE.test(expectedType)) {
  4950. var t = typeof value;
  4951. valid = t === expectedType.toLowerCase();
  4952. // for primitive wrapper objects
  4953. if (!valid && t === 'object') {
  4954. valid = value instanceof type;
  4955. }
  4956. } else if (expectedType === 'Object') {
  4957. valid = isPlainObject(value);
  4958. } else if (expectedType === 'Array') {
  4959. valid = Array.isArray(value);
  4960. } else {
  4961. valid = value instanceof type;
  4962. }
  4963. return {
  4964. valid: valid,
  4965. expectedType: expectedType
  4966. }
  4967. }
  4968. /**
  4969. * Use function string name to check built-in types,
  4970. * because a simple equality check will fail when running
  4971. * across different vms / iframes.
  4972. */
  4973. function getType (fn) {
  4974. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4975. return match ? match[1] : ''
  4976. }
  4977. function isSameType (a, b) {
  4978. return getType(a) === getType(b)
  4979. }
  4980. function getTypeIndex (type, expectedTypes) {
  4981. if (!Array.isArray(expectedTypes)) {
  4982. return isSameType(expectedTypes, type) ? 0 : -1
  4983. }
  4984. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4985. if (isSameType(expectedTypes[i], type)) {
  4986. return i
  4987. }
  4988. }
  4989. return -1
  4990. }
  4991. function getInvalidTypeMessage (name, value, expectedTypes) {
  4992. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4993. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4994. var expectedType = expectedTypes[0];
  4995. var receivedType = toRawType(value);
  4996. var expectedValue = styleValue(value, expectedType);
  4997. var receivedValue = styleValue(value, receivedType);
  4998. // check if we need to specify expected value
  4999. if (expectedTypes.length === 1 &&
  5000. isExplicable(expectedType) &&
  5001. !isBoolean(expectedType, receivedType)) {
  5002. message += " with value " + expectedValue;
  5003. }
  5004. message += ", got " + receivedType + " ";
  5005. // check if we need to specify received value
  5006. if (isExplicable(receivedType)) {
  5007. message += "with value " + receivedValue + ".";
  5008. }
  5009. return message
  5010. }
  5011. function styleValue (value, type) {
  5012. if (type === 'String') {
  5013. return ("\"" + value + "\"")
  5014. } else if (type === 'Number') {
  5015. return ("" + (Number(value)))
  5016. } else {
  5017. return ("" + value)
  5018. }
  5019. }
  5020. function isExplicable (value) {
  5021. var explicitTypes = ['string', 'number', 'boolean'];
  5022. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5023. }
  5024. function isBoolean () {
  5025. var args = [], len = arguments.length;
  5026. while ( len-- ) args[ len ] = arguments[ len ];
  5027. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5028. }
  5029. /* */
  5030. function handleError (err, vm, info) {
  5031. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5032. // See: https://github.com/vuejs/vuex/issues/1505
  5033. pushTarget();
  5034. try {
  5035. if (vm) {
  5036. var cur = vm;
  5037. while ((cur = cur.$parent)) {
  5038. var hooks = cur.$options.errorCaptured;
  5039. if (hooks) {
  5040. for (var i = 0; i < hooks.length; i++) {
  5041. try {
  5042. var capture = hooks[i].call(cur, err, vm, info) === false;
  5043. if (capture) { return }
  5044. } catch (e) {
  5045. globalHandleError(e, cur, 'errorCaptured hook');
  5046. }
  5047. }
  5048. }
  5049. }
  5050. }
  5051. globalHandleError(err, vm, info);
  5052. } finally {
  5053. popTarget();
  5054. }
  5055. }
  5056. function invokeWithErrorHandling (
  5057. handler,
  5058. context,
  5059. args,
  5060. vm,
  5061. info
  5062. ) {
  5063. var res;
  5064. try {
  5065. res = args ? handler.apply(context, args) : handler.call(context);
  5066. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5067. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5068. // issue #9511
  5069. // avoid catch triggering multiple times when nested calls
  5070. res._handled = true;
  5071. }
  5072. } catch (e) {
  5073. handleError(e, vm, info);
  5074. }
  5075. return res
  5076. }
  5077. function globalHandleError (err, vm, info) {
  5078. if (config.errorHandler) {
  5079. try {
  5080. return config.errorHandler.call(null, err, vm, info)
  5081. } catch (e) {
  5082. // if the user intentionally throws the original error in the handler,
  5083. // do not log it twice
  5084. if (e !== err) {
  5085. logError(e, null, 'config.errorHandler');
  5086. }
  5087. }
  5088. }
  5089. logError(err, vm, info);
  5090. }
  5091. function logError (err, vm, info) {
  5092. if (true) {
  5093. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5094. }
  5095. /* istanbul ignore else */
  5096. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5097. console.error(err);
  5098. } else {
  5099. throw err
  5100. }
  5101. }
  5102. /* */
  5103. var callbacks = [];
  5104. var pending = false;
  5105. function flushCallbacks () {
  5106. pending = false;
  5107. var copies = callbacks.slice(0);
  5108. callbacks.length = 0;
  5109. for (var i = 0; i < copies.length; i++) {
  5110. copies[i]();
  5111. }
  5112. }
  5113. // Here we have async deferring wrappers using microtasks.
  5114. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5115. // However, it has subtle problems when state is changed right before repaint
  5116. // (e.g. #6813, out-in transitions).
  5117. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5118. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5119. // So we now use microtasks everywhere, again.
  5120. // A major drawback of this tradeoff is that there are some scenarios
  5121. // where microtasks have too high a priority and fire in between supposedly
  5122. // sequential events (e.g. #4521, #6690, which have workarounds)
  5123. // or even between bubbling of the same event (#6566).
  5124. var timerFunc;
  5125. // The nextTick behavior leverages the microtask queue, which can be accessed
  5126. // via either native Promise.then or MutationObserver.
  5127. // MutationObserver has wider support, however it is seriously bugged in
  5128. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5129. // completely stops working after triggering a few times... so, if native
  5130. // Promise is available, we will use it:
  5131. /* istanbul ignore next, $flow-disable-line */
  5132. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5133. var p = Promise.resolve();
  5134. timerFunc = function () {
  5135. p.then(flushCallbacks);
  5136. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5137. // it can get stuck in a weird state where callbacks are pushed into the
  5138. // microtask queue but the queue isn't being flushed, until the browser
  5139. // needs to do some other work, e.g. handle a timer. Therefore we can
  5140. // "force" the microtask queue to be flushed by adding an empty timer.
  5141. if (isIOS) { setTimeout(noop); }
  5142. };
  5143. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5144. isNative(MutationObserver) ||
  5145. // PhantomJS and iOS 7.x
  5146. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5147. )) {
  5148. // Use MutationObserver where native Promise is not available,
  5149. // e.g. PhantomJS, iOS7, Android 4.4
  5150. // (#6466 MutationObserver is unreliable in IE11)
  5151. var counter = 1;
  5152. var observer = new MutationObserver(flushCallbacks);
  5153. var textNode = document.createTextNode(String(counter));
  5154. observer.observe(textNode, {
  5155. characterData: true
  5156. });
  5157. timerFunc = function () {
  5158. counter = (counter + 1) % 2;
  5159. textNode.data = String(counter);
  5160. };
  5161. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5162. // Fallback to setImmediate.
  5163. // Technically it leverages the (macro) task queue,
  5164. // but it is still a better choice than setTimeout.
  5165. timerFunc = function () {
  5166. setImmediate(flushCallbacks);
  5167. };
  5168. } else {
  5169. // Fallback to setTimeout.
  5170. timerFunc = function () {
  5171. setTimeout(flushCallbacks, 0);
  5172. };
  5173. }
  5174. function nextTick (cb, ctx) {
  5175. var _resolve;
  5176. callbacks.push(function () {
  5177. if (cb) {
  5178. try {
  5179. cb.call(ctx);
  5180. } catch (e) {
  5181. handleError(e, ctx, 'nextTick');
  5182. }
  5183. } else if (_resolve) {
  5184. _resolve(ctx);
  5185. }
  5186. });
  5187. if (!pending) {
  5188. pending = true;
  5189. timerFunc();
  5190. }
  5191. // $flow-disable-line
  5192. if (!cb && typeof Promise !== 'undefined') {
  5193. return new Promise(function (resolve) {
  5194. _resolve = resolve;
  5195. })
  5196. }
  5197. }
  5198. /* */
  5199. /* not type checking this file because flow doesn't play well with Proxy */
  5200. var initProxy;
  5201. if (true) {
  5202. var allowedGlobals = makeMap(
  5203. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5204. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5205. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5206. 'require' // for Webpack/Browserify
  5207. );
  5208. var warnNonPresent = function (target, key) {
  5209. warn(
  5210. "Property or method \"" + key + "\" is not defined on the instance but " +
  5211. 'referenced during render. Make sure that this property is reactive, ' +
  5212. 'either in the data option, or for class-based components, by ' +
  5213. 'initializing the property. ' +
  5214. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5215. target
  5216. );
  5217. };
  5218. var warnReservedPrefix = function (target, key) {
  5219. warn(
  5220. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5221. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5222. 'prevent conflicts with Vue internals. ' +
  5223. 'See: https://vuejs.org/v2/api/#data',
  5224. target
  5225. );
  5226. };
  5227. var hasProxy =
  5228. typeof Proxy !== 'undefined' && isNative(Proxy);
  5229. if (hasProxy) {
  5230. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5231. config.keyCodes = new Proxy(config.keyCodes, {
  5232. set: function set (target, key, value) {
  5233. if (isBuiltInModifier(key)) {
  5234. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5235. return false
  5236. } else {
  5237. target[key] = value;
  5238. return true
  5239. }
  5240. }
  5241. });
  5242. }
  5243. var hasHandler = {
  5244. has: function has (target, key) {
  5245. var has = key in target;
  5246. var isAllowed = allowedGlobals(key) ||
  5247. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5248. if (!has && !isAllowed) {
  5249. if (key in target.$data) { warnReservedPrefix(target, key); }
  5250. else { warnNonPresent(target, key); }
  5251. }
  5252. return has || !isAllowed
  5253. }
  5254. };
  5255. var getHandler = {
  5256. get: function get (target, key) {
  5257. if (typeof key === 'string' && !(key in target)) {
  5258. if (key in target.$data) { warnReservedPrefix(target, key); }
  5259. else { warnNonPresent(target, key); }
  5260. }
  5261. return target[key]
  5262. }
  5263. };
  5264. initProxy = function initProxy (vm) {
  5265. if (hasProxy) {
  5266. // determine which proxy handler to use
  5267. var options = vm.$options;
  5268. var handlers = options.render && options.render._withStripped
  5269. ? getHandler
  5270. : hasHandler;
  5271. vm._renderProxy = new Proxy(vm, handlers);
  5272. } else {
  5273. vm._renderProxy = vm;
  5274. }
  5275. };
  5276. }
  5277. /* */
  5278. var seenObjects = new _Set();
  5279. /**
  5280. * Recursively traverse an object to evoke all converted
  5281. * getters, so that every nested property inside the object
  5282. * is collected as a "deep" dependency.
  5283. */
  5284. function traverse (val) {
  5285. _traverse(val, seenObjects);
  5286. seenObjects.clear();
  5287. }
  5288. function _traverse (val, seen) {
  5289. var i, keys;
  5290. var isA = Array.isArray(val);
  5291. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5292. return
  5293. }
  5294. if (val.__ob__) {
  5295. var depId = val.__ob__.dep.id;
  5296. if (seen.has(depId)) {
  5297. return
  5298. }
  5299. seen.add(depId);
  5300. }
  5301. if (isA) {
  5302. i = val.length;
  5303. while (i--) { _traverse(val[i], seen); }
  5304. } else {
  5305. keys = Object.keys(val);
  5306. i = keys.length;
  5307. while (i--) { _traverse(val[keys[i]], seen); }
  5308. }
  5309. }
  5310. var mark;
  5311. var measure;
  5312. if (true) {
  5313. var perf = inBrowser && window.performance;
  5314. /* istanbul ignore if */
  5315. if (
  5316. perf &&
  5317. perf.mark &&
  5318. perf.measure &&
  5319. perf.clearMarks &&
  5320. perf.clearMeasures
  5321. ) {
  5322. mark = function (tag) { return perf.mark(tag); };
  5323. measure = function (name, startTag, endTag) {
  5324. perf.measure(name, startTag, endTag);
  5325. perf.clearMarks(startTag);
  5326. perf.clearMarks(endTag);
  5327. // perf.clearMeasures(name)
  5328. };
  5329. }
  5330. }
  5331. /* */
  5332. var normalizeEvent = cached(function (name) {
  5333. var passive = name.charAt(0) === '&';
  5334. name = passive ? name.slice(1) : name;
  5335. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5336. name = once$$1 ? name.slice(1) : name;
  5337. var capture = name.charAt(0) === '!';
  5338. name = capture ? name.slice(1) : name;
  5339. return {
  5340. name: name,
  5341. once: once$$1,
  5342. capture: capture,
  5343. passive: passive
  5344. }
  5345. });
  5346. function createFnInvoker (fns, vm) {
  5347. function invoker () {
  5348. var arguments$1 = arguments;
  5349. var fns = invoker.fns;
  5350. if (Array.isArray(fns)) {
  5351. var cloned = fns.slice();
  5352. for (var i = 0; i < cloned.length; i++) {
  5353. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5354. }
  5355. } else {
  5356. // return handler return value for single handlers
  5357. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5358. }
  5359. }
  5360. invoker.fns = fns;
  5361. return invoker
  5362. }
  5363. function updateListeners (
  5364. on,
  5365. oldOn,
  5366. add,
  5367. remove$$1,
  5368. createOnceHandler,
  5369. vm
  5370. ) {
  5371. var name, def$$1, cur, old, event;
  5372. for (name in on) {
  5373. def$$1 = cur = on[name];
  5374. old = oldOn[name];
  5375. event = normalizeEvent(name);
  5376. if (isUndef(cur)) {
  5377. true && warn(
  5378. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5379. vm
  5380. );
  5381. } else if (isUndef(old)) {
  5382. if (isUndef(cur.fns)) {
  5383. cur = on[name] = createFnInvoker(cur, vm);
  5384. }
  5385. if (isTrue(event.once)) {
  5386. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5387. }
  5388. add(event.name, cur, event.capture, event.passive, event.params);
  5389. } else if (cur !== old) {
  5390. old.fns = cur;
  5391. on[name] = old;
  5392. }
  5393. }
  5394. for (name in oldOn) {
  5395. if (isUndef(on[name])) {
  5396. event = normalizeEvent(name);
  5397. remove$$1(event.name, oldOn[name], event.capture);
  5398. }
  5399. }
  5400. }
  5401. /* */
  5402. /* */
  5403. // fixed by xxxxxx (mp properties)
  5404. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5405. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5406. if (isUndef(propOptions)) {
  5407. return res
  5408. }
  5409. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5410. var attrs = data.attrs;
  5411. var props = data.props;
  5412. if (isDef(attrs) || isDef(props)) {
  5413. for (var key in propOptions) {
  5414. var altKey = hyphenate(key);
  5415. var result = checkProp(res, props, key, altKey, true) ||
  5416. checkProp(res, attrs, key, altKey, false);
  5417. // externalClass
  5418. if (
  5419. result &&
  5420. res[key] &&
  5421. externalClasses.indexOf(altKey) !== -1 &&
  5422. context[camelize(res[key])]
  5423. ) {
  5424. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5425. res[key] = context[camelize(res[key])];
  5426. }
  5427. }
  5428. }
  5429. return res
  5430. }
  5431. function extractPropsFromVNodeData (
  5432. data,
  5433. Ctor,
  5434. tag,
  5435. context// fixed by xxxxxx
  5436. ) {
  5437. // we are only extracting raw values here.
  5438. // validation and default values are handled in the child
  5439. // component itself.
  5440. var propOptions = Ctor.options.props;
  5441. if (isUndef(propOptions)) {
  5442. // fixed by xxxxxx
  5443. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5444. }
  5445. var res = {};
  5446. var attrs = data.attrs;
  5447. var props = data.props;
  5448. if (isDef(attrs) || isDef(props)) {
  5449. for (var key in propOptions) {
  5450. var altKey = hyphenate(key);
  5451. if (true) {
  5452. var keyInLowerCase = key.toLowerCase();
  5453. if (
  5454. key !== keyInLowerCase &&
  5455. attrs && hasOwn(attrs, keyInLowerCase)
  5456. ) {
  5457. tip(
  5458. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5459. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5460. " \"" + key + "\". " +
  5461. "Note that HTML attributes are case-insensitive and camelCased " +
  5462. "props need to use their kebab-case equivalents when using in-DOM " +
  5463. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5464. );
  5465. }
  5466. }
  5467. checkProp(res, props, key, altKey, true) ||
  5468. checkProp(res, attrs, key, altKey, false);
  5469. }
  5470. }
  5471. // fixed by xxxxxx
  5472. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5473. }
  5474. function checkProp (
  5475. res,
  5476. hash,
  5477. key,
  5478. altKey,
  5479. preserve
  5480. ) {
  5481. if (isDef(hash)) {
  5482. if (hasOwn(hash, key)) {
  5483. res[key] = hash[key];
  5484. if (!preserve) {
  5485. delete hash[key];
  5486. }
  5487. return true
  5488. } else if (hasOwn(hash, altKey)) {
  5489. res[key] = hash[altKey];
  5490. if (!preserve) {
  5491. delete hash[altKey];
  5492. }
  5493. return true
  5494. }
  5495. }
  5496. return false
  5497. }
  5498. /* */
  5499. // The template compiler attempts to minimize the need for normalization by
  5500. // statically analyzing the template at compile time.
  5501. //
  5502. // For plain HTML markup, normalization can be completely skipped because the
  5503. // generated render function is guaranteed to return Array<VNode>. There are
  5504. // two cases where extra normalization is needed:
  5505. // 1. When the children contains components - because a functional component
  5506. // may return an Array instead of a single root. In this case, just a simple
  5507. // normalization is needed - if any child is an Array, we flatten the whole
  5508. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5509. // because functional components already normalize their own children.
  5510. function simpleNormalizeChildren (children) {
  5511. for (var i = 0; i < children.length; i++) {
  5512. if (Array.isArray(children[i])) {
  5513. return Array.prototype.concat.apply([], children)
  5514. }
  5515. }
  5516. return children
  5517. }
  5518. // 2. When the children contains constructs that always generated nested Arrays,
  5519. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5520. // with hand-written render functions / JSX. In such cases a full normalization
  5521. // is needed to cater to all possible types of children values.
  5522. function normalizeChildren (children) {
  5523. return isPrimitive(children)
  5524. ? [createTextVNode(children)]
  5525. : Array.isArray(children)
  5526. ? normalizeArrayChildren(children)
  5527. : undefined
  5528. }
  5529. function isTextNode (node) {
  5530. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5531. }
  5532. function normalizeArrayChildren (children, nestedIndex) {
  5533. var res = [];
  5534. var i, c, lastIndex, last;
  5535. for (i = 0; i < children.length; i++) {
  5536. c = children[i];
  5537. if (isUndef(c) || typeof c === 'boolean') { continue }
  5538. lastIndex = res.length - 1;
  5539. last = res[lastIndex];
  5540. // nested
  5541. if (Array.isArray(c)) {
  5542. if (c.length > 0) {
  5543. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5544. // merge adjacent text nodes
  5545. if (isTextNode(c[0]) && isTextNode(last)) {
  5546. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5547. c.shift();
  5548. }
  5549. res.push.apply(res, c);
  5550. }
  5551. } else if (isPrimitive(c)) {
  5552. if (isTextNode(last)) {
  5553. // merge adjacent text nodes
  5554. // this is necessary for SSR hydration because text nodes are
  5555. // essentially merged when rendered to HTML strings
  5556. res[lastIndex] = createTextVNode(last.text + c);
  5557. } else if (c !== '') {
  5558. // convert primitive to vnode
  5559. res.push(createTextVNode(c));
  5560. }
  5561. } else {
  5562. if (isTextNode(c) && isTextNode(last)) {
  5563. // merge adjacent text nodes
  5564. res[lastIndex] = createTextVNode(last.text + c.text);
  5565. } else {
  5566. // default key for nested array children (likely generated by v-for)
  5567. if (isTrue(children._isVList) &&
  5568. isDef(c.tag) &&
  5569. isUndef(c.key) &&
  5570. isDef(nestedIndex)) {
  5571. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5572. }
  5573. res.push(c);
  5574. }
  5575. }
  5576. }
  5577. return res
  5578. }
  5579. /* */
  5580. function initProvide (vm) {
  5581. var provide = vm.$options.provide;
  5582. if (provide) {
  5583. vm._provided = typeof provide === 'function'
  5584. ? provide.call(vm)
  5585. : provide;
  5586. }
  5587. }
  5588. function initInjections (vm) {
  5589. var result = resolveInject(vm.$options.inject, vm);
  5590. if (result) {
  5591. toggleObserving(false);
  5592. Object.keys(result).forEach(function (key) {
  5593. /* istanbul ignore else */
  5594. if (true) {
  5595. defineReactive$$1(vm, key, result[key], function () {
  5596. warn(
  5597. "Avoid mutating an injected value directly since the changes will be " +
  5598. "overwritten whenever the provided component re-renders. " +
  5599. "injection being mutated: \"" + key + "\"",
  5600. vm
  5601. );
  5602. });
  5603. } else {}
  5604. });
  5605. toggleObserving(true);
  5606. }
  5607. }
  5608. function resolveInject (inject, vm) {
  5609. if (inject) {
  5610. // inject is :any because flow is not smart enough to figure out cached
  5611. var result = Object.create(null);
  5612. var keys = hasSymbol
  5613. ? Reflect.ownKeys(inject)
  5614. : Object.keys(inject);
  5615. for (var i = 0; i < keys.length; i++) {
  5616. var key = keys[i];
  5617. // #6574 in case the inject object is observed...
  5618. if (key === '__ob__') { continue }
  5619. var provideKey = inject[key].from;
  5620. var source = vm;
  5621. while (source) {
  5622. if (source._provided && hasOwn(source._provided, provideKey)) {
  5623. result[key] = source._provided[provideKey];
  5624. break
  5625. }
  5626. source = source.$parent;
  5627. }
  5628. if (!source) {
  5629. if ('default' in inject[key]) {
  5630. var provideDefault = inject[key].default;
  5631. result[key] = typeof provideDefault === 'function'
  5632. ? provideDefault.call(vm)
  5633. : provideDefault;
  5634. } else if (true) {
  5635. warn(("Injection \"" + key + "\" not found"), vm);
  5636. }
  5637. }
  5638. }
  5639. return result
  5640. }
  5641. }
  5642. /* */
  5643. /**
  5644. * Runtime helper for resolving raw children VNodes into a slot object.
  5645. */
  5646. function resolveSlots (
  5647. children,
  5648. context
  5649. ) {
  5650. if (!children || !children.length) {
  5651. return {}
  5652. }
  5653. var slots = {};
  5654. for (var i = 0, l = children.length; i < l; i++) {
  5655. var child = children[i];
  5656. var data = child.data;
  5657. // remove slot attribute if the node is resolved as a Vue slot node
  5658. if (data && data.attrs && data.attrs.slot) {
  5659. delete data.attrs.slot;
  5660. }
  5661. // named slots should only be respected if the vnode was rendered in the
  5662. // same context.
  5663. if ((child.context === context || child.fnContext === context) &&
  5664. data && data.slot != null
  5665. ) {
  5666. var name = data.slot;
  5667. var slot = (slots[name] || (slots[name] = []));
  5668. if (child.tag === 'template') {
  5669. slot.push.apply(slot, child.children || []);
  5670. } else {
  5671. slot.push(child);
  5672. }
  5673. } else {
  5674. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5675. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5676. (slots['page'] || (slots['page'] = [])).push(child);
  5677. }else{
  5678. (slots.default || (slots.default = [])).push(child);
  5679. }
  5680. }
  5681. }
  5682. // ignore slots that contains only whitespace
  5683. for (var name$1 in slots) {
  5684. if (slots[name$1].every(isWhitespace)) {
  5685. delete slots[name$1];
  5686. }
  5687. }
  5688. return slots
  5689. }
  5690. function isWhitespace (node) {
  5691. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5692. }
  5693. /* */
  5694. function normalizeScopedSlots (
  5695. slots,
  5696. normalSlots,
  5697. prevSlots
  5698. ) {
  5699. var res;
  5700. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5701. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5702. var key = slots && slots.$key;
  5703. if (!slots) {
  5704. res = {};
  5705. } else if (slots._normalized) {
  5706. // fast path 1: child component re-render only, parent did not change
  5707. return slots._normalized
  5708. } else if (
  5709. isStable &&
  5710. prevSlots &&
  5711. prevSlots !== emptyObject &&
  5712. key === prevSlots.$key &&
  5713. !hasNormalSlots &&
  5714. !prevSlots.$hasNormal
  5715. ) {
  5716. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5717. // only need to normalize once
  5718. return prevSlots
  5719. } else {
  5720. res = {};
  5721. for (var key$1 in slots) {
  5722. if (slots[key$1] && key$1[0] !== '$') {
  5723. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5724. }
  5725. }
  5726. }
  5727. // expose normal slots on scopedSlots
  5728. for (var key$2 in normalSlots) {
  5729. if (!(key$2 in res)) {
  5730. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5731. }
  5732. }
  5733. // avoriaz seems to mock a non-extensible $scopedSlots object
  5734. // and when that is passed down this would cause an error
  5735. if (slots && Object.isExtensible(slots)) {
  5736. (slots)._normalized = res;
  5737. }
  5738. def(res, '$stable', isStable);
  5739. def(res, '$key', key);
  5740. def(res, '$hasNormal', hasNormalSlots);
  5741. return res
  5742. }
  5743. function normalizeScopedSlot(normalSlots, key, fn) {
  5744. var normalized = function () {
  5745. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5746. res = res && typeof res === 'object' && !Array.isArray(res)
  5747. ? [res] // single vnode
  5748. : normalizeChildren(res);
  5749. return res && (
  5750. res.length === 0 ||
  5751. (res.length === 1 && res[0].isComment) // #9658
  5752. ) ? undefined
  5753. : res
  5754. };
  5755. // this is a slot using the new v-slot syntax without scope. although it is
  5756. // compiled as a scoped slot, render fn users would expect it to be present
  5757. // on this.$slots because the usage is semantically a normal slot.
  5758. if (fn.proxy) {
  5759. Object.defineProperty(normalSlots, key, {
  5760. get: normalized,
  5761. enumerable: true,
  5762. configurable: true
  5763. });
  5764. }
  5765. return normalized
  5766. }
  5767. function proxyNormalSlot(slots, key) {
  5768. return function () { return slots[key]; }
  5769. }
  5770. /* */
  5771. /**
  5772. * Runtime helper for rendering v-for lists.
  5773. */
  5774. function renderList (
  5775. val,
  5776. render
  5777. ) {
  5778. var ret, i, l, keys, key;
  5779. if (Array.isArray(val) || typeof val === 'string') {
  5780. ret = new Array(val.length);
  5781. for (i = 0, l = val.length; i < l; i++) {
  5782. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5783. }
  5784. } else if (typeof val === 'number') {
  5785. ret = new Array(val);
  5786. for (i = 0; i < val; i++) {
  5787. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5788. }
  5789. } else if (isObject(val)) {
  5790. if (hasSymbol && val[Symbol.iterator]) {
  5791. ret = [];
  5792. var iterator = val[Symbol.iterator]();
  5793. var result = iterator.next();
  5794. while (!result.done) {
  5795. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5796. result = iterator.next();
  5797. }
  5798. } else {
  5799. keys = Object.keys(val);
  5800. ret = new Array(keys.length);
  5801. for (i = 0, l = keys.length; i < l; i++) {
  5802. key = keys[i];
  5803. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5804. }
  5805. }
  5806. }
  5807. if (!isDef(ret)) {
  5808. ret = [];
  5809. }
  5810. (ret)._isVList = true;
  5811. return ret
  5812. }
  5813. /* */
  5814. /**
  5815. * Runtime helper for rendering <slot>
  5816. */
  5817. function renderSlot (
  5818. name,
  5819. fallback,
  5820. props,
  5821. bindObject
  5822. ) {
  5823. var scopedSlotFn = this.$scopedSlots[name];
  5824. var nodes;
  5825. if (scopedSlotFn) { // scoped slot
  5826. props = props || {};
  5827. if (bindObject) {
  5828. if ( true && !isObject(bindObject)) {
  5829. warn(
  5830. 'slot v-bind without argument expects an Object',
  5831. this
  5832. );
  5833. }
  5834. props = extend(extend({}, bindObject), props);
  5835. }
  5836. // fixed by xxxxxx app-plus scopedSlot
  5837. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5838. } else {
  5839. nodes = this.$slots[name] || fallback;
  5840. }
  5841. var target = props && props.slot;
  5842. if (target) {
  5843. return this.$createElement('template', { slot: target }, nodes)
  5844. } else {
  5845. return nodes
  5846. }
  5847. }
  5848. /* */
  5849. /**
  5850. * Runtime helper for resolving filters
  5851. */
  5852. function resolveFilter (id) {
  5853. return resolveAsset(this.$options, 'filters', id, true) || identity
  5854. }
  5855. /* */
  5856. function isKeyNotMatch (expect, actual) {
  5857. if (Array.isArray(expect)) {
  5858. return expect.indexOf(actual) === -1
  5859. } else {
  5860. return expect !== actual
  5861. }
  5862. }
  5863. /**
  5864. * Runtime helper for checking keyCodes from config.
  5865. * exposed as Vue.prototype._k
  5866. * passing in eventKeyName as last argument separately for backwards compat
  5867. */
  5868. function checkKeyCodes (
  5869. eventKeyCode,
  5870. key,
  5871. builtInKeyCode,
  5872. eventKeyName,
  5873. builtInKeyName
  5874. ) {
  5875. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5876. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5877. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5878. } else if (mappedKeyCode) {
  5879. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5880. } else if (eventKeyName) {
  5881. return hyphenate(eventKeyName) !== key
  5882. }
  5883. }
  5884. /* */
  5885. /**
  5886. * Runtime helper for merging v-bind="object" into a VNode's data.
  5887. */
  5888. function bindObjectProps (
  5889. data,
  5890. tag,
  5891. value,
  5892. asProp,
  5893. isSync
  5894. ) {
  5895. if (value) {
  5896. if (!isObject(value)) {
  5897. true && warn(
  5898. 'v-bind without argument expects an Object or Array value',
  5899. this
  5900. );
  5901. } else {
  5902. if (Array.isArray(value)) {
  5903. value = toObject(value);
  5904. }
  5905. var hash;
  5906. var loop = function ( key ) {
  5907. if (
  5908. key === 'class' ||
  5909. key === 'style' ||
  5910. isReservedAttribute(key)
  5911. ) {
  5912. hash = data;
  5913. } else {
  5914. var type = data.attrs && data.attrs.type;
  5915. hash = asProp || config.mustUseProp(tag, type, key)
  5916. ? data.domProps || (data.domProps = {})
  5917. : data.attrs || (data.attrs = {});
  5918. }
  5919. var camelizedKey = camelize(key);
  5920. var hyphenatedKey = hyphenate(key);
  5921. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5922. hash[key] = value[key];
  5923. if (isSync) {
  5924. var on = data.on || (data.on = {});
  5925. on[("update:" + key)] = function ($event) {
  5926. value[key] = $event;
  5927. };
  5928. }
  5929. }
  5930. };
  5931. for (var key in value) loop( key );
  5932. }
  5933. }
  5934. return data
  5935. }
  5936. /* */
  5937. /**
  5938. * Runtime helper for rendering static trees.
  5939. */
  5940. function renderStatic (
  5941. index,
  5942. isInFor
  5943. ) {
  5944. var cached = this._staticTrees || (this._staticTrees = []);
  5945. var tree = cached[index];
  5946. // if has already-rendered static tree and not inside v-for,
  5947. // we can reuse the same tree.
  5948. if (tree && !isInFor) {
  5949. return tree
  5950. }
  5951. // otherwise, render a fresh tree.
  5952. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5953. this._renderProxy,
  5954. null,
  5955. this // for render fns generated for functional component templates
  5956. );
  5957. markStatic(tree, ("__static__" + index), false);
  5958. return tree
  5959. }
  5960. /**
  5961. * Runtime helper for v-once.
  5962. * Effectively it means marking the node as static with a unique key.
  5963. */
  5964. function markOnce (
  5965. tree,
  5966. index,
  5967. key
  5968. ) {
  5969. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5970. return tree
  5971. }
  5972. function markStatic (
  5973. tree,
  5974. key,
  5975. isOnce
  5976. ) {
  5977. if (Array.isArray(tree)) {
  5978. for (var i = 0; i < tree.length; i++) {
  5979. if (tree[i] && typeof tree[i] !== 'string') {
  5980. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5981. }
  5982. }
  5983. } else {
  5984. markStaticNode(tree, key, isOnce);
  5985. }
  5986. }
  5987. function markStaticNode (node, key, isOnce) {
  5988. node.isStatic = true;
  5989. node.key = key;
  5990. node.isOnce = isOnce;
  5991. }
  5992. /* */
  5993. function bindObjectListeners (data, value) {
  5994. if (value) {
  5995. if (!isPlainObject(value)) {
  5996. true && warn(
  5997. 'v-on without argument expects an Object value',
  5998. this
  5999. );
  6000. } else {
  6001. var on = data.on = data.on ? extend({}, data.on) : {};
  6002. for (var key in value) {
  6003. var existing = on[key];
  6004. var ours = value[key];
  6005. on[key] = existing ? [].concat(existing, ours) : ours;
  6006. }
  6007. }
  6008. }
  6009. return data
  6010. }
  6011. /* */
  6012. function resolveScopedSlots (
  6013. fns, // see flow/vnode
  6014. res,
  6015. // the following are added in 2.6
  6016. hasDynamicKeys,
  6017. contentHashKey
  6018. ) {
  6019. res = res || { $stable: !hasDynamicKeys };
  6020. for (var i = 0; i < fns.length; i++) {
  6021. var slot = fns[i];
  6022. if (Array.isArray(slot)) {
  6023. resolveScopedSlots(slot, res, hasDynamicKeys);
  6024. } else if (slot) {
  6025. // marker for reverse proxying v-slot without scope on this.$slots
  6026. if (slot.proxy) {
  6027. slot.fn.proxy = true;
  6028. }
  6029. res[slot.key] = slot.fn;
  6030. }
  6031. }
  6032. if (contentHashKey) {
  6033. (res).$key = contentHashKey;
  6034. }
  6035. return res
  6036. }
  6037. /* */
  6038. function bindDynamicKeys (baseObj, values) {
  6039. for (var i = 0; i < values.length; i += 2) {
  6040. var key = values[i];
  6041. if (typeof key === 'string' && key) {
  6042. baseObj[values[i]] = values[i + 1];
  6043. } else if ( true && key !== '' && key !== null) {
  6044. // null is a special value for explicitly removing a binding
  6045. warn(
  6046. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6047. this
  6048. );
  6049. }
  6050. }
  6051. return baseObj
  6052. }
  6053. // helper to dynamically append modifier runtime markers to event names.
  6054. // ensure only append when value is already string, otherwise it will be cast
  6055. // to string and cause the type check to miss.
  6056. function prependModifier (value, symbol) {
  6057. return typeof value === 'string' ? symbol + value : value
  6058. }
  6059. /* */
  6060. function installRenderHelpers (target) {
  6061. target._o = markOnce;
  6062. target._n = toNumber;
  6063. target._s = toString;
  6064. target._l = renderList;
  6065. target._t = renderSlot;
  6066. target._q = looseEqual;
  6067. target._i = looseIndexOf;
  6068. target._m = renderStatic;
  6069. target._f = resolveFilter;
  6070. target._k = checkKeyCodes;
  6071. target._b = bindObjectProps;
  6072. target._v = createTextVNode;
  6073. target._e = createEmptyVNode;
  6074. target._u = resolveScopedSlots;
  6075. target._g = bindObjectListeners;
  6076. target._d = bindDynamicKeys;
  6077. target._p = prependModifier;
  6078. }
  6079. /* */
  6080. function FunctionalRenderContext (
  6081. data,
  6082. props,
  6083. children,
  6084. parent,
  6085. Ctor
  6086. ) {
  6087. var this$1 = this;
  6088. var options = Ctor.options;
  6089. // ensure the createElement function in functional components
  6090. // gets a unique context - this is necessary for correct named slot check
  6091. var contextVm;
  6092. if (hasOwn(parent, '_uid')) {
  6093. contextVm = Object.create(parent);
  6094. // $flow-disable-line
  6095. contextVm._original = parent;
  6096. } else {
  6097. // the context vm passed in is a functional context as well.
  6098. // in this case we want to make sure we are able to get a hold to the
  6099. // real context instance.
  6100. contextVm = parent;
  6101. // $flow-disable-line
  6102. parent = parent._original;
  6103. }
  6104. var isCompiled = isTrue(options._compiled);
  6105. var needNormalization = !isCompiled;
  6106. this.data = data;
  6107. this.props = props;
  6108. this.children = children;
  6109. this.parent = parent;
  6110. this.listeners = data.on || emptyObject;
  6111. this.injections = resolveInject(options.inject, parent);
  6112. this.slots = function () {
  6113. if (!this$1.$slots) {
  6114. normalizeScopedSlots(
  6115. data.scopedSlots,
  6116. this$1.$slots = resolveSlots(children, parent)
  6117. );
  6118. }
  6119. return this$1.$slots
  6120. };
  6121. Object.defineProperty(this, 'scopedSlots', ({
  6122. enumerable: true,
  6123. get: function get () {
  6124. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6125. }
  6126. }));
  6127. // support for compiled functional template
  6128. if (isCompiled) {
  6129. // exposing $options for renderStatic()
  6130. this.$options = options;
  6131. // pre-resolve slots for renderSlot()
  6132. this.$slots = this.slots();
  6133. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6134. }
  6135. if (options._scopeId) {
  6136. this._c = function (a, b, c, d) {
  6137. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6138. if (vnode && !Array.isArray(vnode)) {
  6139. vnode.fnScopeId = options._scopeId;
  6140. vnode.fnContext = parent;
  6141. }
  6142. return vnode
  6143. };
  6144. } else {
  6145. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6146. }
  6147. }
  6148. installRenderHelpers(FunctionalRenderContext.prototype);
  6149. function createFunctionalComponent (
  6150. Ctor,
  6151. propsData,
  6152. data,
  6153. contextVm,
  6154. children
  6155. ) {
  6156. var options = Ctor.options;
  6157. var props = {};
  6158. var propOptions = options.props;
  6159. if (isDef(propOptions)) {
  6160. for (var key in propOptions) {
  6161. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6162. }
  6163. } else {
  6164. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6165. if (isDef(data.props)) { mergeProps(props, data.props); }
  6166. }
  6167. var renderContext = new FunctionalRenderContext(
  6168. data,
  6169. props,
  6170. children,
  6171. contextVm,
  6172. Ctor
  6173. );
  6174. var vnode = options.render.call(null, renderContext._c, renderContext);
  6175. if (vnode instanceof VNode) {
  6176. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6177. } else if (Array.isArray(vnode)) {
  6178. var vnodes = normalizeChildren(vnode) || [];
  6179. var res = new Array(vnodes.length);
  6180. for (var i = 0; i < vnodes.length; i++) {
  6181. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6182. }
  6183. return res
  6184. }
  6185. }
  6186. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6187. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6188. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6189. // that should not be matched to match.
  6190. var clone = cloneVNode(vnode);
  6191. clone.fnContext = contextVm;
  6192. clone.fnOptions = options;
  6193. if (true) {
  6194. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6195. }
  6196. if (data.slot) {
  6197. (clone.data || (clone.data = {})).slot = data.slot;
  6198. }
  6199. return clone
  6200. }
  6201. function mergeProps (to, from) {
  6202. for (var key in from) {
  6203. to[camelize(key)] = from[key];
  6204. }
  6205. }
  6206. /* */
  6207. /* */
  6208. /* */
  6209. /* */
  6210. // inline hooks to be invoked on component VNodes during patch
  6211. var componentVNodeHooks = {
  6212. init: function init (vnode, hydrating) {
  6213. if (
  6214. vnode.componentInstance &&
  6215. !vnode.componentInstance._isDestroyed &&
  6216. vnode.data.keepAlive
  6217. ) {
  6218. // kept-alive components, treat as a patch
  6219. var mountedNode = vnode; // work around flow
  6220. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6221. } else {
  6222. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6223. vnode,
  6224. activeInstance
  6225. );
  6226. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6227. }
  6228. },
  6229. prepatch: function prepatch (oldVnode, vnode) {
  6230. var options = vnode.componentOptions;
  6231. var child = vnode.componentInstance = oldVnode.componentInstance;
  6232. updateChildComponent(
  6233. child,
  6234. options.propsData, // updated props
  6235. options.listeners, // updated listeners
  6236. vnode, // new parent vnode
  6237. options.children // new children
  6238. );
  6239. },
  6240. insert: function insert (vnode) {
  6241. var context = vnode.context;
  6242. var componentInstance = vnode.componentInstance;
  6243. if (!componentInstance._isMounted) {
  6244. callHook(componentInstance, 'onServiceCreated');
  6245. callHook(componentInstance, 'onServiceAttached');
  6246. componentInstance._isMounted = true;
  6247. callHook(componentInstance, 'mounted');
  6248. }
  6249. if (vnode.data.keepAlive) {
  6250. if (context._isMounted) {
  6251. // vue-router#1212
  6252. // During updates, a kept-alive component's child components may
  6253. // change, so directly walking the tree here may call activated hooks
  6254. // on incorrect children. Instead we push them into a queue which will
  6255. // be processed after the whole patch process ended.
  6256. queueActivatedComponent(componentInstance);
  6257. } else {
  6258. activateChildComponent(componentInstance, true /* direct */);
  6259. }
  6260. }
  6261. },
  6262. destroy: function destroy (vnode) {
  6263. var componentInstance = vnode.componentInstance;
  6264. if (!componentInstance._isDestroyed) {
  6265. if (!vnode.data.keepAlive) {
  6266. componentInstance.$destroy();
  6267. } else {
  6268. deactivateChildComponent(componentInstance, true /* direct */);
  6269. }
  6270. }
  6271. }
  6272. };
  6273. var hooksToMerge = Object.keys(componentVNodeHooks);
  6274. function createComponent (
  6275. Ctor,
  6276. data,
  6277. context,
  6278. children,
  6279. tag
  6280. ) {
  6281. if (isUndef(Ctor)) {
  6282. return
  6283. }
  6284. var baseCtor = context.$options._base;
  6285. // plain options object: turn it into a constructor
  6286. if (isObject(Ctor)) {
  6287. Ctor = baseCtor.extend(Ctor);
  6288. }
  6289. // if at this stage it's not a constructor or an async component factory,
  6290. // reject.
  6291. if (typeof Ctor !== 'function') {
  6292. if (true) {
  6293. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6294. }
  6295. return
  6296. }
  6297. // async component
  6298. var asyncFactory;
  6299. if (isUndef(Ctor.cid)) {
  6300. asyncFactory = Ctor;
  6301. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6302. if (Ctor === undefined) {
  6303. // return a placeholder node for async component, which is rendered
  6304. // as a comment node but preserves all the raw information for the node.
  6305. // the information will be used for async server-rendering and hydration.
  6306. return createAsyncPlaceholder(
  6307. asyncFactory,
  6308. data,
  6309. context,
  6310. children,
  6311. tag
  6312. )
  6313. }
  6314. }
  6315. data = data || {};
  6316. // resolve constructor options in case global mixins are applied after
  6317. // component constructor creation
  6318. resolveConstructorOptions(Ctor);
  6319. // transform component v-model data into props & events
  6320. if (isDef(data.model)) {
  6321. transformModel(Ctor.options, data);
  6322. }
  6323. // extract props
  6324. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6325. // functional component
  6326. if (isTrue(Ctor.options.functional)) {
  6327. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6328. }
  6329. // extract listeners, since these needs to be treated as
  6330. // child component listeners instead of DOM listeners
  6331. var listeners = data.on;
  6332. // replace with listeners with .native modifier
  6333. // so it gets processed during parent component patch.
  6334. data.on = data.nativeOn;
  6335. if (isTrue(Ctor.options.abstract)) {
  6336. // abstract components do not keep anything
  6337. // other than props & listeners & slot
  6338. // work around flow
  6339. var slot = data.slot;
  6340. data = {};
  6341. if (slot) {
  6342. data.slot = slot;
  6343. }
  6344. }
  6345. // install component management hooks onto the placeholder node
  6346. installComponentHooks(data);
  6347. // return a placeholder vnode
  6348. var name = Ctor.options.name || tag;
  6349. var vnode = new VNode(
  6350. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6351. data, undefined, undefined, undefined, context,
  6352. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6353. asyncFactory
  6354. );
  6355. return vnode
  6356. }
  6357. function createComponentInstanceForVnode (
  6358. vnode, // we know it's MountedComponentVNode but flow doesn't
  6359. parent // activeInstance in lifecycle state
  6360. ) {
  6361. var options = {
  6362. _isComponent: true,
  6363. _parentVnode: vnode,
  6364. parent: parent
  6365. };
  6366. // check inline-template render functions
  6367. var inlineTemplate = vnode.data.inlineTemplate;
  6368. if (isDef(inlineTemplate)) {
  6369. options.render = inlineTemplate.render;
  6370. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6371. }
  6372. return new vnode.componentOptions.Ctor(options)
  6373. }
  6374. function installComponentHooks (data) {
  6375. var hooks = data.hook || (data.hook = {});
  6376. for (var i = 0; i < hooksToMerge.length; i++) {
  6377. var key = hooksToMerge[i];
  6378. var existing = hooks[key];
  6379. var toMerge = componentVNodeHooks[key];
  6380. if (existing !== toMerge && !(existing && existing._merged)) {
  6381. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6382. }
  6383. }
  6384. }
  6385. function mergeHook$1 (f1, f2) {
  6386. var merged = function (a, b) {
  6387. // flow complains about extra args which is why we use any
  6388. f1(a, b);
  6389. f2(a, b);
  6390. };
  6391. merged._merged = true;
  6392. return merged
  6393. }
  6394. // transform component v-model info (value and callback) into
  6395. // prop and event handler respectively.
  6396. function transformModel (options, data) {
  6397. var prop = (options.model && options.model.prop) || 'value';
  6398. var event = (options.model && options.model.event) || 'input'
  6399. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6400. var on = data.on || (data.on = {});
  6401. var existing = on[event];
  6402. var callback = data.model.callback;
  6403. if (isDef(existing)) {
  6404. if (
  6405. Array.isArray(existing)
  6406. ? existing.indexOf(callback) === -1
  6407. : existing !== callback
  6408. ) {
  6409. on[event] = [callback].concat(existing);
  6410. }
  6411. } else {
  6412. on[event] = callback;
  6413. }
  6414. }
  6415. /* */
  6416. var SIMPLE_NORMALIZE = 1;
  6417. var ALWAYS_NORMALIZE = 2;
  6418. // wrapper function for providing a more flexible interface
  6419. // without getting yelled at by flow
  6420. function createElement (
  6421. context,
  6422. tag,
  6423. data,
  6424. children,
  6425. normalizationType,
  6426. alwaysNormalize
  6427. ) {
  6428. if (Array.isArray(data) || isPrimitive(data)) {
  6429. normalizationType = children;
  6430. children = data;
  6431. data = undefined;
  6432. }
  6433. if (isTrue(alwaysNormalize)) {
  6434. normalizationType = ALWAYS_NORMALIZE;
  6435. }
  6436. return _createElement(context, tag, data, children, normalizationType)
  6437. }
  6438. function _createElement (
  6439. context,
  6440. tag,
  6441. data,
  6442. children,
  6443. normalizationType
  6444. ) {
  6445. if (isDef(data) && isDef((data).__ob__)) {
  6446. true && warn(
  6447. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6448. 'Always create fresh vnode data objects in each render!',
  6449. context
  6450. );
  6451. return createEmptyVNode()
  6452. }
  6453. // object syntax in v-bind
  6454. if (isDef(data) && isDef(data.is)) {
  6455. tag = data.is;
  6456. }
  6457. if (!tag) {
  6458. // in case of component :is set to falsy value
  6459. return createEmptyVNode()
  6460. }
  6461. // warn against non-primitive key
  6462. if ( true &&
  6463. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6464. ) {
  6465. {
  6466. warn(
  6467. 'Avoid using non-primitive value as key, ' +
  6468. 'use string/number value instead.',
  6469. context
  6470. );
  6471. }
  6472. }
  6473. // support single function children as default scoped slot
  6474. if (Array.isArray(children) &&
  6475. typeof children[0] === 'function'
  6476. ) {
  6477. data = data || {};
  6478. data.scopedSlots = { default: children[0] };
  6479. children.length = 0;
  6480. }
  6481. if (normalizationType === ALWAYS_NORMALIZE) {
  6482. children = normalizeChildren(children);
  6483. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6484. children = simpleNormalizeChildren(children);
  6485. }
  6486. var vnode, ns;
  6487. if (typeof tag === 'string') {
  6488. var Ctor;
  6489. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6490. if (config.isReservedTag(tag)) {
  6491. // platform built-in elements
  6492. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6493. warn(
  6494. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6495. context
  6496. );
  6497. }
  6498. vnode = new VNode(
  6499. config.parsePlatformTagName(tag), data, children,
  6500. undefined, undefined, context
  6501. );
  6502. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6503. // component
  6504. vnode = createComponent(Ctor, data, context, children, tag);
  6505. } else {
  6506. // unknown or unlisted namespaced elements
  6507. // check at runtime because it may get assigned a namespace when its
  6508. // parent normalizes children
  6509. vnode = new VNode(
  6510. tag, data, children,
  6511. undefined, undefined, context
  6512. );
  6513. }
  6514. } else {
  6515. // direct component options / constructor
  6516. vnode = createComponent(tag, data, context, children);
  6517. }
  6518. if (Array.isArray(vnode)) {
  6519. return vnode
  6520. } else if (isDef(vnode)) {
  6521. if (isDef(ns)) { applyNS(vnode, ns); }
  6522. if (isDef(data)) { registerDeepBindings(data); }
  6523. return vnode
  6524. } else {
  6525. return createEmptyVNode()
  6526. }
  6527. }
  6528. function applyNS (vnode, ns, force) {
  6529. vnode.ns = ns;
  6530. if (vnode.tag === 'foreignObject') {
  6531. // use default namespace inside foreignObject
  6532. ns = undefined;
  6533. force = true;
  6534. }
  6535. if (isDef(vnode.children)) {
  6536. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6537. var child = vnode.children[i];
  6538. if (isDef(child.tag) && (
  6539. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6540. applyNS(child, ns, force);
  6541. }
  6542. }
  6543. }
  6544. }
  6545. // ref #5318
  6546. // necessary to ensure parent re-render when deep bindings like :style and
  6547. // :class are used on slot nodes
  6548. function registerDeepBindings (data) {
  6549. if (isObject(data.style)) {
  6550. traverse(data.style);
  6551. }
  6552. if (isObject(data.class)) {
  6553. traverse(data.class);
  6554. }
  6555. }
  6556. /* */
  6557. function initRender (vm) {
  6558. vm._vnode = null; // the root of the child tree
  6559. vm._staticTrees = null; // v-once cached trees
  6560. var options = vm.$options;
  6561. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6562. var renderContext = parentVnode && parentVnode.context;
  6563. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6564. vm.$scopedSlots = emptyObject;
  6565. // bind the createElement fn to this instance
  6566. // so that we get proper render context inside it.
  6567. // args order: tag, data, children, normalizationType, alwaysNormalize
  6568. // internal version is used by render functions compiled from templates
  6569. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6570. // normalization is always applied for the public version, used in
  6571. // user-written render functions.
  6572. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6573. // $attrs & $listeners are exposed for easier HOC creation.
  6574. // they need to be reactive so that HOCs using them are always updated
  6575. var parentData = parentVnode && parentVnode.data;
  6576. /* istanbul ignore else */
  6577. if (true) {
  6578. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6579. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6580. }, true);
  6581. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6582. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6583. }, true);
  6584. } else {}
  6585. }
  6586. var currentRenderingInstance = null;
  6587. function renderMixin (Vue) {
  6588. // install runtime convenience helpers
  6589. installRenderHelpers(Vue.prototype);
  6590. Vue.prototype.$nextTick = function (fn) {
  6591. return nextTick(fn, this)
  6592. };
  6593. Vue.prototype._render = function () {
  6594. var vm = this;
  6595. var ref = vm.$options;
  6596. var render = ref.render;
  6597. var _parentVnode = ref._parentVnode;
  6598. if (_parentVnode) {
  6599. vm.$scopedSlots = normalizeScopedSlots(
  6600. _parentVnode.data.scopedSlots,
  6601. vm.$slots,
  6602. vm.$scopedSlots
  6603. );
  6604. }
  6605. // set parent vnode. this allows render functions to have access
  6606. // to the data on the placeholder node.
  6607. vm.$vnode = _parentVnode;
  6608. // render self
  6609. var vnode;
  6610. try {
  6611. // There's no need to maintain a stack because all render fns are called
  6612. // separately from one another. Nested component's render fns are called
  6613. // when parent component is patched.
  6614. currentRenderingInstance = vm;
  6615. vnode = render.call(vm._renderProxy, vm.$createElement);
  6616. } catch (e) {
  6617. handleError(e, vm, "render");
  6618. // return error render result,
  6619. // or previous vnode to prevent render error causing blank component
  6620. /* istanbul ignore else */
  6621. if ( true && vm.$options.renderError) {
  6622. try {
  6623. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6624. } catch (e) {
  6625. handleError(e, vm, "renderError");
  6626. vnode = vm._vnode;
  6627. }
  6628. } else {
  6629. vnode = vm._vnode;
  6630. }
  6631. } finally {
  6632. currentRenderingInstance = null;
  6633. }
  6634. // if the returned array contains only a single node, allow it
  6635. if (Array.isArray(vnode) && vnode.length === 1) {
  6636. vnode = vnode[0];
  6637. }
  6638. // return empty vnode in case the render function errored out
  6639. if (!(vnode instanceof VNode)) {
  6640. if ( true && Array.isArray(vnode)) {
  6641. warn(
  6642. 'Multiple root nodes returned from render function. Render function ' +
  6643. 'should return a single root node.',
  6644. vm
  6645. );
  6646. }
  6647. vnode = createEmptyVNode();
  6648. }
  6649. // set parent
  6650. vnode.parent = _parentVnode;
  6651. return vnode
  6652. };
  6653. }
  6654. /* */
  6655. function ensureCtor (comp, base) {
  6656. if (
  6657. comp.__esModule ||
  6658. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6659. ) {
  6660. comp = comp.default;
  6661. }
  6662. return isObject(comp)
  6663. ? base.extend(comp)
  6664. : comp
  6665. }
  6666. function createAsyncPlaceholder (
  6667. factory,
  6668. data,
  6669. context,
  6670. children,
  6671. tag
  6672. ) {
  6673. var node = createEmptyVNode();
  6674. node.asyncFactory = factory;
  6675. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6676. return node
  6677. }
  6678. function resolveAsyncComponent (
  6679. factory,
  6680. baseCtor
  6681. ) {
  6682. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6683. return factory.errorComp
  6684. }
  6685. if (isDef(factory.resolved)) {
  6686. return factory.resolved
  6687. }
  6688. var owner = currentRenderingInstance;
  6689. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6690. // already pending
  6691. factory.owners.push(owner);
  6692. }
  6693. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6694. return factory.loadingComp
  6695. }
  6696. if (owner && !isDef(factory.owners)) {
  6697. var owners = factory.owners = [owner];
  6698. var sync = true;
  6699. var timerLoading = null;
  6700. var timerTimeout = null
  6701. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6702. var forceRender = function (renderCompleted) {
  6703. for (var i = 0, l = owners.length; i < l; i++) {
  6704. (owners[i]).$forceUpdate();
  6705. }
  6706. if (renderCompleted) {
  6707. owners.length = 0;
  6708. if (timerLoading !== null) {
  6709. clearTimeout(timerLoading);
  6710. timerLoading = null;
  6711. }
  6712. if (timerTimeout !== null) {
  6713. clearTimeout(timerTimeout);
  6714. timerTimeout = null;
  6715. }
  6716. }
  6717. };
  6718. var resolve = once(function (res) {
  6719. // cache resolved
  6720. factory.resolved = ensureCtor(res, baseCtor);
  6721. // invoke callbacks only if this is not a synchronous resolve
  6722. // (async resolves are shimmed as synchronous during SSR)
  6723. if (!sync) {
  6724. forceRender(true);
  6725. } else {
  6726. owners.length = 0;
  6727. }
  6728. });
  6729. var reject = once(function (reason) {
  6730. true && warn(
  6731. "Failed to resolve async component: " + (String(factory)) +
  6732. (reason ? ("\nReason: " + reason) : '')
  6733. );
  6734. if (isDef(factory.errorComp)) {
  6735. factory.error = true;
  6736. forceRender(true);
  6737. }
  6738. });
  6739. var res = factory(resolve, reject);
  6740. if (isObject(res)) {
  6741. if (isPromise(res)) {
  6742. // () => Promise
  6743. if (isUndef(factory.resolved)) {
  6744. res.then(resolve, reject);
  6745. }
  6746. } else if (isPromise(res.component)) {
  6747. res.component.then(resolve, reject);
  6748. if (isDef(res.error)) {
  6749. factory.errorComp = ensureCtor(res.error, baseCtor);
  6750. }
  6751. if (isDef(res.loading)) {
  6752. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6753. if (res.delay === 0) {
  6754. factory.loading = true;
  6755. } else {
  6756. timerLoading = setTimeout(function () {
  6757. timerLoading = null;
  6758. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6759. factory.loading = true;
  6760. forceRender(false);
  6761. }
  6762. }, res.delay || 200);
  6763. }
  6764. }
  6765. if (isDef(res.timeout)) {
  6766. timerTimeout = setTimeout(function () {
  6767. timerTimeout = null;
  6768. if (isUndef(factory.resolved)) {
  6769. reject(
  6770. true
  6771. ? ("timeout (" + (res.timeout) + "ms)")
  6772. : undefined
  6773. );
  6774. }
  6775. }, res.timeout);
  6776. }
  6777. }
  6778. }
  6779. sync = false;
  6780. // return in case resolved synchronously
  6781. return factory.loading
  6782. ? factory.loadingComp
  6783. : factory.resolved
  6784. }
  6785. }
  6786. /* */
  6787. function isAsyncPlaceholder (node) {
  6788. return node.isComment && node.asyncFactory
  6789. }
  6790. /* */
  6791. function getFirstComponentChild (children) {
  6792. if (Array.isArray(children)) {
  6793. for (var i = 0; i < children.length; i++) {
  6794. var c = children[i];
  6795. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6796. return c
  6797. }
  6798. }
  6799. }
  6800. }
  6801. /* */
  6802. /* */
  6803. function initEvents (vm) {
  6804. vm._events = Object.create(null);
  6805. vm._hasHookEvent = false;
  6806. // init parent attached events
  6807. var listeners = vm.$options._parentListeners;
  6808. if (listeners) {
  6809. updateComponentListeners(vm, listeners);
  6810. }
  6811. }
  6812. var target;
  6813. function add (event, fn) {
  6814. target.$on(event, fn);
  6815. }
  6816. function remove$1 (event, fn) {
  6817. target.$off(event, fn);
  6818. }
  6819. function createOnceHandler (event, fn) {
  6820. var _target = target;
  6821. return function onceHandler () {
  6822. var res = fn.apply(null, arguments);
  6823. if (res !== null) {
  6824. _target.$off(event, onceHandler);
  6825. }
  6826. }
  6827. }
  6828. function updateComponentListeners (
  6829. vm,
  6830. listeners,
  6831. oldListeners
  6832. ) {
  6833. target = vm;
  6834. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6835. target = undefined;
  6836. }
  6837. function eventsMixin (Vue) {
  6838. var hookRE = /^hook:/;
  6839. Vue.prototype.$on = function (event, fn) {
  6840. var vm = this;
  6841. if (Array.isArray(event)) {
  6842. for (var i = 0, l = event.length; i < l; i++) {
  6843. vm.$on(event[i], fn);
  6844. }
  6845. } else {
  6846. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6847. // optimize hook:event cost by using a boolean flag marked at registration
  6848. // instead of a hash lookup
  6849. if (hookRE.test(event)) {
  6850. vm._hasHookEvent = true;
  6851. }
  6852. }
  6853. return vm
  6854. };
  6855. Vue.prototype.$once = function (event, fn) {
  6856. var vm = this;
  6857. function on () {
  6858. vm.$off(event, on);
  6859. fn.apply(vm, arguments);
  6860. }
  6861. on.fn = fn;
  6862. vm.$on(event, on);
  6863. return vm
  6864. };
  6865. Vue.prototype.$off = function (event, fn) {
  6866. var vm = this;
  6867. // all
  6868. if (!arguments.length) {
  6869. vm._events = Object.create(null);
  6870. return vm
  6871. }
  6872. // array of events
  6873. if (Array.isArray(event)) {
  6874. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6875. vm.$off(event[i$1], fn);
  6876. }
  6877. return vm
  6878. }
  6879. // specific event
  6880. var cbs = vm._events[event];
  6881. if (!cbs) {
  6882. return vm
  6883. }
  6884. if (!fn) {
  6885. vm._events[event] = null;
  6886. return vm
  6887. }
  6888. // specific handler
  6889. var cb;
  6890. var i = cbs.length;
  6891. while (i--) {
  6892. cb = cbs[i];
  6893. if (cb === fn || cb.fn === fn) {
  6894. cbs.splice(i, 1);
  6895. break
  6896. }
  6897. }
  6898. return vm
  6899. };
  6900. Vue.prototype.$emit = function (event) {
  6901. var vm = this;
  6902. if (true) {
  6903. var lowerCaseEvent = event.toLowerCase();
  6904. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6905. tip(
  6906. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6907. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6908. "Note that HTML attributes are case-insensitive and you cannot use " +
  6909. "v-on to listen to camelCase events when using in-DOM templates. " +
  6910. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6911. );
  6912. }
  6913. }
  6914. var cbs = vm._events[event];
  6915. if (cbs) {
  6916. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6917. var args = toArray(arguments, 1);
  6918. var info = "event handler for \"" + event + "\"";
  6919. for (var i = 0, l = cbs.length; i < l; i++) {
  6920. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6921. }
  6922. }
  6923. return vm
  6924. };
  6925. }
  6926. /* */
  6927. var activeInstance = null;
  6928. var isUpdatingChildComponent = false;
  6929. function setActiveInstance(vm) {
  6930. var prevActiveInstance = activeInstance;
  6931. activeInstance = vm;
  6932. return function () {
  6933. activeInstance = prevActiveInstance;
  6934. }
  6935. }
  6936. function initLifecycle (vm) {
  6937. var options = vm.$options;
  6938. // locate first non-abstract parent
  6939. var parent = options.parent;
  6940. if (parent && !options.abstract) {
  6941. while (parent.$options.abstract && parent.$parent) {
  6942. parent = parent.$parent;
  6943. }
  6944. parent.$children.push(vm);
  6945. }
  6946. vm.$parent = parent;
  6947. vm.$root = parent ? parent.$root : vm;
  6948. vm.$children = [];
  6949. vm.$refs = {};
  6950. vm._watcher = null;
  6951. vm._inactive = null;
  6952. vm._directInactive = false;
  6953. vm._isMounted = false;
  6954. vm._isDestroyed = false;
  6955. vm._isBeingDestroyed = false;
  6956. }
  6957. function lifecycleMixin (Vue) {
  6958. Vue.prototype._update = function (vnode, hydrating) {
  6959. var vm = this;
  6960. var prevEl = vm.$el;
  6961. var prevVnode = vm._vnode;
  6962. var restoreActiveInstance = setActiveInstance(vm);
  6963. vm._vnode = vnode;
  6964. // Vue.prototype.__patch__ is injected in entry points
  6965. // based on the rendering backend used.
  6966. if (!prevVnode) {
  6967. // initial render
  6968. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6969. } else {
  6970. // updates
  6971. vm.$el = vm.__patch__(prevVnode, vnode);
  6972. }
  6973. restoreActiveInstance();
  6974. // update __vue__ reference
  6975. if (prevEl) {
  6976. prevEl.__vue__ = null;
  6977. }
  6978. if (vm.$el) {
  6979. vm.$el.__vue__ = vm;
  6980. }
  6981. // if parent is an HOC, update its $el as well
  6982. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6983. vm.$parent.$el = vm.$el;
  6984. }
  6985. // updated hook is called by the scheduler to ensure that children are
  6986. // updated in a parent's updated hook.
  6987. };
  6988. Vue.prototype.$forceUpdate = function () {
  6989. var vm = this;
  6990. if (vm._watcher) {
  6991. vm._watcher.update();
  6992. }
  6993. };
  6994. Vue.prototype.$destroy = function () {
  6995. var vm = this;
  6996. if (vm._isBeingDestroyed) {
  6997. return
  6998. }
  6999. callHook(vm, 'beforeDestroy');
  7000. vm._isBeingDestroyed = true;
  7001. // remove self from parent
  7002. var parent = vm.$parent;
  7003. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7004. remove(parent.$children, vm);
  7005. }
  7006. // teardown watchers
  7007. if (vm._watcher) {
  7008. vm._watcher.teardown();
  7009. }
  7010. var i = vm._watchers.length;
  7011. while (i--) {
  7012. vm._watchers[i].teardown();
  7013. }
  7014. // remove reference from data ob
  7015. // frozen object may not have observer.
  7016. if (vm._data.__ob__) {
  7017. vm._data.__ob__.vmCount--;
  7018. }
  7019. // call the last hook...
  7020. vm._isDestroyed = true;
  7021. // invoke destroy hooks on current rendered tree
  7022. vm.__patch__(vm._vnode, null);
  7023. // fire destroyed hook
  7024. callHook(vm, 'destroyed');
  7025. // turn off all instance listeners.
  7026. vm.$off();
  7027. // remove __vue__ reference
  7028. if (vm.$el) {
  7029. vm.$el.__vue__ = null;
  7030. }
  7031. // release circular reference (#6759)
  7032. if (vm.$vnode) {
  7033. vm.$vnode.parent = null;
  7034. }
  7035. };
  7036. }
  7037. function updateChildComponent (
  7038. vm,
  7039. propsData,
  7040. listeners,
  7041. parentVnode,
  7042. renderChildren
  7043. ) {
  7044. if (true) {
  7045. isUpdatingChildComponent = true;
  7046. }
  7047. // determine whether component has slot children
  7048. // we need to do this before overwriting $options._renderChildren.
  7049. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7050. // dynamic slot names). Static scoped slots compiled from template has the
  7051. // "$stable" marker.
  7052. var newScopedSlots = parentVnode.data.scopedSlots;
  7053. var oldScopedSlots = vm.$scopedSlots;
  7054. var hasDynamicScopedSlot = !!(
  7055. (newScopedSlots && !newScopedSlots.$stable) ||
  7056. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7057. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7058. );
  7059. // Any static slot children from the parent may have changed during parent's
  7060. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7061. // update is necessary to ensure correctness.
  7062. var needsForceUpdate = !!(
  7063. renderChildren || // has new static slots
  7064. vm.$options._renderChildren || // has old static slots
  7065. hasDynamicScopedSlot
  7066. );
  7067. vm.$options._parentVnode = parentVnode;
  7068. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7069. if (vm._vnode) { // update child tree's parent
  7070. vm._vnode.parent = parentVnode;
  7071. }
  7072. vm.$options._renderChildren = renderChildren;
  7073. // update $attrs and $listeners hash
  7074. // these are also reactive so they may trigger child update if the child
  7075. // used them during render
  7076. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7077. vm.$listeners = listeners || emptyObject;
  7078. // update props
  7079. if (propsData && vm.$options.props) {
  7080. toggleObserving(false);
  7081. var props = vm._props;
  7082. var propKeys = vm.$options._propKeys || [];
  7083. for (var i = 0; i < propKeys.length; i++) {
  7084. var key = propKeys[i];
  7085. var propOptions = vm.$options.props; // wtf flow?
  7086. props[key] = validateProp(key, propOptions, propsData, vm);
  7087. }
  7088. toggleObserving(true);
  7089. // keep a copy of raw propsData
  7090. vm.$options.propsData = propsData;
  7091. }
  7092. // fixed by xxxxxx update properties(mp runtime)
  7093. vm._$updateProperties && vm._$updateProperties(vm);
  7094. // update listeners
  7095. listeners = listeners || emptyObject;
  7096. var oldListeners = vm.$options._parentListeners;
  7097. vm.$options._parentListeners = listeners;
  7098. updateComponentListeners(vm, listeners, oldListeners);
  7099. // resolve slots + force update if has children
  7100. if (needsForceUpdate) {
  7101. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7102. vm.$forceUpdate();
  7103. }
  7104. if (true) {
  7105. isUpdatingChildComponent = false;
  7106. }
  7107. }
  7108. function isInInactiveTree (vm) {
  7109. while (vm && (vm = vm.$parent)) {
  7110. if (vm._inactive) { return true }
  7111. }
  7112. return false
  7113. }
  7114. function activateChildComponent (vm, direct) {
  7115. if (direct) {
  7116. vm._directInactive = false;
  7117. if (isInInactiveTree(vm)) {
  7118. return
  7119. }
  7120. } else if (vm._directInactive) {
  7121. return
  7122. }
  7123. if (vm._inactive || vm._inactive === null) {
  7124. vm._inactive = false;
  7125. for (var i = 0; i < vm.$children.length; i++) {
  7126. activateChildComponent(vm.$children[i]);
  7127. }
  7128. callHook(vm, 'activated');
  7129. }
  7130. }
  7131. function deactivateChildComponent (vm, direct) {
  7132. if (direct) {
  7133. vm._directInactive = true;
  7134. if (isInInactiveTree(vm)) {
  7135. return
  7136. }
  7137. }
  7138. if (!vm._inactive) {
  7139. vm._inactive = true;
  7140. for (var i = 0; i < vm.$children.length; i++) {
  7141. deactivateChildComponent(vm.$children[i]);
  7142. }
  7143. callHook(vm, 'deactivated');
  7144. }
  7145. }
  7146. function callHook (vm, hook) {
  7147. // #7573 disable dep collection when invoking lifecycle hooks
  7148. pushTarget();
  7149. var handlers = vm.$options[hook];
  7150. var info = hook + " hook";
  7151. if (handlers) {
  7152. for (var i = 0, j = handlers.length; i < j; i++) {
  7153. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7154. }
  7155. }
  7156. if (vm._hasHookEvent) {
  7157. vm.$emit('hook:' + hook);
  7158. }
  7159. popTarget();
  7160. }
  7161. /* */
  7162. var MAX_UPDATE_COUNT = 100;
  7163. var queue = [];
  7164. var activatedChildren = [];
  7165. var has = {};
  7166. var circular = {};
  7167. var waiting = false;
  7168. var flushing = false;
  7169. var index = 0;
  7170. /**
  7171. * Reset the scheduler's state.
  7172. */
  7173. function resetSchedulerState () {
  7174. index = queue.length = activatedChildren.length = 0;
  7175. has = {};
  7176. if (true) {
  7177. circular = {};
  7178. }
  7179. waiting = flushing = false;
  7180. }
  7181. // Async edge case #6566 requires saving the timestamp when event listeners are
  7182. // attached. However, calling performance.now() has a perf overhead especially
  7183. // if the page has thousands of event listeners. Instead, we take a timestamp
  7184. // every time the scheduler flushes and use that for all event listeners
  7185. // attached during that flush.
  7186. var currentFlushTimestamp = 0;
  7187. // Async edge case fix requires storing an event listener's attach timestamp.
  7188. var getNow = Date.now;
  7189. // Determine what event timestamp the browser is using. Annoyingly, the
  7190. // timestamp can either be hi-res (relative to page load) or low-res
  7191. // (relative to UNIX epoch), so in order to compare time we have to use the
  7192. // same timestamp type when saving the flush timestamp.
  7193. // All IE versions use low-res event timestamps, and have problematic clock
  7194. // implementations (#9632)
  7195. if (inBrowser && !isIE) {
  7196. var performance = window.performance;
  7197. if (
  7198. performance &&
  7199. typeof performance.now === 'function' &&
  7200. getNow() > document.createEvent('Event').timeStamp
  7201. ) {
  7202. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7203. // smaller than it, it means the event is using a hi-res timestamp,
  7204. // and we need to use the hi-res version for event listener timestamps as
  7205. // well.
  7206. getNow = function () { return performance.now(); };
  7207. }
  7208. }
  7209. /**
  7210. * Flush both queues and run the watchers.
  7211. */
  7212. function flushSchedulerQueue () {
  7213. currentFlushTimestamp = getNow();
  7214. flushing = true;
  7215. var watcher, id;
  7216. // Sort queue before flush.
  7217. // This ensures that:
  7218. // 1. Components are updated from parent to child. (because parent is always
  7219. // created before the child)
  7220. // 2. A component's user watchers are run before its render watcher (because
  7221. // user watchers are created before the render watcher)
  7222. // 3. If a component is destroyed during a parent component's watcher run,
  7223. // its watchers can be skipped.
  7224. queue.sort(function (a, b) { return a.id - b.id; });
  7225. // do not cache length because more watchers might be pushed
  7226. // as we run existing watchers
  7227. for (index = 0; index < queue.length; index++) {
  7228. watcher = queue[index];
  7229. if (watcher.before) {
  7230. watcher.before();
  7231. }
  7232. id = watcher.id;
  7233. has[id] = null;
  7234. watcher.run();
  7235. // in dev build, check and stop circular updates.
  7236. if ( true && has[id] != null) {
  7237. circular[id] = (circular[id] || 0) + 1;
  7238. if (circular[id] > MAX_UPDATE_COUNT) {
  7239. warn(
  7240. 'You may have an infinite update loop ' + (
  7241. watcher.user
  7242. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7243. : "in a component render function."
  7244. ),
  7245. watcher.vm
  7246. );
  7247. break
  7248. }
  7249. }
  7250. }
  7251. // keep copies of post queues before resetting state
  7252. var activatedQueue = activatedChildren.slice();
  7253. var updatedQueue = queue.slice();
  7254. resetSchedulerState();
  7255. // call component updated and activated hooks
  7256. callActivatedHooks(activatedQueue);
  7257. callUpdatedHooks(updatedQueue);
  7258. // devtool hook
  7259. /* istanbul ignore if */
  7260. if (devtools && config.devtools) {
  7261. devtools.emit('flush');
  7262. }
  7263. }
  7264. function callUpdatedHooks (queue) {
  7265. var i = queue.length;
  7266. while (i--) {
  7267. var watcher = queue[i];
  7268. var vm = watcher.vm;
  7269. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7270. callHook(vm, 'updated');
  7271. }
  7272. }
  7273. }
  7274. /**
  7275. * Queue a kept-alive component that was activated during patch.
  7276. * The queue will be processed after the entire tree has been patched.
  7277. */
  7278. function queueActivatedComponent (vm) {
  7279. // setting _inactive to false here so that a render function can
  7280. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7281. vm._inactive = false;
  7282. activatedChildren.push(vm);
  7283. }
  7284. function callActivatedHooks (queue) {
  7285. for (var i = 0; i < queue.length; i++) {
  7286. queue[i]._inactive = true;
  7287. activateChildComponent(queue[i], true /* true */);
  7288. }
  7289. }
  7290. /**
  7291. * Push a watcher into the watcher queue.
  7292. * Jobs with duplicate IDs will be skipped unless it's
  7293. * pushed when the queue is being flushed.
  7294. */
  7295. function queueWatcher (watcher) {
  7296. var id = watcher.id;
  7297. if (has[id] == null) {
  7298. has[id] = true;
  7299. if (!flushing) {
  7300. queue.push(watcher);
  7301. } else {
  7302. // if already flushing, splice the watcher based on its id
  7303. // if already past its id, it will be run next immediately.
  7304. var i = queue.length - 1;
  7305. while (i > index && queue[i].id > watcher.id) {
  7306. i--;
  7307. }
  7308. queue.splice(i + 1, 0, watcher);
  7309. }
  7310. // queue the flush
  7311. if (!waiting) {
  7312. waiting = true;
  7313. if ( true && !config.async) {
  7314. flushSchedulerQueue();
  7315. return
  7316. }
  7317. nextTick(flushSchedulerQueue);
  7318. }
  7319. }
  7320. }
  7321. /* */
  7322. var uid$2 = 0;
  7323. /**
  7324. * A watcher parses an expression, collects dependencies,
  7325. * and fires callback when the expression value changes.
  7326. * This is used for both the $watch() api and directives.
  7327. */
  7328. var Watcher = function Watcher (
  7329. vm,
  7330. expOrFn,
  7331. cb,
  7332. options,
  7333. isRenderWatcher
  7334. ) {
  7335. this.vm = vm;
  7336. if (isRenderWatcher) {
  7337. vm._watcher = this;
  7338. }
  7339. vm._watchers.push(this);
  7340. // options
  7341. if (options) {
  7342. this.deep = !!options.deep;
  7343. this.user = !!options.user;
  7344. this.lazy = !!options.lazy;
  7345. this.sync = !!options.sync;
  7346. this.before = options.before;
  7347. } else {
  7348. this.deep = this.user = this.lazy = this.sync = false;
  7349. }
  7350. this.cb = cb;
  7351. this.id = ++uid$2; // uid for batching
  7352. this.active = true;
  7353. this.dirty = this.lazy; // for lazy watchers
  7354. this.deps = [];
  7355. this.newDeps = [];
  7356. this.depIds = new _Set();
  7357. this.newDepIds = new _Set();
  7358. this.expression = true
  7359. ? expOrFn.toString()
  7360. : undefined;
  7361. // parse expression for getter
  7362. if (typeof expOrFn === 'function') {
  7363. this.getter = expOrFn;
  7364. } else {
  7365. this.getter = parsePath(expOrFn);
  7366. if (!this.getter) {
  7367. this.getter = noop;
  7368. true && warn(
  7369. "Failed watching path: \"" + expOrFn + "\" " +
  7370. 'Watcher only accepts simple dot-delimited paths. ' +
  7371. 'For full control, use a function instead.',
  7372. vm
  7373. );
  7374. }
  7375. }
  7376. this.value = this.lazy
  7377. ? undefined
  7378. : this.get();
  7379. };
  7380. /**
  7381. * Evaluate the getter, and re-collect dependencies.
  7382. */
  7383. Watcher.prototype.get = function get () {
  7384. pushTarget(this);
  7385. var value;
  7386. var vm = this.vm;
  7387. try {
  7388. value = this.getter.call(vm, vm);
  7389. } catch (e) {
  7390. if (this.user) {
  7391. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7392. } else {
  7393. throw e
  7394. }
  7395. } finally {
  7396. // "touch" every property so they are all tracked as
  7397. // dependencies for deep watching
  7398. if (this.deep) {
  7399. traverse(value);
  7400. }
  7401. popTarget();
  7402. this.cleanupDeps();
  7403. }
  7404. return value
  7405. };
  7406. /**
  7407. * Add a dependency to this directive.
  7408. */
  7409. Watcher.prototype.addDep = function addDep (dep) {
  7410. var id = dep.id;
  7411. if (!this.newDepIds.has(id)) {
  7412. this.newDepIds.add(id);
  7413. this.newDeps.push(dep);
  7414. if (!this.depIds.has(id)) {
  7415. dep.addSub(this);
  7416. }
  7417. }
  7418. };
  7419. /**
  7420. * Clean up for dependency collection.
  7421. */
  7422. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7423. var i = this.deps.length;
  7424. while (i--) {
  7425. var dep = this.deps[i];
  7426. if (!this.newDepIds.has(dep.id)) {
  7427. dep.removeSub(this);
  7428. }
  7429. }
  7430. var tmp = this.depIds;
  7431. this.depIds = this.newDepIds;
  7432. this.newDepIds = tmp;
  7433. this.newDepIds.clear();
  7434. tmp = this.deps;
  7435. this.deps = this.newDeps;
  7436. this.newDeps = tmp;
  7437. this.newDeps.length = 0;
  7438. };
  7439. /**
  7440. * Subscriber interface.
  7441. * Will be called when a dependency changes.
  7442. */
  7443. Watcher.prototype.update = function update () {
  7444. /* istanbul ignore else */
  7445. if (this.lazy) {
  7446. this.dirty = true;
  7447. } else if (this.sync) {
  7448. this.run();
  7449. } else {
  7450. queueWatcher(this);
  7451. }
  7452. };
  7453. /**
  7454. * Scheduler job interface.
  7455. * Will be called by the scheduler.
  7456. */
  7457. Watcher.prototype.run = function run () {
  7458. if (this.active) {
  7459. var value = this.get();
  7460. if (
  7461. value !== this.value ||
  7462. // Deep watchers and watchers on Object/Arrays should fire even
  7463. // when the value is the same, because the value may
  7464. // have mutated.
  7465. isObject(value) ||
  7466. this.deep
  7467. ) {
  7468. // set new value
  7469. var oldValue = this.value;
  7470. this.value = value;
  7471. if (this.user) {
  7472. try {
  7473. this.cb.call(this.vm, value, oldValue);
  7474. } catch (e) {
  7475. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7476. }
  7477. } else {
  7478. this.cb.call(this.vm, value, oldValue);
  7479. }
  7480. }
  7481. }
  7482. };
  7483. /**
  7484. * Evaluate the value of the watcher.
  7485. * This only gets called for lazy watchers.
  7486. */
  7487. Watcher.prototype.evaluate = function evaluate () {
  7488. this.value = this.get();
  7489. this.dirty = false;
  7490. };
  7491. /**
  7492. * Depend on all deps collected by this watcher.
  7493. */
  7494. Watcher.prototype.depend = function depend () {
  7495. var i = this.deps.length;
  7496. while (i--) {
  7497. this.deps[i].depend();
  7498. }
  7499. };
  7500. /**
  7501. * Remove self from all dependencies' subscriber list.
  7502. */
  7503. Watcher.prototype.teardown = function teardown () {
  7504. if (this.active) {
  7505. // remove self from vm's watcher list
  7506. // this is a somewhat expensive operation so we skip it
  7507. // if the vm is being destroyed.
  7508. if (!this.vm._isBeingDestroyed) {
  7509. remove(this.vm._watchers, this);
  7510. }
  7511. var i = this.deps.length;
  7512. while (i--) {
  7513. this.deps[i].removeSub(this);
  7514. }
  7515. this.active = false;
  7516. }
  7517. };
  7518. /* */
  7519. var sharedPropertyDefinition = {
  7520. enumerable: true,
  7521. configurable: true,
  7522. get: noop,
  7523. set: noop
  7524. };
  7525. function proxy (target, sourceKey, key) {
  7526. sharedPropertyDefinition.get = function proxyGetter () {
  7527. return this[sourceKey][key]
  7528. };
  7529. sharedPropertyDefinition.set = function proxySetter (val) {
  7530. this[sourceKey][key] = val;
  7531. };
  7532. Object.defineProperty(target, key, sharedPropertyDefinition);
  7533. }
  7534. function initState (vm) {
  7535. vm._watchers = [];
  7536. var opts = vm.$options;
  7537. if (opts.props) { initProps(vm, opts.props); }
  7538. if (opts.methods) { initMethods(vm, opts.methods); }
  7539. if (opts.data) {
  7540. initData(vm);
  7541. } else {
  7542. observe(vm._data = {}, true /* asRootData */);
  7543. }
  7544. if (opts.computed) { initComputed(vm, opts.computed); }
  7545. if (opts.watch && opts.watch !== nativeWatch) {
  7546. initWatch(vm, opts.watch);
  7547. }
  7548. }
  7549. function initProps (vm, propsOptions) {
  7550. var propsData = vm.$options.propsData || {};
  7551. var props = vm._props = {};
  7552. // cache prop keys so that future props updates can iterate using Array
  7553. // instead of dynamic object key enumeration.
  7554. var keys = vm.$options._propKeys = [];
  7555. var isRoot = !vm.$parent;
  7556. // root instance props should be converted
  7557. if (!isRoot) {
  7558. toggleObserving(false);
  7559. }
  7560. var loop = function ( key ) {
  7561. keys.push(key);
  7562. var value = validateProp(key, propsOptions, propsData, vm);
  7563. /* istanbul ignore else */
  7564. if (true) {
  7565. var hyphenatedKey = hyphenate(key);
  7566. if (isReservedAttribute(hyphenatedKey) ||
  7567. config.isReservedAttr(hyphenatedKey)) {
  7568. warn(
  7569. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7570. vm
  7571. );
  7572. }
  7573. defineReactive$$1(props, key, value, function () {
  7574. if (!isRoot && !isUpdatingChildComponent) {
  7575. {
  7576. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  7577. return
  7578. }
  7579. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7580. if(
  7581. key === 'value' &&
  7582. Array.isArray(vm.$options.behaviors) &&
  7583. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7584. ){
  7585. return
  7586. }
  7587. if(vm._getFormData){
  7588. return
  7589. }
  7590. var $parent = vm.$parent;
  7591. while($parent){
  7592. if($parent.__next_tick_pending){
  7593. return
  7594. }
  7595. $parent = $parent.$parent;
  7596. }
  7597. }
  7598. warn(
  7599. "Avoid mutating a prop directly since the value will be " +
  7600. "overwritten whenever the parent component re-renders. " +
  7601. "Instead, use a data or computed property based on the prop's " +
  7602. "value. Prop being mutated: \"" + key + "\"",
  7603. vm
  7604. );
  7605. }
  7606. });
  7607. } else {}
  7608. // static props are already proxied on the component's prototype
  7609. // during Vue.extend(). We only need to proxy props defined at
  7610. // instantiation here.
  7611. if (!(key in vm)) {
  7612. proxy(vm, "_props", key);
  7613. }
  7614. };
  7615. for (var key in propsOptions) loop( key );
  7616. toggleObserving(true);
  7617. }
  7618. function initData (vm) {
  7619. var data = vm.$options.data;
  7620. data = vm._data = typeof data === 'function'
  7621. ? getData(data, vm)
  7622. : data || {};
  7623. if (!isPlainObject(data)) {
  7624. data = {};
  7625. true && warn(
  7626. 'data functions should return an object:\n' +
  7627. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7628. vm
  7629. );
  7630. }
  7631. // proxy data on instance
  7632. var keys = Object.keys(data);
  7633. var props = vm.$options.props;
  7634. var methods = vm.$options.methods;
  7635. var i = keys.length;
  7636. while (i--) {
  7637. var key = keys[i];
  7638. if (true) {
  7639. if (methods && hasOwn(methods, key)) {
  7640. warn(
  7641. ("Method \"" + key + "\" has already been defined as a data property."),
  7642. vm
  7643. );
  7644. }
  7645. }
  7646. if (props && hasOwn(props, key)) {
  7647. true && warn(
  7648. "The data property \"" + key + "\" is already declared as a prop. " +
  7649. "Use prop default value instead.",
  7650. vm
  7651. );
  7652. } else if (!isReserved(key)) {
  7653. proxy(vm, "_data", key);
  7654. }
  7655. }
  7656. // observe data
  7657. observe(data, true /* asRootData */);
  7658. }
  7659. function getData (data, vm) {
  7660. // #7573 disable dep collection when invoking data getters
  7661. pushTarget();
  7662. try {
  7663. return data.call(vm, vm)
  7664. } catch (e) {
  7665. handleError(e, vm, "data()");
  7666. return {}
  7667. } finally {
  7668. popTarget();
  7669. }
  7670. }
  7671. var computedWatcherOptions = { lazy: true };
  7672. function initComputed (vm, computed) {
  7673. // $flow-disable-line
  7674. var watchers = vm._computedWatchers = Object.create(null);
  7675. // computed properties are just getters during SSR
  7676. var isSSR = isServerRendering();
  7677. for (var key in computed) {
  7678. var userDef = computed[key];
  7679. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7680. if ( true && getter == null) {
  7681. warn(
  7682. ("Getter is missing for computed property \"" + key + "\"."),
  7683. vm
  7684. );
  7685. }
  7686. if (!isSSR) {
  7687. // create internal watcher for the computed property.
  7688. watchers[key] = new Watcher(
  7689. vm,
  7690. getter || noop,
  7691. noop,
  7692. computedWatcherOptions
  7693. );
  7694. }
  7695. // component-defined computed properties are already defined on the
  7696. // component prototype. We only need to define computed properties defined
  7697. // at instantiation here.
  7698. if (!(key in vm)) {
  7699. defineComputed(vm, key, userDef);
  7700. } else if (true) {
  7701. if (key in vm.$data) {
  7702. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7703. } else if (vm.$options.props && key in vm.$options.props) {
  7704. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7705. }
  7706. }
  7707. }
  7708. }
  7709. function defineComputed (
  7710. target,
  7711. key,
  7712. userDef
  7713. ) {
  7714. var shouldCache = !isServerRendering();
  7715. if (typeof userDef === 'function') {
  7716. sharedPropertyDefinition.get = shouldCache
  7717. ? createComputedGetter(key)
  7718. : createGetterInvoker(userDef);
  7719. sharedPropertyDefinition.set = noop;
  7720. } else {
  7721. sharedPropertyDefinition.get = userDef.get
  7722. ? shouldCache && userDef.cache !== false
  7723. ? createComputedGetter(key)
  7724. : createGetterInvoker(userDef.get)
  7725. : noop;
  7726. sharedPropertyDefinition.set = userDef.set || noop;
  7727. }
  7728. if ( true &&
  7729. sharedPropertyDefinition.set === noop) {
  7730. sharedPropertyDefinition.set = function () {
  7731. warn(
  7732. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7733. this
  7734. );
  7735. };
  7736. }
  7737. Object.defineProperty(target, key, sharedPropertyDefinition);
  7738. }
  7739. function createComputedGetter (key) {
  7740. return function computedGetter () {
  7741. var watcher = this._computedWatchers && this._computedWatchers[key];
  7742. if (watcher) {
  7743. if (watcher.dirty) {
  7744. watcher.evaluate();
  7745. }
  7746. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7747. watcher.depend();
  7748. }
  7749. return watcher.value
  7750. }
  7751. }
  7752. }
  7753. function createGetterInvoker(fn) {
  7754. return function computedGetter () {
  7755. return fn.call(this, this)
  7756. }
  7757. }
  7758. function initMethods (vm, methods) {
  7759. var props = vm.$options.props;
  7760. for (var key in methods) {
  7761. if (true) {
  7762. if (typeof methods[key] !== 'function') {
  7763. warn(
  7764. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7765. "Did you reference the function correctly?",
  7766. vm
  7767. );
  7768. }
  7769. if (props && hasOwn(props, key)) {
  7770. warn(
  7771. ("Method \"" + key + "\" has already been defined as a prop."),
  7772. vm
  7773. );
  7774. }
  7775. if ((key in vm) && isReserved(key)) {
  7776. warn(
  7777. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7778. "Avoid defining component methods that start with _ or $."
  7779. );
  7780. }
  7781. }
  7782. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7783. }
  7784. }
  7785. function initWatch (vm, watch) {
  7786. for (var key in watch) {
  7787. var handler = watch[key];
  7788. if (Array.isArray(handler)) {
  7789. for (var i = 0; i < handler.length; i++) {
  7790. createWatcher(vm, key, handler[i]);
  7791. }
  7792. } else {
  7793. createWatcher(vm, key, handler);
  7794. }
  7795. }
  7796. }
  7797. function createWatcher (
  7798. vm,
  7799. expOrFn,
  7800. handler,
  7801. options
  7802. ) {
  7803. if (isPlainObject(handler)) {
  7804. options = handler;
  7805. handler = handler.handler;
  7806. }
  7807. if (typeof handler === 'string') {
  7808. handler = vm[handler];
  7809. }
  7810. return vm.$watch(expOrFn, handler, options)
  7811. }
  7812. function stateMixin (Vue) {
  7813. // flow somehow has problems with directly declared definition object
  7814. // when using Object.defineProperty, so we have to procedurally build up
  7815. // the object here.
  7816. var dataDef = {};
  7817. dataDef.get = function () { return this._data };
  7818. var propsDef = {};
  7819. propsDef.get = function () { return this._props };
  7820. if (true) {
  7821. dataDef.set = function () {
  7822. warn(
  7823. 'Avoid replacing instance root $data. ' +
  7824. 'Use nested data properties instead.',
  7825. this
  7826. );
  7827. };
  7828. propsDef.set = function () {
  7829. warn("$props is readonly.", this);
  7830. };
  7831. }
  7832. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7833. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7834. Vue.prototype.$set = set;
  7835. Vue.prototype.$delete = del;
  7836. Vue.prototype.$watch = function (
  7837. expOrFn,
  7838. cb,
  7839. options
  7840. ) {
  7841. var vm = this;
  7842. if (isPlainObject(cb)) {
  7843. return createWatcher(vm, expOrFn, cb, options)
  7844. }
  7845. options = options || {};
  7846. options.user = true;
  7847. var watcher = new Watcher(vm, expOrFn, cb, options);
  7848. if (options.immediate) {
  7849. try {
  7850. cb.call(vm, watcher.value);
  7851. } catch (error) {
  7852. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7853. }
  7854. }
  7855. return function unwatchFn () {
  7856. watcher.teardown();
  7857. }
  7858. };
  7859. }
  7860. /* */
  7861. var uid$3 = 0;
  7862. function initMixin (Vue) {
  7863. Vue.prototype._init = function (options) {
  7864. var vm = this;
  7865. // a uid
  7866. vm._uid = uid$3++;
  7867. var startTag, endTag;
  7868. /* istanbul ignore if */
  7869. if ( true && config.performance && mark) {
  7870. startTag = "vue-perf-start:" + (vm._uid);
  7871. endTag = "vue-perf-end:" + (vm._uid);
  7872. mark(startTag);
  7873. }
  7874. // a flag to avoid this being observed
  7875. vm._isVue = true;
  7876. // merge options
  7877. if (options && options._isComponent) {
  7878. // optimize internal component instantiation
  7879. // since dynamic options merging is pretty slow, and none of the
  7880. // internal component options needs special treatment.
  7881. initInternalComponent(vm, options);
  7882. } else {
  7883. vm.$options = mergeOptions(
  7884. resolveConstructorOptions(vm.constructor),
  7885. options || {},
  7886. vm
  7887. );
  7888. }
  7889. /* istanbul ignore else */
  7890. if (true) {
  7891. initProxy(vm);
  7892. } else {}
  7893. // expose real self
  7894. vm._self = vm;
  7895. initLifecycle(vm);
  7896. initEvents(vm);
  7897. initRender(vm);
  7898. callHook(vm, 'beforeCreate');
  7899. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7900. initState(vm);
  7901. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7902. !vm._$fallback && callHook(vm, 'created');
  7903. /* istanbul ignore if */
  7904. if ( true && config.performance && mark) {
  7905. vm._name = formatComponentName(vm, false);
  7906. mark(endTag);
  7907. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7908. }
  7909. if (vm.$options.el) {
  7910. vm.$mount(vm.$options.el);
  7911. }
  7912. };
  7913. }
  7914. function initInternalComponent (vm, options) {
  7915. var opts = vm.$options = Object.create(vm.constructor.options);
  7916. // doing this because it's faster than dynamic enumeration.
  7917. var parentVnode = options._parentVnode;
  7918. opts.parent = options.parent;
  7919. opts._parentVnode = parentVnode;
  7920. var vnodeComponentOptions = parentVnode.componentOptions;
  7921. opts.propsData = vnodeComponentOptions.propsData;
  7922. opts._parentListeners = vnodeComponentOptions.listeners;
  7923. opts._renderChildren = vnodeComponentOptions.children;
  7924. opts._componentTag = vnodeComponentOptions.tag;
  7925. if (options.render) {
  7926. opts.render = options.render;
  7927. opts.staticRenderFns = options.staticRenderFns;
  7928. }
  7929. }
  7930. function resolveConstructorOptions (Ctor) {
  7931. var options = Ctor.options;
  7932. if (Ctor.super) {
  7933. var superOptions = resolveConstructorOptions(Ctor.super);
  7934. var cachedSuperOptions = Ctor.superOptions;
  7935. if (superOptions !== cachedSuperOptions) {
  7936. // super option changed,
  7937. // need to resolve new options.
  7938. Ctor.superOptions = superOptions;
  7939. // check if there are any late-modified/attached options (#4976)
  7940. var modifiedOptions = resolveModifiedOptions(Ctor);
  7941. // update base extend options
  7942. if (modifiedOptions) {
  7943. extend(Ctor.extendOptions, modifiedOptions);
  7944. }
  7945. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7946. if (options.name) {
  7947. options.components[options.name] = Ctor;
  7948. }
  7949. }
  7950. }
  7951. return options
  7952. }
  7953. function resolveModifiedOptions (Ctor) {
  7954. var modified;
  7955. var latest = Ctor.options;
  7956. var sealed = Ctor.sealedOptions;
  7957. for (var key in latest) {
  7958. if (latest[key] !== sealed[key]) {
  7959. if (!modified) { modified = {}; }
  7960. modified[key] = latest[key];
  7961. }
  7962. }
  7963. return modified
  7964. }
  7965. function Vue (options) {
  7966. if ( true &&
  7967. !(this instanceof Vue)
  7968. ) {
  7969. warn('Vue is a constructor and should be called with the `new` keyword');
  7970. }
  7971. this._init(options);
  7972. }
  7973. initMixin(Vue);
  7974. stateMixin(Vue);
  7975. eventsMixin(Vue);
  7976. lifecycleMixin(Vue);
  7977. renderMixin(Vue);
  7978. /* */
  7979. function initUse (Vue) {
  7980. Vue.use = function (plugin) {
  7981. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7982. if (installedPlugins.indexOf(plugin) > -1) {
  7983. return this
  7984. }
  7985. // additional parameters
  7986. var args = toArray(arguments, 1);
  7987. args.unshift(this);
  7988. if (typeof plugin.install === 'function') {
  7989. plugin.install.apply(plugin, args);
  7990. } else if (typeof plugin === 'function') {
  7991. plugin.apply(null, args);
  7992. }
  7993. installedPlugins.push(plugin);
  7994. return this
  7995. };
  7996. }
  7997. /* */
  7998. function initMixin$1 (Vue) {
  7999. Vue.mixin = function (mixin) {
  8000. this.options = mergeOptions(this.options, mixin);
  8001. return this
  8002. };
  8003. }
  8004. /* */
  8005. function initExtend (Vue) {
  8006. /**
  8007. * Each instance constructor, including Vue, has a unique
  8008. * cid. This enables us to create wrapped "child
  8009. * constructors" for prototypal inheritance and cache them.
  8010. */
  8011. Vue.cid = 0;
  8012. var cid = 1;
  8013. /**
  8014. * Class inheritance
  8015. */
  8016. Vue.extend = function (extendOptions) {
  8017. extendOptions = extendOptions || {};
  8018. var Super = this;
  8019. var SuperId = Super.cid;
  8020. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8021. if (cachedCtors[SuperId]) {
  8022. return cachedCtors[SuperId]
  8023. }
  8024. var name = extendOptions.name || Super.options.name;
  8025. if ( true && name) {
  8026. validateComponentName(name);
  8027. }
  8028. var Sub = function VueComponent (options) {
  8029. this._init(options);
  8030. };
  8031. Sub.prototype = Object.create(Super.prototype);
  8032. Sub.prototype.constructor = Sub;
  8033. Sub.cid = cid++;
  8034. Sub.options = mergeOptions(
  8035. Super.options,
  8036. extendOptions
  8037. );
  8038. Sub['super'] = Super;
  8039. // For props and computed properties, we define the proxy getters on
  8040. // the Vue instances at extension time, on the extended prototype. This
  8041. // avoids Object.defineProperty calls for each instance created.
  8042. if (Sub.options.props) {
  8043. initProps$1(Sub);
  8044. }
  8045. if (Sub.options.computed) {
  8046. initComputed$1(Sub);
  8047. }
  8048. // allow further extension/mixin/plugin usage
  8049. Sub.extend = Super.extend;
  8050. Sub.mixin = Super.mixin;
  8051. Sub.use = Super.use;
  8052. // create asset registers, so extended classes
  8053. // can have their private assets too.
  8054. ASSET_TYPES.forEach(function (type) {
  8055. Sub[type] = Super[type];
  8056. });
  8057. // enable recursive self-lookup
  8058. if (name) {
  8059. Sub.options.components[name] = Sub;
  8060. }
  8061. // keep a reference to the super options at extension time.
  8062. // later at instantiation we can check if Super's options have
  8063. // been updated.
  8064. Sub.superOptions = Super.options;
  8065. Sub.extendOptions = extendOptions;
  8066. Sub.sealedOptions = extend({}, Sub.options);
  8067. // cache constructor
  8068. cachedCtors[SuperId] = Sub;
  8069. return Sub
  8070. };
  8071. }
  8072. function initProps$1 (Comp) {
  8073. var props = Comp.options.props;
  8074. for (var key in props) {
  8075. proxy(Comp.prototype, "_props", key);
  8076. }
  8077. }
  8078. function initComputed$1 (Comp) {
  8079. var computed = Comp.options.computed;
  8080. for (var key in computed) {
  8081. defineComputed(Comp.prototype, key, computed[key]);
  8082. }
  8083. }
  8084. /* */
  8085. function initAssetRegisters (Vue) {
  8086. /**
  8087. * Create asset registration methods.
  8088. */
  8089. ASSET_TYPES.forEach(function (type) {
  8090. Vue[type] = function (
  8091. id,
  8092. definition
  8093. ) {
  8094. if (!definition) {
  8095. return this.options[type + 's'][id]
  8096. } else {
  8097. /* istanbul ignore if */
  8098. if ( true && type === 'component') {
  8099. validateComponentName(id);
  8100. }
  8101. if (type === 'component' && isPlainObject(definition)) {
  8102. definition.name = definition.name || id;
  8103. definition = this.options._base.extend(definition);
  8104. }
  8105. if (type === 'directive' && typeof definition === 'function') {
  8106. definition = { bind: definition, update: definition };
  8107. }
  8108. this.options[type + 's'][id] = definition;
  8109. return definition
  8110. }
  8111. };
  8112. });
  8113. }
  8114. /* */
  8115. function getComponentName (opts) {
  8116. return opts && (opts.Ctor.options.name || opts.tag)
  8117. }
  8118. function matches (pattern, name) {
  8119. if (Array.isArray(pattern)) {
  8120. return pattern.indexOf(name) > -1
  8121. } else if (typeof pattern === 'string') {
  8122. return pattern.split(',').indexOf(name) > -1
  8123. } else if (isRegExp(pattern)) {
  8124. return pattern.test(name)
  8125. }
  8126. /* istanbul ignore next */
  8127. return false
  8128. }
  8129. function pruneCache (keepAliveInstance, filter) {
  8130. var cache = keepAliveInstance.cache;
  8131. var keys = keepAliveInstance.keys;
  8132. var _vnode = keepAliveInstance._vnode;
  8133. for (var key in cache) {
  8134. var cachedNode = cache[key];
  8135. if (cachedNode) {
  8136. var name = getComponentName(cachedNode.componentOptions);
  8137. if (name && !filter(name)) {
  8138. pruneCacheEntry(cache, key, keys, _vnode);
  8139. }
  8140. }
  8141. }
  8142. }
  8143. function pruneCacheEntry (
  8144. cache,
  8145. key,
  8146. keys,
  8147. current
  8148. ) {
  8149. var cached$$1 = cache[key];
  8150. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8151. cached$$1.componentInstance.$destroy();
  8152. }
  8153. cache[key] = null;
  8154. remove(keys, key);
  8155. }
  8156. var patternTypes = [String, RegExp, Array];
  8157. var KeepAlive = {
  8158. name: 'keep-alive',
  8159. abstract: true,
  8160. props: {
  8161. include: patternTypes,
  8162. exclude: patternTypes,
  8163. max: [String, Number]
  8164. },
  8165. created: function created () {
  8166. this.cache = Object.create(null);
  8167. this.keys = [];
  8168. },
  8169. destroyed: function destroyed () {
  8170. for (var key in this.cache) {
  8171. pruneCacheEntry(this.cache, key, this.keys);
  8172. }
  8173. },
  8174. mounted: function mounted () {
  8175. var this$1 = this;
  8176. this.$watch('include', function (val) {
  8177. pruneCache(this$1, function (name) { return matches(val, name); });
  8178. });
  8179. this.$watch('exclude', function (val) {
  8180. pruneCache(this$1, function (name) { return !matches(val, name); });
  8181. });
  8182. },
  8183. render: function render () {
  8184. var slot = this.$slots.default;
  8185. var vnode = getFirstComponentChild(slot);
  8186. var componentOptions = vnode && vnode.componentOptions;
  8187. if (componentOptions) {
  8188. // check pattern
  8189. var name = getComponentName(componentOptions);
  8190. var ref = this;
  8191. var include = ref.include;
  8192. var exclude = ref.exclude;
  8193. if (
  8194. // not included
  8195. (include && (!name || !matches(include, name))) ||
  8196. // excluded
  8197. (exclude && name && matches(exclude, name))
  8198. ) {
  8199. return vnode
  8200. }
  8201. var ref$1 = this;
  8202. var cache = ref$1.cache;
  8203. var keys = ref$1.keys;
  8204. var key = vnode.key == null
  8205. // same constructor may get registered as different local components
  8206. // so cid alone is not enough (#3269)
  8207. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8208. : vnode.key;
  8209. if (cache[key]) {
  8210. vnode.componentInstance = cache[key].componentInstance;
  8211. // make current key freshest
  8212. remove(keys, key);
  8213. keys.push(key);
  8214. } else {
  8215. cache[key] = vnode;
  8216. keys.push(key);
  8217. // prune oldest entry
  8218. if (this.max && keys.length > parseInt(this.max)) {
  8219. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8220. }
  8221. }
  8222. vnode.data.keepAlive = true;
  8223. }
  8224. return vnode || (slot && slot[0])
  8225. }
  8226. };
  8227. var builtInComponents = {
  8228. KeepAlive: KeepAlive
  8229. };
  8230. /* */
  8231. function initGlobalAPI (Vue) {
  8232. // config
  8233. var configDef = {};
  8234. configDef.get = function () { return config; };
  8235. if (true) {
  8236. configDef.set = function () {
  8237. warn(
  8238. 'Do not replace the Vue.config object, set individual fields instead.'
  8239. );
  8240. };
  8241. }
  8242. Object.defineProperty(Vue, 'config', configDef);
  8243. // exposed util methods.
  8244. // NOTE: these are not considered part of the public API - avoid relying on
  8245. // them unless you are aware of the risk.
  8246. Vue.util = {
  8247. warn: warn,
  8248. extend: extend,
  8249. mergeOptions: mergeOptions,
  8250. defineReactive: defineReactive$$1
  8251. };
  8252. Vue.set = set;
  8253. Vue.delete = del;
  8254. Vue.nextTick = nextTick;
  8255. // 2.6 explicit observable API
  8256. Vue.observable = function (obj) {
  8257. observe(obj);
  8258. return obj
  8259. };
  8260. Vue.options = Object.create(null);
  8261. ASSET_TYPES.forEach(function (type) {
  8262. Vue.options[type + 's'] = Object.create(null);
  8263. });
  8264. // this is used to identify the "base" constructor to extend all plain-object
  8265. // components with in Weex's multi-instance scenarios.
  8266. Vue.options._base = Vue;
  8267. extend(Vue.options.components, builtInComponents);
  8268. initUse(Vue);
  8269. initMixin$1(Vue);
  8270. initExtend(Vue);
  8271. initAssetRegisters(Vue);
  8272. }
  8273. initGlobalAPI(Vue);
  8274. Object.defineProperty(Vue.prototype, '$isServer', {
  8275. get: isServerRendering
  8276. });
  8277. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8278. get: function get () {
  8279. /* istanbul ignore next */
  8280. return this.$vnode && this.$vnode.ssrContext
  8281. }
  8282. });
  8283. // expose FunctionalRenderContext for ssr runtime helper installation
  8284. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8285. value: FunctionalRenderContext
  8286. });
  8287. Vue.version = '2.6.11';
  8288. /**
  8289. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8290. */
  8291. var ARRAYTYPE = '[object Array]';
  8292. var OBJECTTYPE = '[object Object]';
  8293. // const FUNCTIONTYPE = '[object Function]'
  8294. function diff(current, pre) {
  8295. var result = {};
  8296. syncKeys(current, pre);
  8297. _diff(current, pre, '', result);
  8298. return result
  8299. }
  8300. function syncKeys(current, pre) {
  8301. if (current === pre) { return }
  8302. var rootCurrentType = type(current);
  8303. var rootPreType = type(pre);
  8304. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8305. if(Object.keys(current).length >= Object.keys(pre).length){
  8306. for (var key in pre) {
  8307. var currentValue = current[key];
  8308. if (currentValue === undefined) {
  8309. current[key] = null;
  8310. } else {
  8311. syncKeys(currentValue, pre[key]);
  8312. }
  8313. }
  8314. }
  8315. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8316. if (current.length >= pre.length) {
  8317. pre.forEach(function (item, index) {
  8318. syncKeys(current[index], item);
  8319. });
  8320. }
  8321. }
  8322. }
  8323. function _diff(current, pre, path, result) {
  8324. if (current === pre) { return }
  8325. var rootCurrentType = type(current);
  8326. var rootPreType = type(pre);
  8327. if (rootCurrentType == OBJECTTYPE) {
  8328. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8329. setResult(result, path, current);
  8330. } else {
  8331. var loop = function ( key ) {
  8332. var currentValue = current[key];
  8333. var preValue = pre[key];
  8334. var currentType = type(currentValue);
  8335. var preType = type(preValue);
  8336. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8337. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  8338. if (currentValue !== pre[key]) {
  8339. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8340. }
  8341. } else if (currentType == ARRAYTYPE) {
  8342. if (preType != ARRAYTYPE) {
  8343. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8344. } else {
  8345. if (currentValue.length < preValue.length) {
  8346. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8347. } else {
  8348. currentValue.forEach(function (item, index) {
  8349. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8350. });
  8351. }
  8352. }
  8353. } else if (currentType == OBJECTTYPE) {
  8354. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8355. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8356. } else {
  8357. for (var subKey in currentValue) {
  8358. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8359. }
  8360. }
  8361. }
  8362. };
  8363. for (var key in current) loop( key );
  8364. }
  8365. } else if (rootCurrentType == ARRAYTYPE) {
  8366. if (rootPreType != ARRAYTYPE) {
  8367. setResult(result, path, current);
  8368. } else {
  8369. if (current.length < pre.length) {
  8370. setResult(result, path, current);
  8371. } else {
  8372. current.forEach(function (item, index) {
  8373. _diff(item, pre[index], path + '[' + index + ']', result);
  8374. });
  8375. }
  8376. }
  8377. } else {
  8378. setResult(result, path, current);
  8379. }
  8380. }
  8381. function setResult(result, k, v) {
  8382. // if (type(v) != FUNCTIONTYPE) {
  8383. result[k] = v;
  8384. // }
  8385. }
  8386. function type(obj) {
  8387. return Object.prototype.toString.call(obj)
  8388. }
  8389. /* */
  8390. function flushCallbacks$1(vm) {
  8391. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8392. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8393. var mpInstance = vm.$scope;
  8394. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8395. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8396. }
  8397. var copies = vm.__next_tick_callbacks.slice(0);
  8398. vm.__next_tick_callbacks.length = 0;
  8399. for (var i = 0; i < copies.length; i++) {
  8400. copies[i]();
  8401. }
  8402. }
  8403. }
  8404. function hasRenderWatcher(vm) {
  8405. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8406. }
  8407. function nextTick$1(vm, cb) {
  8408. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8409. //2.nextTick 之前存在 render watcher
  8410. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8411. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8412. var mpInstance = vm.$scope;
  8413. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8414. ']:nextVueTick');
  8415. }
  8416. return nextTick(cb, vm)
  8417. }else{
  8418. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8419. var mpInstance$1 = vm.$scope;
  8420. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8421. ']:nextMPTick');
  8422. }
  8423. }
  8424. var _resolve;
  8425. if (!vm.__next_tick_callbacks) {
  8426. vm.__next_tick_callbacks = [];
  8427. }
  8428. vm.__next_tick_callbacks.push(function () {
  8429. if (cb) {
  8430. try {
  8431. cb.call(vm);
  8432. } catch (e) {
  8433. handleError(e, vm, 'nextTick');
  8434. }
  8435. } else if (_resolve) {
  8436. _resolve(vm);
  8437. }
  8438. });
  8439. // $flow-disable-line
  8440. if (!cb && typeof Promise !== 'undefined') {
  8441. return new Promise(function (resolve) {
  8442. _resolve = resolve;
  8443. })
  8444. }
  8445. }
  8446. /* */
  8447. function cloneWithData(vm) {
  8448. // 确保当前 vm 所有数据被同步
  8449. var ret = Object.create(null);
  8450. var dataKeys = [].concat(
  8451. Object.keys(vm._data || {}),
  8452. Object.keys(vm._computedWatchers || {}));
  8453. dataKeys.reduce(function(ret, key) {
  8454. ret[key] = vm[key];
  8455. return ret
  8456. }, ret);
  8457. // vue-composition-api
  8458. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8459. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8460. if (rawBindings) {
  8461. Object.keys(rawBindings).forEach(function (key) {
  8462. ret[key] = vm[key];
  8463. });
  8464. }
  8465. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8466. Object.assign(ret, vm.$mp.data || {});
  8467. if (
  8468. Array.isArray(vm.$options.behaviors) &&
  8469. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8470. ) { //form-field
  8471. ret['name'] = vm.name;
  8472. ret['value'] = vm.value;
  8473. }
  8474. return JSON.parse(JSON.stringify(ret))
  8475. }
  8476. var patch = function(oldVnode, vnode) {
  8477. var this$1 = this;
  8478. if (vnode === null) { //destroy
  8479. return
  8480. }
  8481. if (this.mpType === 'page' || this.mpType === 'component') {
  8482. var mpInstance = this.$scope;
  8483. var data = Object.create(null);
  8484. try {
  8485. data = cloneWithData(this);
  8486. } catch (err) {
  8487. console.error(err);
  8488. }
  8489. data.__webviewId__ = mpInstance.data.__webviewId__;
  8490. var mpData = Object.create(null);
  8491. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8492. mpData[key] = mpInstance.data[key];
  8493. });
  8494. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8495. if (Object.keys(diffData).length) {
  8496. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8497. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8498. ']差量更新',
  8499. JSON.stringify(diffData));
  8500. }
  8501. this.__next_tick_pending = true;
  8502. mpInstance.setData(diffData, function () {
  8503. this$1.__next_tick_pending = false;
  8504. flushCallbacks$1(this$1);
  8505. });
  8506. } else {
  8507. flushCallbacks$1(this);
  8508. }
  8509. }
  8510. };
  8511. /* */
  8512. function createEmptyRender() {
  8513. }
  8514. function mountComponent$1(
  8515. vm,
  8516. el,
  8517. hydrating
  8518. ) {
  8519. if (!vm.mpType) {//main.js 中的 new Vue
  8520. return vm
  8521. }
  8522. if (vm.mpType === 'app') {
  8523. vm.$options.render = createEmptyRender;
  8524. }
  8525. if (!vm.$options.render) {
  8526. vm.$options.render = createEmptyRender;
  8527. if (true) {
  8528. /* istanbul ignore if */
  8529. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8530. vm.$options.el || el) {
  8531. warn(
  8532. 'You are using the runtime-only build of Vue where the template ' +
  8533. 'compiler is not available. Either pre-compile the templates into ' +
  8534. 'render functions, or use the compiler-included build.',
  8535. vm
  8536. );
  8537. } else {
  8538. warn(
  8539. 'Failed to mount component: template or render function not defined.',
  8540. vm
  8541. );
  8542. }
  8543. }
  8544. }
  8545. !vm._$fallback && callHook(vm, 'beforeMount');
  8546. var updateComponent = function () {
  8547. vm._update(vm._render(), hydrating);
  8548. };
  8549. // we set this to vm._watcher inside the watcher's constructor
  8550. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8551. // component's mounted hook), which relies on vm._watcher being already defined
  8552. new Watcher(vm, updateComponent, noop, {
  8553. before: function before() {
  8554. if (vm._isMounted && !vm._isDestroyed) {
  8555. callHook(vm, 'beforeUpdate');
  8556. }
  8557. }
  8558. }, true /* isRenderWatcher */);
  8559. hydrating = false;
  8560. return vm
  8561. }
  8562. /* */
  8563. function renderClass (
  8564. staticClass,
  8565. dynamicClass
  8566. ) {
  8567. if (isDef(staticClass) || isDef(dynamicClass)) {
  8568. return concat(staticClass, stringifyClass(dynamicClass))
  8569. }
  8570. /* istanbul ignore next */
  8571. return ''
  8572. }
  8573. function concat (a, b) {
  8574. return a ? b ? (a + ' ' + b) : a : (b || '')
  8575. }
  8576. function stringifyClass (value) {
  8577. if (Array.isArray(value)) {
  8578. return stringifyArray(value)
  8579. }
  8580. if (isObject(value)) {
  8581. return stringifyObject(value)
  8582. }
  8583. if (typeof value === 'string') {
  8584. return value
  8585. }
  8586. /* istanbul ignore next */
  8587. return ''
  8588. }
  8589. function stringifyArray (value) {
  8590. var res = '';
  8591. var stringified;
  8592. for (var i = 0, l = value.length; i < l; i++) {
  8593. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8594. if (res) { res += ' '; }
  8595. res += stringified;
  8596. }
  8597. }
  8598. return res
  8599. }
  8600. function stringifyObject (value) {
  8601. var res = '';
  8602. for (var key in value) {
  8603. if (value[key]) {
  8604. if (res) { res += ' '; }
  8605. res += key;
  8606. }
  8607. }
  8608. return res
  8609. }
  8610. /* */
  8611. var parseStyleText = cached(function (cssText) {
  8612. var res = {};
  8613. var listDelimiter = /;(?![^(]*\))/g;
  8614. var propertyDelimiter = /:(.+)/;
  8615. cssText.split(listDelimiter).forEach(function (item) {
  8616. if (item) {
  8617. var tmp = item.split(propertyDelimiter);
  8618. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8619. }
  8620. });
  8621. return res
  8622. });
  8623. // normalize possible array / string values into Object
  8624. function normalizeStyleBinding (bindingStyle) {
  8625. if (Array.isArray(bindingStyle)) {
  8626. return toObject(bindingStyle)
  8627. }
  8628. if (typeof bindingStyle === 'string') {
  8629. return parseStyleText(bindingStyle)
  8630. }
  8631. return bindingStyle
  8632. }
  8633. /* */
  8634. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8635. function getTarget(obj, path) {
  8636. var parts = path.split('.');
  8637. var key = parts[0];
  8638. if (key.indexOf('__$n') === 0) { //number index
  8639. key = parseInt(key.replace('__$n', ''));
  8640. }
  8641. if (parts.length === 1) {
  8642. return obj[key]
  8643. }
  8644. return getTarget(obj[key], parts.slice(1).join('.'))
  8645. }
  8646. function internalMixin(Vue) {
  8647. Vue.config.errorHandler = function(err, vm, info) {
  8648. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8649. console.error(err);
  8650. /* eslint-disable no-undef */
  8651. var app = typeof getApp === 'function' && getApp();
  8652. if (app && app.onError) {
  8653. app.onError(err);
  8654. }
  8655. };
  8656. var oldEmit = Vue.prototype.$emit;
  8657. Vue.prototype.$emit = function(event) {
  8658. if (this.$scope && event) {
  8659. this.$scope['triggerEvent'](event, {
  8660. __args__: toArray(arguments, 1)
  8661. });
  8662. }
  8663. return oldEmit.apply(this, arguments)
  8664. };
  8665. Vue.prototype.$nextTick = function(fn) {
  8666. return nextTick$1(this, fn)
  8667. };
  8668. MP_METHODS.forEach(function (method) {
  8669. Vue.prototype[method] = function(args) {
  8670. if (this.$scope && this.$scope[method]) {
  8671. return this.$scope[method](args)
  8672. }
  8673. // mp-alipay
  8674. if (typeof my === 'undefined') {
  8675. return
  8676. }
  8677. if (method === 'createSelectorQuery') {
  8678. /* eslint-disable no-undef */
  8679. return my.createSelectorQuery(args)
  8680. } else if (method === 'createIntersectionObserver') {
  8681. /* eslint-disable no-undef */
  8682. return my.createIntersectionObserver(args)
  8683. }
  8684. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8685. };
  8686. });
  8687. Vue.prototype.__init_provide = initProvide;
  8688. Vue.prototype.__init_injections = initInjections;
  8689. Vue.prototype.__call_hook = function(hook, args) {
  8690. var vm = this;
  8691. // #7573 disable dep collection when invoking lifecycle hooks
  8692. pushTarget();
  8693. var handlers = vm.$options[hook];
  8694. var info = hook + " hook";
  8695. var ret;
  8696. if (handlers) {
  8697. for (var i = 0, j = handlers.length; i < j; i++) {
  8698. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8699. }
  8700. }
  8701. if (vm._hasHookEvent) {
  8702. vm.$emit('hook:' + hook, args);
  8703. }
  8704. popTarget();
  8705. return ret
  8706. };
  8707. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8708. if (Array.isArray(modifiers)) {
  8709. if (modifiers.indexOf('trim') !== -1) {
  8710. value = value.trim();
  8711. }
  8712. if (modifiers.indexOf('number') !== -1) {
  8713. value = this._n(value);
  8714. }
  8715. }
  8716. if (!target) {
  8717. target = this;
  8718. }
  8719. target[key] = value;
  8720. };
  8721. Vue.prototype.__set_sync = function(target, key, value) {
  8722. if (!target) {
  8723. target = this;
  8724. }
  8725. target[key] = value;
  8726. };
  8727. Vue.prototype.__get_orig = function(item) {
  8728. if (isPlainObject(item)) {
  8729. return item['$orig'] || item
  8730. }
  8731. return item
  8732. };
  8733. Vue.prototype.__get_value = function(dataPath, target) {
  8734. return getTarget(target || this, dataPath)
  8735. };
  8736. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8737. return renderClass(staticClass, dynamicClass)
  8738. };
  8739. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8740. if (!dynamicStyle && !staticStyle) {
  8741. return ''
  8742. }
  8743. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8744. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8745. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8746. };
  8747. Vue.prototype.__map = function(val, iteratee) {
  8748. //TODO 暂不考虑 string
  8749. var ret, i, l, keys, key;
  8750. if (Array.isArray(val)) {
  8751. ret = new Array(val.length);
  8752. for (i = 0, l = val.length; i < l; i++) {
  8753. ret[i] = iteratee(val[i], i);
  8754. }
  8755. return ret
  8756. } else if (isObject(val)) {
  8757. keys = Object.keys(val);
  8758. ret = Object.create(null);
  8759. for (i = 0, l = keys.length; i < l; i++) {
  8760. key = keys[i];
  8761. ret[key] = iteratee(val[key], key, i);
  8762. }
  8763. return ret
  8764. } else if (typeof val === 'number') {
  8765. ret = new Array(val);
  8766. for (i = 0, l = val; i < l; i++) {
  8767. // 第一个参数暂时仍和小程序一致
  8768. ret[i] = iteratee(i, i);
  8769. }
  8770. return ret
  8771. }
  8772. return []
  8773. };
  8774. }
  8775. /* */
  8776. var LIFECYCLE_HOOKS$1 = [
  8777. //App
  8778. 'onLaunch',
  8779. 'onShow',
  8780. 'onHide',
  8781. 'onUniNViewMessage',
  8782. 'onPageNotFound',
  8783. 'onThemeChange',
  8784. 'onError',
  8785. 'onUnhandledRejection',
  8786. //Page
  8787. 'onInit',
  8788. 'onLoad',
  8789. // 'onShow',
  8790. 'onReady',
  8791. // 'onHide',
  8792. 'onUnload',
  8793. 'onPullDownRefresh',
  8794. 'onReachBottom',
  8795. 'onTabItemTap',
  8796. 'onAddToFavorites',
  8797. 'onShareTimeline',
  8798. 'onShareAppMessage',
  8799. 'onResize',
  8800. 'onPageScroll',
  8801. 'onNavigationBarButtonTap',
  8802. 'onBackPress',
  8803. 'onNavigationBarSearchInputChanged',
  8804. 'onNavigationBarSearchInputConfirmed',
  8805. 'onNavigationBarSearchInputClicked',
  8806. //Component
  8807. // 'onReady', // 兼容旧版本,应该移除该事件
  8808. 'onPageShow',
  8809. 'onPageHide',
  8810. 'onPageResize'
  8811. ];
  8812. function lifecycleMixin$1(Vue) {
  8813. //fixed vue-class-component
  8814. var oldExtend = Vue.extend;
  8815. Vue.extend = function(extendOptions) {
  8816. extendOptions = extendOptions || {};
  8817. var methods = extendOptions.methods;
  8818. if (methods) {
  8819. Object.keys(methods).forEach(function (methodName) {
  8820. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8821. extendOptions[methodName] = methods[methodName];
  8822. delete methods[methodName];
  8823. }
  8824. });
  8825. }
  8826. return oldExtend.call(this, extendOptions)
  8827. };
  8828. var strategies = Vue.config.optionMergeStrategies;
  8829. var mergeHook = strategies.created;
  8830. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8831. strategies[hook] = mergeHook;
  8832. });
  8833. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8834. }
  8835. /* */
  8836. // install platform patch function
  8837. Vue.prototype.__patch__ = patch;
  8838. // public mount method
  8839. Vue.prototype.$mount = function(
  8840. el ,
  8841. hydrating
  8842. ) {
  8843. return mountComponent$1(this, el, hydrating)
  8844. };
  8845. lifecycleMixin$1(Vue);
  8846. internalMixin(Vue);
  8847. /* */
  8848. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8849. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8850. /***/ }),
  8851. /***/ 4:
  8852. /*!*************************************************************!*\
  8853. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  8854. \*************************************************************/
  8855. /*! no static exports found */
  8856. /***/ (function(module, exports, __webpack_require__) {
  8857. "use strict";
  8858. /* 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;
  8859. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  8860. var defaultDelimiters = ['{', '}'];var
  8861. BaseFormatter = /*#__PURE__*/function () {
  8862. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  8863. this._caches = Object.create(null);
  8864. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  8865. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  8866. if (!values) {
  8867. return [message];
  8868. }
  8869. var tokens = this._caches[message];
  8870. if (!tokens) {
  8871. tokens = parse(message, delimiters);
  8872. this._caches[message] = tokens;
  8873. }
  8874. return compile(tokens, values);
  8875. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  8876. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  8877. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  8878. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  8879. var tokens = [];
  8880. var position = 0;
  8881. var text = '';
  8882. while (position < format.length) {
  8883. var char = format[position++];
  8884. if (char === startDelimiter) {
  8885. if (text) {
  8886. tokens.push({ type: 'text', value: text });
  8887. }
  8888. text = '';
  8889. var sub = '';
  8890. char = format[position++];
  8891. while (char !== undefined && char !== endDelimiter) {
  8892. sub += char;
  8893. char = format[position++];
  8894. }
  8895. var isClosed = char === endDelimiter;
  8896. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  8897. 'list' :
  8898. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  8899. 'named' :
  8900. 'unknown';
  8901. tokens.push({ value: sub, type: type });
  8902. }
  8903. // else if (char === '%') {
  8904. // // when found rails i18n syntax, skip text capture
  8905. // if (format[position] !== '{') {
  8906. // text += char
  8907. // }
  8908. // }
  8909. else {
  8910. text += char;
  8911. }
  8912. }
  8913. text && tokens.push({ type: 'text', value: text });
  8914. return tokens;
  8915. }
  8916. function compile(tokens, values) {
  8917. var compiled = [];
  8918. var index = 0;
  8919. var mode = isArray(values) ?
  8920. 'list' :
  8921. isObject(values) ?
  8922. 'named' :
  8923. 'unknown';
  8924. if (mode === 'unknown') {
  8925. return compiled;
  8926. }
  8927. while (index < tokens.length) {
  8928. var token = tokens[index];
  8929. switch (token.type) {
  8930. case 'text':
  8931. compiled.push(token.value);
  8932. break;
  8933. case 'list':
  8934. compiled.push(values[parseInt(token.value, 10)]);
  8935. break;
  8936. case 'named':
  8937. if (mode === 'named') {
  8938. compiled.push(values[token.value]);
  8939. } else
  8940. {
  8941. if (true) {
  8942. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  8943. }
  8944. }
  8945. break;
  8946. case 'unknown':
  8947. if (true) {
  8948. console.warn("Detect 'unknown' type of token!");
  8949. }
  8950. break;}
  8951. index++;
  8952. }
  8953. return compiled;
  8954. }
  8955. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  8956. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  8957. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  8958. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  8959. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  8960. var hasOwnProperty = Object.prototype.hasOwnProperty;
  8961. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  8962. var defaultFormatter = new BaseFormatter();
  8963. function include(str, parts) {
  8964. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  8965. }
  8966. function startsWith(str, parts) {
  8967. return parts.find(function (part) {return str.indexOf(part) === 0;});
  8968. }
  8969. function normalizeLocale(locale, messages) {
  8970. if (!locale) {
  8971. return;
  8972. }
  8973. locale = locale.trim().replace(/_/g, '-');
  8974. if (messages && messages[locale]) {
  8975. return locale;
  8976. }
  8977. locale = locale.toLowerCase();
  8978. if (locale.indexOf('zh') === 0) {
  8979. if (locale.indexOf('-hans') > -1) {
  8980. return LOCALE_ZH_HANS;
  8981. }
  8982. if (locale.indexOf('-hant') > -1) {
  8983. return LOCALE_ZH_HANT;
  8984. }
  8985. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  8986. return LOCALE_ZH_HANT;
  8987. }
  8988. return LOCALE_ZH_HANS;
  8989. }
  8990. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  8991. if (lang) {
  8992. return lang;
  8993. }
  8994. }var
  8995. I18n = /*#__PURE__*/function () {
  8996. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  8997. this.locale = LOCALE_EN;
  8998. this.fallbackLocale = LOCALE_EN;
  8999. this.message = {};
  9000. this.messages = {};
  9001. this.watchers = [];
  9002. if (fallbackLocale) {
  9003. this.fallbackLocale = fallbackLocale;
  9004. }
  9005. this.formater = formater || defaultFormatter;
  9006. this.messages = messages || {};
  9007. this.setLocale(locale || LOCALE_EN);
  9008. if (watcher) {
  9009. this.watchLocale(watcher);
  9010. }
  9011. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  9012. locale) {var _this = this;
  9013. var oldLocale = this.locale;
  9014. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  9015. if (!this.messages[this.locale]) {
  9016. // 可能初始化时不存在
  9017. this.messages[this.locale] = {};
  9018. }
  9019. this.message = this.messages[this.locale];
  9020. // 仅发生变化时,通知
  9021. if (oldLocale !== this.locale) {
  9022. this.watchers.forEach(function (watcher) {
  9023. watcher(_this.locale, oldLocale);
  9024. });
  9025. }
  9026. } }, { key: "getLocale", value: function getLocale()
  9027. {
  9028. return this.locale;
  9029. } }, { key: "watchLocale", value: function watchLocale(
  9030. fn) {var _this2 = this;
  9031. var index = this.watchers.push(fn) - 1;
  9032. return function () {
  9033. _this2.watchers.splice(index, 1);
  9034. };
  9035. } }, { key: "add", value: function add(
  9036. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9037. var curMessages = this.messages[locale];
  9038. if (curMessages) {
  9039. if (override) {
  9040. Object.assign(curMessages, message);
  9041. } else
  9042. {
  9043. Object.keys(message).forEach(function (key) {
  9044. if (!hasOwn(curMessages, key)) {
  9045. curMessages[key] = message[key];
  9046. }
  9047. });
  9048. }
  9049. } else
  9050. {
  9051. this.messages[locale] = message;
  9052. }
  9053. } }, { key: "f", value: function f(
  9054. message, values, delimiters) {
  9055. return this.formater.interpolate(message, values, delimiters).join('');
  9056. } }, { key: "t", value: function t(
  9057. key, locale, values) {
  9058. var message = this.message;
  9059. if (typeof locale === 'string') {
  9060. locale = normalizeLocale(locale, this.messages);
  9061. locale && (message = this.messages[locale]);
  9062. } else
  9063. {
  9064. values = locale;
  9065. }
  9066. if (!hasOwn(message, key)) {
  9067. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  9068. return key;
  9069. }
  9070. return this.formater.interpolate(message[key], values).join('');
  9071. } }]);return I18n;}();exports.I18n = I18n;
  9072. function watchAppLocale(appVm, i18n) {
  9073. // 需要保证 watch 的触发在组件渲染之前
  9074. if (appVm.$watchLocale) {
  9075. // vue2
  9076. appVm.$watchLocale(function (newLocale) {
  9077. i18n.setLocale(newLocale);
  9078. });
  9079. } else
  9080. {
  9081. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  9082. i18n.setLocale(newLocale);
  9083. });
  9084. }
  9085. }
  9086. function getDefaultLocale() {
  9087. if (typeof uni !== 'undefined' && uni.getLocale) {
  9088. return uni.getLocale();
  9089. }
  9090. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  9091. if (typeof global !== 'undefined' && global.getLocale) {
  9092. return global.getLocale();
  9093. }
  9094. return LOCALE_EN;
  9095. }
  9096. 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;
  9097. // 兼容旧版本入参
  9098. if (typeof locale !== 'string') {var _ref4 =
  9099. [
  9100. messages,
  9101. locale];locale = _ref4[0];messages = _ref4[1];
  9102. }
  9103. if (typeof locale !== 'string') {
  9104. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  9105. locale = getDefaultLocale();
  9106. }
  9107. if (typeof fallbackLocale !== 'string') {
  9108. fallbackLocale =
  9109. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  9110. LOCALE_EN;
  9111. }
  9112. var i18n = new I18n({
  9113. locale: locale,
  9114. fallbackLocale: fallbackLocale,
  9115. messages: messages,
  9116. watcher: watcher });
  9117. var _t = function t(key, values) {
  9118. if (typeof getApp !== 'function') {
  9119. // app view
  9120. /* eslint-disable no-func-assign */
  9121. _t = function t(key, values) {
  9122. return i18n.t(key, values);
  9123. };
  9124. } else
  9125. {
  9126. var isWatchedAppLocale = false;
  9127. _t = function t(key, values) {
  9128. var appVm = getApp().$vm;
  9129. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  9130. // options: {
  9131. // type: Array,
  9132. // default () {
  9133. // return [{
  9134. // icon: 'shop',
  9135. // text: t("uni-goods-nav.options.shop"),
  9136. // }, {
  9137. // icon: 'cart',
  9138. // text: t("uni-goods-nav.options.cart")
  9139. // }]
  9140. // }
  9141. // },
  9142. if (appVm) {
  9143. // 触发响应式
  9144. appVm.$locale;
  9145. if (!isWatchedAppLocale) {
  9146. isWatchedAppLocale = true;
  9147. watchAppLocale(appVm, i18n);
  9148. }
  9149. }
  9150. return i18n.t(key, values);
  9151. };
  9152. }
  9153. return _t(key, values);
  9154. };
  9155. return {
  9156. i18n: i18n,
  9157. f: function f(message, values, delimiters) {
  9158. return i18n.f(message, values, delimiters);
  9159. },
  9160. t: function t(key, values) {
  9161. return _t(key, values);
  9162. },
  9163. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9164. return i18n.add(locale, message, override);
  9165. },
  9166. watch: function watch(fn) {
  9167. return i18n.watchLocale(fn);
  9168. },
  9169. getLocale: function getLocale() {
  9170. return i18n.getLocale();
  9171. },
  9172. setLocale: function setLocale(newLocale) {
  9173. return i18n.setLocale(newLocale);
  9174. } };
  9175. }
  9176. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  9177. var formater;
  9178. function hasI18nJson(jsonObj, delimiters) {
  9179. if (!formater) {
  9180. formater = new BaseFormatter();
  9181. }
  9182. return walkJsonObj(jsonObj, function (jsonObj, key) {
  9183. var value = jsonObj[key];
  9184. if (isString(value)) {
  9185. if (isI18nStr(value, delimiters)) {
  9186. return true;
  9187. }
  9188. } else
  9189. {
  9190. return hasI18nJson(value, delimiters);
  9191. }
  9192. });
  9193. }
  9194. function parseI18nJson(jsonObj, values, delimiters) {
  9195. if (!formater) {
  9196. formater = new BaseFormatter();
  9197. }
  9198. walkJsonObj(jsonObj, function (jsonObj, key) {
  9199. var value = jsonObj[key];
  9200. if (isString(value)) {
  9201. if (isI18nStr(value, delimiters)) {
  9202. jsonObj[key] = compileStr(value, values, delimiters);
  9203. }
  9204. } else
  9205. {
  9206. parseI18nJson(value, values, delimiters);
  9207. }
  9208. });
  9209. return jsonObj;
  9210. }
  9211. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  9212. if (!isI18nStr(jsonStr, delimiters)) {
  9213. return jsonStr;
  9214. }
  9215. if (!formater) {
  9216. formater = new BaseFormatter();
  9217. }
  9218. var localeValues = [];
  9219. Object.keys(locales).forEach(function (name) {
  9220. if (name !== locale) {
  9221. localeValues.push({
  9222. locale: name,
  9223. values: locales[name] });
  9224. }
  9225. });
  9226. localeValues.unshift({ locale: locale, values: locales[locale] });
  9227. try {
  9228. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  9229. }
  9230. catch (e) {}
  9231. return jsonStr;
  9232. }
  9233. function isI18nStr(value, delimiters) {
  9234. return value.indexOf(delimiters[0]) > -1;
  9235. }
  9236. function compileStr(value, values, delimiters) {
  9237. return formater.interpolate(value, values, delimiters).join('');
  9238. }
  9239. function compileValue(jsonObj, key, localeValues, delimiters) {
  9240. var value = jsonObj[key];
  9241. if (isString(value)) {
  9242. // 存在国际化
  9243. if (isI18nStr(value, delimiters)) {
  9244. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  9245. if (localeValues.length > 1) {
  9246. // 格式化国际化语言
  9247. var valueLocales = jsonObj[key + 'Locales'] = {};
  9248. localeValues.forEach(function (localValue) {
  9249. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  9250. });
  9251. }
  9252. }
  9253. } else
  9254. {
  9255. compileJsonObj(value, localeValues, delimiters);
  9256. }
  9257. }
  9258. function compileJsonObj(jsonObj, localeValues, delimiters) {
  9259. walkJsonObj(jsonObj, function (jsonObj, key) {
  9260. compileValue(jsonObj, key, localeValues, delimiters);
  9261. });
  9262. return jsonObj;
  9263. }
  9264. function walkJsonObj(jsonObj, walk) {
  9265. if (isArray(jsonObj)) {
  9266. for (var i = 0; i < jsonObj.length; i++) {
  9267. if (walk(jsonObj, i)) {
  9268. return true;
  9269. }
  9270. }
  9271. } else
  9272. if (isObject(jsonObj)) {
  9273. for (var key in jsonObj) {
  9274. if (walk(jsonObj, key)) {
  9275. return true;
  9276. }
  9277. }
  9278. }
  9279. return false;
  9280. }
  9281. function resolveLocale(locales) {
  9282. return function (locale) {
  9283. if (!locale) {
  9284. return locale;
  9285. }
  9286. locale = normalizeLocale(locale) || locale;
  9287. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  9288. };
  9289. }
  9290. function resolveLocaleChain(locale) {
  9291. var chain = [];
  9292. var tokens = locale.split('-');
  9293. while (tokens.length) {
  9294. chain.push(tokens.join('-'));
  9295. tokens.pop();
  9296. }
  9297. return chain;
  9298. }
  9299. /* 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)))
  9300. /***/ }),
  9301. /***/ 5:
  9302. /*!*******************************************!*\
  9303. !*** /Users/guo/Desktop/txCar/pages.json ***!
  9304. \*******************************************/
  9305. /*! no static exports found */
  9306. /***/ (function(module, exports) {
  9307. /***/ })
  9308. }]);
  9309. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map