vendor.js 321 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  10. function b64DecodeUnicode(str) {
  11. return decodeURIComponent(atob(str).split('').map(function (c) {
  12. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  13. }).join(''));
  14. }
  15. function getCurrentUserInfo() {
  16. var token = wx.getStorageSync('uni_id_token') || '';
  17. var tokenArr = token.split('.');
  18. if (!token || tokenArr.length !== 3) {
  19. return {
  20. uid: null,
  21. role: [],
  22. permission: [],
  23. tokenExpired: 0 };
  24. }
  25. var userInfo;
  26. try {
  27. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  28. } catch (error) {
  29. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  30. }
  31. userInfo.tokenExpired = userInfo.exp * 1000;
  32. delete userInfo.exp;
  33. delete userInfo.iat;
  34. return userInfo;
  35. }
  36. function uniIdMixin(Vue) {
  37. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  38. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  39. return role.indexOf(roleId) > -1;
  40. };
  41. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  42. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  43. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  44. };
  45. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  46. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  47. return tokenExpired > Date.now();
  48. };
  49. }
  50. var _toString = Object.prototype.toString;
  51. var hasOwnProperty = Object.prototype.hasOwnProperty;
  52. function isFn(fn) {
  53. return typeof fn === 'function';
  54. }
  55. function isStr(str) {
  56. return typeof str === 'string';
  57. }
  58. function isPlainObject(obj) {
  59. return _toString.call(obj) === '[object Object]';
  60. }
  61. function hasOwn(obj, key) {
  62. return hasOwnProperty.call(obj, key);
  63. }
  64. function noop() {}
  65. /**
  66. * Create a cached version of a pure function.
  67. */
  68. function cached(fn) {
  69. var cache = Object.create(null);
  70. return function cachedFn(str) {
  71. var hit = cache[str];
  72. return hit || (cache[str] = fn(str));
  73. };
  74. }
  75. /**
  76. * Camelize a hyphen-delimited string.
  77. */
  78. var camelizeRE = /-(\w)/g;
  79. var camelize = cached(function (str) {
  80. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  81. });
  82. var HOOKS = [
  83. 'invoke',
  84. 'success',
  85. 'fail',
  86. 'complete',
  87. 'returnValue'];
  88. var globalInterceptors = {};
  89. var scopedInterceptors = {};
  90. function mergeHook(parentVal, childVal) {
  91. var res = childVal ?
  92. parentVal ?
  93. parentVal.concat(childVal) :
  94. Array.isArray(childVal) ?
  95. childVal : [childVal] :
  96. parentVal;
  97. return res ?
  98. dedupeHooks(res) :
  99. res;
  100. }
  101. function dedupeHooks(hooks) {
  102. var res = [];
  103. for (var i = 0; i < hooks.length; i++) {
  104. if (res.indexOf(hooks[i]) === -1) {
  105. res.push(hooks[i]);
  106. }
  107. }
  108. return res;
  109. }
  110. function removeHook(hooks, hook) {
  111. var index = hooks.indexOf(hook);
  112. if (index !== -1) {
  113. hooks.splice(index, 1);
  114. }
  115. }
  116. function mergeInterceptorHook(interceptor, option) {
  117. Object.keys(option).forEach(function (hook) {
  118. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  119. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  120. }
  121. });
  122. }
  123. function removeInterceptorHook(interceptor, option) {
  124. if (!interceptor || !option) {
  125. return;
  126. }
  127. Object.keys(option).forEach(function (hook) {
  128. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  129. removeHook(interceptor[hook], option[hook]);
  130. }
  131. });
  132. }
  133. function addInterceptor(method, option) {
  134. if (typeof method === 'string' && isPlainObject(option)) {
  135. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  136. } else if (isPlainObject(method)) {
  137. mergeInterceptorHook(globalInterceptors, method);
  138. }
  139. }
  140. function removeInterceptor(method, option) {
  141. if (typeof method === 'string') {
  142. if (isPlainObject(option)) {
  143. removeInterceptorHook(scopedInterceptors[method], option);
  144. } else {
  145. delete scopedInterceptors[method];
  146. }
  147. } else if (isPlainObject(method)) {
  148. removeInterceptorHook(globalInterceptors, method);
  149. }
  150. }
  151. function wrapperHook(hook) {
  152. return function (data) {
  153. return hook(data) || data;
  154. };
  155. }
  156. function isPromise(obj) {
  157. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  158. }
  159. function queue(hooks, data) {
  160. var promise = false;
  161. for (var i = 0; i < hooks.length; i++) {
  162. var hook = hooks[i];
  163. if (promise) {
  164. promise = Promise.resolve(wrapperHook(hook));
  165. } else {
  166. var res = hook(data);
  167. if (isPromise(res)) {
  168. promise = Promise.resolve(res);
  169. }
  170. if (res === false) {
  171. return {
  172. then: function then() {} };
  173. }
  174. }
  175. }
  176. return promise || {
  177. then: function then(callback) {
  178. return callback(data);
  179. } };
  180. }
  181. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  182. ['success', 'fail', 'complete'].forEach(function (name) {
  183. if (Array.isArray(interceptor[name])) {
  184. var oldCallback = options[name];
  185. options[name] = function callbackInterceptor(res) {
  186. queue(interceptor[name], res).then(function (res) {
  187. /* eslint-disable no-mixed-operators */
  188. return isFn(oldCallback) && oldCallback(res) || res;
  189. });
  190. };
  191. }
  192. });
  193. return options;
  194. }
  195. function wrapperReturnValue(method, returnValue) {
  196. var returnValueHooks = [];
  197. if (Array.isArray(globalInterceptors.returnValue)) {
  198. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  199. }
  200. var interceptor = scopedInterceptors[method];
  201. if (interceptor && Array.isArray(interceptor.returnValue)) {
  202. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  203. }
  204. returnValueHooks.forEach(function (hook) {
  205. returnValue = hook(returnValue) || returnValue;
  206. });
  207. return returnValue;
  208. }
  209. function getApiInterceptorHooks(method) {
  210. var interceptor = Object.create(null);
  211. Object.keys(globalInterceptors).forEach(function (hook) {
  212. if (hook !== 'returnValue') {
  213. interceptor[hook] = globalInterceptors[hook].slice();
  214. }
  215. });
  216. var scopedInterceptor = scopedInterceptors[method];
  217. if (scopedInterceptor) {
  218. Object.keys(scopedInterceptor).forEach(function (hook) {
  219. if (hook !== 'returnValue') {
  220. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  221. }
  222. });
  223. }
  224. return interceptor;
  225. }
  226. 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];}
  227. var interceptor = getApiInterceptorHooks(method);
  228. if (interceptor && Object.keys(interceptor).length) {
  229. if (Array.isArray(interceptor.invoke)) {
  230. var res = queue(interceptor.invoke, options);
  231. return res.then(function (options) {
  232. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  233. });
  234. } else {
  235. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  236. }
  237. }
  238. return api.apply(void 0, [options].concat(params));
  239. }
  240. var promiseInterceptor = {
  241. returnValue: function returnValue(res) {
  242. if (!isPromise(res)) {
  243. return res;
  244. }
  245. return res.then(function (res) {
  246. return res[1];
  247. }).catch(function (res) {
  248. return res[0];
  249. });
  250. } };
  251. var SYNC_API_RE =
  252. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  253. var CONTEXT_API_RE = /^create|Manager$/;
  254. // Context例外情况
  255. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  256. // 同步例外情况
  257. var ASYNC_API = ['createBLEConnection'];
  258. var CALLBACK_API_RE = /^on|^off/;
  259. function isContextApi(name) {
  260. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  261. }
  262. function isSyncApi(name) {
  263. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  264. }
  265. function isCallbackApi(name) {
  266. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  267. }
  268. function handlePromise(promise) {
  269. return promise.then(function (data) {
  270. return [null, data];
  271. }).
  272. catch(function (err) {return [err];});
  273. }
  274. function shouldPromise(name) {
  275. if (
  276. isContextApi(name) ||
  277. isSyncApi(name) ||
  278. isCallbackApi(name))
  279. {
  280. return false;
  281. }
  282. return true;
  283. }
  284. /* eslint-disable no-extend-native */
  285. if (!Promise.prototype.finally) {
  286. Promise.prototype.finally = function (callback) {
  287. var promise = this.constructor;
  288. return this.then(
  289. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  290. function (reason) {return promise.resolve(callback()).then(function () {
  291. throw reason;
  292. });});
  293. };
  294. }
  295. function promisify(name, api) {
  296. if (!shouldPromise(name)) {
  297. return api;
  298. }
  299. 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];}
  300. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  301. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  302. }
  303. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  304. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  305. success: resolve,
  306. fail: reject })].concat(
  307. params));
  308. })));
  309. };
  310. }
  311. var EPS = 1e-4;
  312. var BASE_DEVICE_WIDTH = 750;
  313. var isIOS = false;
  314. var deviceWidth = 0;
  315. var deviceDPR = 0;
  316. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  317. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  318. deviceWidth = windowWidth;
  319. deviceDPR = pixelRatio;
  320. isIOS = platform === 'ios';
  321. }
  322. function upx2px(number, newDeviceWidth) {
  323. if (deviceWidth === 0) {
  324. checkDeviceWidth();
  325. }
  326. number = Number(number);
  327. if (number === 0) {
  328. return 0;
  329. }
  330. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  331. if (result < 0) {
  332. result = -result;
  333. }
  334. result = Math.floor(result + EPS);
  335. if (result === 0) {
  336. if (deviceDPR === 1 || !isIOS) {
  337. result = 1;
  338. } else {
  339. result = 0.5;
  340. }
  341. }
  342. return number < 0 ? -result : result;
  343. }
  344. var interceptors = {
  345. promiseInterceptor: promiseInterceptor };
  346. var baseApi = /*#__PURE__*/Object.freeze({
  347. __proto__: null,
  348. upx2px: upx2px,
  349. addInterceptor: addInterceptor,
  350. removeInterceptor: removeInterceptor,
  351. interceptors: interceptors });
  352. function findExistsPageIndex(url) {
  353. var pages = getCurrentPages();
  354. var len = pages.length;
  355. while (len--) {
  356. var page = pages[len];
  357. if (page.$page && page.$page.fullPath === url) {
  358. return len;
  359. }
  360. }
  361. return -1;
  362. }
  363. var redirectTo = {
  364. name: function name(fromArgs) {
  365. if (fromArgs.exists === 'back' && fromArgs.delta) {
  366. return 'navigateBack';
  367. }
  368. return 'redirectTo';
  369. },
  370. args: function args(fromArgs) {
  371. if (fromArgs.exists === 'back' && fromArgs.url) {
  372. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  373. if (existsPageIndex !== -1) {
  374. var delta = getCurrentPages().length - 1 - existsPageIndex;
  375. if (delta > 0) {
  376. fromArgs.delta = delta;
  377. }
  378. }
  379. }
  380. } };
  381. var previewImage = {
  382. args: function args(fromArgs) {
  383. var currentIndex = parseInt(fromArgs.current);
  384. if (isNaN(currentIndex)) {
  385. return;
  386. }
  387. var urls = fromArgs.urls;
  388. if (!Array.isArray(urls)) {
  389. return;
  390. }
  391. var len = urls.length;
  392. if (!len) {
  393. return;
  394. }
  395. if (currentIndex < 0) {
  396. currentIndex = 0;
  397. } else if (currentIndex >= len) {
  398. currentIndex = len - 1;
  399. }
  400. if (currentIndex > 0) {
  401. fromArgs.current = urls[currentIndex];
  402. fromArgs.urls = urls.filter(
  403. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  404. } else {
  405. fromArgs.current = urls[0];
  406. }
  407. return {
  408. indicator: false,
  409. loop: false };
  410. } };
  411. var UUID_KEY = '__DC_STAT_UUID';
  412. var deviceId;
  413. function addUuid(result) {
  414. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  415. if (!deviceId) {
  416. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  417. wx.setStorage({
  418. key: UUID_KEY,
  419. data: deviceId });
  420. }
  421. result.deviceId = deviceId;
  422. }
  423. function addSafeAreaInsets(result) {
  424. if (result.safeArea) {
  425. var safeArea = result.safeArea;
  426. result.safeAreaInsets = {
  427. top: safeArea.top,
  428. left: safeArea.left,
  429. right: result.windowWidth - safeArea.right,
  430. bottom: result.windowHeight - safeArea.bottom };
  431. }
  432. }
  433. var getSystemInfo = {
  434. returnValue: function returnValue(result) {
  435. addUuid(result);
  436. addSafeAreaInsets(result);
  437. } };
  438. // import navigateTo from 'uni-helpers/navigate-to'
  439. var protocols = {
  440. redirectTo: redirectTo,
  441. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  442. previewImage: previewImage,
  443. getSystemInfo: getSystemInfo,
  444. getSystemInfoSync: getSystemInfo };
  445. var todos = [
  446. 'vibrate',
  447. 'preloadPage',
  448. 'unPreloadPage',
  449. 'loadSubPackage'];
  450. var canIUses = [];
  451. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  452. function processCallback(methodName, method, returnValue) {
  453. return function (res) {
  454. return method(processReturnValue(methodName, res, returnValue));
  455. };
  456. }
  457. 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;
  458. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  459. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  460. if (isFn(argsOption)) {
  461. argsOption = argsOption(fromArgs, toArgs) || {};
  462. }
  463. for (var key in fromArgs) {
  464. if (hasOwn(argsOption, key)) {
  465. var keyOption = argsOption[key];
  466. if (isFn(keyOption)) {
  467. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  468. }
  469. if (!keyOption) {// 不支持的参数
  470. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  471. } else if (isStr(keyOption)) {// 重写参数 key
  472. toArgs[keyOption] = fromArgs[key];
  473. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  474. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  475. }
  476. } else if (CALLBACKS.indexOf(key) !== -1) {
  477. if (isFn(fromArgs[key])) {
  478. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  479. }
  480. } else {
  481. if (!keepFromArgs) {
  482. toArgs[key] = fromArgs[key];
  483. }
  484. }
  485. }
  486. return toArgs;
  487. } else if (isFn(fromArgs)) {
  488. fromArgs = processCallback(methodName, fromArgs, returnValue);
  489. }
  490. return fromArgs;
  491. }
  492. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  493. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  494. res = protocols.returnValue(methodName, res);
  495. }
  496. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  497. }
  498. function wrapper(methodName, method) {
  499. if (hasOwn(protocols, methodName)) {
  500. var protocol = protocols[methodName];
  501. if (!protocol) {// 暂不支持的 api
  502. return function () {
  503. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  504. };
  505. }
  506. return function (arg1, arg2) {// 目前 api 最多两个参数
  507. var options = protocol;
  508. if (isFn(protocol)) {
  509. options = protocol(arg1);
  510. }
  511. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  512. var args = [arg1];
  513. if (typeof arg2 !== 'undefined') {
  514. args.push(arg2);
  515. }
  516. if (isFn(options.name)) {
  517. methodName = options.name(arg1);
  518. } else if (isStr(options.name)) {
  519. methodName = options.name;
  520. }
  521. var returnValue = wx[methodName].apply(wx, args);
  522. if (isSyncApi(methodName)) {// 同步 api
  523. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  524. }
  525. return returnValue;
  526. };
  527. }
  528. return method;
  529. }
  530. var todoApis = Object.create(null);
  531. var TODOS = [
  532. 'onTabBarMidButtonTap',
  533. 'subscribePush',
  534. 'unsubscribePush',
  535. 'onPush',
  536. 'offPush',
  537. 'share'];
  538. function createTodoApi(name) {
  539. return function todoApi(_ref)
  540. {var fail = _ref.fail,complete = _ref.complete;
  541. var res = {
  542. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  543. isFn(fail) && fail(res);
  544. isFn(complete) && complete(res);
  545. };
  546. }
  547. TODOS.forEach(function (name) {
  548. todoApis[name] = createTodoApi(name);
  549. });
  550. var providers = {
  551. oauth: ['weixin'],
  552. share: ['weixin'],
  553. payment: ['wxpay'],
  554. push: ['weixin'] };
  555. function getProvider(_ref2)
  556. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  557. var res = false;
  558. if (providers[service]) {
  559. res = {
  560. errMsg: 'getProvider:ok',
  561. service: service,
  562. provider: providers[service] };
  563. isFn(success) && success(res);
  564. } else {
  565. res = {
  566. errMsg: 'getProvider:fail service not found' };
  567. isFn(fail) && fail(res);
  568. }
  569. isFn(complete) && complete(res);
  570. }
  571. var extraApi = /*#__PURE__*/Object.freeze({
  572. __proto__: null,
  573. getProvider: getProvider });
  574. var getEmitter = function () {
  575. var Emitter;
  576. return function getUniEmitter() {
  577. if (!Emitter) {
  578. Emitter = new _vue.default();
  579. }
  580. return Emitter;
  581. };
  582. }();
  583. function apply(ctx, method, args) {
  584. return ctx[method].apply(ctx, args);
  585. }
  586. function $on() {
  587. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  588. }
  589. function $off() {
  590. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  591. }
  592. function $once() {
  593. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  594. }
  595. function $emit() {
  596. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  597. }
  598. var eventApi = /*#__PURE__*/Object.freeze({
  599. __proto__: null,
  600. $on: $on,
  601. $off: $off,
  602. $once: $once,
  603. $emit: $emit });
  604. var api = /*#__PURE__*/Object.freeze({
  605. __proto__: null });
  606. var MPPage = Page;
  607. var MPComponent = Component;
  608. var customizeRE = /:/g;
  609. var customize = cached(function (str) {
  610. return camelize(str.replace(customizeRE, '-'));
  611. });
  612. function initTriggerEvent(mpInstance) {
  613. {
  614. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  615. return;
  616. }
  617. }
  618. var oldTriggerEvent = mpInstance.triggerEvent;
  619. 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];}
  620. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  621. };
  622. }
  623. function initHook(name, options) {
  624. var oldHook = options[name];
  625. if (!oldHook) {
  626. options[name] = function () {
  627. initTriggerEvent(this);
  628. };
  629. } else {
  630. options[name] = function () {
  631. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  632. return oldHook.apply(this, args);
  633. };
  634. }
  635. }
  636. if (!MPPage.__$wrappered) {
  637. MPPage.__$wrappered = true;
  638. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  639. initHook('onLoad', options);
  640. return MPPage(options);
  641. };
  642. Page.after = MPPage.after;
  643. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  644. initHook('created', options);
  645. return MPComponent(options);
  646. };
  647. }
  648. var PAGE_EVENT_HOOKS = [
  649. 'onPullDownRefresh',
  650. 'onReachBottom',
  651. 'onAddToFavorites',
  652. 'onShareTimeline',
  653. 'onShareAppMessage',
  654. 'onPageScroll',
  655. 'onResize',
  656. 'onTabItemTap'];
  657. function initMocks(vm, mocks) {
  658. var mpInstance = vm.$mp[vm.mpType];
  659. mocks.forEach(function (mock) {
  660. if (hasOwn(mpInstance, mock)) {
  661. vm[mock] = mpInstance[mock];
  662. }
  663. });
  664. }
  665. function hasHook(hook, vueOptions) {
  666. if (!vueOptions) {
  667. return true;
  668. }
  669. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  670. return true;
  671. }
  672. vueOptions = vueOptions.default || vueOptions;
  673. if (isFn(vueOptions)) {
  674. if (isFn(vueOptions.extendOptions[hook])) {
  675. return true;
  676. }
  677. if (vueOptions.super &&
  678. vueOptions.super.options &&
  679. Array.isArray(vueOptions.super.options[hook])) {
  680. return true;
  681. }
  682. return false;
  683. }
  684. if (isFn(vueOptions[hook])) {
  685. return true;
  686. }
  687. var mixins = vueOptions.mixins;
  688. if (Array.isArray(mixins)) {
  689. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  690. }
  691. }
  692. function initHooks(mpOptions, hooks, vueOptions) {
  693. hooks.forEach(function (hook) {
  694. if (hasHook(hook, vueOptions)) {
  695. mpOptions[hook] = function (args) {
  696. return this.$vm && this.$vm.__call_hook(hook, args);
  697. };
  698. }
  699. });
  700. }
  701. function initVueComponent(Vue, vueOptions) {
  702. vueOptions = vueOptions.default || vueOptions;
  703. var VueComponent;
  704. if (isFn(vueOptions)) {
  705. VueComponent = vueOptions;
  706. } else {
  707. VueComponent = Vue.extend(vueOptions);
  708. }
  709. vueOptions = VueComponent.options;
  710. return [VueComponent, vueOptions];
  711. }
  712. function initSlots(vm, vueSlots) {
  713. if (Array.isArray(vueSlots) && vueSlots.length) {
  714. var $slots = Object.create(null);
  715. vueSlots.forEach(function (slotName) {
  716. $slots[slotName] = true;
  717. });
  718. vm.$scopedSlots = vm.$slots = $slots;
  719. }
  720. }
  721. function initVueIds(vueIds, mpInstance) {
  722. vueIds = (vueIds || '').split(',');
  723. var len = vueIds.length;
  724. if (len === 1) {
  725. mpInstance._$vueId = vueIds[0];
  726. } else if (len === 2) {
  727. mpInstance._$vueId = vueIds[0];
  728. mpInstance._$vuePid = vueIds[1];
  729. }
  730. }
  731. function initData(vueOptions, context) {
  732. var data = vueOptions.data || {};
  733. var methods = vueOptions.methods || {};
  734. if (typeof data === 'function') {
  735. try {
  736. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  737. } catch (e) {
  738. if (Object({"VUE_APP_NAME":"基础项目","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  739. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  740. }
  741. }
  742. } else {
  743. try {
  744. // 对 data 格式化
  745. data = JSON.parse(JSON.stringify(data));
  746. } catch (e) {}
  747. }
  748. if (!isPlainObject(data)) {
  749. data = {};
  750. }
  751. Object.keys(methods).forEach(function (methodName) {
  752. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  753. data[methodName] = methods[methodName];
  754. }
  755. });
  756. return data;
  757. }
  758. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  759. function createObserver(name) {
  760. return function observer(newVal, oldVal) {
  761. if (this.$vm) {
  762. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  763. }
  764. };
  765. }
  766. function initBehaviors(vueOptions, initBehavior) {
  767. var vueBehaviors = vueOptions.behaviors;
  768. var vueExtends = vueOptions.extends;
  769. var vueMixins = vueOptions.mixins;
  770. var vueProps = vueOptions.props;
  771. if (!vueProps) {
  772. vueOptions.props = vueProps = [];
  773. }
  774. var behaviors = [];
  775. if (Array.isArray(vueBehaviors)) {
  776. vueBehaviors.forEach(function (behavior) {
  777. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  778. if (behavior === 'uni://form-field') {
  779. if (Array.isArray(vueProps)) {
  780. vueProps.push('name');
  781. vueProps.push('value');
  782. } else {
  783. vueProps.name = {
  784. type: String,
  785. default: '' };
  786. vueProps.value = {
  787. type: [String, Number, Boolean, Array, Object, Date],
  788. default: '' };
  789. }
  790. }
  791. });
  792. }
  793. if (isPlainObject(vueExtends) && vueExtends.props) {
  794. behaviors.push(
  795. initBehavior({
  796. properties: initProperties(vueExtends.props, true) }));
  797. }
  798. if (Array.isArray(vueMixins)) {
  799. vueMixins.forEach(function (vueMixin) {
  800. if (isPlainObject(vueMixin) && vueMixin.props) {
  801. behaviors.push(
  802. initBehavior({
  803. properties: initProperties(vueMixin.props, true) }));
  804. }
  805. });
  806. }
  807. return behaviors;
  808. }
  809. function parsePropType(key, type, defaultValue, file) {
  810. // [String]=>String
  811. if (Array.isArray(type) && type.length === 1) {
  812. return type[0];
  813. }
  814. return type;
  815. }
  816. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  817. var properties = {};
  818. if (!isBehavior) {
  819. properties.vueId = {
  820. type: String,
  821. value: '' };
  822. // 用于字节跳动小程序模拟抽象节点
  823. properties.generic = {
  824. type: Object,
  825. value: null };
  826. // scopedSlotsCompiler auto
  827. properties.scopedSlotsCompiler = {
  828. type: String,
  829. value: '' };
  830. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  831. type: null,
  832. value: [],
  833. observer: function observer(newVal, oldVal) {
  834. var $slots = Object.create(null);
  835. newVal.forEach(function (slotName) {
  836. $slots[slotName] = true;
  837. });
  838. this.setData({
  839. $slots: $slots });
  840. } };
  841. }
  842. if (Array.isArray(props)) {// ['title']
  843. props.forEach(function (key) {
  844. properties[key] = {
  845. type: null,
  846. observer: createObserver(key) };
  847. });
  848. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  849. Object.keys(props).forEach(function (key) {
  850. var opts = props[key];
  851. if (isPlainObject(opts)) {// title:{type:String,default:''}
  852. var value = opts.default;
  853. if (isFn(value)) {
  854. value = value();
  855. }
  856. opts.type = parsePropType(key, opts.type);
  857. properties[key] = {
  858. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  859. value: value,
  860. observer: createObserver(key) };
  861. } else {// content:String
  862. var type = parsePropType(key, opts);
  863. properties[key] = {
  864. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  865. observer: createObserver(key) };
  866. }
  867. });
  868. }
  869. return properties;
  870. }
  871. function wrapper$1(event) {
  872. // TODO 又得兼容 mpvue 的 mp 对象
  873. try {
  874. event.mp = JSON.parse(JSON.stringify(event));
  875. } catch (e) {}
  876. event.stopPropagation = noop;
  877. event.preventDefault = noop;
  878. event.target = event.target || {};
  879. if (!hasOwn(event, 'detail')) {
  880. event.detail = {};
  881. }
  882. if (hasOwn(event, 'markerId')) {
  883. event.detail = typeof event.detail === 'object' ? event.detail : {};
  884. event.detail.markerId = event.markerId;
  885. }
  886. if (isPlainObject(event.detail)) {
  887. event.target = Object.assign({}, event.target, event.detail);
  888. }
  889. return event;
  890. }
  891. function getExtraValue(vm, dataPathsArray) {
  892. var context = vm;
  893. dataPathsArray.forEach(function (dataPathArray) {
  894. var dataPath = dataPathArray[0];
  895. var value = dataPathArray[2];
  896. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  897. var propPath = dataPathArray[1];
  898. var valuePath = dataPathArray[3];
  899. var vFor;
  900. if (Number.isInteger(dataPath)) {
  901. vFor = dataPath;
  902. } else if (!dataPath) {
  903. vFor = context;
  904. } else if (typeof dataPath === 'string' && dataPath) {
  905. if (dataPath.indexOf('#s#') === 0) {
  906. vFor = dataPath.substr(3);
  907. } else {
  908. vFor = vm.__get_value(dataPath, context);
  909. }
  910. }
  911. if (Number.isInteger(vFor)) {
  912. context = value;
  913. } else if (!propPath) {
  914. context = vFor[value];
  915. } else {
  916. if (Array.isArray(vFor)) {
  917. context = vFor.find(function (vForItem) {
  918. return vm.__get_value(propPath, vForItem) === value;
  919. });
  920. } else if (isPlainObject(vFor)) {
  921. context = Object.keys(vFor).find(function (vForKey) {
  922. return vm.__get_value(propPath, vFor[vForKey]) === value;
  923. });
  924. } else {
  925. console.error('v-for 暂不支持循环数据:', vFor);
  926. }
  927. }
  928. if (valuePath) {
  929. context = vm.__get_value(valuePath, context);
  930. }
  931. }
  932. });
  933. return context;
  934. }
  935. function processEventExtra(vm, extra, event) {
  936. var extraObj = {};
  937. if (Array.isArray(extra) && extra.length) {
  938. /**
  939. *[
  940. * ['data.items', 'data.id', item.data.id],
  941. * ['metas', 'id', meta.id]
  942. *],
  943. *[
  944. * ['data.items', 'data.id', item.data.id],
  945. * ['metas', 'id', meta.id]
  946. *],
  947. *'test'
  948. */
  949. extra.forEach(function (dataPath, index) {
  950. if (typeof dataPath === 'string') {
  951. if (!dataPath) {// model,prop.sync
  952. extraObj['$' + index] = vm;
  953. } else {
  954. if (dataPath === '$event') {// $event
  955. extraObj['$' + index] = event;
  956. } else if (dataPath === 'arguments') {
  957. if (event.detail && event.detail.__args__) {
  958. extraObj['$' + index] = event.detail.__args__;
  959. } else {
  960. extraObj['$' + index] = [event];
  961. }
  962. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  963. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  964. } else {
  965. extraObj['$' + index] = vm.__get_value(dataPath);
  966. }
  967. }
  968. } else {
  969. extraObj['$' + index] = getExtraValue(vm, dataPath);
  970. }
  971. });
  972. }
  973. return extraObj;
  974. }
  975. function getObjByArray(arr) {
  976. var obj = {};
  977. for (var i = 1; i < arr.length; i++) {
  978. var element = arr[i];
  979. obj[element[0]] = element[1];
  980. }
  981. return obj;
  982. }
  983. 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;
  984. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  985. if (isCustom) {// 自定义事件
  986. isCustomMPEvent = event.currentTarget &&
  987. event.currentTarget.dataset &&
  988. event.currentTarget.dataset.comType === 'wx';
  989. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  990. if (isCustomMPEvent) {
  991. return [event];
  992. }
  993. return event.detail.__args__ || event.detail;
  994. }
  995. }
  996. var extraObj = processEventExtra(vm, extra, event);
  997. var ret = [];
  998. args.forEach(function (arg) {
  999. if (arg === '$event') {
  1000. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1001. ret.push(event.target.value);
  1002. } else {
  1003. if (isCustom && !isCustomMPEvent) {
  1004. ret.push(event.detail.__args__[0]);
  1005. } else {// wxcomponent 组件或内置组件
  1006. ret.push(event);
  1007. }
  1008. }
  1009. } else {
  1010. if (Array.isArray(arg) && arg[0] === 'o') {
  1011. ret.push(getObjByArray(arg));
  1012. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1013. ret.push(extraObj[arg]);
  1014. } else {
  1015. ret.push(arg);
  1016. }
  1017. }
  1018. });
  1019. return ret;
  1020. }
  1021. var ONCE = '~';
  1022. var CUSTOM = '^';
  1023. function isMatchEventType(eventType, optType) {
  1024. return eventType === optType ||
  1025. optType === 'regionchange' && (
  1026. eventType === 'begin' ||
  1027. eventType === 'end');
  1028. }
  1029. function getContextVm(vm) {
  1030. var $parent = vm.$parent;
  1031. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1032. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1033. $parent = $parent.$parent;
  1034. }
  1035. return $parent && $parent.$parent;
  1036. }
  1037. function handleEvent(event) {var _this = this;
  1038. event = wrapper$1(event);
  1039. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1040. var dataset = (event.currentTarget || event.target).dataset;
  1041. if (!dataset) {
  1042. return console.warn('事件信息不存在');
  1043. }
  1044. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1045. if (!eventOpts) {
  1046. return console.warn('事件信息不存在');
  1047. }
  1048. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1049. var eventType = event.type;
  1050. var ret = [];
  1051. eventOpts.forEach(function (eventOpt) {
  1052. var type = eventOpt[0];
  1053. var eventsArray = eventOpt[1];
  1054. var isCustom = type.charAt(0) === CUSTOM;
  1055. type = isCustom ? type.slice(1) : type;
  1056. var isOnce = type.charAt(0) === ONCE;
  1057. type = isOnce ? type.slice(1) : type;
  1058. if (eventsArray && isMatchEventType(eventType, type)) {
  1059. eventsArray.forEach(function (eventArray) {
  1060. var methodName = eventArray[0];
  1061. if (methodName) {
  1062. var handlerCtx = _this.$vm;
  1063. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1064. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1065. }
  1066. if (methodName === '$emit') {
  1067. handlerCtx.$emit.apply(handlerCtx,
  1068. processEventArgs(
  1069. _this.$vm,
  1070. event,
  1071. eventArray[1],
  1072. eventArray[2],
  1073. isCustom,
  1074. methodName));
  1075. return;
  1076. }
  1077. var handler = handlerCtx[methodName];
  1078. if (!isFn(handler)) {
  1079. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1080. }
  1081. if (isOnce) {
  1082. if (handler.once) {
  1083. return;
  1084. }
  1085. handler.once = true;
  1086. }
  1087. var params = processEventArgs(
  1088. _this.$vm,
  1089. event,
  1090. eventArray[1],
  1091. eventArray[2],
  1092. isCustom,
  1093. methodName);
  1094. params = Array.isArray(params) ? params : [];
  1095. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1096. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1097. // eslint-disable-next-line no-sparse-arrays
  1098. params = params.concat([,,,,,,,,,, event]);
  1099. }
  1100. ret.push(handler.apply(handlerCtx, params));
  1101. }
  1102. });
  1103. }
  1104. });
  1105. if (
  1106. eventType === 'input' &&
  1107. ret.length === 1 &&
  1108. typeof ret[0] !== 'undefined')
  1109. {
  1110. return ret[0];
  1111. }
  1112. }
  1113. var eventChannels = {};
  1114. var eventChannelStack = [];
  1115. function getEventChannel(id) {
  1116. if (id) {
  1117. var eventChannel = eventChannels[id];
  1118. delete eventChannels[id];
  1119. return eventChannel;
  1120. }
  1121. return eventChannelStack.shift();
  1122. }
  1123. var hooks = [
  1124. 'onShow',
  1125. 'onHide',
  1126. 'onError',
  1127. 'onPageNotFound',
  1128. 'onThemeChange',
  1129. 'onUnhandledRejection'];
  1130. function initEventChannel() {
  1131. _vue.default.prototype.getOpenerEventChannel = function () {
  1132. // 微信小程序使用自身getOpenerEventChannel
  1133. {
  1134. return this.$scope.getOpenerEventChannel();
  1135. }
  1136. };
  1137. var callHook = _vue.default.prototype.__call_hook;
  1138. _vue.default.prototype.__call_hook = function (hook, args) {
  1139. if (hook === 'onLoad' && args && args.__id__) {
  1140. this.__eventChannel__ = getEventChannel(args.__id__);
  1141. delete args.__id__;
  1142. }
  1143. return callHook.call(this, hook, args);
  1144. };
  1145. }
  1146. function initScopedSlotsParams() {
  1147. var center = {};
  1148. var parents = {};
  1149. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1150. var has = center[vueId];
  1151. if (!has) {
  1152. parents[vueId] = this;
  1153. this.$on('hook:destory', function () {
  1154. delete parents[vueId];
  1155. });
  1156. }
  1157. return has;
  1158. };
  1159. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1160. var data = center[vueId];
  1161. if (data) {
  1162. var object = data[name] || {};
  1163. return key ? object[key] : object;
  1164. } else {
  1165. parents[vueId] = this;
  1166. this.$on('hook:destory', function () {
  1167. delete parents[vueId];
  1168. });
  1169. }
  1170. };
  1171. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1172. var vueIds = this.$options.propsData.vueId;
  1173. if (vueIds) {
  1174. var vueId = vueIds.split(',')[0];
  1175. var object = center[vueId] = center[vueId] || {};
  1176. object[name] = value;
  1177. if (parents[vueId]) {
  1178. parents[vueId].$forceUpdate();
  1179. }
  1180. }
  1181. };
  1182. _vue.default.mixin({
  1183. destroyed: function destroyed() {
  1184. var propsData = this.$options.propsData;
  1185. var vueId = propsData && propsData.vueId;
  1186. if (vueId) {
  1187. delete center[vueId];
  1188. delete parents[vueId];
  1189. }
  1190. } });
  1191. }
  1192. function parseBaseApp(vm, _ref3)
  1193. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1194. initEventChannel();
  1195. {
  1196. initScopedSlotsParams();
  1197. }
  1198. if (vm.$options.store) {
  1199. _vue.default.prototype.$store = vm.$options.store;
  1200. }
  1201. uniIdMixin(_vue.default);
  1202. _vue.default.prototype.mpHost = "mp-weixin";
  1203. _vue.default.mixin({
  1204. beforeCreate: function beforeCreate() {
  1205. if (!this.$options.mpType) {
  1206. return;
  1207. }
  1208. this.mpType = this.$options.mpType;
  1209. this.$mp = _defineProperty({
  1210. data: {} },
  1211. this.mpType, this.$options.mpInstance);
  1212. this.$scope = this.$options.mpInstance;
  1213. delete this.$options.mpType;
  1214. delete this.$options.mpInstance;
  1215. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1216. var app = getApp();
  1217. if (app.$vm && app.$vm.$i18n) {
  1218. this._i18n = app.$vm.$i18n;
  1219. }
  1220. }
  1221. if (this.mpType !== 'app') {
  1222. initRefs(this);
  1223. initMocks(this, mocks);
  1224. }
  1225. } });
  1226. var appOptions = {
  1227. onLaunch: function onLaunch(args) {
  1228. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1229. return;
  1230. }
  1231. {
  1232. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1233. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1234. }
  1235. }
  1236. this.$vm = vm;
  1237. this.$vm.$mp = {
  1238. app: this };
  1239. this.$vm.$scope = this;
  1240. // vm 上也挂载 globalData
  1241. this.$vm.globalData = this.globalData;
  1242. this.$vm._isMounted = true;
  1243. this.$vm.__call_hook('mounted', args);
  1244. this.$vm.__call_hook('onLaunch', args);
  1245. } };
  1246. // 兼容旧版本 globalData
  1247. appOptions.globalData = vm.$options.globalData || {};
  1248. // 将 methods 中的方法挂在 getApp() 中
  1249. var methods = vm.$options.methods;
  1250. if (methods) {
  1251. Object.keys(methods).forEach(function (name) {
  1252. appOptions[name] = methods[name];
  1253. });
  1254. }
  1255. initHooks(appOptions, hooks);
  1256. return appOptions;
  1257. }
  1258. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1259. function findVmByVueId(vm, vuePid) {
  1260. var $children = vm.$children;
  1261. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1262. for (var i = $children.length - 1; i >= 0; i--) {
  1263. var childVm = $children[i];
  1264. if (childVm.$scope._$vueId === vuePid) {
  1265. return childVm;
  1266. }
  1267. }
  1268. // 反向递归查找
  1269. var parentVm;
  1270. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1271. parentVm = findVmByVueId($children[_i], vuePid);
  1272. if (parentVm) {
  1273. return parentVm;
  1274. }
  1275. }
  1276. }
  1277. function initBehavior(options) {
  1278. return Behavior(options);
  1279. }
  1280. function isPage() {
  1281. return !!this.route;
  1282. }
  1283. function initRelation(detail) {
  1284. this.triggerEvent('__l', detail);
  1285. }
  1286. function selectAllComponents(mpInstance, selector, $refs) {
  1287. var components = mpInstance.selectAllComponents(selector);
  1288. components.forEach(function (component) {
  1289. var ref = component.dataset.ref;
  1290. $refs[ref] = component.$vm || component;
  1291. {
  1292. if (component.dataset.vueGeneric === 'scoped') {
  1293. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1294. selectAllComponents(scopedComponent, selector, $refs);
  1295. });
  1296. }
  1297. }
  1298. });
  1299. }
  1300. function initRefs(vm) {
  1301. var mpInstance = vm.$scope;
  1302. Object.defineProperty(vm, '$refs', {
  1303. get: function get() {
  1304. var $refs = {};
  1305. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1306. // TODO 暂不考虑 for 中的 scoped
  1307. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1308. forComponents.forEach(function (component) {
  1309. var ref = component.dataset.ref;
  1310. if (!$refs[ref]) {
  1311. $refs[ref] = [];
  1312. }
  1313. $refs[ref].push(component.$vm || component);
  1314. });
  1315. return $refs;
  1316. } });
  1317. }
  1318. function handleLink(event) {var _ref4 =
  1319. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1320. var parentVm;
  1321. if (vuePid) {
  1322. parentVm = findVmByVueId(this.$vm, vuePid);
  1323. }
  1324. if (!parentVm) {
  1325. parentVm = this.$vm;
  1326. }
  1327. vueOptions.parent = parentVm;
  1328. }
  1329. function parseApp(vm) {
  1330. return parseBaseApp(vm, {
  1331. mocks: mocks,
  1332. initRefs: initRefs });
  1333. }
  1334. function createApp(vm) {
  1335. App(parseApp(vm));
  1336. return vm;
  1337. }
  1338. var encodeReserveRE = /[!'()*]/g;
  1339. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1340. var commaRE = /%2C/g;
  1341. // fixed encodeURIComponent which is more conformant to RFC3986:
  1342. // - escapes [!'()*]
  1343. // - preserve commas
  1344. var encode = function encode(str) {return encodeURIComponent(str).
  1345. replace(encodeReserveRE, encodeReserveReplacer).
  1346. replace(commaRE, ',');};
  1347. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1348. var res = obj ? Object.keys(obj).map(function (key) {
  1349. var val = obj[key];
  1350. if (val === undefined) {
  1351. return '';
  1352. }
  1353. if (val === null) {
  1354. return encodeStr(key);
  1355. }
  1356. if (Array.isArray(val)) {
  1357. var result = [];
  1358. val.forEach(function (val2) {
  1359. if (val2 === undefined) {
  1360. return;
  1361. }
  1362. if (val2 === null) {
  1363. result.push(encodeStr(key));
  1364. } else {
  1365. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1366. }
  1367. });
  1368. return result.join('&');
  1369. }
  1370. return encodeStr(key) + '=' + encodeStr(val);
  1371. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1372. return res ? "?".concat(res) : '';
  1373. }
  1374. function parseBaseComponent(vueComponentOptions)
  1375. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1376. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1377. var options = _objectSpread({
  1378. multipleSlots: true,
  1379. addGlobalClass: true },
  1380. vueOptions.options || {});
  1381. {
  1382. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1383. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1384. Object.assign(options, vueOptions['mp-weixin'].options);
  1385. }
  1386. }
  1387. var componentOptions = {
  1388. options: options,
  1389. data: initData(vueOptions, _vue.default.prototype),
  1390. behaviors: initBehaviors(vueOptions, initBehavior),
  1391. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1392. lifetimes: {
  1393. attached: function attached() {
  1394. var properties = this.properties;
  1395. var options = {
  1396. mpType: isPage.call(this) ? 'page' : 'component',
  1397. mpInstance: this,
  1398. propsData: properties };
  1399. initVueIds(properties.vueId, this);
  1400. // 处理父子关系
  1401. initRelation.call(this, {
  1402. vuePid: this._$vuePid,
  1403. vueOptions: options });
  1404. // 初始化 vue 实例
  1405. this.$vm = new VueComponent(options);
  1406. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1407. initSlots(this.$vm, properties.vueSlots);
  1408. // 触发首次 setData
  1409. this.$vm.$mount();
  1410. },
  1411. ready: function ready() {
  1412. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1413. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1414. if (this.$vm) {
  1415. this.$vm._isMounted = true;
  1416. this.$vm.__call_hook('mounted');
  1417. this.$vm.__call_hook('onReady');
  1418. }
  1419. },
  1420. detached: function detached() {
  1421. this.$vm && this.$vm.$destroy();
  1422. } },
  1423. pageLifetimes: {
  1424. show: function show(args) {
  1425. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1426. },
  1427. hide: function hide() {
  1428. this.$vm && this.$vm.__call_hook('onPageHide');
  1429. },
  1430. resize: function resize(size) {
  1431. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1432. } },
  1433. methods: {
  1434. __l: handleLink,
  1435. __e: handleEvent } };
  1436. // externalClasses
  1437. if (vueOptions.externalClasses) {
  1438. componentOptions.externalClasses = vueOptions.externalClasses;
  1439. }
  1440. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1441. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1442. componentOptions.methods[callMethod] = function (args) {
  1443. return this.$vm[callMethod](args);
  1444. };
  1445. });
  1446. }
  1447. if (isPage) {
  1448. return componentOptions;
  1449. }
  1450. return [componentOptions, VueComponent];
  1451. }
  1452. function parseComponent(vueComponentOptions) {
  1453. return parseBaseComponent(vueComponentOptions, {
  1454. isPage: isPage,
  1455. initRelation: initRelation });
  1456. }
  1457. var hooks$1 = [
  1458. 'onShow',
  1459. 'onHide',
  1460. 'onUnload'];
  1461. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1462. function parseBasePage(vuePageOptions, _ref6)
  1463. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1464. var pageOptions = parseComponent(vuePageOptions);
  1465. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1466. pageOptions.methods.onLoad = function (query) {
  1467. this.options = query;
  1468. var copyQuery = Object.assign({}, query);
  1469. delete copyQuery.__id__;
  1470. this.$page = {
  1471. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1472. this.$vm.$mp.query = query; // 兼容 mpvue
  1473. this.$vm.__call_hook('onLoad', query);
  1474. };
  1475. return pageOptions;
  1476. }
  1477. function parsePage(vuePageOptions) {
  1478. return parseBasePage(vuePageOptions, {
  1479. isPage: isPage,
  1480. initRelation: initRelation });
  1481. }
  1482. function createPage(vuePageOptions) {
  1483. {
  1484. return Component(parsePage(vuePageOptions));
  1485. }
  1486. }
  1487. function createComponent(vueOptions) {
  1488. {
  1489. return Component(parseComponent(vueOptions));
  1490. }
  1491. }
  1492. function createSubpackageApp(vm) {
  1493. var appOptions = parseApp(vm);
  1494. var app = getApp({
  1495. allowDefault: true });
  1496. vm.$scope = app;
  1497. var globalData = app.globalData;
  1498. if (globalData) {
  1499. Object.keys(appOptions.globalData).forEach(function (name) {
  1500. if (!hasOwn(globalData, name)) {
  1501. globalData[name] = appOptions.globalData[name];
  1502. }
  1503. });
  1504. }
  1505. Object.keys(appOptions).forEach(function (name) {
  1506. if (!hasOwn(app, name)) {
  1507. app[name] = appOptions[name];
  1508. }
  1509. });
  1510. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1511. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1512. vm.__call_hook('onShow', args);
  1513. });
  1514. }
  1515. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1516. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1517. vm.__call_hook('onHide', args);
  1518. });
  1519. }
  1520. if (isFn(appOptions.onLaunch)) {
  1521. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1522. vm.__call_hook('onLaunch', args);
  1523. }
  1524. return vm;
  1525. }
  1526. function createPlugin(vm) {
  1527. var appOptions = parseApp(vm);
  1528. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1529. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1530. appOptions.onShow.apply(vm, args);
  1531. });
  1532. }
  1533. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1534. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1535. appOptions.onHide.apply(vm, args);
  1536. });
  1537. }
  1538. if (isFn(appOptions.onLaunch)) {
  1539. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1540. appOptions.onLaunch.call(vm, args);
  1541. }
  1542. return vm;
  1543. }
  1544. todos.forEach(function (todoApi) {
  1545. protocols[todoApi] = false;
  1546. });
  1547. canIUses.forEach(function (canIUseApi) {
  1548. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1549. canIUseApi;
  1550. if (!wx.canIUse(apiName)) {
  1551. protocols[canIUseApi] = false;
  1552. }
  1553. });
  1554. var uni = {};
  1555. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1556. uni = new Proxy({}, {
  1557. get: function get(target, name) {
  1558. if (hasOwn(target, name)) {
  1559. return target[name];
  1560. }
  1561. if (baseApi[name]) {
  1562. return baseApi[name];
  1563. }
  1564. if (api[name]) {
  1565. return promisify(name, api[name]);
  1566. }
  1567. {
  1568. if (extraApi[name]) {
  1569. return promisify(name, extraApi[name]);
  1570. }
  1571. if (todoApis[name]) {
  1572. return promisify(name, todoApis[name]);
  1573. }
  1574. }
  1575. if (eventApi[name]) {
  1576. return eventApi[name];
  1577. }
  1578. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1579. return;
  1580. }
  1581. return promisify(name, wrapper(name, wx[name]));
  1582. },
  1583. set: function set(target, name, value) {
  1584. target[name] = value;
  1585. return true;
  1586. } });
  1587. } else {
  1588. Object.keys(baseApi).forEach(function (name) {
  1589. uni[name] = baseApi[name];
  1590. });
  1591. {
  1592. Object.keys(todoApis).forEach(function (name) {
  1593. uni[name] = promisify(name, todoApis[name]);
  1594. });
  1595. Object.keys(extraApi).forEach(function (name) {
  1596. uni[name] = promisify(name, todoApis[name]);
  1597. });
  1598. }
  1599. Object.keys(eventApi).forEach(function (name) {
  1600. uni[name] = eventApi[name];
  1601. });
  1602. Object.keys(api).forEach(function (name) {
  1603. uni[name] = promisify(name, api[name]);
  1604. });
  1605. Object.keys(wx).forEach(function (name) {
  1606. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1607. uni[name] = promisify(name, wrapper(name, wx[name]));
  1608. }
  1609. });
  1610. }
  1611. wx.createApp = createApp;
  1612. wx.createPage = createPage;
  1613. wx.createComponent = createComponent;
  1614. wx.createSubpackageApp = createSubpackageApp;
  1615. wx.createPlugin = createPlugin;
  1616. var uni$1 = uni;var _default =
  1617. uni$1;exports.default = _default;
  1618. /***/ }),
  1619. /***/ 138:
  1620. /*!**************************************!*\
  1621. !*** G:/gsxm/git/xinwang/api/set.js ***!
  1622. \**************************************/
  1623. /*! no static exports found */
  1624. /***/ (function(module, exports, __webpack_require__) {
  1625. "use strict";
  1626. Object.defineProperty(exports, "__esModule", { value: true });exports.userEdit = userEdit;exports.logout = logout;exports.registerReset = registerReset;exports.binding = binding;exports.getAddressArea = getAddressArea;exports.getAddressCity = getAddressCity;exports.getAddressDetail = getAddressDetail;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1627. // 修改用户信息
  1628. function userEdit(data) {
  1629. return (0, _request.default)({
  1630. url: '/api/user/edit',
  1631. method: 'post',
  1632. data: data });
  1633. }
  1634. //退出登录
  1635. function logout(data) {
  1636. return (0, _request.default)({
  1637. url: '/api/logout',
  1638. method: 'get',
  1639. data: data });
  1640. }
  1641. //修改密码
  1642. function registerReset(data) {
  1643. return (0, _request.default)({
  1644. url: '/api/register/reset',
  1645. method: 'post',
  1646. data: data });
  1647. }
  1648. //绑定手机
  1649. function binding(data) {
  1650. return (0, _request.default)({
  1651. url: '/api/binding',
  1652. method: 'post',
  1653. data: data });
  1654. }
  1655. //获取省市区
  1656. function getAddressArea(data) {
  1657. return (0, _request.default)({
  1658. url: '/api/area',
  1659. method: 'get',
  1660. data: data });
  1661. }
  1662. //获取村镇
  1663. function getAddressCity(data, id) {
  1664. return (0, _request.default)({
  1665. url: '/api/village/' + id,
  1666. method: 'get',
  1667. data: data });
  1668. }
  1669. function getAddressDetail(data, id) {
  1670. return (0, _request.default)({
  1671. url: '/api/address/detail/' + id,
  1672. method: 'get',
  1673. data: data });
  1674. }
  1675. /***/ }),
  1676. /***/ 15:
  1677. /*!**********************************************************************************************************!*\
  1678. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1679. \**********************************************************************************************************/
  1680. /*! exports provided: default */
  1681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1682. "use strict";
  1683. __webpack_require__.r(__webpack_exports__);
  1684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1685. /* globals __VUE_SSR_CONTEXT__ */
  1686. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1687. // This module is a runtime utility for cleaner component module output and will
  1688. // be included in the final webpack user bundle.
  1689. function normalizeComponent (
  1690. scriptExports,
  1691. render,
  1692. staticRenderFns,
  1693. functionalTemplate,
  1694. injectStyles,
  1695. scopeId,
  1696. moduleIdentifier, /* server only */
  1697. shadowMode, /* vue-cli only */
  1698. components, // fixed by xxxxxx auto components
  1699. renderjs // fixed by xxxxxx renderjs
  1700. ) {
  1701. // Vue.extend constructor export interop
  1702. var options = typeof scriptExports === 'function'
  1703. ? scriptExports.options
  1704. : scriptExports
  1705. // fixed by xxxxxx auto components
  1706. if (components) {
  1707. if (!options.components) {
  1708. options.components = {}
  1709. }
  1710. var hasOwn = Object.prototype.hasOwnProperty
  1711. for (var name in components) {
  1712. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1713. options.components[name] = components[name]
  1714. }
  1715. }
  1716. }
  1717. // fixed by xxxxxx renderjs
  1718. if (renderjs) {
  1719. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1720. this[renderjs.__module] = this
  1721. });
  1722. (options.mixins || (options.mixins = [])).push(renderjs)
  1723. }
  1724. // render functions
  1725. if (render) {
  1726. options.render = render
  1727. options.staticRenderFns = staticRenderFns
  1728. options._compiled = true
  1729. }
  1730. // functional template
  1731. if (functionalTemplate) {
  1732. options.functional = true
  1733. }
  1734. // scopedId
  1735. if (scopeId) {
  1736. options._scopeId = 'data-v-' + scopeId
  1737. }
  1738. var hook
  1739. if (moduleIdentifier) { // server build
  1740. hook = function (context) {
  1741. // 2.3 injection
  1742. context =
  1743. context || // cached call
  1744. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1745. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1746. // 2.2 with runInNewContext: true
  1747. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1748. context = __VUE_SSR_CONTEXT__
  1749. }
  1750. // inject component styles
  1751. if (injectStyles) {
  1752. injectStyles.call(this, context)
  1753. }
  1754. // register component module identifier for async chunk inferrence
  1755. if (context && context._registeredComponents) {
  1756. context._registeredComponents.add(moduleIdentifier)
  1757. }
  1758. }
  1759. // used by ssr in case component is cached and beforeCreate
  1760. // never gets called
  1761. options._ssrRegister = hook
  1762. } else if (injectStyles) {
  1763. hook = shadowMode
  1764. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1765. : injectStyles
  1766. }
  1767. if (hook) {
  1768. if (options.functional) {
  1769. // for template-only hot-reload because in that case the render fn doesn't
  1770. // go through the normalizer
  1771. options._injectStyles = hook
  1772. // register for functioal component in vue file
  1773. var originalRender = options.render
  1774. options.render = function renderWithStyleInjection (h, context) {
  1775. hook.call(context)
  1776. return originalRender(h, context)
  1777. }
  1778. } else {
  1779. // inject component registration as beforeCreate hook
  1780. var existing = options.beforeCreate
  1781. options.beforeCreate = existing
  1782. ? [].concat(existing, hook)
  1783. : [hook]
  1784. }
  1785. }
  1786. return {
  1787. exports: scriptExports,
  1788. options: options
  1789. }
  1790. }
  1791. /***/ }),
  1792. /***/ 2:
  1793. /*!******************************************************************************************!*\
  1794. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1795. \******************************************************************************************/
  1796. /*! exports provided: default */
  1797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1798. "use strict";
  1799. __webpack_require__.r(__webpack_exports__);
  1800. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1801. * Vue.js v2.6.11
  1802. * (c) 2014-2021 Evan You
  1803. * Released under the MIT License.
  1804. */
  1805. /* */
  1806. var emptyObject = Object.freeze({});
  1807. // These helpers produce better VM code in JS engines due to their
  1808. // explicitness and function inlining.
  1809. function isUndef (v) {
  1810. return v === undefined || v === null
  1811. }
  1812. function isDef (v) {
  1813. return v !== undefined && v !== null
  1814. }
  1815. function isTrue (v) {
  1816. return v === true
  1817. }
  1818. function isFalse (v) {
  1819. return v === false
  1820. }
  1821. /**
  1822. * Check if value is primitive.
  1823. */
  1824. function isPrimitive (value) {
  1825. return (
  1826. typeof value === 'string' ||
  1827. typeof value === 'number' ||
  1828. // $flow-disable-line
  1829. typeof value === 'symbol' ||
  1830. typeof value === 'boolean'
  1831. )
  1832. }
  1833. /**
  1834. * Quick object check - this is primarily used to tell
  1835. * Objects from primitive values when we know the value
  1836. * is a JSON-compliant type.
  1837. */
  1838. function isObject (obj) {
  1839. return obj !== null && typeof obj === 'object'
  1840. }
  1841. /**
  1842. * Get the raw type string of a value, e.g., [object Object].
  1843. */
  1844. var _toString = Object.prototype.toString;
  1845. function toRawType (value) {
  1846. return _toString.call(value).slice(8, -1)
  1847. }
  1848. /**
  1849. * Strict object type check. Only returns true
  1850. * for plain JavaScript objects.
  1851. */
  1852. function isPlainObject (obj) {
  1853. return _toString.call(obj) === '[object Object]'
  1854. }
  1855. function isRegExp (v) {
  1856. return _toString.call(v) === '[object RegExp]'
  1857. }
  1858. /**
  1859. * Check if val is a valid array index.
  1860. */
  1861. function isValidArrayIndex (val) {
  1862. var n = parseFloat(String(val));
  1863. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1864. }
  1865. function isPromise (val) {
  1866. return (
  1867. isDef(val) &&
  1868. typeof val.then === 'function' &&
  1869. typeof val.catch === 'function'
  1870. )
  1871. }
  1872. /**
  1873. * Convert a value to a string that is actually rendered.
  1874. */
  1875. function toString (val) {
  1876. return val == null
  1877. ? ''
  1878. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1879. ? JSON.stringify(val, null, 2)
  1880. : String(val)
  1881. }
  1882. /**
  1883. * Convert an input value to a number for persistence.
  1884. * If the conversion fails, return original string.
  1885. */
  1886. function toNumber (val) {
  1887. var n = parseFloat(val);
  1888. return isNaN(n) ? val : n
  1889. }
  1890. /**
  1891. * Make a map and return a function for checking if a key
  1892. * is in that map.
  1893. */
  1894. function makeMap (
  1895. str,
  1896. expectsLowerCase
  1897. ) {
  1898. var map = Object.create(null);
  1899. var list = str.split(',');
  1900. for (var i = 0; i < list.length; i++) {
  1901. map[list[i]] = true;
  1902. }
  1903. return expectsLowerCase
  1904. ? function (val) { return map[val.toLowerCase()]; }
  1905. : function (val) { return map[val]; }
  1906. }
  1907. /**
  1908. * Check if a tag is a built-in tag.
  1909. */
  1910. var isBuiltInTag = makeMap('slot,component', true);
  1911. /**
  1912. * Check if an attribute is a reserved attribute.
  1913. */
  1914. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1915. /**
  1916. * Remove an item from an array.
  1917. */
  1918. function remove (arr, item) {
  1919. if (arr.length) {
  1920. var index = arr.indexOf(item);
  1921. if (index > -1) {
  1922. return arr.splice(index, 1)
  1923. }
  1924. }
  1925. }
  1926. /**
  1927. * Check whether an object has the property.
  1928. */
  1929. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1930. function hasOwn (obj, key) {
  1931. return hasOwnProperty.call(obj, key)
  1932. }
  1933. /**
  1934. * Create a cached version of a pure function.
  1935. */
  1936. function cached (fn) {
  1937. var cache = Object.create(null);
  1938. return (function cachedFn (str) {
  1939. var hit = cache[str];
  1940. return hit || (cache[str] = fn(str))
  1941. })
  1942. }
  1943. /**
  1944. * Camelize a hyphen-delimited string.
  1945. */
  1946. var camelizeRE = /-(\w)/g;
  1947. var camelize = cached(function (str) {
  1948. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1949. });
  1950. /**
  1951. * Capitalize a string.
  1952. */
  1953. var capitalize = cached(function (str) {
  1954. return str.charAt(0).toUpperCase() + str.slice(1)
  1955. });
  1956. /**
  1957. * Hyphenate a camelCase string.
  1958. */
  1959. var hyphenateRE = /\B([A-Z])/g;
  1960. var hyphenate = cached(function (str) {
  1961. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1962. });
  1963. /**
  1964. * Simple bind polyfill for environments that do not support it,
  1965. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1966. * since native bind is now performant enough in most browsers.
  1967. * But removing it would mean breaking code that was able to run in
  1968. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1969. */
  1970. /* istanbul ignore next */
  1971. function polyfillBind (fn, ctx) {
  1972. function boundFn (a) {
  1973. var l = arguments.length;
  1974. return l
  1975. ? l > 1
  1976. ? fn.apply(ctx, arguments)
  1977. : fn.call(ctx, a)
  1978. : fn.call(ctx)
  1979. }
  1980. boundFn._length = fn.length;
  1981. return boundFn
  1982. }
  1983. function nativeBind (fn, ctx) {
  1984. return fn.bind(ctx)
  1985. }
  1986. var bind = Function.prototype.bind
  1987. ? nativeBind
  1988. : polyfillBind;
  1989. /**
  1990. * Convert an Array-like object to a real Array.
  1991. */
  1992. function toArray (list, start) {
  1993. start = start || 0;
  1994. var i = list.length - start;
  1995. var ret = new Array(i);
  1996. while (i--) {
  1997. ret[i] = list[i + start];
  1998. }
  1999. return ret
  2000. }
  2001. /**
  2002. * Mix properties into target object.
  2003. */
  2004. function extend (to, _from) {
  2005. for (var key in _from) {
  2006. to[key] = _from[key];
  2007. }
  2008. return to
  2009. }
  2010. /**
  2011. * Merge an Array of Objects into a single Object.
  2012. */
  2013. function toObject (arr) {
  2014. var res = {};
  2015. for (var i = 0; i < arr.length; i++) {
  2016. if (arr[i]) {
  2017. extend(res, arr[i]);
  2018. }
  2019. }
  2020. return res
  2021. }
  2022. /* eslint-disable no-unused-vars */
  2023. /**
  2024. * Perform no operation.
  2025. * Stubbing args to make Flow happy without leaving useless transpiled code
  2026. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2027. */
  2028. function noop (a, b, c) {}
  2029. /**
  2030. * Always return false.
  2031. */
  2032. var no = function (a, b, c) { return false; };
  2033. /* eslint-enable no-unused-vars */
  2034. /**
  2035. * Return the same value.
  2036. */
  2037. var identity = function (_) { return _; };
  2038. /**
  2039. * Check if two values are loosely equal - that is,
  2040. * if they are plain objects, do they have the same shape?
  2041. */
  2042. function looseEqual (a, b) {
  2043. if (a === b) { return true }
  2044. var isObjectA = isObject(a);
  2045. var isObjectB = isObject(b);
  2046. if (isObjectA && isObjectB) {
  2047. try {
  2048. var isArrayA = Array.isArray(a);
  2049. var isArrayB = Array.isArray(b);
  2050. if (isArrayA && isArrayB) {
  2051. return a.length === b.length && a.every(function (e, i) {
  2052. return looseEqual(e, b[i])
  2053. })
  2054. } else if (a instanceof Date && b instanceof Date) {
  2055. return a.getTime() === b.getTime()
  2056. } else if (!isArrayA && !isArrayB) {
  2057. var keysA = Object.keys(a);
  2058. var keysB = Object.keys(b);
  2059. return keysA.length === keysB.length && keysA.every(function (key) {
  2060. return looseEqual(a[key], b[key])
  2061. })
  2062. } else {
  2063. /* istanbul ignore next */
  2064. return false
  2065. }
  2066. } catch (e) {
  2067. /* istanbul ignore next */
  2068. return false
  2069. }
  2070. } else if (!isObjectA && !isObjectB) {
  2071. return String(a) === String(b)
  2072. } else {
  2073. return false
  2074. }
  2075. }
  2076. /**
  2077. * Return the first index at which a loosely equal value can be
  2078. * found in the array (if value is a plain object, the array must
  2079. * contain an object of the same shape), or -1 if it is not present.
  2080. */
  2081. function looseIndexOf (arr, val) {
  2082. for (var i = 0; i < arr.length; i++) {
  2083. if (looseEqual(arr[i], val)) { return i }
  2084. }
  2085. return -1
  2086. }
  2087. /**
  2088. * Ensure a function is called only once.
  2089. */
  2090. function once (fn) {
  2091. var called = false;
  2092. return function () {
  2093. if (!called) {
  2094. called = true;
  2095. fn.apply(this, arguments);
  2096. }
  2097. }
  2098. }
  2099. var ASSET_TYPES = [
  2100. 'component',
  2101. 'directive',
  2102. 'filter'
  2103. ];
  2104. var LIFECYCLE_HOOKS = [
  2105. 'beforeCreate',
  2106. 'created',
  2107. 'beforeMount',
  2108. 'mounted',
  2109. 'beforeUpdate',
  2110. 'updated',
  2111. 'beforeDestroy',
  2112. 'destroyed',
  2113. 'activated',
  2114. 'deactivated',
  2115. 'errorCaptured',
  2116. 'serverPrefetch'
  2117. ];
  2118. /* */
  2119. var config = ({
  2120. /**
  2121. * Option merge strategies (used in core/util/options)
  2122. */
  2123. // $flow-disable-line
  2124. optionMergeStrategies: Object.create(null),
  2125. /**
  2126. * Whether to suppress warnings.
  2127. */
  2128. silent: false,
  2129. /**
  2130. * Show production mode tip message on boot?
  2131. */
  2132. productionTip: "development" !== 'production',
  2133. /**
  2134. * Whether to enable devtools
  2135. */
  2136. devtools: "development" !== 'production',
  2137. /**
  2138. * Whether to record perf
  2139. */
  2140. performance: false,
  2141. /**
  2142. * Error handler for watcher errors
  2143. */
  2144. errorHandler: null,
  2145. /**
  2146. * Warn handler for watcher warns
  2147. */
  2148. warnHandler: null,
  2149. /**
  2150. * Ignore certain custom elements
  2151. */
  2152. ignoredElements: [],
  2153. /**
  2154. * Custom user key aliases for v-on
  2155. */
  2156. // $flow-disable-line
  2157. keyCodes: Object.create(null),
  2158. /**
  2159. * Check if a tag is reserved so that it cannot be registered as a
  2160. * component. This is platform-dependent and may be overwritten.
  2161. */
  2162. isReservedTag: no,
  2163. /**
  2164. * Check if an attribute is reserved so that it cannot be used as a component
  2165. * prop. This is platform-dependent and may be overwritten.
  2166. */
  2167. isReservedAttr: no,
  2168. /**
  2169. * Check if a tag is an unknown element.
  2170. * Platform-dependent.
  2171. */
  2172. isUnknownElement: no,
  2173. /**
  2174. * Get the namespace of an element
  2175. */
  2176. getTagNamespace: noop,
  2177. /**
  2178. * Parse the real tag name for the specific platform.
  2179. */
  2180. parsePlatformTagName: identity,
  2181. /**
  2182. * Check if an attribute must be bound using property, e.g. value
  2183. * Platform-dependent.
  2184. */
  2185. mustUseProp: no,
  2186. /**
  2187. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2188. * This will significantly reduce performance if set to false.
  2189. */
  2190. async: true,
  2191. /**
  2192. * Exposed for legacy reasons
  2193. */
  2194. _lifecycleHooks: LIFECYCLE_HOOKS
  2195. });
  2196. /* */
  2197. /**
  2198. * unicode letters used for parsing html tags, component names and property paths.
  2199. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2200. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2201. */
  2202. 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/;
  2203. /**
  2204. * Check if a string starts with $ or _
  2205. */
  2206. function isReserved (str) {
  2207. var c = (str + '').charCodeAt(0);
  2208. return c === 0x24 || c === 0x5F
  2209. }
  2210. /**
  2211. * Define a property.
  2212. */
  2213. function def (obj, key, val, enumerable) {
  2214. Object.defineProperty(obj, key, {
  2215. value: val,
  2216. enumerable: !!enumerable,
  2217. writable: true,
  2218. configurable: true
  2219. });
  2220. }
  2221. /**
  2222. * Parse simple path.
  2223. */
  2224. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2225. function parsePath (path) {
  2226. if (bailRE.test(path)) {
  2227. return
  2228. }
  2229. var segments = path.split('.');
  2230. return function (obj) {
  2231. for (var i = 0; i < segments.length; i++) {
  2232. if (!obj) { return }
  2233. obj = obj[segments[i]];
  2234. }
  2235. return obj
  2236. }
  2237. }
  2238. /* */
  2239. // can we use __proto__?
  2240. var hasProto = '__proto__' in {};
  2241. // Browser environment sniffing
  2242. var inBrowser = typeof window !== 'undefined';
  2243. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2244. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2245. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2246. var isIE = UA && /msie|trident/.test(UA);
  2247. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2248. var isEdge = UA && UA.indexOf('edge/') > 0;
  2249. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2250. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2251. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2252. var isPhantomJS = UA && /phantomjs/.test(UA);
  2253. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2254. // Firefox has a "watch" function on Object.prototype...
  2255. var nativeWatch = ({}).watch;
  2256. if (inBrowser) {
  2257. try {
  2258. var opts = {};
  2259. Object.defineProperty(opts, 'passive', ({
  2260. get: function get () {
  2261. }
  2262. })); // https://github.com/facebook/flow/issues/285
  2263. window.addEventListener('test-passive', null, opts);
  2264. } catch (e) {}
  2265. }
  2266. // this needs to be lazy-evaled because vue may be required before
  2267. // vue-server-renderer can set VUE_ENV
  2268. var _isServer;
  2269. var isServerRendering = function () {
  2270. if (_isServer === undefined) {
  2271. /* istanbul ignore if */
  2272. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2273. // detect presence of vue-server-renderer and avoid
  2274. // Webpack shimming the process
  2275. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2276. } else {
  2277. _isServer = false;
  2278. }
  2279. }
  2280. return _isServer
  2281. };
  2282. // detect devtools
  2283. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2284. /* istanbul ignore next */
  2285. function isNative (Ctor) {
  2286. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2287. }
  2288. var hasSymbol =
  2289. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2290. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2291. var _Set;
  2292. /* istanbul ignore if */ // $flow-disable-line
  2293. if (typeof Set !== 'undefined' && isNative(Set)) {
  2294. // use native Set when available.
  2295. _Set = Set;
  2296. } else {
  2297. // a non-standard Set polyfill that only works with primitive keys.
  2298. _Set = /*@__PURE__*/(function () {
  2299. function Set () {
  2300. this.set = Object.create(null);
  2301. }
  2302. Set.prototype.has = function has (key) {
  2303. return this.set[key] === true
  2304. };
  2305. Set.prototype.add = function add (key) {
  2306. this.set[key] = true;
  2307. };
  2308. Set.prototype.clear = function clear () {
  2309. this.set = Object.create(null);
  2310. };
  2311. return Set;
  2312. }());
  2313. }
  2314. /* */
  2315. var warn = noop;
  2316. var tip = noop;
  2317. var generateComponentTrace = (noop); // work around flow check
  2318. var formatComponentName = (noop);
  2319. if (true) {
  2320. var hasConsole = typeof console !== 'undefined';
  2321. var classifyRE = /(?:^|[-_])(\w)/g;
  2322. var classify = function (str) { return str
  2323. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2324. .replace(/[-_]/g, ''); };
  2325. warn = function (msg, vm) {
  2326. var trace = vm ? generateComponentTrace(vm) : '';
  2327. if (config.warnHandler) {
  2328. config.warnHandler.call(null, msg, vm, trace);
  2329. } else if (hasConsole && (!config.silent)) {
  2330. console.error(("[Vue warn]: " + msg + trace));
  2331. }
  2332. };
  2333. tip = function (msg, vm) {
  2334. if (hasConsole && (!config.silent)) {
  2335. console.warn("[Vue tip]: " + msg + (
  2336. vm ? generateComponentTrace(vm) : ''
  2337. ));
  2338. }
  2339. };
  2340. formatComponentName = function (vm, includeFile) {
  2341. if (vm.$root === vm) {
  2342. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2343. return ('') + vm.$options.__file
  2344. }
  2345. return '<Root>'
  2346. }
  2347. var options = typeof vm === 'function' && vm.cid != null
  2348. ? vm.options
  2349. : vm._isVue
  2350. ? vm.$options || vm.constructor.options
  2351. : vm;
  2352. var name = options.name || options._componentTag;
  2353. var file = options.__file;
  2354. if (!name && file) {
  2355. var match = file.match(/([^/\\]+)\.vue$/);
  2356. name = match && match[1];
  2357. }
  2358. return (
  2359. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2360. (file && includeFile !== false ? (" at " + file) : '')
  2361. )
  2362. };
  2363. var repeat = function (str, n) {
  2364. var res = '';
  2365. while (n) {
  2366. if (n % 2 === 1) { res += str; }
  2367. if (n > 1) { str += str; }
  2368. n >>= 1;
  2369. }
  2370. return res
  2371. };
  2372. generateComponentTrace = function (vm) {
  2373. if (vm._isVue && vm.$parent) {
  2374. var tree = [];
  2375. var currentRecursiveSequence = 0;
  2376. while (vm && vm.$options.name !== 'PageBody') {
  2377. if (tree.length > 0) {
  2378. var last = tree[tree.length - 1];
  2379. if (last.constructor === vm.constructor) {
  2380. currentRecursiveSequence++;
  2381. vm = vm.$parent;
  2382. continue
  2383. } else if (currentRecursiveSequence > 0) {
  2384. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2385. currentRecursiveSequence = 0;
  2386. }
  2387. }
  2388. !vm.$options.isReserved && tree.push(vm);
  2389. vm = vm.$parent;
  2390. }
  2391. return '\n\nfound in\n\n' + tree
  2392. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2393. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2394. : formatComponentName(vm))); })
  2395. .join('\n')
  2396. } else {
  2397. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2398. }
  2399. };
  2400. }
  2401. /* */
  2402. var uid = 0;
  2403. /**
  2404. * A dep is an observable that can have multiple
  2405. * directives subscribing to it.
  2406. */
  2407. var Dep = function Dep () {
  2408. this.id = uid++;
  2409. this.subs = [];
  2410. };
  2411. Dep.prototype.addSub = function addSub (sub) {
  2412. this.subs.push(sub);
  2413. };
  2414. Dep.prototype.removeSub = function removeSub (sub) {
  2415. remove(this.subs, sub);
  2416. };
  2417. Dep.prototype.depend = function depend () {
  2418. if (Dep.SharedObject.target) {
  2419. Dep.SharedObject.target.addDep(this);
  2420. }
  2421. };
  2422. Dep.prototype.notify = function notify () {
  2423. // stabilize the subscriber list first
  2424. var subs = this.subs.slice();
  2425. if ( true && !config.async) {
  2426. // subs aren't sorted in scheduler if not running async
  2427. // we need to sort them now to make sure they fire in correct
  2428. // order
  2429. subs.sort(function (a, b) { return a.id - b.id; });
  2430. }
  2431. for (var i = 0, l = subs.length; i < l; i++) {
  2432. subs[i].update();
  2433. }
  2434. };
  2435. // The current target watcher being evaluated.
  2436. // This is globally unique because only one watcher
  2437. // can be evaluated at a time.
  2438. // fixed by xxxxxx (nvue shared vuex)
  2439. /* eslint-disable no-undef */
  2440. Dep.SharedObject = {};
  2441. Dep.SharedObject.target = null;
  2442. Dep.SharedObject.targetStack = [];
  2443. function pushTarget (target) {
  2444. Dep.SharedObject.targetStack.push(target);
  2445. Dep.SharedObject.target = target;
  2446. Dep.target = target;
  2447. }
  2448. function popTarget () {
  2449. Dep.SharedObject.targetStack.pop();
  2450. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2451. Dep.target = Dep.SharedObject.target;
  2452. }
  2453. /* */
  2454. var VNode = function VNode (
  2455. tag,
  2456. data,
  2457. children,
  2458. text,
  2459. elm,
  2460. context,
  2461. componentOptions,
  2462. asyncFactory
  2463. ) {
  2464. this.tag = tag;
  2465. this.data = data;
  2466. this.children = children;
  2467. this.text = text;
  2468. this.elm = elm;
  2469. this.ns = undefined;
  2470. this.context = context;
  2471. this.fnContext = undefined;
  2472. this.fnOptions = undefined;
  2473. this.fnScopeId = undefined;
  2474. this.key = data && data.key;
  2475. this.componentOptions = componentOptions;
  2476. this.componentInstance = undefined;
  2477. this.parent = undefined;
  2478. this.raw = false;
  2479. this.isStatic = false;
  2480. this.isRootInsert = true;
  2481. this.isComment = false;
  2482. this.isCloned = false;
  2483. this.isOnce = false;
  2484. this.asyncFactory = asyncFactory;
  2485. this.asyncMeta = undefined;
  2486. this.isAsyncPlaceholder = false;
  2487. };
  2488. var prototypeAccessors = { child: { configurable: true } };
  2489. // DEPRECATED: alias for componentInstance for backwards compat.
  2490. /* istanbul ignore next */
  2491. prototypeAccessors.child.get = function () {
  2492. return this.componentInstance
  2493. };
  2494. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2495. var createEmptyVNode = function (text) {
  2496. if ( text === void 0 ) text = '';
  2497. var node = new VNode();
  2498. node.text = text;
  2499. node.isComment = true;
  2500. return node
  2501. };
  2502. function createTextVNode (val) {
  2503. return new VNode(undefined, undefined, undefined, String(val))
  2504. }
  2505. // optimized shallow clone
  2506. // used for static nodes and slot nodes because they may be reused across
  2507. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2508. // on their elm reference.
  2509. function cloneVNode (vnode) {
  2510. var cloned = new VNode(
  2511. vnode.tag,
  2512. vnode.data,
  2513. // #7975
  2514. // clone children array to avoid mutating original in case of cloning
  2515. // a child.
  2516. vnode.children && vnode.children.slice(),
  2517. vnode.text,
  2518. vnode.elm,
  2519. vnode.context,
  2520. vnode.componentOptions,
  2521. vnode.asyncFactory
  2522. );
  2523. cloned.ns = vnode.ns;
  2524. cloned.isStatic = vnode.isStatic;
  2525. cloned.key = vnode.key;
  2526. cloned.isComment = vnode.isComment;
  2527. cloned.fnContext = vnode.fnContext;
  2528. cloned.fnOptions = vnode.fnOptions;
  2529. cloned.fnScopeId = vnode.fnScopeId;
  2530. cloned.asyncMeta = vnode.asyncMeta;
  2531. cloned.isCloned = true;
  2532. return cloned
  2533. }
  2534. /*
  2535. * not type checking this file because flow doesn't play well with
  2536. * dynamically accessing methods on Array prototype
  2537. */
  2538. var arrayProto = Array.prototype;
  2539. var arrayMethods = Object.create(arrayProto);
  2540. var methodsToPatch = [
  2541. 'push',
  2542. 'pop',
  2543. 'shift',
  2544. 'unshift',
  2545. 'splice',
  2546. 'sort',
  2547. 'reverse'
  2548. ];
  2549. /**
  2550. * Intercept mutating methods and emit events
  2551. */
  2552. methodsToPatch.forEach(function (method) {
  2553. // cache original method
  2554. var original = arrayProto[method];
  2555. def(arrayMethods, method, function mutator () {
  2556. var args = [], len = arguments.length;
  2557. while ( len-- ) args[ len ] = arguments[ len ];
  2558. var result = original.apply(this, args);
  2559. var ob = this.__ob__;
  2560. var inserted;
  2561. switch (method) {
  2562. case 'push':
  2563. case 'unshift':
  2564. inserted = args;
  2565. break
  2566. case 'splice':
  2567. inserted = args.slice(2);
  2568. break
  2569. }
  2570. if (inserted) { ob.observeArray(inserted); }
  2571. // notify change
  2572. ob.dep.notify();
  2573. return result
  2574. });
  2575. });
  2576. /* */
  2577. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2578. /**
  2579. * In some cases we may want to disable observation inside a component's
  2580. * update computation.
  2581. */
  2582. var shouldObserve = true;
  2583. function toggleObserving (value) {
  2584. shouldObserve = value;
  2585. }
  2586. /**
  2587. * Observer class that is attached to each observed
  2588. * object. Once attached, the observer converts the target
  2589. * object's property keys into getter/setters that
  2590. * collect dependencies and dispatch updates.
  2591. */
  2592. var Observer = function Observer (value) {
  2593. this.value = value;
  2594. this.dep = new Dep();
  2595. this.vmCount = 0;
  2596. def(value, '__ob__', this);
  2597. if (Array.isArray(value)) {
  2598. if (hasProto) {
  2599. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2600. if(value.push !== value.__proto__.push){
  2601. copyAugment(value, arrayMethods, arrayKeys);
  2602. } else {
  2603. protoAugment(value, arrayMethods);
  2604. }
  2605. }
  2606. } else {
  2607. copyAugment(value, arrayMethods, arrayKeys);
  2608. }
  2609. this.observeArray(value);
  2610. } else {
  2611. this.walk(value);
  2612. }
  2613. };
  2614. /**
  2615. * Walk through all properties and convert them into
  2616. * getter/setters. This method should only be called when
  2617. * value type is Object.
  2618. */
  2619. Observer.prototype.walk = function walk (obj) {
  2620. var keys = Object.keys(obj);
  2621. for (var i = 0; i < keys.length; i++) {
  2622. defineReactive$$1(obj, keys[i]);
  2623. }
  2624. };
  2625. /**
  2626. * Observe a list of Array items.
  2627. */
  2628. Observer.prototype.observeArray = function observeArray (items) {
  2629. for (var i = 0, l = items.length; i < l; i++) {
  2630. observe(items[i]);
  2631. }
  2632. };
  2633. // helpers
  2634. /**
  2635. * Augment a target Object or Array by intercepting
  2636. * the prototype chain using __proto__
  2637. */
  2638. function protoAugment (target, src) {
  2639. /* eslint-disable no-proto */
  2640. target.__proto__ = src;
  2641. /* eslint-enable no-proto */
  2642. }
  2643. /**
  2644. * Augment a target Object or Array by defining
  2645. * hidden properties.
  2646. */
  2647. /* istanbul ignore next */
  2648. function copyAugment (target, src, keys) {
  2649. for (var i = 0, l = keys.length; i < l; i++) {
  2650. var key = keys[i];
  2651. def(target, key, src[key]);
  2652. }
  2653. }
  2654. /**
  2655. * Attempt to create an observer instance for a value,
  2656. * returns the new observer if successfully observed,
  2657. * or the existing observer if the value already has one.
  2658. */
  2659. function observe (value, asRootData) {
  2660. if (!isObject(value) || value instanceof VNode) {
  2661. return
  2662. }
  2663. var ob;
  2664. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2665. ob = value.__ob__;
  2666. } else if (
  2667. shouldObserve &&
  2668. !isServerRendering() &&
  2669. (Array.isArray(value) || isPlainObject(value)) &&
  2670. Object.isExtensible(value) &&
  2671. !value._isVue
  2672. ) {
  2673. ob = new Observer(value);
  2674. }
  2675. if (asRootData && ob) {
  2676. ob.vmCount++;
  2677. }
  2678. return ob
  2679. }
  2680. /**
  2681. * Define a reactive property on an Object.
  2682. */
  2683. function defineReactive$$1 (
  2684. obj,
  2685. key,
  2686. val,
  2687. customSetter,
  2688. shallow
  2689. ) {
  2690. var dep = new Dep();
  2691. var property = Object.getOwnPropertyDescriptor(obj, key);
  2692. if (property && property.configurable === false) {
  2693. return
  2694. }
  2695. // cater for pre-defined getter/setters
  2696. var getter = property && property.get;
  2697. var setter = property && property.set;
  2698. if ((!getter || setter) && arguments.length === 2) {
  2699. val = obj[key];
  2700. }
  2701. var childOb = !shallow && observe(val);
  2702. Object.defineProperty(obj, key, {
  2703. enumerable: true,
  2704. configurable: true,
  2705. get: function reactiveGetter () {
  2706. var value = getter ? getter.call(obj) : val;
  2707. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2708. dep.depend();
  2709. if (childOb) {
  2710. childOb.dep.depend();
  2711. if (Array.isArray(value)) {
  2712. dependArray(value);
  2713. }
  2714. }
  2715. }
  2716. return value
  2717. },
  2718. set: function reactiveSetter (newVal) {
  2719. var value = getter ? getter.call(obj) : val;
  2720. /* eslint-disable no-self-compare */
  2721. if (newVal === value || (newVal !== newVal && value !== value)) {
  2722. return
  2723. }
  2724. /* eslint-enable no-self-compare */
  2725. if ( true && customSetter) {
  2726. customSetter();
  2727. }
  2728. // #7981: for accessor properties without setter
  2729. if (getter && !setter) { return }
  2730. if (setter) {
  2731. setter.call(obj, newVal);
  2732. } else {
  2733. val = newVal;
  2734. }
  2735. childOb = !shallow && observe(newVal);
  2736. dep.notify();
  2737. }
  2738. });
  2739. }
  2740. /**
  2741. * Set a property on an object. Adds the new property and
  2742. * triggers change notification if the property doesn't
  2743. * already exist.
  2744. */
  2745. function set (target, key, val) {
  2746. if ( true &&
  2747. (isUndef(target) || isPrimitive(target))
  2748. ) {
  2749. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2750. }
  2751. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2752. target.length = Math.max(target.length, key);
  2753. target.splice(key, 1, val);
  2754. return val
  2755. }
  2756. if (key in target && !(key in Object.prototype)) {
  2757. target[key] = val;
  2758. return val
  2759. }
  2760. var ob = (target).__ob__;
  2761. if (target._isVue || (ob && ob.vmCount)) {
  2762. true && warn(
  2763. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2764. 'at runtime - declare it upfront in the data option.'
  2765. );
  2766. return val
  2767. }
  2768. if (!ob) {
  2769. target[key] = val;
  2770. return val
  2771. }
  2772. defineReactive$$1(ob.value, key, val);
  2773. ob.dep.notify();
  2774. return val
  2775. }
  2776. /**
  2777. * Delete a property and trigger change if necessary.
  2778. */
  2779. function del (target, key) {
  2780. if ( true &&
  2781. (isUndef(target) || isPrimitive(target))
  2782. ) {
  2783. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2784. }
  2785. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2786. target.splice(key, 1);
  2787. return
  2788. }
  2789. var ob = (target).__ob__;
  2790. if (target._isVue || (ob && ob.vmCount)) {
  2791. true && warn(
  2792. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2793. '- just set it to null.'
  2794. );
  2795. return
  2796. }
  2797. if (!hasOwn(target, key)) {
  2798. return
  2799. }
  2800. delete target[key];
  2801. if (!ob) {
  2802. return
  2803. }
  2804. ob.dep.notify();
  2805. }
  2806. /**
  2807. * Collect dependencies on array elements when the array is touched, since
  2808. * we cannot intercept array element access like property getters.
  2809. */
  2810. function dependArray (value) {
  2811. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2812. e = value[i];
  2813. e && e.__ob__ && e.__ob__.dep.depend();
  2814. if (Array.isArray(e)) {
  2815. dependArray(e);
  2816. }
  2817. }
  2818. }
  2819. /* */
  2820. /**
  2821. * Option overwriting strategies are functions that handle
  2822. * how to merge a parent option value and a child option
  2823. * value into the final value.
  2824. */
  2825. var strats = config.optionMergeStrategies;
  2826. /**
  2827. * Options with restrictions
  2828. */
  2829. if (true) {
  2830. strats.el = strats.propsData = function (parent, child, vm, key) {
  2831. if (!vm) {
  2832. warn(
  2833. "option \"" + key + "\" can only be used during instance " +
  2834. 'creation with the `new` keyword.'
  2835. );
  2836. }
  2837. return defaultStrat(parent, child)
  2838. };
  2839. }
  2840. /**
  2841. * Helper that recursively merges two data objects together.
  2842. */
  2843. function mergeData (to, from) {
  2844. if (!from) { return to }
  2845. var key, toVal, fromVal;
  2846. var keys = hasSymbol
  2847. ? Reflect.ownKeys(from)
  2848. : Object.keys(from);
  2849. for (var i = 0; i < keys.length; i++) {
  2850. key = keys[i];
  2851. // in case the object is already observed...
  2852. if (key === '__ob__') { continue }
  2853. toVal = to[key];
  2854. fromVal = from[key];
  2855. if (!hasOwn(to, key)) {
  2856. set(to, key, fromVal);
  2857. } else if (
  2858. toVal !== fromVal &&
  2859. isPlainObject(toVal) &&
  2860. isPlainObject(fromVal)
  2861. ) {
  2862. mergeData(toVal, fromVal);
  2863. }
  2864. }
  2865. return to
  2866. }
  2867. /**
  2868. * Data
  2869. */
  2870. function mergeDataOrFn (
  2871. parentVal,
  2872. childVal,
  2873. vm
  2874. ) {
  2875. if (!vm) {
  2876. // in a Vue.extend merge, both should be functions
  2877. if (!childVal) {
  2878. return parentVal
  2879. }
  2880. if (!parentVal) {
  2881. return childVal
  2882. }
  2883. // when parentVal & childVal are both present,
  2884. // we need to return a function that returns the
  2885. // merged result of both functions... no need to
  2886. // check if parentVal is a function here because
  2887. // it has to be a function to pass previous merges.
  2888. return function mergedDataFn () {
  2889. return mergeData(
  2890. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2891. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2892. )
  2893. }
  2894. } else {
  2895. return function mergedInstanceDataFn () {
  2896. // instance merge
  2897. var instanceData = typeof childVal === 'function'
  2898. ? childVal.call(vm, vm)
  2899. : childVal;
  2900. var defaultData = typeof parentVal === 'function'
  2901. ? parentVal.call(vm, vm)
  2902. : parentVal;
  2903. if (instanceData) {
  2904. return mergeData(instanceData, defaultData)
  2905. } else {
  2906. return defaultData
  2907. }
  2908. }
  2909. }
  2910. }
  2911. strats.data = function (
  2912. parentVal,
  2913. childVal,
  2914. vm
  2915. ) {
  2916. if (!vm) {
  2917. if (childVal && typeof childVal !== 'function') {
  2918. true && warn(
  2919. 'The "data" option should be a function ' +
  2920. 'that returns a per-instance value in component ' +
  2921. 'definitions.',
  2922. vm
  2923. );
  2924. return parentVal
  2925. }
  2926. return mergeDataOrFn(parentVal, childVal)
  2927. }
  2928. return mergeDataOrFn(parentVal, childVal, vm)
  2929. };
  2930. /**
  2931. * Hooks and props are merged as arrays.
  2932. */
  2933. function mergeHook (
  2934. parentVal,
  2935. childVal
  2936. ) {
  2937. var res = childVal
  2938. ? parentVal
  2939. ? parentVal.concat(childVal)
  2940. : Array.isArray(childVal)
  2941. ? childVal
  2942. : [childVal]
  2943. : parentVal;
  2944. return res
  2945. ? dedupeHooks(res)
  2946. : res
  2947. }
  2948. function dedupeHooks (hooks) {
  2949. var res = [];
  2950. for (var i = 0; i < hooks.length; i++) {
  2951. if (res.indexOf(hooks[i]) === -1) {
  2952. res.push(hooks[i]);
  2953. }
  2954. }
  2955. return res
  2956. }
  2957. LIFECYCLE_HOOKS.forEach(function (hook) {
  2958. strats[hook] = mergeHook;
  2959. });
  2960. /**
  2961. * Assets
  2962. *
  2963. * When a vm is present (instance creation), we need to do
  2964. * a three-way merge between constructor options, instance
  2965. * options and parent options.
  2966. */
  2967. function mergeAssets (
  2968. parentVal,
  2969. childVal,
  2970. vm,
  2971. key
  2972. ) {
  2973. var res = Object.create(parentVal || null);
  2974. if (childVal) {
  2975. true && assertObjectType(key, childVal, vm);
  2976. return extend(res, childVal)
  2977. } else {
  2978. return res
  2979. }
  2980. }
  2981. ASSET_TYPES.forEach(function (type) {
  2982. strats[type + 's'] = mergeAssets;
  2983. });
  2984. /**
  2985. * Watchers.
  2986. *
  2987. * Watchers hashes should not overwrite one
  2988. * another, so we merge them as arrays.
  2989. */
  2990. strats.watch = function (
  2991. parentVal,
  2992. childVal,
  2993. vm,
  2994. key
  2995. ) {
  2996. // work around Firefox's Object.prototype.watch...
  2997. if (parentVal === nativeWatch) { parentVal = undefined; }
  2998. if (childVal === nativeWatch) { childVal = undefined; }
  2999. /* istanbul ignore if */
  3000. if (!childVal) { return Object.create(parentVal || null) }
  3001. if (true) {
  3002. assertObjectType(key, childVal, vm);
  3003. }
  3004. if (!parentVal) { return childVal }
  3005. var ret = {};
  3006. extend(ret, parentVal);
  3007. for (var key$1 in childVal) {
  3008. var parent = ret[key$1];
  3009. var child = childVal[key$1];
  3010. if (parent && !Array.isArray(parent)) {
  3011. parent = [parent];
  3012. }
  3013. ret[key$1] = parent
  3014. ? parent.concat(child)
  3015. : Array.isArray(child) ? child : [child];
  3016. }
  3017. return ret
  3018. };
  3019. /**
  3020. * Other object hashes.
  3021. */
  3022. strats.props =
  3023. strats.methods =
  3024. strats.inject =
  3025. strats.computed = function (
  3026. parentVal,
  3027. childVal,
  3028. vm,
  3029. key
  3030. ) {
  3031. if (childVal && "development" !== 'production') {
  3032. assertObjectType(key, childVal, vm);
  3033. }
  3034. if (!parentVal) { return childVal }
  3035. var ret = Object.create(null);
  3036. extend(ret, parentVal);
  3037. if (childVal) { extend(ret, childVal); }
  3038. return ret
  3039. };
  3040. strats.provide = mergeDataOrFn;
  3041. /**
  3042. * Default strategy.
  3043. */
  3044. var defaultStrat = function (parentVal, childVal) {
  3045. return childVal === undefined
  3046. ? parentVal
  3047. : childVal
  3048. };
  3049. /**
  3050. * Validate component names
  3051. */
  3052. function checkComponents (options) {
  3053. for (var key in options.components) {
  3054. validateComponentName(key);
  3055. }
  3056. }
  3057. function validateComponentName (name) {
  3058. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3059. warn(
  3060. 'Invalid component name: "' + name + '". Component names ' +
  3061. 'should conform to valid custom element name in html5 specification.'
  3062. );
  3063. }
  3064. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3065. warn(
  3066. 'Do not use built-in or reserved HTML elements as component ' +
  3067. 'id: ' + name
  3068. );
  3069. }
  3070. }
  3071. /**
  3072. * Ensure all props option syntax are normalized into the
  3073. * Object-based format.
  3074. */
  3075. function normalizeProps (options, vm) {
  3076. var props = options.props;
  3077. if (!props) { return }
  3078. var res = {};
  3079. var i, val, name;
  3080. if (Array.isArray(props)) {
  3081. i = props.length;
  3082. while (i--) {
  3083. val = props[i];
  3084. if (typeof val === 'string') {
  3085. name = camelize(val);
  3086. res[name] = { type: null };
  3087. } else if (true) {
  3088. warn('props must be strings when using array syntax.');
  3089. }
  3090. }
  3091. } else if (isPlainObject(props)) {
  3092. for (var key in props) {
  3093. val = props[key];
  3094. name = camelize(key);
  3095. res[name] = isPlainObject(val)
  3096. ? val
  3097. : { type: val };
  3098. }
  3099. } else if (true) {
  3100. warn(
  3101. "Invalid value for option \"props\": expected an Array or an Object, " +
  3102. "but got " + (toRawType(props)) + ".",
  3103. vm
  3104. );
  3105. }
  3106. options.props = res;
  3107. }
  3108. /**
  3109. * Normalize all injections into Object-based format
  3110. */
  3111. function normalizeInject (options, vm) {
  3112. var inject = options.inject;
  3113. if (!inject) { return }
  3114. var normalized = options.inject = {};
  3115. if (Array.isArray(inject)) {
  3116. for (var i = 0; i < inject.length; i++) {
  3117. normalized[inject[i]] = { from: inject[i] };
  3118. }
  3119. } else if (isPlainObject(inject)) {
  3120. for (var key in inject) {
  3121. var val = inject[key];
  3122. normalized[key] = isPlainObject(val)
  3123. ? extend({ from: key }, val)
  3124. : { from: val };
  3125. }
  3126. } else if (true) {
  3127. warn(
  3128. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3129. "but got " + (toRawType(inject)) + ".",
  3130. vm
  3131. );
  3132. }
  3133. }
  3134. /**
  3135. * Normalize raw function directives into object format.
  3136. */
  3137. function normalizeDirectives (options) {
  3138. var dirs = options.directives;
  3139. if (dirs) {
  3140. for (var key in dirs) {
  3141. var def$$1 = dirs[key];
  3142. if (typeof def$$1 === 'function') {
  3143. dirs[key] = { bind: def$$1, update: def$$1 };
  3144. }
  3145. }
  3146. }
  3147. }
  3148. function assertObjectType (name, value, vm) {
  3149. if (!isPlainObject(value)) {
  3150. warn(
  3151. "Invalid value for option \"" + name + "\": expected an Object, " +
  3152. "but got " + (toRawType(value)) + ".",
  3153. vm
  3154. );
  3155. }
  3156. }
  3157. /**
  3158. * Merge two option objects into a new one.
  3159. * Core utility used in both instantiation and inheritance.
  3160. */
  3161. function mergeOptions (
  3162. parent,
  3163. child,
  3164. vm
  3165. ) {
  3166. if (true) {
  3167. checkComponents(child);
  3168. }
  3169. if (typeof child === 'function') {
  3170. child = child.options;
  3171. }
  3172. normalizeProps(child, vm);
  3173. normalizeInject(child, vm);
  3174. normalizeDirectives(child);
  3175. // Apply extends and mixins on the child options,
  3176. // but only if it is a raw options object that isn't
  3177. // the result of another mergeOptions call.
  3178. // Only merged options has the _base property.
  3179. if (!child._base) {
  3180. if (child.extends) {
  3181. parent = mergeOptions(parent, child.extends, vm);
  3182. }
  3183. if (child.mixins) {
  3184. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3185. parent = mergeOptions(parent, child.mixins[i], vm);
  3186. }
  3187. }
  3188. }
  3189. var options = {};
  3190. var key;
  3191. for (key in parent) {
  3192. mergeField(key);
  3193. }
  3194. for (key in child) {
  3195. if (!hasOwn(parent, key)) {
  3196. mergeField(key);
  3197. }
  3198. }
  3199. function mergeField (key) {
  3200. var strat = strats[key] || defaultStrat;
  3201. options[key] = strat(parent[key], child[key], vm, key);
  3202. }
  3203. return options
  3204. }
  3205. /**
  3206. * Resolve an asset.
  3207. * This function is used because child instances need access
  3208. * to assets defined in its ancestor chain.
  3209. */
  3210. function resolveAsset (
  3211. options,
  3212. type,
  3213. id,
  3214. warnMissing
  3215. ) {
  3216. /* istanbul ignore if */
  3217. if (typeof id !== 'string') {
  3218. return
  3219. }
  3220. var assets = options[type];
  3221. // check local registration variations first
  3222. if (hasOwn(assets, id)) { return assets[id] }
  3223. var camelizedId = camelize(id);
  3224. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3225. var PascalCaseId = capitalize(camelizedId);
  3226. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3227. // fallback to prototype chain
  3228. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3229. if ( true && warnMissing && !res) {
  3230. warn(
  3231. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3232. options
  3233. );
  3234. }
  3235. return res
  3236. }
  3237. /* */
  3238. function validateProp (
  3239. key,
  3240. propOptions,
  3241. propsData,
  3242. vm
  3243. ) {
  3244. var prop = propOptions[key];
  3245. var absent = !hasOwn(propsData, key);
  3246. var value = propsData[key];
  3247. // boolean casting
  3248. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3249. if (booleanIndex > -1) {
  3250. if (absent && !hasOwn(prop, 'default')) {
  3251. value = false;
  3252. } else if (value === '' || value === hyphenate(key)) {
  3253. // only cast empty string / same name to boolean if
  3254. // boolean has higher priority
  3255. var stringIndex = getTypeIndex(String, prop.type);
  3256. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3257. value = true;
  3258. }
  3259. }
  3260. }
  3261. // check default value
  3262. if (value === undefined) {
  3263. value = getPropDefaultValue(vm, prop, key);
  3264. // since the default value is a fresh copy,
  3265. // make sure to observe it.
  3266. var prevShouldObserve = shouldObserve;
  3267. toggleObserving(true);
  3268. observe(value);
  3269. toggleObserving(prevShouldObserve);
  3270. }
  3271. if (
  3272. true
  3273. ) {
  3274. assertProp(prop, key, value, vm, absent);
  3275. }
  3276. return value
  3277. }
  3278. /**
  3279. * Get the default value of a prop.
  3280. */
  3281. function getPropDefaultValue (vm, prop, key) {
  3282. // no default, return undefined
  3283. if (!hasOwn(prop, 'default')) {
  3284. return undefined
  3285. }
  3286. var def = prop.default;
  3287. // warn against non-factory defaults for Object & Array
  3288. if ( true && isObject(def)) {
  3289. warn(
  3290. 'Invalid default value for prop "' + key + '": ' +
  3291. 'Props with type Object/Array must use a factory function ' +
  3292. 'to return the default value.',
  3293. vm
  3294. );
  3295. }
  3296. // the raw prop value was also undefined from previous render,
  3297. // return previous default value to avoid unnecessary watcher trigger
  3298. if (vm && vm.$options.propsData &&
  3299. vm.$options.propsData[key] === undefined &&
  3300. vm._props[key] !== undefined
  3301. ) {
  3302. return vm._props[key]
  3303. }
  3304. // call factory function for non-Function types
  3305. // a value is Function if its prototype is function even across different execution context
  3306. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3307. ? def.call(vm)
  3308. : def
  3309. }
  3310. /**
  3311. * Assert whether a prop is valid.
  3312. */
  3313. function assertProp (
  3314. prop,
  3315. name,
  3316. value,
  3317. vm,
  3318. absent
  3319. ) {
  3320. if (prop.required && absent) {
  3321. warn(
  3322. 'Missing required prop: "' + name + '"',
  3323. vm
  3324. );
  3325. return
  3326. }
  3327. if (value == null && !prop.required) {
  3328. return
  3329. }
  3330. var type = prop.type;
  3331. var valid = !type || type === true;
  3332. var expectedTypes = [];
  3333. if (type) {
  3334. if (!Array.isArray(type)) {
  3335. type = [type];
  3336. }
  3337. for (var i = 0; i < type.length && !valid; i++) {
  3338. var assertedType = assertType(value, type[i]);
  3339. expectedTypes.push(assertedType.expectedType || '');
  3340. valid = assertedType.valid;
  3341. }
  3342. }
  3343. if (!valid) {
  3344. warn(
  3345. getInvalidTypeMessage(name, value, expectedTypes),
  3346. vm
  3347. );
  3348. return
  3349. }
  3350. var validator = prop.validator;
  3351. if (validator) {
  3352. if (!validator(value)) {
  3353. warn(
  3354. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3355. vm
  3356. );
  3357. }
  3358. }
  3359. }
  3360. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3361. function assertType (value, type) {
  3362. var valid;
  3363. var expectedType = getType(type);
  3364. if (simpleCheckRE.test(expectedType)) {
  3365. var t = typeof value;
  3366. valid = t === expectedType.toLowerCase();
  3367. // for primitive wrapper objects
  3368. if (!valid && t === 'object') {
  3369. valid = value instanceof type;
  3370. }
  3371. } else if (expectedType === 'Object') {
  3372. valid = isPlainObject(value);
  3373. } else if (expectedType === 'Array') {
  3374. valid = Array.isArray(value);
  3375. } else {
  3376. valid = value instanceof type;
  3377. }
  3378. return {
  3379. valid: valid,
  3380. expectedType: expectedType
  3381. }
  3382. }
  3383. /**
  3384. * Use function string name to check built-in types,
  3385. * because a simple equality check will fail when running
  3386. * across different vms / iframes.
  3387. */
  3388. function getType (fn) {
  3389. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3390. return match ? match[1] : ''
  3391. }
  3392. function isSameType (a, b) {
  3393. return getType(a) === getType(b)
  3394. }
  3395. function getTypeIndex (type, expectedTypes) {
  3396. if (!Array.isArray(expectedTypes)) {
  3397. return isSameType(expectedTypes, type) ? 0 : -1
  3398. }
  3399. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3400. if (isSameType(expectedTypes[i], type)) {
  3401. return i
  3402. }
  3403. }
  3404. return -1
  3405. }
  3406. function getInvalidTypeMessage (name, value, expectedTypes) {
  3407. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3408. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3409. var expectedType = expectedTypes[0];
  3410. var receivedType = toRawType(value);
  3411. var expectedValue = styleValue(value, expectedType);
  3412. var receivedValue = styleValue(value, receivedType);
  3413. // check if we need to specify expected value
  3414. if (expectedTypes.length === 1 &&
  3415. isExplicable(expectedType) &&
  3416. !isBoolean(expectedType, receivedType)) {
  3417. message += " with value " + expectedValue;
  3418. }
  3419. message += ", got " + receivedType + " ";
  3420. // check if we need to specify received value
  3421. if (isExplicable(receivedType)) {
  3422. message += "with value " + receivedValue + ".";
  3423. }
  3424. return message
  3425. }
  3426. function styleValue (value, type) {
  3427. if (type === 'String') {
  3428. return ("\"" + value + "\"")
  3429. } else if (type === 'Number') {
  3430. return ("" + (Number(value)))
  3431. } else {
  3432. return ("" + value)
  3433. }
  3434. }
  3435. function isExplicable (value) {
  3436. var explicitTypes = ['string', 'number', 'boolean'];
  3437. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3438. }
  3439. function isBoolean () {
  3440. var args = [], len = arguments.length;
  3441. while ( len-- ) args[ len ] = arguments[ len ];
  3442. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3443. }
  3444. /* */
  3445. function handleError (err, vm, info) {
  3446. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3447. // See: https://github.com/vuejs/vuex/issues/1505
  3448. pushTarget();
  3449. try {
  3450. if (vm) {
  3451. var cur = vm;
  3452. while ((cur = cur.$parent)) {
  3453. var hooks = cur.$options.errorCaptured;
  3454. if (hooks) {
  3455. for (var i = 0; i < hooks.length; i++) {
  3456. try {
  3457. var capture = hooks[i].call(cur, err, vm, info) === false;
  3458. if (capture) { return }
  3459. } catch (e) {
  3460. globalHandleError(e, cur, 'errorCaptured hook');
  3461. }
  3462. }
  3463. }
  3464. }
  3465. }
  3466. globalHandleError(err, vm, info);
  3467. } finally {
  3468. popTarget();
  3469. }
  3470. }
  3471. function invokeWithErrorHandling (
  3472. handler,
  3473. context,
  3474. args,
  3475. vm,
  3476. info
  3477. ) {
  3478. var res;
  3479. try {
  3480. res = args ? handler.apply(context, args) : handler.call(context);
  3481. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3482. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3483. // issue #9511
  3484. // avoid catch triggering multiple times when nested calls
  3485. res._handled = true;
  3486. }
  3487. } catch (e) {
  3488. handleError(e, vm, info);
  3489. }
  3490. return res
  3491. }
  3492. function globalHandleError (err, vm, info) {
  3493. if (config.errorHandler) {
  3494. try {
  3495. return config.errorHandler.call(null, err, vm, info)
  3496. } catch (e) {
  3497. // if the user intentionally throws the original error in the handler,
  3498. // do not log it twice
  3499. if (e !== err) {
  3500. logError(e, null, 'config.errorHandler');
  3501. }
  3502. }
  3503. }
  3504. logError(err, vm, info);
  3505. }
  3506. function logError (err, vm, info) {
  3507. if (true) {
  3508. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3509. }
  3510. /* istanbul ignore else */
  3511. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3512. console.error(err);
  3513. } else {
  3514. throw err
  3515. }
  3516. }
  3517. /* */
  3518. var callbacks = [];
  3519. var pending = false;
  3520. function flushCallbacks () {
  3521. pending = false;
  3522. var copies = callbacks.slice(0);
  3523. callbacks.length = 0;
  3524. for (var i = 0; i < copies.length; i++) {
  3525. copies[i]();
  3526. }
  3527. }
  3528. // Here we have async deferring wrappers using microtasks.
  3529. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3530. // However, it has subtle problems when state is changed right before repaint
  3531. // (e.g. #6813, out-in transitions).
  3532. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3533. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3534. // So we now use microtasks everywhere, again.
  3535. // A major drawback of this tradeoff is that there are some scenarios
  3536. // where microtasks have too high a priority and fire in between supposedly
  3537. // sequential events (e.g. #4521, #6690, which have workarounds)
  3538. // or even between bubbling of the same event (#6566).
  3539. var timerFunc;
  3540. // The nextTick behavior leverages the microtask queue, which can be accessed
  3541. // via either native Promise.then or MutationObserver.
  3542. // MutationObserver has wider support, however it is seriously bugged in
  3543. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3544. // completely stops working after triggering a few times... so, if native
  3545. // Promise is available, we will use it:
  3546. /* istanbul ignore next, $flow-disable-line */
  3547. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3548. var p = Promise.resolve();
  3549. timerFunc = function () {
  3550. p.then(flushCallbacks);
  3551. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3552. // it can get stuck in a weird state where callbacks are pushed into the
  3553. // microtask queue but the queue isn't being flushed, until the browser
  3554. // needs to do some other work, e.g. handle a timer. Therefore we can
  3555. // "force" the microtask queue to be flushed by adding an empty timer.
  3556. if (isIOS) { setTimeout(noop); }
  3557. };
  3558. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3559. isNative(MutationObserver) ||
  3560. // PhantomJS and iOS 7.x
  3561. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3562. )) {
  3563. // Use MutationObserver where native Promise is not available,
  3564. // e.g. PhantomJS, iOS7, Android 4.4
  3565. // (#6466 MutationObserver is unreliable in IE11)
  3566. var counter = 1;
  3567. var observer = new MutationObserver(flushCallbacks);
  3568. var textNode = document.createTextNode(String(counter));
  3569. observer.observe(textNode, {
  3570. characterData: true
  3571. });
  3572. timerFunc = function () {
  3573. counter = (counter + 1) % 2;
  3574. textNode.data = String(counter);
  3575. };
  3576. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3577. // Fallback to setImmediate.
  3578. // Technically it leverages the (macro) task queue,
  3579. // but it is still a better choice than setTimeout.
  3580. timerFunc = function () {
  3581. setImmediate(flushCallbacks);
  3582. };
  3583. } else {
  3584. // Fallback to setTimeout.
  3585. timerFunc = function () {
  3586. setTimeout(flushCallbacks, 0);
  3587. };
  3588. }
  3589. function nextTick (cb, ctx) {
  3590. var _resolve;
  3591. callbacks.push(function () {
  3592. if (cb) {
  3593. try {
  3594. cb.call(ctx);
  3595. } catch (e) {
  3596. handleError(e, ctx, 'nextTick');
  3597. }
  3598. } else if (_resolve) {
  3599. _resolve(ctx);
  3600. }
  3601. });
  3602. if (!pending) {
  3603. pending = true;
  3604. timerFunc();
  3605. }
  3606. // $flow-disable-line
  3607. if (!cb && typeof Promise !== 'undefined') {
  3608. return new Promise(function (resolve) {
  3609. _resolve = resolve;
  3610. })
  3611. }
  3612. }
  3613. /* */
  3614. /* not type checking this file because flow doesn't play well with Proxy */
  3615. var initProxy;
  3616. if (true) {
  3617. var allowedGlobals = makeMap(
  3618. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3619. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3620. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3621. 'require' // for Webpack/Browserify
  3622. );
  3623. var warnNonPresent = function (target, key) {
  3624. warn(
  3625. "Property or method \"" + key + "\" is not defined on the instance but " +
  3626. 'referenced during render. Make sure that this property is reactive, ' +
  3627. 'either in the data option, or for class-based components, by ' +
  3628. 'initializing the property. ' +
  3629. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3630. target
  3631. );
  3632. };
  3633. var warnReservedPrefix = function (target, key) {
  3634. warn(
  3635. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3636. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3637. 'prevent conflicts with Vue internals. ' +
  3638. 'See: https://vuejs.org/v2/api/#data',
  3639. target
  3640. );
  3641. };
  3642. var hasProxy =
  3643. typeof Proxy !== 'undefined' && isNative(Proxy);
  3644. if (hasProxy) {
  3645. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3646. config.keyCodes = new Proxy(config.keyCodes, {
  3647. set: function set (target, key, value) {
  3648. if (isBuiltInModifier(key)) {
  3649. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3650. return false
  3651. } else {
  3652. target[key] = value;
  3653. return true
  3654. }
  3655. }
  3656. });
  3657. }
  3658. var hasHandler = {
  3659. has: function has (target, key) {
  3660. var has = key in target;
  3661. var isAllowed = allowedGlobals(key) ||
  3662. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3663. if (!has && !isAllowed) {
  3664. if (key in target.$data) { warnReservedPrefix(target, key); }
  3665. else { warnNonPresent(target, key); }
  3666. }
  3667. return has || !isAllowed
  3668. }
  3669. };
  3670. var getHandler = {
  3671. get: function get (target, key) {
  3672. if (typeof key === 'string' && !(key in target)) {
  3673. if (key in target.$data) { warnReservedPrefix(target, key); }
  3674. else { warnNonPresent(target, key); }
  3675. }
  3676. return target[key]
  3677. }
  3678. };
  3679. initProxy = function initProxy (vm) {
  3680. if (hasProxy) {
  3681. // determine which proxy handler to use
  3682. var options = vm.$options;
  3683. var handlers = options.render && options.render._withStripped
  3684. ? getHandler
  3685. : hasHandler;
  3686. vm._renderProxy = new Proxy(vm, handlers);
  3687. } else {
  3688. vm._renderProxy = vm;
  3689. }
  3690. };
  3691. }
  3692. /* */
  3693. var seenObjects = new _Set();
  3694. /**
  3695. * Recursively traverse an object to evoke all converted
  3696. * getters, so that every nested property inside the object
  3697. * is collected as a "deep" dependency.
  3698. */
  3699. function traverse (val) {
  3700. _traverse(val, seenObjects);
  3701. seenObjects.clear();
  3702. }
  3703. function _traverse (val, seen) {
  3704. var i, keys;
  3705. var isA = Array.isArray(val);
  3706. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3707. return
  3708. }
  3709. if (val.__ob__) {
  3710. var depId = val.__ob__.dep.id;
  3711. if (seen.has(depId)) {
  3712. return
  3713. }
  3714. seen.add(depId);
  3715. }
  3716. if (isA) {
  3717. i = val.length;
  3718. while (i--) { _traverse(val[i], seen); }
  3719. } else {
  3720. keys = Object.keys(val);
  3721. i = keys.length;
  3722. while (i--) { _traverse(val[keys[i]], seen); }
  3723. }
  3724. }
  3725. var mark;
  3726. var measure;
  3727. if (true) {
  3728. var perf = inBrowser && window.performance;
  3729. /* istanbul ignore if */
  3730. if (
  3731. perf &&
  3732. perf.mark &&
  3733. perf.measure &&
  3734. perf.clearMarks &&
  3735. perf.clearMeasures
  3736. ) {
  3737. mark = function (tag) { return perf.mark(tag); };
  3738. measure = function (name, startTag, endTag) {
  3739. perf.measure(name, startTag, endTag);
  3740. perf.clearMarks(startTag);
  3741. perf.clearMarks(endTag);
  3742. // perf.clearMeasures(name)
  3743. };
  3744. }
  3745. }
  3746. /* */
  3747. var normalizeEvent = cached(function (name) {
  3748. var passive = name.charAt(0) === '&';
  3749. name = passive ? name.slice(1) : name;
  3750. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3751. name = once$$1 ? name.slice(1) : name;
  3752. var capture = name.charAt(0) === '!';
  3753. name = capture ? name.slice(1) : name;
  3754. return {
  3755. name: name,
  3756. once: once$$1,
  3757. capture: capture,
  3758. passive: passive
  3759. }
  3760. });
  3761. function createFnInvoker (fns, vm) {
  3762. function invoker () {
  3763. var arguments$1 = arguments;
  3764. var fns = invoker.fns;
  3765. if (Array.isArray(fns)) {
  3766. var cloned = fns.slice();
  3767. for (var i = 0; i < cloned.length; i++) {
  3768. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3769. }
  3770. } else {
  3771. // return handler return value for single handlers
  3772. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3773. }
  3774. }
  3775. invoker.fns = fns;
  3776. return invoker
  3777. }
  3778. function updateListeners (
  3779. on,
  3780. oldOn,
  3781. add,
  3782. remove$$1,
  3783. createOnceHandler,
  3784. vm
  3785. ) {
  3786. var name, def$$1, cur, old, event;
  3787. for (name in on) {
  3788. def$$1 = cur = on[name];
  3789. old = oldOn[name];
  3790. event = normalizeEvent(name);
  3791. if (isUndef(cur)) {
  3792. true && warn(
  3793. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3794. vm
  3795. );
  3796. } else if (isUndef(old)) {
  3797. if (isUndef(cur.fns)) {
  3798. cur = on[name] = createFnInvoker(cur, vm);
  3799. }
  3800. if (isTrue(event.once)) {
  3801. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3802. }
  3803. add(event.name, cur, event.capture, event.passive, event.params);
  3804. } else if (cur !== old) {
  3805. old.fns = cur;
  3806. on[name] = old;
  3807. }
  3808. }
  3809. for (name in oldOn) {
  3810. if (isUndef(on[name])) {
  3811. event = normalizeEvent(name);
  3812. remove$$1(event.name, oldOn[name], event.capture);
  3813. }
  3814. }
  3815. }
  3816. /* */
  3817. /* */
  3818. // fixed by xxxxxx (mp properties)
  3819. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3820. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3821. if (isUndef(propOptions)) {
  3822. return res
  3823. }
  3824. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3825. var attrs = data.attrs;
  3826. var props = data.props;
  3827. if (isDef(attrs) || isDef(props)) {
  3828. for (var key in propOptions) {
  3829. var altKey = hyphenate(key);
  3830. var result = checkProp(res, props, key, altKey, true) ||
  3831. checkProp(res, attrs, key, altKey, false);
  3832. // externalClass
  3833. if (
  3834. result &&
  3835. res[key] &&
  3836. externalClasses.indexOf(altKey) !== -1 &&
  3837. context[camelize(res[key])]
  3838. ) {
  3839. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3840. res[key] = context[camelize(res[key])];
  3841. }
  3842. }
  3843. }
  3844. return res
  3845. }
  3846. function extractPropsFromVNodeData (
  3847. data,
  3848. Ctor,
  3849. tag,
  3850. context// fixed by xxxxxx
  3851. ) {
  3852. // we are only extracting raw values here.
  3853. // validation and default values are handled in the child
  3854. // component itself.
  3855. var propOptions = Ctor.options.props;
  3856. if (isUndef(propOptions)) {
  3857. // fixed by xxxxxx
  3858. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3859. }
  3860. var res = {};
  3861. var attrs = data.attrs;
  3862. var props = data.props;
  3863. if (isDef(attrs) || isDef(props)) {
  3864. for (var key in propOptions) {
  3865. var altKey = hyphenate(key);
  3866. if (true) {
  3867. var keyInLowerCase = key.toLowerCase();
  3868. if (
  3869. key !== keyInLowerCase &&
  3870. attrs && hasOwn(attrs, keyInLowerCase)
  3871. ) {
  3872. tip(
  3873. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3874. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3875. " \"" + key + "\". " +
  3876. "Note that HTML attributes are case-insensitive and camelCased " +
  3877. "props need to use their kebab-case equivalents when using in-DOM " +
  3878. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3879. );
  3880. }
  3881. }
  3882. checkProp(res, props, key, altKey, true) ||
  3883. checkProp(res, attrs, key, altKey, false);
  3884. }
  3885. }
  3886. // fixed by xxxxxx
  3887. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3888. }
  3889. function checkProp (
  3890. res,
  3891. hash,
  3892. key,
  3893. altKey,
  3894. preserve
  3895. ) {
  3896. if (isDef(hash)) {
  3897. if (hasOwn(hash, key)) {
  3898. res[key] = hash[key];
  3899. if (!preserve) {
  3900. delete hash[key];
  3901. }
  3902. return true
  3903. } else if (hasOwn(hash, altKey)) {
  3904. res[key] = hash[altKey];
  3905. if (!preserve) {
  3906. delete hash[altKey];
  3907. }
  3908. return true
  3909. }
  3910. }
  3911. return false
  3912. }
  3913. /* */
  3914. // The template compiler attempts to minimize the need for normalization by
  3915. // statically analyzing the template at compile time.
  3916. //
  3917. // For plain HTML markup, normalization can be completely skipped because the
  3918. // generated render function is guaranteed to return Array<VNode>. There are
  3919. // two cases where extra normalization is needed:
  3920. // 1. When the children contains components - because a functional component
  3921. // may return an Array instead of a single root. In this case, just a simple
  3922. // normalization is needed - if any child is an Array, we flatten the whole
  3923. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3924. // because functional components already normalize their own children.
  3925. function simpleNormalizeChildren (children) {
  3926. for (var i = 0; i < children.length; i++) {
  3927. if (Array.isArray(children[i])) {
  3928. return Array.prototype.concat.apply([], children)
  3929. }
  3930. }
  3931. return children
  3932. }
  3933. // 2. When the children contains constructs that always generated nested Arrays,
  3934. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3935. // with hand-written render functions / JSX. In such cases a full normalization
  3936. // is needed to cater to all possible types of children values.
  3937. function normalizeChildren (children) {
  3938. return isPrimitive(children)
  3939. ? [createTextVNode(children)]
  3940. : Array.isArray(children)
  3941. ? normalizeArrayChildren(children)
  3942. : undefined
  3943. }
  3944. function isTextNode (node) {
  3945. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3946. }
  3947. function normalizeArrayChildren (children, nestedIndex) {
  3948. var res = [];
  3949. var i, c, lastIndex, last;
  3950. for (i = 0; i < children.length; i++) {
  3951. c = children[i];
  3952. if (isUndef(c) || typeof c === 'boolean') { continue }
  3953. lastIndex = res.length - 1;
  3954. last = res[lastIndex];
  3955. // nested
  3956. if (Array.isArray(c)) {
  3957. if (c.length > 0) {
  3958. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3959. // merge adjacent text nodes
  3960. if (isTextNode(c[0]) && isTextNode(last)) {
  3961. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3962. c.shift();
  3963. }
  3964. res.push.apply(res, c);
  3965. }
  3966. } else if (isPrimitive(c)) {
  3967. if (isTextNode(last)) {
  3968. // merge adjacent text nodes
  3969. // this is necessary for SSR hydration because text nodes are
  3970. // essentially merged when rendered to HTML strings
  3971. res[lastIndex] = createTextVNode(last.text + c);
  3972. } else if (c !== '') {
  3973. // convert primitive to vnode
  3974. res.push(createTextVNode(c));
  3975. }
  3976. } else {
  3977. if (isTextNode(c) && isTextNode(last)) {
  3978. // merge adjacent text nodes
  3979. res[lastIndex] = createTextVNode(last.text + c.text);
  3980. } else {
  3981. // default key for nested array children (likely generated by v-for)
  3982. if (isTrue(children._isVList) &&
  3983. isDef(c.tag) &&
  3984. isUndef(c.key) &&
  3985. isDef(nestedIndex)) {
  3986. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3987. }
  3988. res.push(c);
  3989. }
  3990. }
  3991. }
  3992. return res
  3993. }
  3994. /* */
  3995. function initProvide (vm) {
  3996. var provide = vm.$options.provide;
  3997. if (provide) {
  3998. vm._provided = typeof provide === 'function'
  3999. ? provide.call(vm)
  4000. : provide;
  4001. }
  4002. }
  4003. function initInjections (vm) {
  4004. var result = resolveInject(vm.$options.inject, vm);
  4005. if (result) {
  4006. toggleObserving(false);
  4007. Object.keys(result).forEach(function (key) {
  4008. /* istanbul ignore else */
  4009. if (true) {
  4010. defineReactive$$1(vm, key, result[key], function () {
  4011. warn(
  4012. "Avoid mutating an injected value directly since the changes will be " +
  4013. "overwritten whenever the provided component re-renders. " +
  4014. "injection being mutated: \"" + key + "\"",
  4015. vm
  4016. );
  4017. });
  4018. } else {}
  4019. });
  4020. toggleObserving(true);
  4021. }
  4022. }
  4023. function resolveInject (inject, vm) {
  4024. if (inject) {
  4025. // inject is :any because flow is not smart enough to figure out cached
  4026. var result = Object.create(null);
  4027. var keys = hasSymbol
  4028. ? Reflect.ownKeys(inject)
  4029. : Object.keys(inject);
  4030. for (var i = 0; i < keys.length; i++) {
  4031. var key = keys[i];
  4032. // #6574 in case the inject object is observed...
  4033. if (key === '__ob__') { continue }
  4034. var provideKey = inject[key].from;
  4035. var source = vm;
  4036. while (source) {
  4037. if (source._provided && hasOwn(source._provided, provideKey)) {
  4038. result[key] = source._provided[provideKey];
  4039. break
  4040. }
  4041. source = source.$parent;
  4042. }
  4043. if (!source) {
  4044. if ('default' in inject[key]) {
  4045. var provideDefault = inject[key].default;
  4046. result[key] = typeof provideDefault === 'function'
  4047. ? provideDefault.call(vm)
  4048. : provideDefault;
  4049. } else if (true) {
  4050. warn(("Injection \"" + key + "\" not found"), vm);
  4051. }
  4052. }
  4053. }
  4054. return result
  4055. }
  4056. }
  4057. /* */
  4058. /**
  4059. * Runtime helper for resolving raw children VNodes into a slot object.
  4060. */
  4061. function resolveSlots (
  4062. children,
  4063. context
  4064. ) {
  4065. if (!children || !children.length) {
  4066. return {}
  4067. }
  4068. var slots = {};
  4069. for (var i = 0, l = children.length; i < l; i++) {
  4070. var child = children[i];
  4071. var data = child.data;
  4072. // remove slot attribute if the node is resolved as a Vue slot node
  4073. if (data && data.attrs && data.attrs.slot) {
  4074. delete data.attrs.slot;
  4075. }
  4076. // named slots should only be respected if the vnode was rendered in the
  4077. // same context.
  4078. if ((child.context === context || child.fnContext === context) &&
  4079. data && data.slot != null
  4080. ) {
  4081. var name = data.slot;
  4082. var slot = (slots[name] || (slots[name] = []));
  4083. if (child.tag === 'template') {
  4084. slot.push.apply(slot, child.children || []);
  4085. } else {
  4086. slot.push(child);
  4087. }
  4088. } else {
  4089. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4090. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4091. (slots['page'] || (slots['page'] = [])).push(child);
  4092. }else{
  4093. (slots.default || (slots.default = [])).push(child);
  4094. }
  4095. }
  4096. }
  4097. // ignore slots that contains only whitespace
  4098. for (var name$1 in slots) {
  4099. if (slots[name$1].every(isWhitespace)) {
  4100. delete slots[name$1];
  4101. }
  4102. }
  4103. return slots
  4104. }
  4105. function isWhitespace (node) {
  4106. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4107. }
  4108. /* */
  4109. function normalizeScopedSlots (
  4110. slots,
  4111. normalSlots,
  4112. prevSlots
  4113. ) {
  4114. var res;
  4115. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4116. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4117. var key = slots && slots.$key;
  4118. if (!slots) {
  4119. res = {};
  4120. } else if (slots._normalized) {
  4121. // fast path 1: child component re-render only, parent did not change
  4122. return slots._normalized
  4123. } else if (
  4124. isStable &&
  4125. prevSlots &&
  4126. prevSlots !== emptyObject &&
  4127. key === prevSlots.$key &&
  4128. !hasNormalSlots &&
  4129. !prevSlots.$hasNormal
  4130. ) {
  4131. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4132. // only need to normalize once
  4133. return prevSlots
  4134. } else {
  4135. res = {};
  4136. for (var key$1 in slots) {
  4137. if (slots[key$1] && key$1[0] !== '$') {
  4138. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4139. }
  4140. }
  4141. }
  4142. // expose normal slots on scopedSlots
  4143. for (var key$2 in normalSlots) {
  4144. if (!(key$2 in res)) {
  4145. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4146. }
  4147. }
  4148. // avoriaz seems to mock a non-extensible $scopedSlots object
  4149. // and when that is passed down this would cause an error
  4150. if (slots && Object.isExtensible(slots)) {
  4151. (slots)._normalized = res;
  4152. }
  4153. def(res, '$stable', isStable);
  4154. def(res, '$key', key);
  4155. def(res, '$hasNormal', hasNormalSlots);
  4156. return res
  4157. }
  4158. function normalizeScopedSlot(normalSlots, key, fn) {
  4159. var normalized = function () {
  4160. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4161. res = res && typeof res === 'object' && !Array.isArray(res)
  4162. ? [res] // single vnode
  4163. : normalizeChildren(res);
  4164. return res && (
  4165. res.length === 0 ||
  4166. (res.length === 1 && res[0].isComment) // #9658
  4167. ) ? undefined
  4168. : res
  4169. };
  4170. // this is a slot using the new v-slot syntax without scope. although it is
  4171. // compiled as a scoped slot, render fn users would expect it to be present
  4172. // on this.$slots because the usage is semantically a normal slot.
  4173. if (fn.proxy) {
  4174. Object.defineProperty(normalSlots, key, {
  4175. get: normalized,
  4176. enumerable: true,
  4177. configurable: true
  4178. });
  4179. }
  4180. return normalized
  4181. }
  4182. function proxyNormalSlot(slots, key) {
  4183. return function () { return slots[key]; }
  4184. }
  4185. /* */
  4186. /**
  4187. * Runtime helper for rendering v-for lists.
  4188. */
  4189. function renderList (
  4190. val,
  4191. render
  4192. ) {
  4193. var ret, i, l, keys, key;
  4194. if (Array.isArray(val) || typeof val === 'string') {
  4195. ret = new Array(val.length);
  4196. for (i = 0, l = val.length; i < l; i++) {
  4197. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4198. }
  4199. } else if (typeof val === 'number') {
  4200. ret = new Array(val);
  4201. for (i = 0; i < val; i++) {
  4202. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4203. }
  4204. } else if (isObject(val)) {
  4205. if (hasSymbol && val[Symbol.iterator]) {
  4206. ret = [];
  4207. var iterator = val[Symbol.iterator]();
  4208. var result = iterator.next();
  4209. while (!result.done) {
  4210. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4211. result = iterator.next();
  4212. }
  4213. } else {
  4214. keys = Object.keys(val);
  4215. ret = new Array(keys.length);
  4216. for (i = 0, l = keys.length; i < l; i++) {
  4217. key = keys[i];
  4218. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4219. }
  4220. }
  4221. }
  4222. if (!isDef(ret)) {
  4223. ret = [];
  4224. }
  4225. (ret)._isVList = true;
  4226. return ret
  4227. }
  4228. /* */
  4229. /**
  4230. * Runtime helper for rendering <slot>
  4231. */
  4232. function renderSlot (
  4233. name,
  4234. fallback,
  4235. props,
  4236. bindObject
  4237. ) {
  4238. var scopedSlotFn = this.$scopedSlots[name];
  4239. var nodes;
  4240. if (scopedSlotFn) { // scoped slot
  4241. props = props || {};
  4242. if (bindObject) {
  4243. if ( true && !isObject(bindObject)) {
  4244. warn(
  4245. 'slot v-bind without argument expects an Object',
  4246. this
  4247. );
  4248. }
  4249. props = extend(extend({}, bindObject), props);
  4250. }
  4251. // fixed by xxxxxx app-plus scopedSlot
  4252. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4253. } else {
  4254. nodes = this.$slots[name] || fallback;
  4255. }
  4256. var target = props && props.slot;
  4257. if (target) {
  4258. return this.$createElement('template', { slot: target }, nodes)
  4259. } else {
  4260. return nodes
  4261. }
  4262. }
  4263. /* */
  4264. /**
  4265. * Runtime helper for resolving filters
  4266. */
  4267. function resolveFilter (id) {
  4268. return resolveAsset(this.$options, 'filters', id, true) || identity
  4269. }
  4270. /* */
  4271. function isKeyNotMatch (expect, actual) {
  4272. if (Array.isArray(expect)) {
  4273. return expect.indexOf(actual) === -1
  4274. } else {
  4275. return expect !== actual
  4276. }
  4277. }
  4278. /**
  4279. * Runtime helper for checking keyCodes from config.
  4280. * exposed as Vue.prototype._k
  4281. * passing in eventKeyName as last argument separately for backwards compat
  4282. */
  4283. function checkKeyCodes (
  4284. eventKeyCode,
  4285. key,
  4286. builtInKeyCode,
  4287. eventKeyName,
  4288. builtInKeyName
  4289. ) {
  4290. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4291. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4292. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4293. } else if (mappedKeyCode) {
  4294. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4295. } else if (eventKeyName) {
  4296. return hyphenate(eventKeyName) !== key
  4297. }
  4298. }
  4299. /* */
  4300. /**
  4301. * Runtime helper for merging v-bind="object" into a VNode's data.
  4302. */
  4303. function bindObjectProps (
  4304. data,
  4305. tag,
  4306. value,
  4307. asProp,
  4308. isSync
  4309. ) {
  4310. if (value) {
  4311. if (!isObject(value)) {
  4312. true && warn(
  4313. 'v-bind without argument expects an Object or Array value',
  4314. this
  4315. );
  4316. } else {
  4317. if (Array.isArray(value)) {
  4318. value = toObject(value);
  4319. }
  4320. var hash;
  4321. var loop = function ( key ) {
  4322. if (
  4323. key === 'class' ||
  4324. key === 'style' ||
  4325. isReservedAttribute(key)
  4326. ) {
  4327. hash = data;
  4328. } else {
  4329. var type = data.attrs && data.attrs.type;
  4330. hash = asProp || config.mustUseProp(tag, type, key)
  4331. ? data.domProps || (data.domProps = {})
  4332. : data.attrs || (data.attrs = {});
  4333. }
  4334. var camelizedKey = camelize(key);
  4335. var hyphenatedKey = hyphenate(key);
  4336. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4337. hash[key] = value[key];
  4338. if (isSync) {
  4339. var on = data.on || (data.on = {});
  4340. on[("update:" + key)] = function ($event) {
  4341. value[key] = $event;
  4342. };
  4343. }
  4344. }
  4345. };
  4346. for (var key in value) loop( key );
  4347. }
  4348. }
  4349. return data
  4350. }
  4351. /* */
  4352. /**
  4353. * Runtime helper for rendering static trees.
  4354. */
  4355. function renderStatic (
  4356. index,
  4357. isInFor
  4358. ) {
  4359. var cached = this._staticTrees || (this._staticTrees = []);
  4360. var tree = cached[index];
  4361. // if has already-rendered static tree and not inside v-for,
  4362. // we can reuse the same tree.
  4363. if (tree && !isInFor) {
  4364. return tree
  4365. }
  4366. // otherwise, render a fresh tree.
  4367. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4368. this._renderProxy,
  4369. null,
  4370. this // for render fns generated for functional component templates
  4371. );
  4372. markStatic(tree, ("__static__" + index), false);
  4373. return tree
  4374. }
  4375. /**
  4376. * Runtime helper for v-once.
  4377. * Effectively it means marking the node as static with a unique key.
  4378. */
  4379. function markOnce (
  4380. tree,
  4381. index,
  4382. key
  4383. ) {
  4384. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4385. return tree
  4386. }
  4387. function markStatic (
  4388. tree,
  4389. key,
  4390. isOnce
  4391. ) {
  4392. if (Array.isArray(tree)) {
  4393. for (var i = 0; i < tree.length; i++) {
  4394. if (tree[i] && typeof tree[i] !== 'string') {
  4395. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4396. }
  4397. }
  4398. } else {
  4399. markStaticNode(tree, key, isOnce);
  4400. }
  4401. }
  4402. function markStaticNode (node, key, isOnce) {
  4403. node.isStatic = true;
  4404. node.key = key;
  4405. node.isOnce = isOnce;
  4406. }
  4407. /* */
  4408. function bindObjectListeners (data, value) {
  4409. if (value) {
  4410. if (!isPlainObject(value)) {
  4411. true && warn(
  4412. 'v-on without argument expects an Object value',
  4413. this
  4414. );
  4415. } else {
  4416. var on = data.on = data.on ? extend({}, data.on) : {};
  4417. for (var key in value) {
  4418. var existing = on[key];
  4419. var ours = value[key];
  4420. on[key] = existing ? [].concat(existing, ours) : ours;
  4421. }
  4422. }
  4423. }
  4424. return data
  4425. }
  4426. /* */
  4427. function resolveScopedSlots (
  4428. fns, // see flow/vnode
  4429. res,
  4430. // the following are added in 2.6
  4431. hasDynamicKeys,
  4432. contentHashKey
  4433. ) {
  4434. res = res || { $stable: !hasDynamicKeys };
  4435. for (var i = 0; i < fns.length; i++) {
  4436. var slot = fns[i];
  4437. if (Array.isArray(slot)) {
  4438. resolveScopedSlots(slot, res, hasDynamicKeys);
  4439. } else if (slot) {
  4440. // marker for reverse proxying v-slot without scope on this.$slots
  4441. if (slot.proxy) {
  4442. slot.fn.proxy = true;
  4443. }
  4444. res[slot.key] = slot.fn;
  4445. }
  4446. }
  4447. if (contentHashKey) {
  4448. (res).$key = contentHashKey;
  4449. }
  4450. return res
  4451. }
  4452. /* */
  4453. function bindDynamicKeys (baseObj, values) {
  4454. for (var i = 0; i < values.length; i += 2) {
  4455. var key = values[i];
  4456. if (typeof key === 'string' && key) {
  4457. baseObj[values[i]] = values[i + 1];
  4458. } else if ( true && key !== '' && key !== null) {
  4459. // null is a special value for explicitly removing a binding
  4460. warn(
  4461. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4462. this
  4463. );
  4464. }
  4465. }
  4466. return baseObj
  4467. }
  4468. // helper to dynamically append modifier runtime markers to event names.
  4469. // ensure only append when value is already string, otherwise it will be cast
  4470. // to string and cause the type check to miss.
  4471. function prependModifier (value, symbol) {
  4472. return typeof value === 'string' ? symbol + value : value
  4473. }
  4474. /* */
  4475. function installRenderHelpers (target) {
  4476. target._o = markOnce;
  4477. target._n = toNumber;
  4478. target._s = toString;
  4479. target._l = renderList;
  4480. target._t = renderSlot;
  4481. target._q = looseEqual;
  4482. target._i = looseIndexOf;
  4483. target._m = renderStatic;
  4484. target._f = resolveFilter;
  4485. target._k = checkKeyCodes;
  4486. target._b = bindObjectProps;
  4487. target._v = createTextVNode;
  4488. target._e = createEmptyVNode;
  4489. target._u = resolveScopedSlots;
  4490. target._g = bindObjectListeners;
  4491. target._d = bindDynamicKeys;
  4492. target._p = prependModifier;
  4493. }
  4494. /* */
  4495. function FunctionalRenderContext (
  4496. data,
  4497. props,
  4498. children,
  4499. parent,
  4500. Ctor
  4501. ) {
  4502. var this$1 = this;
  4503. var options = Ctor.options;
  4504. // ensure the createElement function in functional components
  4505. // gets a unique context - this is necessary for correct named slot check
  4506. var contextVm;
  4507. if (hasOwn(parent, '_uid')) {
  4508. contextVm = Object.create(parent);
  4509. // $flow-disable-line
  4510. contextVm._original = parent;
  4511. } else {
  4512. // the context vm passed in is a functional context as well.
  4513. // in this case we want to make sure we are able to get a hold to the
  4514. // real context instance.
  4515. contextVm = parent;
  4516. // $flow-disable-line
  4517. parent = parent._original;
  4518. }
  4519. var isCompiled = isTrue(options._compiled);
  4520. var needNormalization = !isCompiled;
  4521. this.data = data;
  4522. this.props = props;
  4523. this.children = children;
  4524. this.parent = parent;
  4525. this.listeners = data.on || emptyObject;
  4526. this.injections = resolveInject(options.inject, parent);
  4527. this.slots = function () {
  4528. if (!this$1.$slots) {
  4529. normalizeScopedSlots(
  4530. data.scopedSlots,
  4531. this$1.$slots = resolveSlots(children, parent)
  4532. );
  4533. }
  4534. return this$1.$slots
  4535. };
  4536. Object.defineProperty(this, 'scopedSlots', ({
  4537. enumerable: true,
  4538. get: function get () {
  4539. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4540. }
  4541. }));
  4542. // support for compiled functional template
  4543. if (isCompiled) {
  4544. // exposing $options for renderStatic()
  4545. this.$options = options;
  4546. // pre-resolve slots for renderSlot()
  4547. this.$slots = this.slots();
  4548. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4549. }
  4550. if (options._scopeId) {
  4551. this._c = function (a, b, c, d) {
  4552. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4553. if (vnode && !Array.isArray(vnode)) {
  4554. vnode.fnScopeId = options._scopeId;
  4555. vnode.fnContext = parent;
  4556. }
  4557. return vnode
  4558. };
  4559. } else {
  4560. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4561. }
  4562. }
  4563. installRenderHelpers(FunctionalRenderContext.prototype);
  4564. function createFunctionalComponent (
  4565. Ctor,
  4566. propsData,
  4567. data,
  4568. contextVm,
  4569. children
  4570. ) {
  4571. var options = Ctor.options;
  4572. var props = {};
  4573. var propOptions = options.props;
  4574. if (isDef(propOptions)) {
  4575. for (var key in propOptions) {
  4576. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4577. }
  4578. } else {
  4579. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4580. if (isDef(data.props)) { mergeProps(props, data.props); }
  4581. }
  4582. var renderContext = new FunctionalRenderContext(
  4583. data,
  4584. props,
  4585. children,
  4586. contextVm,
  4587. Ctor
  4588. );
  4589. var vnode = options.render.call(null, renderContext._c, renderContext);
  4590. if (vnode instanceof VNode) {
  4591. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4592. } else if (Array.isArray(vnode)) {
  4593. var vnodes = normalizeChildren(vnode) || [];
  4594. var res = new Array(vnodes.length);
  4595. for (var i = 0; i < vnodes.length; i++) {
  4596. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4597. }
  4598. return res
  4599. }
  4600. }
  4601. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4602. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4603. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4604. // that should not be matched to match.
  4605. var clone = cloneVNode(vnode);
  4606. clone.fnContext = contextVm;
  4607. clone.fnOptions = options;
  4608. if (true) {
  4609. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4610. }
  4611. if (data.slot) {
  4612. (clone.data || (clone.data = {})).slot = data.slot;
  4613. }
  4614. return clone
  4615. }
  4616. function mergeProps (to, from) {
  4617. for (var key in from) {
  4618. to[camelize(key)] = from[key];
  4619. }
  4620. }
  4621. /* */
  4622. /* */
  4623. /* */
  4624. /* */
  4625. // inline hooks to be invoked on component VNodes during patch
  4626. var componentVNodeHooks = {
  4627. init: function init (vnode, hydrating) {
  4628. if (
  4629. vnode.componentInstance &&
  4630. !vnode.componentInstance._isDestroyed &&
  4631. vnode.data.keepAlive
  4632. ) {
  4633. // kept-alive components, treat as a patch
  4634. var mountedNode = vnode; // work around flow
  4635. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4636. } else {
  4637. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4638. vnode,
  4639. activeInstance
  4640. );
  4641. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4642. }
  4643. },
  4644. prepatch: function prepatch (oldVnode, vnode) {
  4645. var options = vnode.componentOptions;
  4646. var child = vnode.componentInstance = oldVnode.componentInstance;
  4647. updateChildComponent(
  4648. child,
  4649. options.propsData, // updated props
  4650. options.listeners, // updated listeners
  4651. vnode, // new parent vnode
  4652. options.children // new children
  4653. );
  4654. },
  4655. insert: function insert (vnode) {
  4656. var context = vnode.context;
  4657. var componentInstance = vnode.componentInstance;
  4658. if (!componentInstance._isMounted) {
  4659. callHook(componentInstance, 'onServiceCreated');
  4660. callHook(componentInstance, 'onServiceAttached');
  4661. componentInstance._isMounted = true;
  4662. callHook(componentInstance, 'mounted');
  4663. }
  4664. if (vnode.data.keepAlive) {
  4665. if (context._isMounted) {
  4666. // vue-router#1212
  4667. // During updates, a kept-alive component's child components may
  4668. // change, so directly walking the tree here may call activated hooks
  4669. // on incorrect children. Instead we push them into a queue which will
  4670. // be processed after the whole patch process ended.
  4671. queueActivatedComponent(componentInstance);
  4672. } else {
  4673. activateChildComponent(componentInstance, true /* direct */);
  4674. }
  4675. }
  4676. },
  4677. destroy: function destroy (vnode) {
  4678. var componentInstance = vnode.componentInstance;
  4679. if (!componentInstance._isDestroyed) {
  4680. if (!vnode.data.keepAlive) {
  4681. componentInstance.$destroy();
  4682. } else {
  4683. deactivateChildComponent(componentInstance, true /* direct */);
  4684. }
  4685. }
  4686. }
  4687. };
  4688. var hooksToMerge = Object.keys(componentVNodeHooks);
  4689. function createComponent (
  4690. Ctor,
  4691. data,
  4692. context,
  4693. children,
  4694. tag
  4695. ) {
  4696. if (isUndef(Ctor)) {
  4697. return
  4698. }
  4699. var baseCtor = context.$options._base;
  4700. // plain options object: turn it into a constructor
  4701. if (isObject(Ctor)) {
  4702. Ctor = baseCtor.extend(Ctor);
  4703. }
  4704. // if at this stage it's not a constructor or an async component factory,
  4705. // reject.
  4706. if (typeof Ctor !== 'function') {
  4707. if (true) {
  4708. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4709. }
  4710. return
  4711. }
  4712. // async component
  4713. var asyncFactory;
  4714. if (isUndef(Ctor.cid)) {
  4715. asyncFactory = Ctor;
  4716. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4717. if (Ctor === undefined) {
  4718. // return a placeholder node for async component, which is rendered
  4719. // as a comment node but preserves all the raw information for the node.
  4720. // the information will be used for async server-rendering and hydration.
  4721. return createAsyncPlaceholder(
  4722. asyncFactory,
  4723. data,
  4724. context,
  4725. children,
  4726. tag
  4727. )
  4728. }
  4729. }
  4730. data = data || {};
  4731. // resolve constructor options in case global mixins are applied after
  4732. // component constructor creation
  4733. resolveConstructorOptions(Ctor);
  4734. // transform component v-model data into props & events
  4735. if (isDef(data.model)) {
  4736. transformModel(Ctor.options, data);
  4737. }
  4738. // extract props
  4739. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4740. // functional component
  4741. if (isTrue(Ctor.options.functional)) {
  4742. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4743. }
  4744. // extract listeners, since these needs to be treated as
  4745. // child component listeners instead of DOM listeners
  4746. var listeners = data.on;
  4747. // replace with listeners with .native modifier
  4748. // so it gets processed during parent component patch.
  4749. data.on = data.nativeOn;
  4750. if (isTrue(Ctor.options.abstract)) {
  4751. // abstract components do not keep anything
  4752. // other than props & listeners & slot
  4753. // work around flow
  4754. var slot = data.slot;
  4755. data = {};
  4756. if (slot) {
  4757. data.slot = slot;
  4758. }
  4759. }
  4760. // install component management hooks onto the placeholder node
  4761. installComponentHooks(data);
  4762. // return a placeholder vnode
  4763. var name = Ctor.options.name || tag;
  4764. var vnode = new VNode(
  4765. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4766. data, undefined, undefined, undefined, context,
  4767. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4768. asyncFactory
  4769. );
  4770. return vnode
  4771. }
  4772. function createComponentInstanceForVnode (
  4773. vnode, // we know it's MountedComponentVNode but flow doesn't
  4774. parent // activeInstance in lifecycle state
  4775. ) {
  4776. var options = {
  4777. _isComponent: true,
  4778. _parentVnode: vnode,
  4779. parent: parent
  4780. };
  4781. // check inline-template render functions
  4782. var inlineTemplate = vnode.data.inlineTemplate;
  4783. if (isDef(inlineTemplate)) {
  4784. options.render = inlineTemplate.render;
  4785. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4786. }
  4787. return new vnode.componentOptions.Ctor(options)
  4788. }
  4789. function installComponentHooks (data) {
  4790. var hooks = data.hook || (data.hook = {});
  4791. for (var i = 0; i < hooksToMerge.length; i++) {
  4792. var key = hooksToMerge[i];
  4793. var existing = hooks[key];
  4794. var toMerge = componentVNodeHooks[key];
  4795. if (existing !== toMerge && !(existing && existing._merged)) {
  4796. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4797. }
  4798. }
  4799. }
  4800. function mergeHook$1 (f1, f2) {
  4801. var merged = function (a, b) {
  4802. // flow complains about extra args which is why we use any
  4803. f1(a, b);
  4804. f2(a, b);
  4805. };
  4806. merged._merged = true;
  4807. return merged
  4808. }
  4809. // transform component v-model info (value and callback) into
  4810. // prop and event handler respectively.
  4811. function transformModel (options, data) {
  4812. var prop = (options.model && options.model.prop) || 'value';
  4813. var event = (options.model && options.model.event) || 'input'
  4814. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4815. var on = data.on || (data.on = {});
  4816. var existing = on[event];
  4817. var callback = data.model.callback;
  4818. if (isDef(existing)) {
  4819. if (
  4820. Array.isArray(existing)
  4821. ? existing.indexOf(callback) === -1
  4822. : existing !== callback
  4823. ) {
  4824. on[event] = [callback].concat(existing);
  4825. }
  4826. } else {
  4827. on[event] = callback;
  4828. }
  4829. }
  4830. /* */
  4831. var SIMPLE_NORMALIZE = 1;
  4832. var ALWAYS_NORMALIZE = 2;
  4833. // wrapper function for providing a more flexible interface
  4834. // without getting yelled at by flow
  4835. function createElement (
  4836. context,
  4837. tag,
  4838. data,
  4839. children,
  4840. normalizationType,
  4841. alwaysNormalize
  4842. ) {
  4843. if (Array.isArray(data) || isPrimitive(data)) {
  4844. normalizationType = children;
  4845. children = data;
  4846. data = undefined;
  4847. }
  4848. if (isTrue(alwaysNormalize)) {
  4849. normalizationType = ALWAYS_NORMALIZE;
  4850. }
  4851. return _createElement(context, tag, data, children, normalizationType)
  4852. }
  4853. function _createElement (
  4854. context,
  4855. tag,
  4856. data,
  4857. children,
  4858. normalizationType
  4859. ) {
  4860. if (isDef(data) && isDef((data).__ob__)) {
  4861. true && warn(
  4862. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4863. 'Always create fresh vnode data objects in each render!',
  4864. context
  4865. );
  4866. return createEmptyVNode()
  4867. }
  4868. // object syntax in v-bind
  4869. if (isDef(data) && isDef(data.is)) {
  4870. tag = data.is;
  4871. }
  4872. if (!tag) {
  4873. // in case of component :is set to falsy value
  4874. return createEmptyVNode()
  4875. }
  4876. // warn against non-primitive key
  4877. if ( true &&
  4878. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4879. ) {
  4880. {
  4881. warn(
  4882. 'Avoid using non-primitive value as key, ' +
  4883. 'use string/number value instead.',
  4884. context
  4885. );
  4886. }
  4887. }
  4888. // support single function children as default scoped slot
  4889. if (Array.isArray(children) &&
  4890. typeof children[0] === 'function'
  4891. ) {
  4892. data = data || {};
  4893. data.scopedSlots = { default: children[0] };
  4894. children.length = 0;
  4895. }
  4896. if (normalizationType === ALWAYS_NORMALIZE) {
  4897. children = normalizeChildren(children);
  4898. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4899. children = simpleNormalizeChildren(children);
  4900. }
  4901. var vnode, ns;
  4902. if (typeof tag === 'string') {
  4903. var Ctor;
  4904. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4905. if (config.isReservedTag(tag)) {
  4906. // platform built-in elements
  4907. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4908. warn(
  4909. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4910. context
  4911. );
  4912. }
  4913. vnode = new VNode(
  4914. config.parsePlatformTagName(tag), data, children,
  4915. undefined, undefined, context
  4916. );
  4917. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4918. // component
  4919. vnode = createComponent(Ctor, data, context, children, tag);
  4920. } else {
  4921. // unknown or unlisted namespaced elements
  4922. // check at runtime because it may get assigned a namespace when its
  4923. // parent normalizes children
  4924. vnode = new VNode(
  4925. tag, data, children,
  4926. undefined, undefined, context
  4927. );
  4928. }
  4929. } else {
  4930. // direct component options / constructor
  4931. vnode = createComponent(tag, data, context, children);
  4932. }
  4933. if (Array.isArray(vnode)) {
  4934. return vnode
  4935. } else if (isDef(vnode)) {
  4936. if (isDef(ns)) { applyNS(vnode, ns); }
  4937. if (isDef(data)) { registerDeepBindings(data); }
  4938. return vnode
  4939. } else {
  4940. return createEmptyVNode()
  4941. }
  4942. }
  4943. function applyNS (vnode, ns, force) {
  4944. vnode.ns = ns;
  4945. if (vnode.tag === 'foreignObject') {
  4946. // use default namespace inside foreignObject
  4947. ns = undefined;
  4948. force = true;
  4949. }
  4950. if (isDef(vnode.children)) {
  4951. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4952. var child = vnode.children[i];
  4953. if (isDef(child.tag) && (
  4954. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4955. applyNS(child, ns, force);
  4956. }
  4957. }
  4958. }
  4959. }
  4960. // ref #5318
  4961. // necessary to ensure parent re-render when deep bindings like :style and
  4962. // :class are used on slot nodes
  4963. function registerDeepBindings (data) {
  4964. if (isObject(data.style)) {
  4965. traverse(data.style);
  4966. }
  4967. if (isObject(data.class)) {
  4968. traverse(data.class);
  4969. }
  4970. }
  4971. /* */
  4972. function initRender (vm) {
  4973. vm._vnode = null; // the root of the child tree
  4974. vm._staticTrees = null; // v-once cached trees
  4975. var options = vm.$options;
  4976. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4977. var renderContext = parentVnode && parentVnode.context;
  4978. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4979. vm.$scopedSlots = emptyObject;
  4980. // bind the createElement fn to this instance
  4981. // so that we get proper render context inside it.
  4982. // args order: tag, data, children, normalizationType, alwaysNormalize
  4983. // internal version is used by render functions compiled from templates
  4984. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4985. // normalization is always applied for the public version, used in
  4986. // user-written render functions.
  4987. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4988. // $attrs & $listeners are exposed for easier HOC creation.
  4989. // they need to be reactive so that HOCs using them are always updated
  4990. var parentData = parentVnode && parentVnode.data;
  4991. /* istanbul ignore else */
  4992. if (true) {
  4993. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4994. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4995. }, true);
  4996. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4997. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4998. }, true);
  4999. } else {}
  5000. }
  5001. var currentRenderingInstance = null;
  5002. function renderMixin (Vue) {
  5003. // install runtime convenience helpers
  5004. installRenderHelpers(Vue.prototype);
  5005. Vue.prototype.$nextTick = function (fn) {
  5006. return nextTick(fn, this)
  5007. };
  5008. Vue.prototype._render = function () {
  5009. var vm = this;
  5010. var ref = vm.$options;
  5011. var render = ref.render;
  5012. var _parentVnode = ref._parentVnode;
  5013. if (_parentVnode) {
  5014. vm.$scopedSlots = normalizeScopedSlots(
  5015. _parentVnode.data.scopedSlots,
  5016. vm.$slots,
  5017. vm.$scopedSlots
  5018. );
  5019. }
  5020. // set parent vnode. this allows render functions to have access
  5021. // to the data on the placeholder node.
  5022. vm.$vnode = _parentVnode;
  5023. // render self
  5024. var vnode;
  5025. try {
  5026. // There's no need to maintain a stack because all render fns are called
  5027. // separately from one another. Nested component's render fns are called
  5028. // when parent component is patched.
  5029. currentRenderingInstance = vm;
  5030. vnode = render.call(vm._renderProxy, vm.$createElement);
  5031. } catch (e) {
  5032. handleError(e, vm, "render");
  5033. // return error render result,
  5034. // or previous vnode to prevent render error causing blank component
  5035. /* istanbul ignore else */
  5036. if ( true && vm.$options.renderError) {
  5037. try {
  5038. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5039. } catch (e) {
  5040. handleError(e, vm, "renderError");
  5041. vnode = vm._vnode;
  5042. }
  5043. } else {
  5044. vnode = vm._vnode;
  5045. }
  5046. } finally {
  5047. currentRenderingInstance = null;
  5048. }
  5049. // if the returned array contains only a single node, allow it
  5050. if (Array.isArray(vnode) && vnode.length === 1) {
  5051. vnode = vnode[0];
  5052. }
  5053. // return empty vnode in case the render function errored out
  5054. if (!(vnode instanceof VNode)) {
  5055. if ( true && Array.isArray(vnode)) {
  5056. warn(
  5057. 'Multiple root nodes returned from render function. Render function ' +
  5058. 'should return a single root node.',
  5059. vm
  5060. );
  5061. }
  5062. vnode = createEmptyVNode();
  5063. }
  5064. // set parent
  5065. vnode.parent = _parentVnode;
  5066. return vnode
  5067. };
  5068. }
  5069. /* */
  5070. function ensureCtor (comp, base) {
  5071. if (
  5072. comp.__esModule ||
  5073. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5074. ) {
  5075. comp = comp.default;
  5076. }
  5077. return isObject(comp)
  5078. ? base.extend(comp)
  5079. : comp
  5080. }
  5081. function createAsyncPlaceholder (
  5082. factory,
  5083. data,
  5084. context,
  5085. children,
  5086. tag
  5087. ) {
  5088. var node = createEmptyVNode();
  5089. node.asyncFactory = factory;
  5090. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5091. return node
  5092. }
  5093. function resolveAsyncComponent (
  5094. factory,
  5095. baseCtor
  5096. ) {
  5097. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5098. return factory.errorComp
  5099. }
  5100. if (isDef(factory.resolved)) {
  5101. return factory.resolved
  5102. }
  5103. var owner = currentRenderingInstance;
  5104. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5105. // already pending
  5106. factory.owners.push(owner);
  5107. }
  5108. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5109. return factory.loadingComp
  5110. }
  5111. if (owner && !isDef(factory.owners)) {
  5112. var owners = factory.owners = [owner];
  5113. var sync = true;
  5114. var timerLoading = null;
  5115. var timerTimeout = null
  5116. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5117. var forceRender = function (renderCompleted) {
  5118. for (var i = 0, l = owners.length; i < l; i++) {
  5119. (owners[i]).$forceUpdate();
  5120. }
  5121. if (renderCompleted) {
  5122. owners.length = 0;
  5123. if (timerLoading !== null) {
  5124. clearTimeout(timerLoading);
  5125. timerLoading = null;
  5126. }
  5127. if (timerTimeout !== null) {
  5128. clearTimeout(timerTimeout);
  5129. timerTimeout = null;
  5130. }
  5131. }
  5132. };
  5133. var resolve = once(function (res) {
  5134. // cache resolved
  5135. factory.resolved = ensureCtor(res, baseCtor);
  5136. // invoke callbacks only if this is not a synchronous resolve
  5137. // (async resolves are shimmed as synchronous during SSR)
  5138. if (!sync) {
  5139. forceRender(true);
  5140. } else {
  5141. owners.length = 0;
  5142. }
  5143. });
  5144. var reject = once(function (reason) {
  5145. true && warn(
  5146. "Failed to resolve async component: " + (String(factory)) +
  5147. (reason ? ("\nReason: " + reason) : '')
  5148. );
  5149. if (isDef(factory.errorComp)) {
  5150. factory.error = true;
  5151. forceRender(true);
  5152. }
  5153. });
  5154. var res = factory(resolve, reject);
  5155. if (isObject(res)) {
  5156. if (isPromise(res)) {
  5157. // () => Promise
  5158. if (isUndef(factory.resolved)) {
  5159. res.then(resolve, reject);
  5160. }
  5161. } else if (isPromise(res.component)) {
  5162. res.component.then(resolve, reject);
  5163. if (isDef(res.error)) {
  5164. factory.errorComp = ensureCtor(res.error, baseCtor);
  5165. }
  5166. if (isDef(res.loading)) {
  5167. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5168. if (res.delay === 0) {
  5169. factory.loading = true;
  5170. } else {
  5171. timerLoading = setTimeout(function () {
  5172. timerLoading = null;
  5173. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5174. factory.loading = true;
  5175. forceRender(false);
  5176. }
  5177. }, res.delay || 200);
  5178. }
  5179. }
  5180. if (isDef(res.timeout)) {
  5181. timerTimeout = setTimeout(function () {
  5182. timerTimeout = null;
  5183. if (isUndef(factory.resolved)) {
  5184. reject(
  5185. true
  5186. ? ("timeout (" + (res.timeout) + "ms)")
  5187. : undefined
  5188. );
  5189. }
  5190. }, res.timeout);
  5191. }
  5192. }
  5193. }
  5194. sync = false;
  5195. // return in case resolved synchronously
  5196. return factory.loading
  5197. ? factory.loadingComp
  5198. : factory.resolved
  5199. }
  5200. }
  5201. /* */
  5202. function isAsyncPlaceholder (node) {
  5203. return node.isComment && node.asyncFactory
  5204. }
  5205. /* */
  5206. function getFirstComponentChild (children) {
  5207. if (Array.isArray(children)) {
  5208. for (var i = 0; i < children.length; i++) {
  5209. var c = children[i];
  5210. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5211. return c
  5212. }
  5213. }
  5214. }
  5215. }
  5216. /* */
  5217. /* */
  5218. function initEvents (vm) {
  5219. vm._events = Object.create(null);
  5220. vm._hasHookEvent = false;
  5221. // init parent attached events
  5222. var listeners = vm.$options._parentListeners;
  5223. if (listeners) {
  5224. updateComponentListeners(vm, listeners);
  5225. }
  5226. }
  5227. var target;
  5228. function add (event, fn) {
  5229. target.$on(event, fn);
  5230. }
  5231. function remove$1 (event, fn) {
  5232. target.$off(event, fn);
  5233. }
  5234. function createOnceHandler (event, fn) {
  5235. var _target = target;
  5236. return function onceHandler () {
  5237. var res = fn.apply(null, arguments);
  5238. if (res !== null) {
  5239. _target.$off(event, onceHandler);
  5240. }
  5241. }
  5242. }
  5243. function updateComponentListeners (
  5244. vm,
  5245. listeners,
  5246. oldListeners
  5247. ) {
  5248. target = vm;
  5249. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5250. target = undefined;
  5251. }
  5252. function eventsMixin (Vue) {
  5253. var hookRE = /^hook:/;
  5254. Vue.prototype.$on = function (event, fn) {
  5255. var vm = this;
  5256. if (Array.isArray(event)) {
  5257. for (var i = 0, l = event.length; i < l; i++) {
  5258. vm.$on(event[i], fn);
  5259. }
  5260. } else {
  5261. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5262. // optimize hook:event cost by using a boolean flag marked at registration
  5263. // instead of a hash lookup
  5264. if (hookRE.test(event)) {
  5265. vm._hasHookEvent = true;
  5266. }
  5267. }
  5268. return vm
  5269. };
  5270. Vue.prototype.$once = function (event, fn) {
  5271. var vm = this;
  5272. function on () {
  5273. vm.$off(event, on);
  5274. fn.apply(vm, arguments);
  5275. }
  5276. on.fn = fn;
  5277. vm.$on(event, on);
  5278. return vm
  5279. };
  5280. Vue.prototype.$off = function (event, fn) {
  5281. var vm = this;
  5282. // all
  5283. if (!arguments.length) {
  5284. vm._events = Object.create(null);
  5285. return vm
  5286. }
  5287. // array of events
  5288. if (Array.isArray(event)) {
  5289. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5290. vm.$off(event[i$1], fn);
  5291. }
  5292. return vm
  5293. }
  5294. // specific event
  5295. var cbs = vm._events[event];
  5296. if (!cbs) {
  5297. return vm
  5298. }
  5299. if (!fn) {
  5300. vm._events[event] = null;
  5301. return vm
  5302. }
  5303. // specific handler
  5304. var cb;
  5305. var i = cbs.length;
  5306. while (i--) {
  5307. cb = cbs[i];
  5308. if (cb === fn || cb.fn === fn) {
  5309. cbs.splice(i, 1);
  5310. break
  5311. }
  5312. }
  5313. return vm
  5314. };
  5315. Vue.prototype.$emit = function (event) {
  5316. var vm = this;
  5317. if (true) {
  5318. var lowerCaseEvent = event.toLowerCase();
  5319. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5320. tip(
  5321. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5322. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5323. "Note that HTML attributes are case-insensitive and you cannot use " +
  5324. "v-on to listen to camelCase events when using in-DOM templates. " +
  5325. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5326. );
  5327. }
  5328. }
  5329. var cbs = vm._events[event];
  5330. if (cbs) {
  5331. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5332. var args = toArray(arguments, 1);
  5333. var info = "event handler for \"" + event + "\"";
  5334. for (var i = 0, l = cbs.length; i < l; i++) {
  5335. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5336. }
  5337. }
  5338. return vm
  5339. };
  5340. }
  5341. /* */
  5342. var activeInstance = null;
  5343. var isUpdatingChildComponent = false;
  5344. function setActiveInstance(vm) {
  5345. var prevActiveInstance = activeInstance;
  5346. activeInstance = vm;
  5347. return function () {
  5348. activeInstance = prevActiveInstance;
  5349. }
  5350. }
  5351. function initLifecycle (vm) {
  5352. var options = vm.$options;
  5353. // locate first non-abstract parent
  5354. var parent = options.parent;
  5355. if (parent && !options.abstract) {
  5356. while (parent.$options.abstract && parent.$parent) {
  5357. parent = parent.$parent;
  5358. }
  5359. parent.$children.push(vm);
  5360. }
  5361. vm.$parent = parent;
  5362. vm.$root = parent ? parent.$root : vm;
  5363. vm.$children = [];
  5364. vm.$refs = {};
  5365. vm._watcher = null;
  5366. vm._inactive = null;
  5367. vm._directInactive = false;
  5368. vm._isMounted = false;
  5369. vm._isDestroyed = false;
  5370. vm._isBeingDestroyed = false;
  5371. }
  5372. function lifecycleMixin (Vue) {
  5373. Vue.prototype._update = function (vnode, hydrating) {
  5374. var vm = this;
  5375. var prevEl = vm.$el;
  5376. var prevVnode = vm._vnode;
  5377. var restoreActiveInstance = setActiveInstance(vm);
  5378. vm._vnode = vnode;
  5379. // Vue.prototype.__patch__ is injected in entry points
  5380. // based on the rendering backend used.
  5381. if (!prevVnode) {
  5382. // initial render
  5383. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5384. } else {
  5385. // updates
  5386. vm.$el = vm.__patch__(prevVnode, vnode);
  5387. }
  5388. restoreActiveInstance();
  5389. // update __vue__ reference
  5390. if (prevEl) {
  5391. prevEl.__vue__ = null;
  5392. }
  5393. if (vm.$el) {
  5394. vm.$el.__vue__ = vm;
  5395. }
  5396. // if parent is an HOC, update its $el as well
  5397. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5398. vm.$parent.$el = vm.$el;
  5399. }
  5400. // updated hook is called by the scheduler to ensure that children are
  5401. // updated in a parent's updated hook.
  5402. };
  5403. Vue.prototype.$forceUpdate = function () {
  5404. var vm = this;
  5405. if (vm._watcher) {
  5406. vm._watcher.update();
  5407. }
  5408. };
  5409. Vue.prototype.$destroy = function () {
  5410. var vm = this;
  5411. if (vm._isBeingDestroyed) {
  5412. return
  5413. }
  5414. callHook(vm, 'beforeDestroy');
  5415. vm._isBeingDestroyed = true;
  5416. // remove self from parent
  5417. var parent = vm.$parent;
  5418. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5419. remove(parent.$children, vm);
  5420. }
  5421. // teardown watchers
  5422. if (vm._watcher) {
  5423. vm._watcher.teardown();
  5424. }
  5425. var i = vm._watchers.length;
  5426. while (i--) {
  5427. vm._watchers[i].teardown();
  5428. }
  5429. // remove reference from data ob
  5430. // frozen object may not have observer.
  5431. if (vm._data.__ob__) {
  5432. vm._data.__ob__.vmCount--;
  5433. }
  5434. // call the last hook...
  5435. vm._isDestroyed = true;
  5436. // invoke destroy hooks on current rendered tree
  5437. vm.__patch__(vm._vnode, null);
  5438. // fire destroyed hook
  5439. callHook(vm, 'destroyed');
  5440. // turn off all instance listeners.
  5441. vm.$off();
  5442. // remove __vue__ reference
  5443. if (vm.$el) {
  5444. vm.$el.__vue__ = null;
  5445. }
  5446. // release circular reference (#6759)
  5447. if (vm.$vnode) {
  5448. vm.$vnode.parent = null;
  5449. }
  5450. };
  5451. }
  5452. function updateChildComponent (
  5453. vm,
  5454. propsData,
  5455. listeners,
  5456. parentVnode,
  5457. renderChildren
  5458. ) {
  5459. if (true) {
  5460. isUpdatingChildComponent = true;
  5461. }
  5462. // determine whether component has slot children
  5463. // we need to do this before overwriting $options._renderChildren.
  5464. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5465. // dynamic slot names). Static scoped slots compiled from template has the
  5466. // "$stable" marker.
  5467. var newScopedSlots = parentVnode.data.scopedSlots;
  5468. var oldScopedSlots = vm.$scopedSlots;
  5469. var hasDynamicScopedSlot = !!(
  5470. (newScopedSlots && !newScopedSlots.$stable) ||
  5471. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5472. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5473. );
  5474. // Any static slot children from the parent may have changed during parent's
  5475. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5476. // update is necessary to ensure correctness.
  5477. var needsForceUpdate = !!(
  5478. renderChildren || // has new static slots
  5479. vm.$options._renderChildren || // has old static slots
  5480. hasDynamicScopedSlot
  5481. );
  5482. vm.$options._parentVnode = parentVnode;
  5483. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5484. if (vm._vnode) { // update child tree's parent
  5485. vm._vnode.parent = parentVnode;
  5486. }
  5487. vm.$options._renderChildren = renderChildren;
  5488. // update $attrs and $listeners hash
  5489. // these are also reactive so they may trigger child update if the child
  5490. // used them during render
  5491. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5492. vm.$listeners = listeners || emptyObject;
  5493. // update props
  5494. if (propsData && vm.$options.props) {
  5495. toggleObserving(false);
  5496. var props = vm._props;
  5497. var propKeys = vm.$options._propKeys || [];
  5498. for (var i = 0; i < propKeys.length; i++) {
  5499. var key = propKeys[i];
  5500. var propOptions = vm.$options.props; // wtf flow?
  5501. props[key] = validateProp(key, propOptions, propsData, vm);
  5502. }
  5503. toggleObserving(true);
  5504. // keep a copy of raw propsData
  5505. vm.$options.propsData = propsData;
  5506. }
  5507. // fixed by xxxxxx update properties(mp runtime)
  5508. vm._$updateProperties && vm._$updateProperties(vm);
  5509. // update listeners
  5510. listeners = listeners || emptyObject;
  5511. var oldListeners = vm.$options._parentListeners;
  5512. vm.$options._parentListeners = listeners;
  5513. updateComponentListeners(vm, listeners, oldListeners);
  5514. // resolve slots + force update if has children
  5515. if (needsForceUpdate) {
  5516. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5517. vm.$forceUpdate();
  5518. }
  5519. if (true) {
  5520. isUpdatingChildComponent = false;
  5521. }
  5522. }
  5523. function isInInactiveTree (vm) {
  5524. while (vm && (vm = vm.$parent)) {
  5525. if (vm._inactive) { return true }
  5526. }
  5527. return false
  5528. }
  5529. function activateChildComponent (vm, direct) {
  5530. if (direct) {
  5531. vm._directInactive = false;
  5532. if (isInInactiveTree(vm)) {
  5533. return
  5534. }
  5535. } else if (vm._directInactive) {
  5536. return
  5537. }
  5538. if (vm._inactive || vm._inactive === null) {
  5539. vm._inactive = false;
  5540. for (var i = 0; i < vm.$children.length; i++) {
  5541. activateChildComponent(vm.$children[i]);
  5542. }
  5543. callHook(vm, 'activated');
  5544. }
  5545. }
  5546. function deactivateChildComponent (vm, direct) {
  5547. if (direct) {
  5548. vm._directInactive = true;
  5549. if (isInInactiveTree(vm)) {
  5550. return
  5551. }
  5552. }
  5553. if (!vm._inactive) {
  5554. vm._inactive = true;
  5555. for (var i = 0; i < vm.$children.length; i++) {
  5556. deactivateChildComponent(vm.$children[i]);
  5557. }
  5558. callHook(vm, 'deactivated');
  5559. }
  5560. }
  5561. function callHook (vm, hook) {
  5562. // #7573 disable dep collection when invoking lifecycle hooks
  5563. pushTarget();
  5564. var handlers = vm.$options[hook];
  5565. var info = hook + " hook";
  5566. if (handlers) {
  5567. for (var i = 0, j = handlers.length; i < j; i++) {
  5568. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5569. }
  5570. }
  5571. if (vm._hasHookEvent) {
  5572. vm.$emit('hook:' + hook);
  5573. }
  5574. popTarget();
  5575. }
  5576. /* */
  5577. var MAX_UPDATE_COUNT = 100;
  5578. var queue = [];
  5579. var activatedChildren = [];
  5580. var has = {};
  5581. var circular = {};
  5582. var waiting = false;
  5583. var flushing = false;
  5584. var index = 0;
  5585. /**
  5586. * Reset the scheduler's state.
  5587. */
  5588. function resetSchedulerState () {
  5589. index = queue.length = activatedChildren.length = 0;
  5590. has = {};
  5591. if (true) {
  5592. circular = {};
  5593. }
  5594. waiting = flushing = false;
  5595. }
  5596. // Async edge case #6566 requires saving the timestamp when event listeners are
  5597. // attached. However, calling performance.now() has a perf overhead especially
  5598. // if the page has thousands of event listeners. Instead, we take a timestamp
  5599. // every time the scheduler flushes and use that for all event listeners
  5600. // attached during that flush.
  5601. var currentFlushTimestamp = 0;
  5602. // Async edge case fix requires storing an event listener's attach timestamp.
  5603. var getNow = Date.now;
  5604. // Determine what event timestamp the browser is using. Annoyingly, the
  5605. // timestamp can either be hi-res (relative to page load) or low-res
  5606. // (relative to UNIX epoch), so in order to compare time we have to use the
  5607. // same timestamp type when saving the flush timestamp.
  5608. // All IE versions use low-res event timestamps, and have problematic clock
  5609. // implementations (#9632)
  5610. if (inBrowser && !isIE) {
  5611. var performance = window.performance;
  5612. if (
  5613. performance &&
  5614. typeof performance.now === 'function' &&
  5615. getNow() > document.createEvent('Event').timeStamp
  5616. ) {
  5617. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5618. // smaller than it, it means the event is using a hi-res timestamp,
  5619. // and we need to use the hi-res version for event listener timestamps as
  5620. // well.
  5621. getNow = function () { return performance.now(); };
  5622. }
  5623. }
  5624. /**
  5625. * Flush both queues and run the watchers.
  5626. */
  5627. function flushSchedulerQueue () {
  5628. currentFlushTimestamp = getNow();
  5629. flushing = true;
  5630. var watcher, id;
  5631. // Sort queue before flush.
  5632. // This ensures that:
  5633. // 1. Components are updated from parent to child. (because parent is always
  5634. // created before the child)
  5635. // 2. A component's user watchers are run before its render watcher (because
  5636. // user watchers are created before the render watcher)
  5637. // 3. If a component is destroyed during a parent component's watcher run,
  5638. // its watchers can be skipped.
  5639. queue.sort(function (a, b) { return a.id - b.id; });
  5640. // do not cache length because more watchers might be pushed
  5641. // as we run existing watchers
  5642. for (index = 0; index < queue.length; index++) {
  5643. watcher = queue[index];
  5644. if (watcher.before) {
  5645. watcher.before();
  5646. }
  5647. id = watcher.id;
  5648. has[id] = null;
  5649. watcher.run();
  5650. // in dev build, check and stop circular updates.
  5651. if ( true && has[id] != null) {
  5652. circular[id] = (circular[id] || 0) + 1;
  5653. if (circular[id] > MAX_UPDATE_COUNT) {
  5654. warn(
  5655. 'You may have an infinite update loop ' + (
  5656. watcher.user
  5657. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5658. : "in a component render function."
  5659. ),
  5660. watcher.vm
  5661. );
  5662. break
  5663. }
  5664. }
  5665. }
  5666. // keep copies of post queues before resetting state
  5667. var activatedQueue = activatedChildren.slice();
  5668. var updatedQueue = queue.slice();
  5669. resetSchedulerState();
  5670. // call component updated and activated hooks
  5671. callActivatedHooks(activatedQueue);
  5672. callUpdatedHooks(updatedQueue);
  5673. // devtool hook
  5674. /* istanbul ignore if */
  5675. if (devtools && config.devtools) {
  5676. devtools.emit('flush');
  5677. }
  5678. }
  5679. function callUpdatedHooks (queue) {
  5680. var i = queue.length;
  5681. while (i--) {
  5682. var watcher = queue[i];
  5683. var vm = watcher.vm;
  5684. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5685. callHook(vm, 'updated');
  5686. }
  5687. }
  5688. }
  5689. /**
  5690. * Queue a kept-alive component that was activated during patch.
  5691. * The queue will be processed after the entire tree has been patched.
  5692. */
  5693. function queueActivatedComponent (vm) {
  5694. // setting _inactive to false here so that a render function can
  5695. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5696. vm._inactive = false;
  5697. activatedChildren.push(vm);
  5698. }
  5699. function callActivatedHooks (queue) {
  5700. for (var i = 0; i < queue.length; i++) {
  5701. queue[i]._inactive = true;
  5702. activateChildComponent(queue[i], true /* true */);
  5703. }
  5704. }
  5705. /**
  5706. * Push a watcher into the watcher queue.
  5707. * Jobs with duplicate IDs will be skipped unless it's
  5708. * pushed when the queue is being flushed.
  5709. */
  5710. function queueWatcher (watcher) {
  5711. var id = watcher.id;
  5712. if (has[id] == null) {
  5713. has[id] = true;
  5714. if (!flushing) {
  5715. queue.push(watcher);
  5716. } else {
  5717. // if already flushing, splice the watcher based on its id
  5718. // if already past its id, it will be run next immediately.
  5719. var i = queue.length - 1;
  5720. while (i > index && queue[i].id > watcher.id) {
  5721. i--;
  5722. }
  5723. queue.splice(i + 1, 0, watcher);
  5724. }
  5725. // queue the flush
  5726. if (!waiting) {
  5727. waiting = true;
  5728. if ( true && !config.async) {
  5729. flushSchedulerQueue();
  5730. return
  5731. }
  5732. nextTick(flushSchedulerQueue);
  5733. }
  5734. }
  5735. }
  5736. /* */
  5737. var uid$2 = 0;
  5738. /**
  5739. * A watcher parses an expression, collects dependencies,
  5740. * and fires callback when the expression value changes.
  5741. * This is used for both the $watch() api and directives.
  5742. */
  5743. var Watcher = function Watcher (
  5744. vm,
  5745. expOrFn,
  5746. cb,
  5747. options,
  5748. isRenderWatcher
  5749. ) {
  5750. this.vm = vm;
  5751. if (isRenderWatcher) {
  5752. vm._watcher = this;
  5753. }
  5754. vm._watchers.push(this);
  5755. // options
  5756. if (options) {
  5757. this.deep = !!options.deep;
  5758. this.user = !!options.user;
  5759. this.lazy = !!options.lazy;
  5760. this.sync = !!options.sync;
  5761. this.before = options.before;
  5762. } else {
  5763. this.deep = this.user = this.lazy = this.sync = false;
  5764. }
  5765. this.cb = cb;
  5766. this.id = ++uid$2; // uid for batching
  5767. this.active = true;
  5768. this.dirty = this.lazy; // for lazy watchers
  5769. this.deps = [];
  5770. this.newDeps = [];
  5771. this.depIds = new _Set();
  5772. this.newDepIds = new _Set();
  5773. this.expression = true
  5774. ? expOrFn.toString()
  5775. : undefined;
  5776. // parse expression for getter
  5777. if (typeof expOrFn === 'function') {
  5778. this.getter = expOrFn;
  5779. } else {
  5780. this.getter = parsePath(expOrFn);
  5781. if (!this.getter) {
  5782. this.getter = noop;
  5783. true && warn(
  5784. "Failed watching path: \"" + expOrFn + "\" " +
  5785. 'Watcher only accepts simple dot-delimited paths. ' +
  5786. 'For full control, use a function instead.',
  5787. vm
  5788. );
  5789. }
  5790. }
  5791. this.value = this.lazy
  5792. ? undefined
  5793. : this.get();
  5794. };
  5795. /**
  5796. * Evaluate the getter, and re-collect dependencies.
  5797. */
  5798. Watcher.prototype.get = function get () {
  5799. pushTarget(this);
  5800. var value;
  5801. var vm = this.vm;
  5802. try {
  5803. value = this.getter.call(vm, vm);
  5804. } catch (e) {
  5805. if (this.user) {
  5806. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5807. } else {
  5808. throw e
  5809. }
  5810. } finally {
  5811. // "touch" every property so they are all tracked as
  5812. // dependencies for deep watching
  5813. if (this.deep) {
  5814. traverse(value);
  5815. }
  5816. popTarget();
  5817. this.cleanupDeps();
  5818. }
  5819. return value
  5820. };
  5821. /**
  5822. * Add a dependency to this directive.
  5823. */
  5824. Watcher.prototype.addDep = function addDep (dep) {
  5825. var id = dep.id;
  5826. if (!this.newDepIds.has(id)) {
  5827. this.newDepIds.add(id);
  5828. this.newDeps.push(dep);
  5829. if (!this.depIds.has(id)) {
  5830. dep.addSub(this);
  5831. }
  5832. }
  5833. };
  5834. /**
  5835. * Clean up for dependency collection.
  5836. */
  5837. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5838. var i = this.deps.length;
  5839. while (i--) {
  5840. var dep = this.deps[i];
  5841. if (!this.newDepIds.has(dep.id)) {
  5842. dep.removeSub(this);
  5843. }
  5844. }
  5845. var tmp = this.depIds;
  5846. this.depIds = this.newDepIds;
  5847. this.newDepIds = tmp;
  5848. this.newDepIds.clear();
  5849. tmp = this.deps;
  5850. this.deps = this.newDeps;
  5851. this.newDeps = tmp;
  5852. this.newDeps.length = 0;
  5853. };
  5854. /**
  5855. * Subscriber interface.
  5856. * Will be called when a dependency changes.
  5857. */
  5858. Watcher.prototype.update = function update () {
  5859. /* istanbul ignore else */
  5860. if (this.lazy) {
  5861. this.dirty = true;
  5862. } else if (this.sync) {
  5863. this.run();
  5864. } else {
  5865. queueWatcher(this);
  5866. }
  5867. };
  5868. /**
  5869. * Scheduler job interface.
  5870. * Will be called by the scheduler.
  5871. */
  5872. Watcher.prototype.run = function run () {
  5873. if (this.active) {
  5874. var value = this.get();
  5875. if (
  5876. value !== this.value ||
  5877. // Deep watchers and watchers on Object/Arrays should fire even
  5878. // when the value is the same, because the value may
  5879. // have mutated.
  5880. isObject(value) ||
  5881. this.deep
  5882. ) {
  5883. // set new value
  5884. var oldValue = this.value;
  5885. this.value = value;
  5886. if (this.user) {
  5887. try {
  5888. this.cb.call(this.vm, value, oldValue);
  5889. } catch (e) {
  5890. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5891. }
  5892. } else {
  5893. this.cb.call(this.vm, value, oldValue);
  5894. }
  5895. }
  5896. }
  5897. };
  5898. /**
  5899. * Evaluate the value of the watcher.
  5900. * This only gets called for lazy watchers.
  5901. */
  5902. Watcher.prototype.evaluate = function evaluate () {
  5903. this.value = this.get();
  5904. this.dirty = false;
  5905. };
  5906. /**
  5907. * Depend on all deps collected by this watcher.
  5908. */
  5909. Watcher.prototype.depend = function depend () {
  5910. var i = this.deps.length;
  5911. while (i--) {
  5912. this.deps[i].depend();
  5913. }
  5914. };
  5915. /**
  5916. * Remove self from all dependencies' subscriber list.
  5917. */
  5918. Watcher.prototype.teardown = function teardown () {
  5919. if (this.active) {
  5920. // remove self from vm's watcher list
  5921. // this is a somewhat expensive operation so we skip it
  5922. // if the vm is being destroyed.
  5923. if (!this.vm._isBeingDestroyed) {
  5924. remove(this.vm._watchers, this);
  5925. }
  5926. var i = this.deps.length;
  5927. while (i--) {
  5928. this.deps[i].removeSub(this);
  5929. }
  5930. this.active = false;
  5931. }
  5932. };
  5933. /* */
  5934. var sharedPropertyDefinition = {
  5935. enumerable: true,
  5936. configurable: true,
  5937. get: noop,
  5938. set: noop
  5939. };
  5940. function proxy (target, sourceKey, key) {
  5941. sharedPropertyDefinition.get = function proxyGetter () {
  5942. return this[sourceKey][key]
  5943. };
  5944. sharedPropertyDefinition.set = function proxySetter (val) {
  5945. this[sourceKey][key] = val;
  5946. };
  5947. Object.defineProperty(target, key, sharedPropertyDefinition);
  5948. }
  5949. function initState (vm) {
  5950. vm._watchers = [];
  5951. var opts = vm.$options;
  5952. if (opts.props) { initProps(vm, opts.props); }
  5953. if (opts.methods) { initMethods(vm, opts.methods); }
  5954. if (opts.data) {
  5955. initData(vm);
  5956. } else {
  5957. observe(vm._data = {}, true /* asRootData */);
  5958. }
  5959. if (opts.computed) { initComputed(vm, opts.computed); }
  5960. if (opts.watch && opts.watch !== nativeWatch) {
  5961. initWatch(vm, opts.watch);
  5962. }
  5963. }
  5964. function initProps (vm, propsOptions) {
  5965. var propsData = vm.$options.propsData || {};
  5966. var props = vm._props = {};
  5967. // cache prop keys so that future props updates can iterate using Array
  5968. // instead of dynamic object key enumeration.
  5969. var keys = vm.$options._propKeys = [];
  5970. var isRoot = !vm.$parent;
  5971. // root instance props should be converted
  5972. if (!isRoot) {
  5973. toggleObserving(false);
  5974. }
  5975. var loop = function ( key ) {
  5976. keys.push(key);
  5977. var value = validateProp(key, propsOptions, propsData, vm);
  5978. /* istanbul ignore else */
  5979. if (true) {
  5980. var hyphenatedKey = hyphenate(key);
  5981. if (isReservedAttribute(hyphenatedKey) ||
  5982. config.isReservedAttr(hyphenatedKey)) {
  5983. warn(
  5984. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5985. vm
  5986. );
  5987. }
  5988. defineReactive$$1(props, key, value, function () {
  5989. if (!isRoot && !isUpdatingChildComponent) {
  5990. {
  5991. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5992. return
  5993. }
  5994. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5995. if(
  5996. key === 'value' &&
  5997. Array.isArray(vm.$options.behaviors) &&
  5998. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5999. ){
  6000. return
  6001. }
  6002. if(vm._getFormData){
  6003. return
  6004. }
  6005. var $parent = vm.$parent;
  6006. while($parent){
  6007. if($parent.__next_tick_pending){
  6008. return
  6009. }
  6010. $parent = $parent.$parent;
  6011. }
  6012. }
  6013. warn(
  6014. "Avoid mutating a prop directly since the value will be " +
  6015. "overwritten whenever the parent component re-renders. " +
  6016. "Instead, use a data or computed property based on the prop's " +
  6017. "value. Prop being mutated: \"" + key + "\"",
  6018. vm
  6019. );
  6020. }
  6021. });
  6022. } else {}
  6023. // static props are already proxied on the component's prototype
  6024. // during Vue.extend(). We only need to proxy props defined at
  6025. // instantiation here.
  6026. if (!(key in vm)) {
  6027. proxy(vm, "_props", key);
  6028. }
  6029. };
  6030. for (var key in propsOptions) loop( key );
  6031. toggleObserving(true);
  6032. }
  6033. function initData (vm) {
  6034. var data = vm.$options.data;
  6035. data = vm._data = typeof data === 'function'
  6036. ? getData(data, vm)
  6037. : data || {};
  6038. if (!isPlainObject(data)) {
  6039. data = {};
  6040. true && warn(
  6041. 'data functions should return an object:\n' +
  6042. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6043. vm
  6044. );
  6045. }
  6046. // proxy data on instance
  6047. var keys = Object.keys(data);
  6048. var props = vm.$options.props;
  6049. var methods = vm.$options.methods;
  6050. var i = keys.length;
  6051. while (i--) {
  6052. var key = keys[i];
  6053. if (true) {
  6054. if (methods && hasOwn(methods, key)) {
  6055. warn(
  6056. ("Method \"" + key + "\" has already been defined as a data property."),
  6057. vm
  6058. );
  6059. }
  6060. }
  6061. if (props && hasOwn(props, key)) {
  6062. true && warn(
  6063. "The data property \"" + key + "\" is already declared as a prop. " +
  6064. "Use prop default value instead.",
  6065. vm
  6066. );
  6067. } else if (!isReserved(key)) {
  6068. proxy(vm, "_data", key);
  6069. }
  6070. }
  6071. // observe data
  6072. observe(data, true /* asRootData */);
  6073. }
  6074. function getData (data, vm) {
  6075. // #7573 disable dep collection when invoking data getters
  6076. pushTarget();
  6077. try {
  6078. return data.call(vm, vm)
  6079. } catch (e) {
  6080. handleError(e, vm, "data()");
  6081. return {}
  6082. } finally {
  6083. popTarget();
  6084. }
  6085. }
  6086. var computedWatcherOptions = { lazy: true };
  6087. function initComputed (vm, computed) {
  6088. // $flow-disable-line
  6089. var watchers = vm._computedWatchers = Object.create(null);
  6090. // computed properties are just getters during SSR
  6091. var isSSR = isServerRendering();
  6092. for (var key in computed) {
  6093. var userDef = computed[key];
  6094. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6095. if ( true && getter == null) {
  6096. warn(
  6097. ("Getter is missing for computed property \"" + key + "\"."),
  6098. vm
  6099. );
  6100. }
  6101. if (!isSSR) {
  6102. // create internal watcher for the computed property.
  6103. watchers[key] = new Watcher(
  6104. vm,
  6105. getter || noop,
  6106. noop,
  6107. computedWatcherOptions
  6108. );
  6109. }
  6110. // component-defined computed properties are already defined on the
  6111. // component prototype. We only need to define computed properties defined
  6112. // at instantiation here.
  6113. if (!(key in vm)) {
  6114. defineComputed(vm, key, userDef);
  6115. } else if (true) {
  6116. if (key in vm.$data) {
  6117. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6118. } else if (vm.$options.props && key in vm.$options.props) {
  6119. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6120. }
  6121. }
  6122. }
  6123. }
  6124. function defineComputed (
  6125. target,
  6126. key,
  6127. userDef
  6128. ) {
  6129. var shouldCache = !isServerRendering();
  6130. if (typeof userDef === 'function') {
  6131. sharedPropertyDefinition.get = shouldCache
  6132. ? createComputedGetter(key)
  6133. : createGetterInvoker(userDef);
  6134. sharedPropertyDefinition.set = noop;
  6135. } else {
  6136. sharedPropertyDefinition.get = userDef.get
  6137. ? shouldCache && userDef.cache !== false
  6138. ? createComputedGetter(key)
  6139. : createGetterInvoker(userDef.get)
  6140. : noop;
  6141. sharedPropertyDefinition.set = userDef.set || noop;
  6142. }
  6143. if ( true &&
  6144. sharedPropertyDefinition.set === noop) {
  6145. sharedPropertyDefinition.set = function () {
  6146. warn(
  6147. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6148. this
  6149. );
  6150. };
  6151. }
  6152. Object.defineProperty(target, key, sharedPropertyDefinition);
  6153. }
  6154. function createComputedGetter (key) {
  6155. return function computedGetter () {
  6156. var watcher = this._computedWatchers && this._computedWatchers[key];
  6157. if (watcher) {
  6158. if (watcher.dirty) {
  6159. watcher.evaluate();
  6160. }
  6161. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6162. watcher.depend();
  6163. }
  6164. return watcher.value
  6165. }
  6166. }
  6167. }
  6168. function createGetterInvoker(fn) {
  6169. return function computedGetter () {
  6170. return fn.call(this, this)
  6171. }
  6172. }
  6173. function initMethods (vm, methods) {
  6174. var props = vm.$options.props;
  6175. for (var key in methods) {
  6176. if (true) {
  6177. if (typeof methods[key] !== 'function') {
  6178. warn(
  6179. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6180. "Did you reference the function correctly?",
  6181. vm
  6182. );
  6183. }
  6184. if (props && hasOwn(props, key)) {
  6185. warn(
  6186. ("Method \"" + key + "\" has already been defined as a prop."),
  6187. vm
  6188. );
  6189. }
  6190. if ((key in vm) && isReserved(key)) {
  6191. warn(
  6192. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6193. "Avoid defining component methods that start with _ or $."
  6194. );
  6195. }
  6196. }
  6197. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6198. }
  6199. }
  6200. function initWatch (vm, watch) {
  6201. for (var key in watch) {
  6202. var handler = watch[key];
  6203. if (Array.isArray(handler)) {
  6204. for (var i = 0; i < handler.length; i++) {
  6205. createWatcher(vm, key, handler[i]);
  6206. }
  6207. } else {
  6208. createWatcher(vm, key, handler);
  6209. }
  6210. }
  6211. }
  6212. function createWatcher (
  6213. vm,
  6214. expOrFn,
  6215. handler,
  6216. options
  6217. ) {
  6218. if (isPlainObject(handler)) {
  6219. options = handler;
  6220. handler = handler.handler;
  6221. }
  6222. if (typeof handler === 'string') {
  6223. handler = vm[handler];
  6224. }
  6225. return vm.$watch(expOrFn, handler, options)
  6226. }
  6227. function stateMixin (Vue) {
  6228. // flow somehow has problems with directly declared definition object
  6229. // when using Object.defineProperty, so we have to procedurally build up
  6230. // the object here.
  6231. var dataDef = {};
  6232. dataDef.get = function () { return this._data };
  6233. var propsDef = {};
  6234. propsDef.get = function () { return this._props };
  6235. if (true) {
  6236. dataDef.set = function () {
  6237. warn(
  6238. 'Avoid replacing instance root $data. ' +
  6239. 'Use nested data properties instead.',
  6240. this
  6241. );
  6242. };
  6243. propsDef.set = function () {
  6244. warn("$props is readonly.", this);
  6245. };
  6246. }
  6247. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6248. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6249. Vue.prototype.$set = set;
  6250. Vue.prototype.$delete = del;
  6251. Vue.prototype.$watch = function (
  6252. expOrFn,
  6253. cb,
  6254. options
  6255. ) {
  6256. var vm = this;
  6257. if (isPlainObject(cb)) {
  6258. return createWatcher(vm, expOrFn, cb, options)
  6259. }
  6260. options = options || {};
  6261. options.user = true;
  6262. var watcher = new Watcher(vm, expOrFn, cb, options);
  6263. if (options.immediate) {
  6264. try {
  6265. cb.call(vm, watcher.value);
  6266. } catch (error) {
  6267. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6268. }
  6269. }
  6270. return function unwatchFn () {
  6271. watcher.teardown();
  6272. }
  6273. };
  6274. }
  6275. /* */
  6276. var uid$3 = 0;
  6277. function initMixin (Vue) {
  6278. Vue.prototype._init = function (options) {
  6279. var vm = this;
  6280. // a uid
  6281. vm._uid = uid$3++;
  6282. var startTag, endTag;
  6283. /* istanbul ignore if */
  6284. if ( true && config.performance && mark) {
  6285. startTag = "vue-perf-start:" + (vm._uid);
  6286. endTag = "vue-perf-end:" + (vm._uid);
  6287. mark(startTag);
  6288. }
  6289. // a flag to avoid this being observed
  6290. vm._isVue = true;
  6291. // merge options
  6292. if (options && options._isComponent) {
  6293. // optimize internal component instantiation
  6294. // since dynamic options merging is pretty slow, and none of the
  6295. // internal component options needs special treatment.
  6296. initInternalComponent(vm, options);
  6297. } else {
  6298. vm.$options = mergeOptions(
  6299. resolveConstructorOptions(vm.constructor),
  6300. options || {},
  6301. vm
  6302. );
  6303. }
  6304. /* istanbul ignore else */
  6305. if (true) {
  6306. initProxy(vm);
  6307. } else {}
  6308. // expose real self
  6309. vm._self = vm;
  6310. initLifecycle(vm);
  6311. initEvents(vm);
  6312. initRender(vm);
  6313. callHook(vm, 'beforeCreate');
  6314. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6315. initState(vm);
  6316. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6317. !vm._$fallback && callHook(vm, 'created');
  6318. /* istanbul ignore if */
  6319. if ( true && config.performance && mark) {
  6320. vm._name = formatComponentName(vm, false);
  6321. mark(endTag);
  6322. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6323. }
  6324. if (vm.$options.el) {
  6325. vm.$mount(vm.$options.el);
  6326. }
  6327. };
  6328. }
  6329. function initInternalComponent (vm, options) {
  6330. var opts = vm.$options = Object.create(vm.constructor.options);
  6331. // doing this because it's faster than dynamic enumeration.
  6332. var parentVnode = options._parentVnode;
  6333. opts.parent = options.parent;
  6334. opts._parentVnode = parentVnode;
  6335. var vnodeComponentOptions = parentVnode.componentOptions;
  6336. opts.propsData = vnodeComponentOptions.propsData;
  6337. opts._parentListeners = vnodeComponentOptions.listeners;
  6338. opts._renderChildren = vnodeComponentOptions.children;
  6339. opts._componentTag = vnodeComponentOptions.tag;
  6340. if (options.render) {
  6341. opts.render = options.render;
  6342. opts.staticRenderFns = options.staticRenderFns;
  6343. }
  6344. }
  6345. function resolveConstructorOptions (Ctor) {
  6346. var options = Ctor.options;
  6347. if (Ctor.super) {
  6348. var superOptions = resolveConstructorOptions(Ctor.super);
  6349. var cachedSuperOptions = Ctor.superOptions;
  6350. if (superOptions !== cachedSuperOptions) {
  6351. // super option changed,
  6352. // need to resolve new options.
  6353. Ctor.superOptions = superOptions;
  6354. // check if there are any late-modified/attached options (#4976)
  6355. var modifiedOptions = resolveModifiedOptions(Ctor);
  6356. // update base extend options
  6357. if (modifiedOptions) {
  6358. extend(Ctor.extendOptions, modifiedOptions);
  6359. }
  6360. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6361. if (options.name) {
  6362. options.components[options.name] = Ctor;
  6363. }
  6364. }
  6365. }
  6366. return options
  6367. }
  6368. function resolveModifiedOptions (Ctor) {
  6369. var modified;
  6370. var latest = Ctor.options;
  6371. var sealed = Ctor.sealedOptions;
  6372. for (var key in latest) {
  6373. if (latest[key] !== sealed[key]) {
  6374. if (!modified) { modified = {}; }
  6375. modified[key] = latest[key];
  6376. }
  6377. }
  6378. return modified
  6379. }
  6380. function Vue (options) {
  6381. if ( true &&
  6382. !(this instanceof Vue)
  6383. ) {
  6384. warn('Vue is a constructor and should be called with the `new` keyword');
  6385. }
  6386. this._init(options);
  6387. }
  6388. initMixin(Vue);
  6389. stateMixin(Vue);
  6390. eventsMixin(Vue);
  6391. lifecycleMixin(Vue);
  6392. renderMixin(Vue);
  6393. /* */
  6394. function initUse (Vue) {
  6395. Vue.use = function (plugin) {
  6396. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6397. if (installedPlugins.indexOf(plugin) > -1) {
  6398. return this
  6399. }
  6400. // additional parameters
  6401. var args = toArray(arguments, 1);
  6402. args.unshift(this);
  6403. if (typeof plugin.install === 'function') {
  6404. plugin.install.apply(plugin, args);
  6405. } else if (typeof plugin === 'function') {
  6406. plugin.apply(null, args);
  6407. }
  6408. installedPlugins.push(plugin);
  6409. return this
  6410. };
  6411. }
  6412. /* */
  6413. function initMixin$1 (Vue) {
  6414. Vue.mixin = function (mixin) {
  6415. this.options = mergeOptions(this.options, mixin);
  6416. return this
  6417. };
  6418. }
  6419. /* */
  6420. function initExtend (Vue) {
  6421. /**
  6422. * Each instance constructor, including Vue, has a unique
  6423. * cid. This enables us to create wrapped "child
  6424. * constructors" for prototypal inheritance and cache them.
  6425. */
  6426. Vue.cid = 0;
  6427. var cid = 1;
  6428. /**
  6429. * Class inheritance
  6430. */
  6431. Vue.extend = function (extendOptions) {
  6432. extendOptions = extendOptions || {};
  6433. var Super = this;
  6434. var SuperId = Super.cid;
  6435. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6436. if (cachedCtors[SuperId]) {
  6437. return cachedCtors[SuperId]
  6438. }
  6439. var name = extendOptions.name || Super.options.name;
  6440. if ( true && name) {
  6441. validateComponentName(name);
  6442. }
  6443. var Sub = function VueComponent (options) {
  6444. this._init(options);
  6445. };
  6446. Sub.prototype = Object.create(Super.prototype);
  6447. Sub.prototype.constructor = Sub;
  6448. Sub.cid = cid++;
  6449. Sub.options = mergeOptions(
  6450. Super.options,
  6451. extendOptions
  6452. );
  6453. Sub['super'] = Super;
  6454. // For props and computed properties, we define the proxy getters on
  6455. // the Vue instances at extension time, on the extended prototype. This
  6456. // avoids Object.defineProperty calls for each instance created.
  6457. if (Sub.options.props) {
  6458. initProps$1(Sub);
  6459. }
  6460. if (Sub.options.computed) {
  6461. initComputed$1(Sub);
  6462. }
  6463. // allow further extension/mixin/plugin usage
  6464. Sub.extend = Super.extend;
  6465. Sub.mixin = Super.mixin;
  6466. Sub.use = Super.use;
  6467. // create asset registers, so extended classes
  6468. // can have their private assets too.
  6469. ASSET_TYPES.forEach(function (type) {
  6470. Sub[type] = Super[type];
  6471. });
  6472. // enable recursive self-lookup
  6473. if (name) {
  6474. Sub.options.components[name] = Sub;
  6475. }
  6476. // keep a reference to the super options at extension time.
  6477. // later at instantiation we can check if Super's options have
  6478. // been updated.
  6479. Sub.superOptions = Super.options;
  6480. Sub.extendOptions = extendOptions;
  6481. Sub.sealedOptions = extend({}, Sub.options);
  6482. // cache constructor
  6483. cachedCtors[SuperId] = Sub;
  6484. return Sub
  6485. };
  6486. }
  6487. function initProps$1 (Comp) {
  6488. var props = Comp.options.props;
  6489. for (var key in props) {
  6490. proxy(Comp.prototype, "_props", key);
  6491. }
  6492. }
  6493. function initComputed$1 (Comp) {
  6494. var computed = Comp.options.computed;
  6495. for (var key in computed) {
  6496. defineComputed(Comp.prototype, key, computed[key]);
  6497. }
  6498. }
  6499. /* */
  6500. function initAssetRegisters (Vue) {
  6501. /**
  6502. * Create asset registration methods.
  6503. */
  6504. ASSET_TYPES.forEach(function (type) {
  6505. Vue[type] = function (
  6506. id,
  6507. definition
  6508. ) {
  6509. if (!definition) {
  6510. return this.options[type + 's'][id]
  6511. } else {
  6512. /* istanbul ignore if */
  6513. if ( true && type === 'component') {
  6514. validateComponentName(id);
  6515. }
  6516. if (type === 'component' && isPlainObject(definition)) {
  6517. definition.name = definition.name || id;
  6518. definition = this.options._base.extend(definition);
  6519. }
  6520. if (type === 'directive' && typeof definition === 'function') {
  6521. definition = { bind: definition, update: definition };
  6522. }
  6523. this.options[type + 's'][id] = definition;
  6524. return definition
  6525. }
  6526. };
  6527. });
  6528. }
  6529. /* */
  6530. function getComponentName (opts) {
  6531. return opts && (opts.Ctor.options.name || opts.tag)
  6532. }
  6533. function matches (pattern, name) {
  6534. if (Array.isArray(pattern)) {
  6535. return pattern.indexOf(name) > -1
  6536. } else if (typeof pattern === 'string') {
  6537. return pattern.split(',').indexOf(name) > -1
  6538. } else if (isRegExp(pattern)) {
  6539. return pattern.test(name)
  6540. }
  6541. /* istanbul ignore next */
  6542. return false
  6543. }
  6544. function pruneCache (keepAliveInstance, filter) {
  6545. var cache = keepAliveInstance.cache;
  6546. var keys = keepAliveInstance.keys;
  6547. var _vnode = keepAliveInstance._vnode;
  6548. for (var key in cache) {
  6549. var cachedNode = cache[key];
  6550. if (cachedNode) {
  6551. var name = getComponentName(cachedNode.componentOptions);
  6552. if (name && !filter(name)) {
  6553. pruneCacheEntry(cache, key, keys, _vnode);
  6554. }
  6555. }
  6556. }
  6557. }
  6558. function pruneCacheEntry (
  6559. cache,
  6560. key,
  6561. keys,
  6562. current
  6563. ) {
  6564. var cached$$1 = cache[key];
  6565. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6566. cached$$1.componentInstance.$destroy();
  6567. }
  6568. cache[key] = null;
  6569. remove(keys, key);
  6570. }
  6571. var patternTypes = [String, RegExp, Array];
  6572. var KeepAlive = {
  6573. name: 'keep-alive',
  6574. abstract: true,
  6575. props: {
  6576. include: patternTypes,
  6577. exclude: patternTypes,
  6578. max: [String, Number]
  6579. },
  6580. created: function created () {
  6581. this.cache = Object.create(null);
  6582. this.keys = [];
  6583. },
  6584. destroyed: function destroyed () {
  6585. for (var key in this.cache) {
  6586. pruneCacheEntry(this.cache, key, this.keys);
  6587. }
  6588. },
  6589. mounted: function mounted () {
  6590. var this$1 = this;
  6591. this.$watch('include', function (val) {
  6592. pruneCache(this$1, function (name) { return matches(val, name); });
  6593. });
  6594. this.$watch('exclude', function (val) {
  6595. pruneCache(this$1, function (name) { return !matches(val, name); });
  6596. });
  6597. },
  6598. render: function render () {
  6599. var slot = this.$slots.default;
  6600. var vnode = getFirstComponentChild(slot);
  6601. var componentOptions = vnode && vnode.componentOptions;
  6602. if (componentOptions) {
  6603. // check pattern
  6604. var name = getComponentName(componentOptions);
  6605. var ref = this;
  6606. var include = ref.include;
  6607. var exclude = ref.exclude;
  6608. if (
  6609. // not included
  6610. (include && (!name || !matches(include, name))) ||
  6611. // excluded
  6612. (exclude && name && matches(exclude, name))
  6613. ) {
  6614. return vnode
  6615. }
  6616. var ref$1 = this;
  6617. var cache = ref$1.cache;
  6618. var keys = ref$1.keys;
  6619. var key = vnode.key == null
  6620. // same constructor may get registered as different local components
  6621. // so cid alone is not enough (#3269)
  6622. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6623. : vnode.key;
  6624. if (cache[key]) {
  6625. vnode.componentInstance = cache[key].componentInstance;
  6626. // make current key freshest
  6627. remove(keys, key);
  6628. keys.push(key);
  6629. } else {
  6630. cache[key] = vnode;
  6631. keys.push(key);
  6632. // prune oldest entry
  6633. if (this.max && keys.length > parseInt(this.max)) {
  6634. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6635. }
  6636. }
  6637. vnode.data.keepAlive = true;
  6638. }
  6639. return vnode || (slot && slot[0])
  6640. }
  6641. };
  6642. var builtInComponents = {
  6643. KeepAlive: KeepAlive
  6644. };
  6645. /* */
  6646. function initGlobalAPI (Vue) {
  6647. // config
  6648. var configDef = {};
  6649. configDef.get = function () { return config; };
  6650. if (true) {
  6651. configDef.set = function () {
  6652. warn(
  6653. 'Do not replace the Vue.config object, set individual fields instead.'
  6654. );
  6655. };
  6656. }
  6657. Object.defineProperty(Vue, 'config', configDef);
  6658. // exposed util methods.
  6659. // NOTE: these are not considered part of the public API - avoid relying on
  6660. // them unless you are aware of the risk.
  6661. Vue.util = {
  6662. warn: warn,
  6663. extend: extend,
  6664. mergeOptions: mergeOptions,
  6665. defineReactive: defineReactive$$1
  6666. };
  6667. Vue.set = set;
  6668. Vue.delete = del;
  6669. Vue.nextTick = nextTick;
  6670. // 2.6 explicit observable API
  6671. Vue.observable = function (obj) {
  6672. observe(obj);
  6673. return obj
  6674. };
  6675. Vue.options = Object.create(null);
  6676. ASSET_TYPES.forEach(function (type) {
  6677. Vue.options[type + 's'] = Object.create(null);
  6678. });
  6679. // this is used to identify the "base" constructor to extend all plain-object
  6680. // components with in Weex's multi-instance scenarios.
  6681. Vue.options._base = Vue;
  6682. extend(Vue.options.components, builtInComponents);
  6683. initUse(Vue);
  6684. initMixin$1(Vue);
  6685. initExtend(Vue);
  6686. initAssetRegisters(Vue);
  6687. }
  6688. initGlobalAPI(Vue);
  6689. Object.defineProperty(Vue.prototype, '$isServer', {
  6690. get: isServerRendering
  6691. });
  6692. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6693. get: function get () {
  6694. /* istanbul ignore next */
  6695. return this.$vnode && this.$vnode.ssrContext
  6696. }
  6697. });
  6698. // expose FunctionalRenderContext for ssr runtime helper installation
  6699. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6700. value: FunctionalRenderContext
  6701. });
  6702. Vue.version = '2.6.11';
  6703. /**
  6704. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6705. */
  6706. var ARRAYTYPE = '[object Array]';
  6707. var OBJECTTYPE = '[object Object]';
  6708. // const FUNCTIONTYPE = '[object Function]'
  6709. function diff(current, pre) {
  6710. var result = {};
  6711. syncKeys(current, pre);
  6712. _diff(current, pre, '', result);
  6713. return result
  6714. }
  6715. function syncKeys(current, pre) {
  6716. if (current === pre) { return }
  6717. var rootCurrentType = type(current);
  6718. var rootPreType = type(pre);
  6719. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6720. if(Object.keys(current).length >= Object.keys(pre).length){
  6721. for (var key in pre) {
  6722. var currentValue = current[key];
  6723. if (currentValue === undefined) {
  6724. current[key] = null;
  6725. } else {
  6726. syncKeys(currentValue, pre[key]);
  6727. }
  6728. }
  6729. }
  6730. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6731. if (current.length >= pre.length) {
  6732. pre.forEach(function (item, index) {
  6733. syncKeys(current[index], item);
  6734. });
  6735. }
  6736. }
  6737. }
  6738. function _diff(current, pre, path, result) {
  6739. if (current === pre) { return }
  6740. var rootCurrentType = type(current);
  6741. var rootPreType = type(pre);
  6742. if (rootCurrentType == OBJECTTYPE) {
  6743. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6744. setResult(result, path, current);
  6745. } else {
  6746. var loop = function ( key ) {
  6747. var currentValue = current[key];
  6748. var preValue = pre[key];
  6749. var currentType = type(currentValue);
  6750. var preType = type(preValue);
  6751. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6752. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  6753. if (currentValue !== pre[key]) {
  6754. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6755. }
  6756. } else if (currentType == ARRAYTYPE) {
  6757. if (preType != ARRAYTYPE) {
  6758. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6759. } else {
  6760. if (currentValue.length < preValue.length) {
  6761. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6762. } else {
  6763. currentValue.forEach(function (item, index) {
  6764. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6765. });
  6766. }
  6767. }
  6768. } else if (currentType == OBJECTTYPE) {
  6769. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6770. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6771. } else {
  6772. for (var subKey in currentValue) {
  6773. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6774. }
  6775. }
  6776. }
  6777. };
  6778. for (var key in current) loop( key );
  6779. }
  6780. } else if (rootCurrentType == ARRAYTYPE) {
  6781. if (rootPreType != ARRAYTYPE) {
  6782. setResult(result, path, current);
  6783. } else {
  6784. if (current.length < pre.length) {
  6785. setResult(result, path, current);
  6786. } else {
  6787. current.forEach(function (item, index) {
  6788. _diff(item, pre[index], path + '[' + index + ']', result);
  6789. });
  6790. }
  6791. }
  6792. } else {
  6793. setResult(result, path, current);
  6794. }
  6795. }
  6796. function setResult(result, k, v) {
  6797. // if (type(v) != FUNCTIONTYPE) {
  6798. result[k] = v;
  6799. // }
  6800. }
  6801. function type(obj) {
  6802. return Object.prototype.toString.call(obj)
  6803. }
  6804. /* */
  6805. function flushCallbacks$1(vm) {
  6806. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6807. if (Object({"VUE_APP_NAME":"基础项目","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6808. var mpInstance = vm.$scope;
  6809. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6810. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6811. }
  6812. var copies = vm.__next_tick_callbacks.slice(0);
  6813. vm.__next_tick_callbacks.length = 0;
  6814. for (var i = 0; i < copies.length; i++) {
  6815. copies[i]();
  6816. }
  6817. }
  6818. }
  6819. function hasRenderWatcher(vm) {
  6820. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6821. }
  6822. function nextTick$1(vm, cb) {
  6823. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6824. //2.nextTick 之前存在 render watcher
  6825. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6826. if(Object({"VUE_APP_NAME":"基础项目","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6827. var mpInstance = vm.$scope;
  6828. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6829. ']:nextVueTick');
  6830. }
  6831. return nextTick(cb, vm)
  6832. }else{
  6833. if(Object({"VUE_APP_NAME":"基础项目","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6834. var mpInstance$1 = vm.$scope;
  6835. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6836. ']:nextMPTick');
  6837. }
  6838. }
  6839. var _resolve;
  6840. if (!vm.__next_tick_callbacks) {
  6841. vm.__next_tick_callbacks = [];
  6842. }
  6843. vm.__next_tick_callbacks.push(function () {
  6844. if (cb) {
  6845. try {
  6846. cb.call(vm);
  6847. } catch (e) {
  6848. handleError(e, vm, 'nextTick');
  6849. }
  6850. } else if (_resolve) {
  6851. _resolve(vm);
  6852. }
  6853. });
  6854. // $flow-disable-line
  6855. if (!cb && typeof Promise !== 'undefined') {
  6856. return new Promise(function (resolve) {
  6857. _resolve = resolve;
  6858. })
  6859. }
  6860. }
  6861. /* */
  6862. function cloneWithData(vm) {
  6863. // 确保当前 vm 所有数据被同步
  6864. var ret = Object.create(null);
  6865. var dataKeys = [].concat(
  6866. Object.keys(vm._data || {}),
  6867. Object.keys(vm._computedWatchers || {}));
  6868. dataKeys.reduce(function(ret, key) {
  6869. ret[key] = vm[key];
  6870. return ret
  6871. }, ret);
  6872. // vue-composition-api
  6873. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6874. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6875. if (rawBindings) {
  6876. Object.keys(rawBindings).forEach(function (key) {
  6877. ret[key] = vm[key];
  6878. });
  6879. }
  6880. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6881. Object.assign(ret, vm.$mp.data || {});
  6882. if (
  6883. Array.isArray(vm.$options.behaviors) &&
  6884. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6885. ) { //form-field
  6886. ret['name'] = vm.name;
  6887. ret['value'] = vm.value;
  6888. }
  6889. return JSON.parse(JSON.stringify(ret))
  6890. }
  6891. var patch = function(oldVnode, vnode) {
  6892. var this$1 = this;
  6893. if (vnode === null) { //destroy
  6894. return
  6895. }
  6896. if (this.mpType === 'page' || this.mpType === 'component') {
  6897. var mpInstance = this.$scope;
  6898. var data = Object.create(null);
  6899. try {
  6900. data = cloneWithData(this);
  6901. } catch (err) {
  6902. console.error(err);
  6903. }
  6904. data.__webviewId__ = mpInstance.data.__webviewId__;
  6905. var mpData = Object.create(null);
  6906. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6907. mpData[key] = mpInstance.data[key];
  6908. });
  6909. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6910. if (Object.keys(diffData).length) {
  6911. if (Object({"VUE_APP_NAME":"基础项目","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6912. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6913. ']差量更新',
  6914. JSON.stringify(diffData));
  6915. }
  6916. this.__next_tick_pending = true;
  6917. mpInstance.setData(diffData, function () {
  6918. this$1.__next_tick_pending = false;
  6919. flushCallbacks$1(this$1);
  6920. });
  6921. } else {
  6922. flushCallbacks$1(this);
  6923. }
  6924. }
  6925. };
  6926. /* */
  6927. function createEmptyRender() {
  6928. }
  6929. function mountComponent$1(
  6930. vm,
  6931. el,
  6932. hydrating
  6933. ) {
  6934. if (!vm.mpType) {//main.js 中的 new Vue
  6935. return vm
  6936. }
  6937. if (vm.mpType === 'app') {
  6938. vm.$options.render = createEmptyRender;
  6939. }
  6940. if (!vm.$options.render) {
  6941. vm.$options.render = createEmptyRender;
  6942. if (true) {
  6943. /* istanbul ignore if */
  6944. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6945. vm.$options.el || el) {
  6946. warn(
  6947. 'You are using the runtime-only build of Vue where the template ' +
  6948. 'compiler is not available. Either pre-compile the templates into ' +
  6949. 'render functions, or use the compiler-included build.',
  6950. vm
  6951. );
  6952. } else {
  6953. warn(
  6954. 'Failed to mount component: template or render function not defined.',
  6955. vm
  6956. );
  6957. }
  6958. }
  6959. }
  6960. !vm._$fallback && callHook(vm, 'beforeMount');
  6961. var updateComponent = function () {
  6962. vm._update(vm._render(), hydrating);
  6963. };
  6964. // we set this to vm._watcher inside the watcher's constructor
  6965. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6966. // component's mounted hook), which relies on vm._watcher being already defined
  6967. new Watcher(vm, updateComponent, noop, {
  6968. before: function before() {
  6969. if (vm._isMounted && !vm._isDestroyed) {
  6970. callHook(vm, 'beforeUpdate');
  6971. }
  6972. }
  6973. }, true /* isRenderWatcher */);
  6974. hydrating = false;
  6975. return vm
  6976. }
  6977. /* */
  6978. function renderClass (
  6979. staticClass,
  6980. dynamicClass
  6981. ) {
  6982. if (isDef(staticClass) || isDef(dynamicClass)) {
  6983. return concat(staticClass, stringifyClass(dynamicClass))
  6984. }
  6985. /* istanbul ignore next */
  6986. return ''
  6987. }
  6988. function concat (a, b) {
  6989. return a ? b ? (a + ' ' + b) : a : (b || '')
  6990. }
  6991. function stringifyClass (value) {
  6992. if (Array.isArray(value)) {
  6993. return stringifyArray(value)
  6994. }
  6995. if (isObject(value)) {
  6996. return stringifyObject(value)
  6997. }
  6998. if (typeof value === 'string') {
  6999. return value
  7000. }
  7001. /* istanbul ignore next */
  7002. return ''
  7003. }
  7004. function stringifyArray (value) {
  7005. var res = '';
  7006. var stringified;
  7007. for (var i = 0, l = value.length; i < l; i++) {
  7008. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  7009. if (res) { res += ' '; }
  7010. res += stringified;
  7011. }
  7012. }
  7013. return res
  7014. }
  7015. function stringifyObject (value) {
  7016. var res = '';
  7017. for (var key in value) {
  7018. if (value[key]) {
  7019. if (res) { res += ' '; }
  7020. res += key;
  7021. }
  7022. }
  7023. return res
  7024. }
  7025. /* */
  7026. var parseStyleText = cached(function (cssText) {
  7027. var res = {};
  7028. var listDelimiter = /;(?![^(]*\))/g;
  7029. var propertyDelimiter = /:(.+)/;
  7030. cssText.split(listDelimiter).forEach(function (item) {
  7031. if (item) {
  7032. var tmp = item.split(propertyDelimiter);
  7033. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7034. }
  7035. });
  7036. return res
  7037. });
  7038. // normalize possible array / string values into Object
  7039. function normalizeStyleBinding (bindingStyle) {
  7040. if (Array.isArray(bindingStyle)) {
  7041. return toObject(bindingStyle)
  7042. }
  7043. if (typeof bindingStyle === 'string') {
  7044. return parseStyleText(bindingStyle)
  7045. }
  7046. return bindingStyle
  7047. }
  7048. /* */
  7049. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7050. function getTarget(obj, path) {
  7051. var parts = path.split('.');
  7052. var key = parts[0];
  7053. if (key.indexOf('__$n') === 0) { //number index
  7054. key = parseInt(key.replace('__$n', ''));
  7055. }
  7056. if (parts.length === 1) {
  7057. return obj[key]
  7058. }
  7059. return getTarget(obj[key], parts.slice(1).join('.'))
  7060. }
  7061. function internalMixin(Vue) {
  7062. Vue.config.errorHandler = function(err, vm, info) {
  7063. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7064. console.error(err);
  7065. /* eslint-disable no-undef */
  7066. var app = typeof getApp === 'function' && getApp();
  7067. if (app && app.onError) {
  7068. app.onError(err);
  7069. }
  7070. };
  7071. var oldEmit = Vue.prototype.$emit;
  7072. Vue.prototype.$emit = function(event) {
  7073. if (this.$scope && event) {
  7074. this.$scope['triggerEvent'](event, {
  7075. __args__: toArray(arguments, 1)
  7076. });
  7077. }
  7078. return oldEmit.apply(this, arguments)
  7079. };
  7080. Vue.prototype.$nextTick = function(fn) {
  7081. return nextTick$1(this, fn)
  7082. };
  7083. MP_METHODS.forEach(function (method) {
  7084. Vue.prototype[method] = function(args) {
  7085. if (this.$scope && this.$scope[method]) {
  7086. return this.$scope[method](args)
  7087. }
  7088. // mp-alipay
  7089. if (typeof my === 'undefined') {
  7090. return
  7091. }
  7092. if (method === 'createSelectorQuery') {
  7093. /* eslint-disable no-undef */
  7094. return my.createSelectorQuery(args)
  7095. } else if (method === 'createIntersectionObserver') {
  7096. /* eslint-disable no-undef */
  7097. return my.createIntersectionObserver(args)
  7098. }
  7099. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7100. };
  7101. });
  7102. Vue.prototype.__init_provide = initProvide;
  7103. Vue.prototype.__init_injections = initInjections;
  7104. Vue.prototype.__call_hook = function(hook, args) {
  7105. var vm = this;
  7106. // #7573 disable dep collection when invoking lifecycle hooks
  7107. pushTarget();
  7108. var handlers = vm.$options[hook];
  7109. var info = hook + " hook";
  7110. var ret;
  7111. if (handlers) {
  7112. for (var i = 0, j = handlers.length; i < j; i++) {
  7113. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7114. }
  7115. }
  7116. if (vm._hasHookEvent) {
  7117. vm.$emit('hook:' + hook, args);
  7118. }
  7119. popTarget();
  7120. return ret
  7121. };
  7122. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7123. if (Array.isArray(modifiers)) {
  7124. if (modifiers.indexOf('trim') !== -1) {
  7125. value = value.trim();
  7126. }
  7127. if (modifiers.indexOf('number') !== -1) {
  7128. value = this._n(value);
  7129. }
  7130. }
  7131. if (!target) {
  7132. target = this;
  7133. }
  7134. target[key] = value;
  7135. };
  7136. Vue.prototype.__set_sync = function(target, key, value) {
  7137. if (!target) {
  7138. target = this;
  7139. }
  7140. target[key] = value;
  7141. };
  7142. Vue.prototype.__get_orig = function(item) {
  7143. if (isPlainObject(item)) {
  7144. return item['$orig'] || item
  7145. }
  7146. return item
  7147. };
  7148. Vue.prototype.__get_value = function(dataPath, target) {
  7149. return getTarget(target || this, dataPath)
  7150. };
  7151. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7152. return renderClass(staticClass, dynamicClass)
  7153. };
  7154. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7155. if (!dynamicStyle && !staticStyle) {
  7156. return ''
  7157. }
  7158. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7159. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7160. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7161. };
  7162. Vue.prototype.__map = function(val, iteratee) {
  7163. //TODO 暂不考虑 string
  7164. var ret, i, l, keys, key;
  7165. if (Array.isArray(val)) {
  7166. ret = new Array(val.length);
  7167. for (i = 0, l = val.length; i < l; i++) {
  7168. ret[i] = iteratee(val[i], i);
  7169. }
  7170. return ret
  7171. } else if (isObject(val)) {
  7172. keys = Object.keys(val);
  7173. ret = Object.create(null);
  7174. for (i = 0, l = keys.length; i < l; i++) {
  7175. key = keys[i];
  7176. ret[key] = iteratee(val[key], key, i);
  7177. }
  7178. return ret
  7179. } else if (typeof val === 'number') {
  7180. ret = new Array(val);
  7181. for (i = 0, l = val; i < l; i++) {
  7182. // 第一个参数暂时仍和小程序一致
  7183. ret[i] = iteratee(i, i);
  7184. }
  7185. return ret
  7186. }
  7187. return []
  7188. };
  7189. }
  7190. /* */
  7191. var LIFECYCLE_HOOKS$1 = [
  7192. //App
  7193. 'onLaunch',
  7194. 'onShow',
  7195. 'onHide',
  7196. 'onUniNViewMessage',
  7197. 'onPageNotFound',
  7198. 'onThemeChange',
  7199. 'onError',
  7200. 'onUnhandledRejection',
  7201. //Page
  7202. 'onInit',
  7203. 'onLoad',
  7204. // 'onShow',
  7205. 'onReady',
  7206. // 'onHide',
  7207. 'onUnload',
  7208. 'onPullDownRefresh',
  7209. 'onReachBottom',
  7210. 'onTabItemTap',
  7211. 'onAddToFavorites',
  7212. 'onShareTimeline',
  7213. 'onShareAppMessage',
  7214. 'onResize',
  7215. 'onPageScroll',
  7216. 'onNavigationBarButtonTap',
  7217. 'onBackPress',
  7218. 'onNavigationBarSearchInputChanged',
  7219. 'onNavigationBarSearchInputConfirmed',
  7220. 'onNavigationBarSearchInputClicked',
  7221. //Component
  7222. // 'onReady', // 兼容旧版本,应该移除该事件
  7223. 'onPageShow',
  7224. 'onPageHide',
  7225. 'onPageResize'
  7226. ];
  7227. function lifecycleMixin$1(Vue) {
  7228. //fixed vue-class-component
  7229. var oldExtend = Vue.extend;
  7230. Vue.extend = function(extendOptions) {
  7231. extendOptions = extendOptions || {};
  7232. var methods = extendOptions.methods;
  7233. if (methods) {
  7234. Object.keys(methods).forEach(function (methodName) {
  7235. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7236. extendOptions[methodName] = methods[methodName];
  7237. delete methods[methodName];
  7238. }
  7239. });
  7240. }
  7241. return oldExtend.call(this, extendOptions)
  7242. };
  7243. var strategies = Vue.config.optionMergeStrategies;
  7244. var mergeHook = strategies.created;
  7245. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7246. strategies[hook] = mergeHook;
  7247. });
  7248. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7249. }
  7250. /* */
  7251. // install platform patch function
  7252. Vue.prototype.__patch__ = patch;
  7253. // public mount method
  7254. Vue.prototype.$mount = function(
  7255. el ,
  7256. hydrating
  7257. ) {
  7258. return mountComponent$1(this, el, hydrating)
  7259. };
  7260. lifecycleMixin$1(Vue);
  7261. internalMixin(Vue);
  7262. /* */
  7263. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7264. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  7265. /***/ }),
  7266. /***/ 203:
  7267. /*!*****************************************!*\
  7268. !*** G:/gsxm/git/xinwang/api/wallet.js ***!
  7269. \*****************************************/
  7270. /*! no static exports found */
  7271. /***/ (function(module, exports, __webpack_require__) {
  7272. "use strict";
  7273. Object.defineProperty(exports, "__esModule", { value: true });exports.spreadCommission = spreadCommission;exports.userBalance = userBalance;exports.extractCash = extractCash;exports.extractBank = extractBank;exports.rechargeRoutine = rechargeRoutine;exports.aliInfo = aliInfo;exports.bankInfo = bankInfo;exports.setAliInfo = setAliInfo;exports.setBankInfo = setBankInfo;exports.balance = balance;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  7274. // 获取用户消费记录
  7275. function spreadCommission(data, state) {
  7276. return (0, _request.default)({
  7277. url: '/api/spread/commission/' + state,
  7278. method: 'get',
  7279. data: data });
  7280. }
  7281. // 获取账户余额
  7282. function userBalance(data) {
  7283. return (0, _request.default)({
  7284. url: '/api/user/balance',
  7285. method: 'get',
  7286. data: data });
  7287. }
  7288. // 提现
  7289. function extractCash(data) {
  7290. return (0, _request.default)({
  7291. url: '/api/extract/cash',
  7292. method: 'post',
  7293. data: data });
  7294. }
  7295. // 提现信息
  7296. function extractBank(data) {
  7297. return (0, _request.default)({
  7298. url: '/api/extract/bank',
  7299. method: 'get',
  7300. data: data });
  7301. }
  7302. // 小程序充值
  7303. function rechargeRoutine(data) {
  7304. return (0, _request.default)({
  7305. url: '/api/recharge/routine',
  7306. method: 'post',
  7307. data: data });
  7308. }
  7309. // 获取提现支付宝账号
  7310. function aliInfo(data) {
  7311. return (0, _request.default)({
  7312. url: '/api/ali/info',
  7313. method: 'get',
  7314. data: data });
  7315. }
  7316. //获取默认银行卡账号
  7317. function bankInfo(data) {
  7318. return (0, _request.default)({
  7319. url: '/api/bank/info',
  7320. method: 'get',
  7321. data: data });
  7322. }
  7323. // 保存提现支付宝账号
  7324. function setAliInfo(data) {
  7325. return (0, _request.default)({
  7326. url: '/api/ali/edit',
  7327. method: 'post',
  7328. data: data });
  7329. }
  7330. //保存默认银行卡账号
  7331. function setBankInfo(data) {
  7332. return (0, _request.default)({
  7333. url: '/api/bank/edit',
  7334. method: 'post',
  7335. data: data });
  7336. }
  7337. // 账户余额
  7338. function balance(data) {
  7339. return (0, _request.default)({
  7340. url: '/api/user/balance',
  7341. method: 'get',
  7342. data: data });
  7343. }
  7344. /***/ }),
  7345. /***/ 22:
  7346. /*!**********************************************************!*\
  7347. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  7348. \**********************************************************/
  7349. /*! no static exports found */
  7350. /***/ (function(module, exports, __webpack_require__) {
  7351. module.exports = __webpack_require__(/*! regenerator-runtime */ 23);
  7352. /***/ }),
  7353. /***/ 23:
  7354. /*!************************************************************!*\
  7355. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  7356. \************************************************************/
  7357. /*! no static exports found */
  7358. /***/ (function(module, exports, __webpack_require__) {
  7359. /**
  7360. * Copyright (c) 2014-present, Facebook, Inc.
  7361. *
  7362. * This source code is licensed under the MIT license found in the
  7363. * LICENSE file in the root directory of this source tree.
  7364. */
  7365. // This method of obtaining a reference to the global object needs to be
  7366. // kept identical to the way it is obtained in runtime.js
  7367. var g = (function() {
  7368. return this || (typeof self === "object" && self);
  7369. })() || Function("return this")();
  7370. // Use `getOwnPropertyNames` because not all browsers support calling
  7371. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  7372. var hadRuntime = g.regeneratorRuntime &&
  7373. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  7374. // Save the old regeneratorRuntime in case it needs to be restored later.
  7375. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  7376. // Force reevalutation of runtime.js.
  7377. g.regeneratorRuntime = undefined;
  7378. module.exports = __webpack_require__(/*! ./runtime */ 24);
  7379. if (hadRuntime) {
  7380. // Restore the original runtime.
  7381. g.regeneratorRuntime = oldRuntime;
  7382. } else {
  7383. // Remove the global property added by runtime.js.
  7384. try {
  7385. delete g.regeneratorRuntime;
  7386. } catch(e) {
  7387. g.regeneratorRuntime = undefined;
  7388. }
  7389. }
  7390. /***/ }),
  7391. /***/ 24:
  7392. /*!*****************************************************!*\
  7393. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  7394. \*****************************************************/
  7395. /*! no static exports found */
  7396. /***/ (function(module, exports) {
  7397. /**
  7398. * Copyright (c) 2014-present, Facebook, Inc.
  7399. *
  7400. * This source code is licensed under the MIT license found in the
  7401. * LICENSE file in the root directory of this source tree.
  7402. */
  7403. !(function(global) {
  7404. "use strict";
  7405. var Op = Object.prototype;
  7406. var hasOwn = Op.hasOwnProperty;
  7407. var undefined; // More compressible than void 0.
  7408. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  7409. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  7410. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  7411. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  7412. var inModule = typeof module === "object";
  7413. var runtime = global.regeneratorRuntime;
  7414. if (runtime) {
  7415. if (inModule) {
  7416. // If regeneratorRuntime is defined globally and we're in a module,
  7417. // make the exports object identical to regeneratorRuntime.
  7418. module.exports = runtime;
  7419. }
  7420. // Don't bother evaluating the rest of this file if the runtime was
  7421. // already defined globally.
  7422. return;
  7423. }
  7424. // Define the runtime globally (as expected by generated code) as either
  7425. // module.exports (if we're in a module) or a new, empty object.
  7426. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  7427. function wrap(innerFn, outerFn, self, tryLocsList) {
  7428. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  7429. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  7430. var generator = Object.create(protoGenerator.prototype);
  7431. var context = new Context(tryLocsList || []);
  7432. // The ._invoke method unifies the implementations of the .next,
  7433. // .throw, and .return methods.
  7434. generator._invoke = makeInvokeMethod(innerFn, self, context);
  7435. return generator;
  7436. }
  7437. runtime.wrap = wrap;
  7438. // Try/catch helper to minimize deoptimizations. Returns a completion
  7439. // record like context.tryEntries[i].completion. This interface could
  7440. // have been (and was previously) designed to take a closure to be
  7441. // invoked without arguments, but in all the cases we care about we
  7442. // already have an existing method we want to call, so there's no need
  7443. // to create a new function object. We can even get away with assuming
  7444. // the method takes exactly one argument, since that happens to be true
  7445. // in every case, so we don't have to touch the arguments object. The
  7446. // only additional allocation required is the completion record, which
  7447. // has a stable shape and so hopefully should be cheap to allocate.
  7448. function tryCatch(fn, obj, arg) {
  7449. try {
  7450. return { type: "normal", arg: fn.call(obj, arg) };
  7451. } catch (err) {
  7452. return { type: "throw", arg: err };
  7453. }
  7454. }
  7455. var GenStateSuspendedStart = "suspendedStart";
  7456. var GenStateSuspendedYield = "suspendedYield";
  7457. var GenStateExecuting = "executing";
  7458. var GenStateCompleted = "completed";
  7459. // Returning this object from the innerFn has the same effect as
  7460. // breaking out of the dispatch switch statement.
  7461. var ContinueSentinel = {};
  7462. // Dummy constructor functions that we use as the .constructor and
  7463. // .constructor.prototype properties for functions that return Generator
  7464. // objects. For full spec compliance, you may wish to configure your
  7465. // minifier not to mangle the names of these two functions.
  7466. function Generator() {}
  7467. function GeneratorFunction() {}
  7468. function GeneratorFunctionPrototype() {}
  7469. // This is a polyfill for %IteratorPrototype% for environments that
  7470. // don't natively support it.
  7471. var IteratorPrototype = {};
  7472. IteratorPrototype[iteratorSymbol] = function () {
  7473. return this;
  7474. };
  7475. var getProto = Object.getPrototypeOf;
  7476. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  7477. if (NativeIteratorPrototype &&
  7478. NativeIteratorPrototype !== Op &&
  7479. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  7480. // This environment has a native %IteratorPrototype%; use it instead
  7481. // of the polyfill.
  7482. IteratorPrototype = NativeIteratorPrototype;
  7483. }
  7484. var Gp = GeneratorFunctionPrototype.prototype =
  7485. Generator.prototype = Object.create(IteratorPrototype);
  7486. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  7487. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  7488. GeneratorFunctionPrototype[toStringTagSymbol] =
  7489. GeneratorFunction.displayName = "GeneratorFunction";
  7490. // Helper for defining the .next, .throw, and .return methods of the
  7491. // Iterator interface in terms of a single ._invoke method.
  7492. function defineIteratorMethods(prototype) {
  7493. ["next", "throw", "return"].forEach(function(method) {
  7494. prototype[method] = function(arg) {
  7495. return this._invoke(method, arg);
  7496. };
  7497. });
  7498. }
  7499. runtime.isGeneratorFunction = function(genFun) {
  7500. var ctor = typeof genFun === "function" && genFun.constructor;
  7501. return ctor
  7502. ? ctor === GeneratorFunction ||
  7503. // For the native GeneratorFunction constructor, the best we can
  7504. // do is to check its .name property.
  7505. (ctor.displayName || ctor.name) === "GeneratorFunction"
  7506. : false;
  7507. };
  7508. runtime.mark = function(genFun) {
  7509. if (Object.setPrototypeOf) {
  7510. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  7511. } else {
  7512. genFun.__proto__ = GeneratorFunctionPrototype;
  7513. if (!(toStringTagSymbol in genFun)) {
  7514. genFun[toStringTagSymbol] = "GeneratorFunction";
  7515. }
  7516. }
  7517. genFun.prototype = Object.create(Gp);
  7518. return genFun;
  7519. };
  7520. // Within the body of any async function, `await x` is transformed to
  7521. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  7522. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  7523. // meant to be awaited.
  7524. runtime.awrap = function(arg) {
  7525. return { __await: arg };
  7526. };
  7527. function AsyncIterator(generator) {
  7528. function invoke(method, arg, resolve, reject) {
  7529. var record = tryCatch(generator[method], generator, arg);
  7530. if (record.type === "throw") {
  7531. reject(record.arg);
  7532. } else {
  7533. var result = record.arg;
  7534. var value = result.value;
  7535. if (value &&
  7536. typeof value === "object" &&
  7537. hasOwn.call(value, "__await")) {
  7538. return Promise.resolve(value.__await).then(function(value) {
  7539. invoke("next", value, resolve, reject);
  7540. }, function(err) {
  7541. invoke("throw", err, resolve, reject);
  7542. });
  7543. }
  7544. return Promise.resolve(value).then(function(unwrapped) {
  7545. // When a yielded Promise is resolved, its final value becomes
  7546. // the .value of the Promise<{value,done}> result for the
  7547. // current iteration.
  7548. result.value = unwrapped;
  7549. resolve(result);
  7550. }, function(error) {
  7551. // If a rejected Promise was yielded, throw the rejection back
  7552. // into the async generator function so it can be handled there.
  7553. return invoke("throw", error, resolve, reject);
  7554. });
  7555. }
  7556. }
  7557. var previousPromise;
  7558. function enqueue(method, arg) {
  7559. function callInvokeWithMethodAndArg() {
  7560. return new Promise(function(resolve, reject) {
  7561. invoke(method, arg, resolve, reject);
  7562. });
  7563. }
  7564. return previousPromise =
  7565. // If enqueue has been called before, then we want to wait until
  7566. // all previous Promises have been resolved before calling invoke,
  7567. // so that results are always delivered in the correct order. If
  7568. // enqueue has not been called before, then it is important to
  7569. // call invoke immediately, without waiting on a callback to fire,
  7570. // so that the async generator function has the opportunity to do
  7571. // any necessary setup in a predictable way. This predictability
  7572. // is why the Promise constructor synchronously invokes its
  7573. // executor callback, and why async functions synchronously
  7574. // execute code before the first await. Since we implement simple
  7575. // async functions in terms of async generators, it is especially
  7576. // important to get this right, even though it requires care.
  7577. previousPromise ? previousPromise.then(
  7578. callInvokeWithMethodAndArg,
  7579. // Avoid propagating failures to Promises returned by later
  7580. // invocations of the iterator.
  7581. callInvokeWithMethodAndArg
  7582. ) : callInvokeWithMethodAndArg();
  7583. }
  7584. // Define the unified helper method that is used to implement .next,
  7585. // .throw, and .return (see defineIteratorMethods).
  7586. this._invoke = enqueue;
  7587. }
  7588. defineIteratorMethods(AsyncIterator.prototype);
  7589. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  7590. return this;
  7591. };
  7592. runtime.AsyncIterator = AsyncIterator;
  7593. // Note that simple async functions are implemented on top of
  7594. // AsyncIterator objects; they just return a Promise for the value of
  7595. // the final result produced by the iterator.
  7596. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  7597. var iter = new AsyncIterator(
  7598. wrap(innerFn, outerFn, self, tryLocsList)
  7599. );
  7600. return runtime.isGeneratorFunction(outerFn)
  7601. ? iter // If outerFn is a generator, return the full iterator.
  7602. : iter.next().then(function(result) {
  7603. return result.done ? result.value : iter.next();
  7604. });
  7605. };
  7606. function makeInvokeMethod(innerFn, self, context) {
  7607. var state = GenStateSuspendedStart;
  7608. return function invoke(method, arg) {
  7609. if (state === GenStateExecuting) {
  7610. throw new Error("Generator is already running");
  7611. }
  7612. if (state === GenStateCompleted) {
  7613. if (method === "throw") {
  7614. throw arg;
  7615. }
  7616. // Be forgiving, per 25.3.3.3.3 of the spec:
  7617. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  7618. return doneResult();
  7619. }
  7620. context.method = method;
  7621. context.arg = arg;
  7622. while (true) {
  7623. var delegate = context.delegate;
  7624. if (delegate) {
  7625. var delegateResult = maybeInvokeDelegate(delegate, context);
  7626. if (delegateResult) {
  7627. if (delegateResult === ContinueSentinel) continue;
  7628. return delegateResult;
  7629. }
  7630. }
  7631. if (context.method === "next") {
  7632. // Setting context._sent for legacy support of Babel's
  7633. // function.sent implementation.
  7634. context.sent = context._sent = context.arg;
  7635. } else if (context.method === "throw") {
  7636. if (state === GenStateSuspendedStart) {
  7637. state = GenStateCompleted;
  7638. throw context.arg;
  7639. }
  7640. context.dispatchException(context.arg);
  7641. } else if (context.method === "return") {
  7642. context.abrupt("return", context.arg);
  7643. }
  7644. state = GenStateExecuting;
  7645. var record = tryCatch(innerFn, self, context);
  7646. if (record.type === "normal") {
  7647. // If an exception is thrown from innerFn, we leave state ===
  7648. // GenStateExecuting and loop back for another invocation.
  7649. state = context.done
  7650. ? GenStateCompleted
  7651. : GenStateSuspendedYield;
  7652. if (record.arg === ContinueSentinel) {
  7653. continue;
  7654. }
  7655. return {
  7656. value: record.arg,
  7657. done: context.done
  7658. };
  7659. } else if (record.type === "throw") {
  7660. state = GenStateCompleted;
  7661. // Dispatch the exception by looping back around to the
  7662. // context.dispatchException(context.arg) call above.
  7663. context.method = "throw";
  7664. context.arg = record.arg;
  7665. }
  7666. }
  7667. };
  7668. }
  7669. // Call delegate.iterator[context.method](context.arg) and handle the
  7670. // result, either by returning a { value, done } result from the
  7671. // delegate iterator, or by modifying context.method and context.arg,
  7672. // setting context.delegate to null, and returning the ContinueSentinel.
  7673. function maybeInvokeDelegate(delegate, context) {
  7674. var method = delegate.iterator[context.method];
  7675. if (method === undefined) {
  7676. // A .throw or .return when the delegate iterator has no .throw
  7677. // method always terminates the yield* loop.
  7678. context.delegate = null;
  7679. if (context.method === "throw") {
  7680. if (delegate.iterator.return) {
  7681. // If the delegate iterator has a return method, give it a
  7682. // chance to clean up.
  7683. context.method = "return";
  7684. context.arg = undefined;
  7685. maybeInvokeDelegate(delegate, context);
  7686. if (context.method === "throw") {
  7687. // If maybeInvokeDelegate(context) changed context.method from
  7688. // "return" to "throw", let that override the TypeError below.
  7689. return ContinueSentinel;
  7690. }
  7691. }
  7692. context.method = "throw";
  7693. context.arg = new TypeError(
  7694. "The iterator does not provide a 'throw' method");
  7695. }
  7696. return ContinueSentinel;
  7697. }
  7698. var record = tryCatch(method, delegate.iterator, context.arg);
  7699. if (record.type === "throw") {
  7700. context.method = "throw";
  7701. context.arg = record.arg;
  7702. context.delegate = null;
  7703. return ContinueSentinel;
  7704. }
  7705. var info = record.arg;
  7706. if (! info) {
  7707. context.method = "throw";
  7708. context.arg = new TypeError("iterator result is not an object");
  7709. context.delegate = null;
  7710. return ContinueSentinel;
  7711. }
  7712. if (info.done) {
  7713. // Assign the result of the finished delegate to the temporary
  7714. // variable specified by delegate.resultName (see delegateYield).
  7715. context[delegate.resultName] = info.value;
  7716. // Resume execution at the desired location (see delegateYield).
  7717. context.next = delegate.nextLoc;
  7718. // If context.method was "throw" but the delegate handled the
  7719. // exception, let the outer generator proceed normally. If
  7720. // context.method was "next", forget context.arg since it has been
  7721. // "consumed" by the delegate iterator. If context.method was
  7722. // "return", allow the original .return call to continue in the
  7723. // outer generator.
  7724. if (context.method !== "return") {
  7725. context.method = "next";
  7726. context.arg = undefined;
  7727. }
  7728. } else {
  7729. // Re-yield the result returned by the delegate method.
  7730. return info;
  7731. }
  7732. // The delegate iterator is finished, so forget it and continue with
  7733. // the outer generator.
  7734. context.delegate = null;
  7735. return ContinueSentinel;
  7736. }
  7737. // Define Generator.prototype.{next,throw,return} in terms of the
  7738. // unified ._invoke helper method.
  7739. defineIteratorMethods(Gp);
  7740. Gp[toStringTagSymbol] = "Generator";
  7741. // A Generator should always return itself as the iterator object when the
  7742. // @@iterator function is called on it. Some browsers' implementations of the
  7743. // iterator prototype chain incorrectly implement this, causing the Generator
  7744. // object to not be returned from this call. This ensures that doesn't happen.
  7745. // See https://github.com/facebook/regenerator/issues/274 for more details.
  7746. Gp[iteratorSymbol] = function() {
  7747. return this;
  7748. };
  7749. Gp.toString = function() {
  7750. return "[object Generator]";
  7751. };
  7752. function pushTryEntry(locs) {
  7753. var entry = { tryLoc: locs[0] };
  7754. if (1 in locs) {
  7755. entry.catchLoc = locs[1];
  7756. }
  7757. if (2 in locs) {
  7758. entry.finallyLoc = locs[2];
  7759. entry.afterLoc = locs[3];
  7760. }
  7761. this.tryEntries.push(entry);
  7762. }
  7763. function resetTryEntry(entry) {
  7764. var record = entry.completion || {};
  7765. record.type = "normal";
  7766. delete record.arg;
  7767. entry.completion = record;
  7768. }
  7769. function Context(tryLocsList) {
  7770. // The root entry object (effectively a try statement without a catch
  7771. // or a finally block) gives us a place to store values thrown from
  7772. // locations where there is no enclosing try statement.
  7773. this.tryEntries = [{ tryLoc: "root" }];
  7774. tryLocsList.forEach(pushTryEntry, this);
  7775. this.reset(true);
  7776. }
  7777. runtime.keys = function(object) {
  7778. var keys = [];
  7779. for (var key in object) {
  7780. keys.push(key);
  7781. }
  7782. keys.reverse();
  7783. // Rather than returning an object with a next method, we keep
  7784. // things simple and return the next function itself.
  7785. return function next() {
  7786. while (keys.length) {
  7787. var key = keys.pop();
  7788. if (key in object) {
  7789. next.value = key;
  7790. next.done = false;
  7791. return next;
  7792. }
  7793. }
  7794. // To avoid creating an additional object, we just hang the .value
  7795. // and .done properties off the next function object itself. This
  7796. // also ensures that the minifier will not anonymize the function.
  7797. next.done = true;
  7798. return next;
  7799. };
  7800. };
  7801. function values(iterable) {
  7802. if (iterable) {
  7803. var iteratorMethod = iterable[iteratorSymbol];
  7804. if (iteratorMethod) {
  7805. return iteratorMethod.call(iterable);
  7806. }
  7807. if (typeof iterable.next === "function") {
  7808. return iterable;
  7809. }
  7810. if (!isNaN(iterable.length)) {
  7811. var i = -1, next = function next() {
  7812. while (++i < iterable.length) {
  7813. if (hasOwn.call(iterable, i)) {
  7814. next.value = iterable[i];
  7815. next.done = false;
  7816. return next;
  7817. }
  7818. }
  7819. next.value = undefined;
  7820. next.done = true;
  7821. return next;
  7822. };
  7823. return next.next = next;
  7824. }
  7825. }
  7826. // Return an iterator with no values.
  7827. return { next: doneResult };
  7828. }
  7829. runtime.values = values;
  7830. function doneResult() {
  7831. return { value: undefined, done: true };
  7832. }
  7833. Context.prototype = {
  7834. constructor: Context,
  7835. reset: function(skipTempReset) {
  7836. this.prev = 0;
  7837. this.next = 0;
  7838. // Resetting context._sent for legacy support of Babel's
  7839. // function.sent implementation.
  7840. this.sent = this._sent = undefined;
  7841. this.done = false;
  7842. this.delegate = null;
  7843. this.method = "next";
  7844. this.arg = undefined;
  7845. this.tryEntries.forEach(resetTryEntry);
  7846. if (!skipTempReset) {
  7847. for (var name in this) {
  7848. // Not sure about the optimal order of these conditions:
  7849. if (name.charAt(0) === "t" &&
  7850. hasOwn.call(this, name) &&
  7851. !isNaN(+name.slice(1))) {
  7852. this[name] = undefined;
  7853. }
  7854. }
  7855. }
  7856. },
  7857. stop: function() {
  7858. this.done = true;
  7859. var rootEntry = this.tryEntries[0];
  7860. var rootRecord = rootEntry.completion;
  7861. if (rootRecord.type === "throw") {
  7862. throw rootRecord.arg;
  7863. }
  7864. return this.rval;
  7865. },
  7866. dispatchException: function(exception) {
  7867. if (this.done) {
  7868. throw exception;
  7869. }
  7870. var context = this;
  7871. function handle(loc, caught) {
  7872. record.type = "throw";
  7873. record.arg = exception;
  7874. context.next = loc;
  7875. if (caught) {
  7876. // If the dispatched exception was caught by a catch block,
  7877. // then let that catch block handle the exception normally.
  7878. context.method = "next";
  7879. context.arg = undefined;
  7880. }
  7881. return !! caught;
  7882. }
  7883. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7884. var entry = this.tryEntries[i];
  7885. var record = entry.completion;
  7886. if (entry.tryLoc === "root") {
  7887. // Exception thrown outside of any try block that could handle
  7888. // it, so set the completion value of the entire function to
  7889. // throw the exception.
  7890. return handle("end");
  7891. }
  7892. if (entry.tryLoc <= this.prev) {
  7893. var hasCatch = hasOwn.call(entry, "catchLoc");
  7894. var hasFinally = hasOwn.call(entry, "finallyLoc");
  7895. if (hasCatch && hasFinally) {
  7896. if (this.prev < entry.catchLoc) {
  7897. return handle(entry.catchLoc, true);
  7898. } else if (this.prev < entry.finallyLoc) {
  7899. return handle(entry.finallyLoc);
  7900. }
  7901. } else if (hasCatch) {
  7902. if (this.prev < entry.catchLoc) {
  7903. return handle(entry.catchLoc, true);
  7904. }
  7905. } else if (hasFinally) {
  7906. if (this.prev < entry.finallyLoc) {
  7907. return handle(entry.finallyLoc);
  7908. }
  7909. } else {
  7910. throw new Error("try statement without catch or finally");
  7911. }
  7912. }
  7913. }
  7914. },
  7915. abrupt: function(type, arg) {
  7916. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7917. var entry = this.tryEntries[i];
  7918. if (entry.tryLoc <= this.prev &&
  7919. hasOwn.call(entry, "finallyLoc") &&
  7920. this.prev < entry.finallyLoc) {
  7921. var finallyEntry = entry;
  7922. break;
  7923. }
  7924. }
  7925. if (finallyEntry &&
  7926. (type === "break" ||
  7927. type === "continue") &&
  7928. finallyEntry.tryLoc <= arg &&
  7929. arg <= finallyEntry.finallyLoc) {
  7930. // Ignore the finally entry if control is not jumping to a
  7931. // location outside the try/catch block.
  7932. finallyEntry = null;
  7933. }
  7934. var record = finallyEntry ? finallyEntry.completion : {};
  7935. record.type = type;
  7936. record.arg = arg;
  7937. if (finallyEntry) {
  7938. this.method = "next";
  7939. this.next = finallyEntry.finallyLoc;
  7940. return ContinueSentinel;
  7941. }
  7942. return this.complete(record);
  7943. },
  7944. complete: function(record, afterLoc) {
  7945. if (record.type === "throw") {
  7946. throw record.arg;
  7947. }
  7948. if (record.type === "break" ||
  7949. record.type === "continue") {
  7950. this.next = record.arg;
  7951. } else if (record.type === "return") {
  7952. this.rval = this.arg = record.arg;
  7953. this.method = "return";
  7954. this.next = "end";
  7955. } else if (record.type === "normal" && afterLoc) {
  7956. this.next = afterLoc;
  7957. }
  7958. return ContinueSentinel;
  7959. },
  7960. finish: function(finallyLoc) {
  7961. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7962. var entry = this.tryEntries[i];
  7963. if (entry.finallyLoc === finallyLoc) {
  7964. this.complete(entry.completion, entry.afterLoc);
  7965. resetTryEntry(entry);
  7966. return ContinueSentinel;
  7967. }
  7968. }
  7969. },
  7970. "catch": function(tryLoc) {
  7971. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7972. var entry = this.tryEntries[i];
  7973. if (entry.tryLoc === tryLoc) {
  7974. var record = entry.completion;
  7975. if (record.type === "throw") {
  7976. var thrown = record.arg;
  7977. resetTryEntry(entry);
  7978. }
  7979. return thrown;
  7980. }
  7981. }
  7982. // The context.catch method must only be called with a location
  7983. // argument that corresponds to a known catch block.
  7984. throw new Error("illegal catch attempt");
  7985. },
  7986. delegateYield: function(iterable, resultName, nextLoc) {
  7987. this.delegate = {
  7988. iterator: values(iterable),
  7989. resultName: resultName,
  7990. nextLoc: nextLoc
  7991. };
  7992. if (this.method === "next") {
  7993. // Deliberately forget the last sent value so that we don't
  7994. // accidentally pass it on to the delegate.
  7995. this.arg = undefined;
  7996. }
  7997. return ContinueSentinel;
  7998. }
  7999. };
  8000. })(
  8001. // In sloppy mode, unbound `this` refers to the global object, fallback to
  8002. // Function constructor if we're in global strict mode. That is sadly a form
  8003. // of indirect eval which violates Content Security Policy.
  8004. (function() {
  8005. return this || (typeof self === "object" && self);
  8006. })() || Function("return this")()
  8007. );
  8008. /***/ }),
  8009. /***/ 25:
  8010. /*!*********************************************!*\
  8011. !*** G:/gsxm/git/xinwang/utils/rocessor.js ***!
  8012. \*********************************************/
  8013. /*! no static exports found */
  8014. /***/ (function(module, exports, __webpack_require__) {
  8015. "use strict";
  8016. Object.defineProperty(exports, "__esModule", { value: true });exports.isCardNo = isCardNo;exports.getMoneyStyle = getMoneyStyle;exports.timeComputed = timeComputed;exports.openMap = openMap;exports.getTime = getTime; //身份证验证
  8017. function isCardNo(card) {
  8018. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  8019. var reg =
  8020. /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
  8021. if (reg.test(card) === false) {
  8022. console.log(card);
  8023. return false;
  8024. }
  8025. return true;
  8026. }
  8027. // 金额显示变化
  8028. function getMoneyStyle() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  8029. if (typeof value == 'string') {
  8030. value = (+value).toFixed(2);
  8031. }
  8032. if (typeof value == 'number') {
  8033. value = value.toFixed(2);
  8034. }
  8035. // 将字符串转为数组
  8036. var n = value.split("");
  8037. // 反转数组并复制循环处理
  8038. var arr = n.reverse().map(function (e, ind, ar) {
  8039. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  8040. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  8041. return e + ',';
  8042. } else {
  8043. return e;
  8044. }
  8045. });
  8046. // 反转数组回复原来排序并合并回字符串
  8047. arr = arr.reverse().join('');
  8048. return arr;
  8049. }
  8050. // 倒计时计算
  8051. // 计算倒计时时间
  8052. function timeComputed(time) {
  8053. // 获取当前时间
  8054. var actTime = new Date().getTime();
  8055. // 获取到期时间
  8056. var stopTime = time - actTime;
  8057. // 判断是否小于0
  8058. if (stopTime < 0) {
  8059. stopTime = stopTime * -1;
  8060. }
  8061. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余天数
  8062. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  8063. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  8064. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  8065. return {
  8066. hours: hours, //倒计时小时数
  8067. minutes: minutes, //倒计时分钟数
  8068. seconds: seconds, //倒计时秒数
  8069. day: day //倒计时天数
  8070. };
  8071. }
  8072. // 调用打开地图方法
  8073. function openMap(e) {
  8074. var that = this;
  8075. return new Promise(function (resolve, reject) {
  8076. wx.getSetting({
  8077. success: function success(res) {
  8078. //这里判断是否有地位权限
  8079. if (!res.authSetting['scope.userLocation']) {
  8080. wx.showModal({
  8081. title: '提示',
  8082. content: '请求获取位置权限',
  8083. success: function success(res) {
  8084. if (res.confirm == false) {
  8085. // 授权失败
  8086. reject();
  8087. return false;
  8088. }
  8089. wx.openSetting({
  8090. success: function success(res) {
  8091. //如果再次拒绝则返回页面并提示
  8092. if (!res.authSetting['scope.userLocation']) {
  8093. wx.showToast({
  8094. title: '此功能需获取位置信息,请重新设置',
  8095. duration: 3000,
  8096. icon: 'none' });
  8097. } else {
  8098. //允许授权,调用地图
  8099. resolve();
  8100. }
  8101. } });
  8102. } });
  8103. } else {
  8104. //如果有定位权限,调用地图
  8105. resolve();
  8106. }
  8107. } });
  8108. });
  8109. }
  8110. //时间戳转换成时间
  8111. function getTime(time) {
  8112. var num = 13 - (time + '').length;
  8113. var l = 1; //倍数
  8114. for (var i = 0; i < num; i++) {
  8115. l += '0';
  8116. }
  8117. // 重新解析为数字
  8118. l = parseInt(l);
  8119. var date = new Date(parseInt(time) * l);
  8120. var year = date.getFullYear();
  8121. var mon = date.getMonth() + 1;
  8122. var day = date.getDate();
  8123. var hours = date.getHours();
  8124. var minu = date.getMinutes();
  8125. var sec = date.getSeconds();
  8126. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  8127. }
  8128. /***/ }),
  8129. /***/ 26:
  8130. /*!****************************************!*\
  8131. !*** G:/gsxm/git/xinwang/api/index.js ***!
  8132. \****************************************/
  8133. /*! no static exports found */
  8134. /***/ (function(module, exports, __webpack_require__) {
  8135. "use strict";
  8136. Object.defineProperty(exports, "__esModule", { value: true });exports.groom4 = groom4;exports.groom1 = groom1;exports.groom3 = groom3;exports.loadIndexs = loadIndexs;exports.getStoreList = getStoreList;exports.getStoreInfo = getStoreInfo;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8137. // 促销商品
  8138. function groom4(data) {
  8139. return (0, _request.default)({
  8140. url: '/api/groom/list/4',
  8141. method: 'get',
  8142. data: data });
  8143. }
  8144. // 精品推荐
  8145. function groom1(data) {
  8146. return (0, _request.default)({
  8147. url: '/api/groom/list/1',
  8148. method: 'get',
  8149. data: data });
  8150. }
  8151. // 新品首发
  8152. function groom3(data) {
  8153. return (0, _request.default)({
  8154. url: '/api/groom/list/3',
  8155. method: 'get',
  8156. data: data });
  8157. }
  8158. // 获取首页信息
  8159. function loadIndexs(data) {
  8160. return (0, _request.default)({
  8161. url: '/api/index',
  8162. method: 'get',
  8163. data: data });
  8164. }
  8165. //获取门店列表
  8166. function getStoreList(data) {
  8167. return (0, _request.default)({
  8168. url: '/api/store_list',
  8169. method: 'get',
  8170. data: data });
  8171. }
  8172. //获取门店列表
  8173. function getStoreInfo(data) {
  8174. return (0, _request.default)({
  8175. url: '/api/store_info',
  8176. method: 'get',
  8177. data: data });
  8178. }
  8179. /***/ }),
  8180. /***/ 27:
  8181. /*!********************************************!*\
  8182. !*** G:/gsxm/git/xinwang/utils/request.js ***!
  8183. \********************************************/
  8184. /*! no static exports found */
  8185. /***/ (function(module, exports, __webpack_require__) {
  8186. "use strict";
  8187. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.upFilse = void 0;var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 28));
  8188. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 5));
  8189. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 29);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8190. // 请求完成后拦截
  8191. _newRequest.default.interceptors.response(
  8192. function (response) {
  8193. try {
  8194. var res = response.data;
  8195. // 解析字符串为数字
  8196. if (res.status !== 200) {
  8197. console.log(res.status);
  8198. if (res.status == 410000) {
  8199. // 调用退出登录方法清空用户信息
  8200. _store.default.commit('user/logout');
  8201. // 判断是否开启强制登录
  8202. uni.showModal({
  8203. title: "登陆",
  8204. content: '您未登录!是否马上登录?',
  8205. success: function success(e) {
  8206. // 判断是否点击确认按钮
  8207. if (e.confirm) {
  8208. // 保存当前页面地址
  8209. (0, _loginUtils.saveUrl)();
  8210. // 跳转页面
  8211. (0, _loginUtils.interceptor)();
  8212. }
  8213. } });
  8214. } else {
  8215. if (res.msg != '系统出现异常') {
  8216. uni.showToast({
  8217. title: res.msg,
  8218. duration: 1500,
  8219. mask: false,
  8220. icon: 'none' });
  8221. }
  8222. }
  8223. return Promise.reject(res);
  8224. } else {
  8225. return res;
  8226. }
  8227. } catch (e) {
  8228. console.log(e);
  8229. }
  8230. },
  8231. function (error) {
  8232. uni.showToast({
  8233. title: "加载错误请重试",
  8234. duration: 1500,
  8235. mask: false,
  8236. icon: 'none' });
  8237. return Promise.reject(error);
  8238. });
  8239. // 请求前拦截器
  8240. _newRequest.default.interceptors.request(
  8241. function (config) {
  8242. var token = uni.getStorageSync('token') || '';
  8243. // console.log(config);
  8244. if (!config.header) {
  8245. config.header = {
  8246. "Authori-zation": 'Bearer ' + token };
  8247. } else {
  8248. // 添加key请求头
  8249. config.header["Authori-zation"] = 'Bearer ' + token;
  8250. }
  8251. return config;
  8252. },
  8253. function (error) {
  8254. // 错误处理
  8255. console.log(error);
  8256. return Promise.reject(error);
  8257. });
  8258. var upFilse = _newRequest.default.upFilse;exports.upFilse = upFilse;var _default =
  8259. _newRequest.default.open;exports.default = _default;
  8260. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8261. /***/ }),
  8262. /***/ 28:
  8263. /*!***********************************************!*\
  8264. !*** G:/gsxm/git/xinwang/utils/newRequest.js ***!
  8265. \***********************************************/
  8266. /*! no static exports found */
  8267. /***/ (function(module, exports, __webpack_require__) {
  8268. "use strict";
  8269. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 22));var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 5));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  8270. var service = {
  8271. baseURL: _store.default.state.baseURL, // 请求头
  8272. header: {
  8273. 'Content-Type': "application/x-www-form-urlencoded" },
  8274. // 请求拦截器
  8275. interceptors: {
  8276. // 安装请求前拦截
  8277. request: function request(success, iserror) {
  8278. service.request.success = success;
  8279. service.request.error = iserror;
  8280. },
  8281. // 安装请求完成后拦截
  8282. response: function response(success, iserror) {
  8283. service.response.success = success;
  8284. service.response.error = iserror;
  8285. } },
  8286. // 请求前拦截
  8287. request: {
  8288. // 回调成功执行方法
  8289. success: function success(e) {
  8290. return e;
  8291. },
  8292. // 回调失败
  8293. error: function error(e) {
  8294. return e;
  8295. } },
  8296. // 请求完成后拦截
  8297. response: {
  8298. // 回调成功执行方法
  8299. success: function success(e) {
  8300. return e;
  8301. },
  8302. // 回调失败
  8303. error: function error(e) {
  8304. return e;
  8305. } },
  8306. // 开始请求
  8307. open: function () {var _open = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return (
  8308. new Promise(function (resolve, reject) {
  8309. var requestData = ''; //保存处理完成后请求数据
  8310. var url = ''; //保存链接地址
  8311. //console.log(data);
  8312. // 请求前数据处理
  8313. requestData = service.request.success(data);
  8314. url = service.baseURL + requestData.url;
  8315. // 数据复制用于请求
  8316. uni.request({
  8317. url: url,
  8318. method: requestData.method || 'GET',
  8319. data: requestData.data,
  8320. header: data.header || service.header,
  8321. success: function success(res) {
  8322. if (res.statusCode == 200) {
  8323. try {
  8324. resolve(service.response.success(res));
  8325. } catch (e) {
  8326. service.response.error(e);
  8327. }
  8328. }
  8329. },
  8330. // 请求失败数据处理
  8331. fail: function fail(err) {
  8332. service.response.error(err);
  8333. } });
  8334. }));case 2:return _context.abrupt("return", _context.sent);case 3:case "end":return _context.stop();}}}, _callee);}));function open(_x) {return _open.apply(this, arguments);}return open;}(),
  8335. // 上传文件
  8336. upFilse: function () {var _upFilse = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:_context4.next = 2;return (
  8337. new Promise(function (resolve, reject) {
  8338. var requestData = ''; //保存处理完成后请求数据
  8339. var url = ''; //保存请求地址
  8340. try {
  8341. // 请求前数据处理
  8342. requestData = service.request.success(data);
  8343. } catch (e) {
  8344. // 请求报错拦截
  8345. service.request.error(e);
  8346. }
  8347. url = service.baseURL + requestData.url;
  8348. var config = {
  8349. // 上传图片的API
  8350. upload_img_url: url };
  8351. var Uploader = {
  8352. // 选择图片
  8353. choose: function choose(num) {
  8354. return new Promise(function (resolve, reject) {
  8355. uni.chooseImage({
  8356. count: num,
  8357. success: function success(res) {
  8358. // console.log(res);
  8359. // 缓存文件路径
  8360. resolve(res.tempFilePaths);
  8361. },
  8362. fail: function fail(err) {
  8363. console.log(err);
  8364. reject(err);
  8365. } });
  8366. });
  8367. },
  8368. // 上传图片
  8369. upload_one: function upload_one(path) {
  8370. return new Promise(function (resolve, reject) {
  8371. uni.showLoading({
  8372. title: '上传中' });
  8373. uni.uploadFile({
  8374. url: config.upload_img_url, //仅为示例,非真实的接口地址
  8375. filePath: path,
  8376. name: 'file',
  8377. header: {
  8378. "Authori-zation": 'Bearer ' + uni.getStorageSync('token') },
  8379. success: function success(uploadFileRes) {
  8380. if ("string" === typeof uploadFileRes.data) {
  8381. resolve(JSON.parse(uploadFileRes.data).data);
  8382. } else {
  8383. resolve(uploadFileRes.data.data);
  8384. }
  8385. },
  8386. complete: function complete() {
  8387. uni.hideLoading();
  8388. } });
  8389. });
  8390. },
  8391. // 上传多个图片
  8392. upload: function upload(path_arr) {var _this = this;
  8393. var num = path_arr.length;
  8394. return new Promise( /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {var img_urls, i, img_url;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  8395. img_urls = [];
  8396. i = 0;case 2:if (!(i < num)) {_context2.next = 10;break;}_context2.next = 5;return (
  8397. _this.upload_one(path_arr[i]));case 5:img_url = _context2.sent;
  8398. img_urls.push(img_url);case 7:i++;_context2.next = 2;break;case 10:
  8399. ;
  8400. resolve(img_urls);case 12:case "end":return _context2.stop();}}}, _callee2);}));return function (_x3, _x4) {return _ref.apply(this, arguments);};}());
  8401. },
  8402. // 触发上传图片事件
  8403. choose_and_upload: function choose_and_upload(num) {var _this2 = this;
  8404. return new Promise( /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {var path_arr;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return (
  8405. _this2.choose(num));case 2:path_arr = _context3.sent;_context3.next = 5;return (
  8406. _this2.upload(path_arr).then(function (e) {
  8407. resolve(e);
  8408. }).catch(function (e) {
  8409. reject(e);
  8410. }));case 5:case "end":return _context3.stop();}}}, _callee3);}));return function (_x5, _x6) {return _ref2.apply(this, arguments);};}());
  8411. } };
  8412. Uploader.choose_and_upload(1).then(function (e) {
  8413. resolve(e);
  8414. }).catch(function (e) {
  8415. console.log(e);
  8416. });
  8417. }));case 2:return _context4.abrupt("return", _context4.sent);case 3:case "end":return _context4.stop();}}}, _callee4);}));function upFilse(_x2) {return _upFilse.apply(this, arguments);}return upFilse;}() };var _default =
  8418. service;exports.default = _default;
  8419. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8420. /***/ }),
  8421. /***/ 29:
  8422. /*!***********************************************!*\
  8423. !*** G:/gsxm/git/xinwang/utils/loginUtils.js ***!
  8424. \***********************************************/
  8425. /*! no static exports found */
  8426. /***/ (function(module, exports, __webpack_require__) {
  8427. "use strict";
  8428. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getActionPage = getActionPage;exports.interceptor = interceptor;exports.saveUrl = saveUrl;exports.getPageUrl = getPageUrl;function getActionPage() {
  8429. var pages = getCurrentPages();
  8430. return pages[pages.length - 1];
  8431. }
  8432. //登录拦截
  8433. function interceptor() {
  8434. var pages = getActionPage();
  8435. // 获取当前页面
  8436. var pageUrl = '/' + pages.route;
  8437. var url = '/pages/public/login';
  8438. url = '/pages/public/wxLogin';
  8439. if (pageUrl != url) {
  8440. uni.navigateTo({
  8441. url: url });
  8442. }
  8443. }
  8444. // 保存页面
  8445. function saveUrl() {
  8446. var path = getPageUrl(true);
  8447. uni.setStorageSync('present', path);
  8448. }
  8449. // 处理分享链接地址
  8450. function getPageUrl() {var showSpeard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  8451. var page = getActionPage();
  8452. var path = '/' + page.route;
  8453. var url = '';
  8454. // 获取对象可枚举键值列表
  8455. var objKeys = Object.keys(page.options);
  8456. // 判断有无传值
  8457. if (objKeys.length > 0) {
  8458. // 循环赋值对象数据
  8459. for (var a in page.options) {
  8460. // 判断有无邀请人
  8461. if (a != 'speard') {
  8462. url += a + "=" + page.options[a] + "&";
  8463. } else {
  8464. // 判断是否需要存储邀请人
  8465. if (showSpeard) {
  8466. url += a + "=" + page.options[a] + "&";
  8467. }
  8468. }
  8469. }
  8470. path += '?' + url.substr(0, url.length - 1);
  8471. }
  8472. // 返回处理邀请人后的邀请地址
  8473. return path;
  8474. }
  8475. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8476. /***/ }),
  8477. /***/ 292:
  8478. /*!****************************************!*\
  8479. !*** G:/gsxm/git/xinwang/api/order.js ***!
  8480. \****************************************/
  8481. /*! no static exports found */
  8482. /***/ (function(module, exports, __webpack_require__) {
  8483. "use strict";
  8484. Object.defineProperty(exports, "__esModule", { value: true });exports.confirm = confirm;exports.couponsOrder = couponsOrder;exports.getCouponsList = getCouponsList;exports.order_comment = order_comment;exports.product = product;exports.express_query = express_query;exports.upload = upload;exports.orderList = orderList;exports.orderDetail = orderDetail;exports.orderCancel = orderCancel;exports.orderDel = orderDel;exports.refund = refund;exports.refundReason = refundReason;exports.orderTake = orderTake;exports.orderPay = orderPay;exports.createOrderkey = createOrderkey;exports.computedOrderkey = computedOrderkey;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 27));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  8485. // 订单确认
  8486. function confirm(data) {
  8487. return (0, _request.default)({
  8488. url: '/api/order/confirm',
  8489. method: 'post',
  8490. data: data });
  8491. }
  8492. //获取可使用优惠券
  8493. function couponsOrder(data, price) {
  8494. return (0, _request.default)({
  8495. url: '/api/coupons/order/' + price,
  8496. method: 'get',
  8497. data: data });
  8498. }
  8499. //获取优惠券列表
  8500. function getCouponsList(data, types) {
  8501. //优惠券状态 0全部 1未使用 2已使用
  8502. return (0, _request.default)({
  8503. url: '/api/coupons/user/' + types,
  8504. method: 'get',
  8505. data: data });
  8506. }
  8507. //提交评论
  8508. function order_comment(data) {
  8509. return (0, _request.default)({
  8510. url: '/api/order/comment',
  8511. method: 'post',
  8512. data: data });
  8513. }
  8514. //订单产品信息
  8515. function product(data) {
  8516. return (0, _request.default)({
  8517. url: '/api/order/product',
  8518. method: 'post',
  8519. data: data });
  8520. }
  8521. // 快递查询
  8522. function express_query(data) {
  8523. return (0, _request.default)({
  8524. url: '/api/order/express_query',
  8525. method: 'get',
  8526. data: data });
  8527. }
  8528. //上传图片
  8529. function upload(data) {
  8530. return (0, _request.upFilse)({
  8531. url: '/api/upload/image',
  8532. method: 'post',
  8533. data: data });
  8534. }
  8535. // 订单列表
  8536. function orderList(data) {
  8537. return (0, _request.default)({
  8538. url: '/api/order/list',
  8539. method: 'get',
  8540. data: data });
  8541. }
  8542. // 订单详细
  8543. function orderDetail(data, orderid) {
  8544. return (0, _request.default)({
  8545. url: '/api/order/detail/' + orderid,
  8546. method: 'get',
  8547. data: data });
  8548. }
  8549. // 取消订单
  8550. function orderCancel(data) {
  8551. return (0, _request.default)({
  8552. url: '/api/order/cancel',
  8553. method: 'post',
  8554. data: data });
  8555. }
  8556. // 删除订单
  8557. function orderDel(data) {
  8558. return (0, _request.default)({
  8559. url: '/api/order/del',
  8560. method: 'get',
  8561. data: data });
  8562. }
  8563. // 申请退款
  8564. function refund(data) {
  8565. return (0, _request.default)({
  8566. url: '/api/order/refund/verify',
  8567. method: 'post',
  8568. data: data });
  8569. }
  8570. // 退款理由列表
  8571. function refundReason(data) {
  8572. return (0, _request.default)({
  8573. url: '/api/order/refund/reason',
  8574. method: 'get',
  8575. data: data });
  8576. }
  8577. // 确认收货
  8578. function orderTake(data) {
  8579. return (0, _request.default)({
  8580. url: '/api/order/take',
  8581. method: 'post',
  8582. data: data });
  8583. }
  8584. // 订单支付
  8585. function orderPay(data) {
  8586. return (0, _request.default)({
  8587. url: '/api/order/pay',
  8588. method: 'post',
  8589. data: data });
  8590. }
  8591. // 创建订单
  8592. function createOrderkey(data, key) {
  8593. return (0, _request.default)({
  8594. url: '/api/order/create/' + key,
  8595. method: 'post',
  8596. data: data });
  8597. }
  8598. // 统计订单金额
  8599. function computedOrderkey(data) {
  8600. return (0, _request.default)({
  8601. url: '/api/order/computed/' + data.orderkey,
  8602. method: 'post',
  8603. data: data });
  8604. }
  8605. /***/ }),
  8606. /***/ 3:
  8607. /*!***********************************!*\
  8608. !*** (webpack)/buildin/global.js ***!
  8609. \***********************************/
  8610. /*! no static exports found */
  8611. /***/ (function(module, exports) {
  8612. var g;
  8613. // This works in non-strict mode
  8614. g = (function() {
  8615. return this;
  8616. })();
  8617. try {
  8618. // This works if eval is allowed (see CSP)
  8619. g = g || new Function("return this")();
  8620. } catch (e) {
  8621. // This works if the window reference is available
  8622. if (typeof window === "object") g = window;
  8623. }
  8624. // g can still be undefined, but nothing to do about it...
  8625. // We return undefined, instead of nothing here, so it's
  8626. // easier to handle this case. if(!global) { ...}
  8627. module.exports = g;
  8628. /***/ }),
  8629. /***/ 30:
  8630. /*!***************************************!*\
  8631. !*** G:/gsxm/git/xinwang/api/user.js ***!
  8632. \***************************************/
  8633. /*! no static exports found */
  8634. /***/ (function(module, exports, __webpack_require__) {
  8635. "use strict";
  8636. Object.defineProperty(exports, "__esModule", { value: true });exports.orderData = orderData;exports.getUserInfo = getUserInfo;exports.spreadBanner = spreadBanner;exports.getAddressList = getAddressList;exports.addressEdit = addressEdit;exports.addressDel = addressDel;exports.setAddressDefault = setAddressDefault;exports.getCartList = getCartList;exports.getCartNum = getCartNum;exports.cartDel = cartDel;exports.getcollectList = getcollectList;exports.delcollect = delcollect;exports.upload = upload;exports.edit = edit;exports.getSpreadPeople = getSpreadPeople;exports.getMyTvillage = getMyTvillage;exports.getSpreadCount = getSpreadCount;exports.getMyStore = getMyStore;exports.enter = enter;exports.editStore = editStore;var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 27));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  8637. // 订单统计信息
  8638. function orderData(data) {
  8639. return (0, _request.default)({
  8640. url: '/api/order/data',
  8641. method: 'get',
  8642. data: data });
  8643. }
  8644. // 获取用户信息
  8645. function getUserInfo(data) {
  8646. return (0, _request.default)({
  8647. url: '/api/userinfo',
  8648. method: 'get',
  8649. data: data });
  8650. }
  8651. // 用户分享图
  8652. function spreadBanner(data) {
  8653. return (0, _request.default)({
  8654. url: '/api/spread/banner',
  8655. method: 'get',
  8656. data: data });
  8657. }
  8658. // 获取地址列表
  8659. function getAddressList(data) {
  8660. return (0, _request.default)({
  8661. url: '/api/address/list',
  8662. method: 'get',
  8663. data: data });
  8664. }
  8665. // 修改地址
  8666. function addressEdit(data) {
  8667. return (0, _request.default)({
  8668. url: '/api/address/edit',
  8669. method: 'post',
  8670. data: data });
  8671. }
  8672. // 删除地址
  8673. function addressDel(data) {
  8674. return (0, _request.default)({
  8675. url: '/api/address/del',
  8676. method: 'post',
  8677. data: data });
  8678. }
  8679. // 设为默认地址
  8680. function setAddressDefault(data) {
  8681. return (0, _request.default)({
  8682. url: '/api/address/default/set',
  8683. method: 'post',
  8684. data: data });
  8685. }
  8686. // 购物车列表
  8687. function getCartList(data) {
  8688. return (0, _request.default)({
  8689. url: '/api/cart/list',
  8690. method: 'get',
  8691. data: data });
  8692. }
  8693. // 修改购物车数量
  8694. function getCartNum(data) {
  8695. return (0, _request.default)({
  8696. url: '/api/cart/num',
  8697. method: 'post',
  8698. data: data });
  8699. }
  8700. //删除购物车
  8701. function cartDel(data) {
  8702. return (0, _request.default)({
  8703. url: '/api/cart/del',
  8704. method: 'post',
  8705. data: data });
  8706. }
  8707. //获取收藏夹列表
  8708. function getcollectList(data) {
  8709. return (0, _request.default)({
  8710. url: '/api/collect/user',
  8711. method: 'get',
  8712. data: data });
  8713. }
  8714. // 取消收藏
  8715. function delcollect(data) {
  8716. return (0, _request.default)({
  8717. url: '/api/collect/del',
  8718. method: 'post',
  8719. data: data });
  8720. }
  8721. //上传图片
  8722. function upload(data) {
  8723. return (0, _request.upFilse)({
  8724. url: '/api/upload/image',
  8725. method: 'post',
  8726. data: data });
  8727. }
  8728. //用户修改信息
  8729. function edit(data) {
  8730. return (0, _request.default)({
  8731. url: '/api/user/edit',
  8732. method: 'post',
  8733. data: data });
  8734. }
  8735. // 推广的人数
  8736. function getSpreadPeople(data) {
  8737. return (0, _request.default)({
  8738. url: '/api/spread/people',
  8739. method: 'post',
  8740. data: data });
  8741. }
  8742. //我的会员
  8743. function getMyTvillage(data) {
  8744. return (0, _request.default)({
  8745. url: '/api/mytvillage',
  8746. method: 'get',
  8747. data: data });
  8748. }
  8749. //推广佣金/提现总和
  8750. //3=佣金,4=提现
  8751. function getSpreadCount(data, type) {
  8752. return (0, _request.default)({
  8753. url: '/api/spread/count/' + type,
  8754. method: 'get',
  8755. data: data });
  8756. }
  8757. //我的实体店
  8758. function getMyStore(data) {
  8759. return (0, _request.default)({
  8760. url: '/api/mystore',
  8761. method: 'get',
  8762. data: data });
  8763. }
  8764. //申请会员 店长
  8765. function enter(data) {
  8766. return (0, _request.default)({
  8767. url: '/api/enter',
  8768. method: 'post',
  8769. data: data });
  8770. }
  8771. //编辑门店
  8772. function editStore(data) {
  8773. return (0, _request.default)({
  8774. url: '/api/store_edit',
  8775. method: 'post',
  8776. data: data });
  8777. }
  8778. /***/ }),
  8779. /***/ 31:
  8780. /*!*************************************************!*\
  8781. !*** G:/gsxm/git/xinwang/api/functionalUnit.js ***!
  8782. \*************************************************/
  8783. /*! no static exports found */
  8784. /***/ (function(module, exports, __webpack_require__) {
  8785. "use strict";
  8786. Object.defineProperty(exports, "__esModule", { value: true });exports.getCouponsList = getCouponsList;exports.setCoupons = setCoupons;exports.couponsOrder = couponsOrder;exports.integrallist = integrallist;exports.signList = signList;exports.integral = integral;exports.signUser = signUser;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8787. //获取优惠券列表
  8788. function getCouponsList(data, types) {
  8789. //优惠券状态 0全部 1未使用 2已使用
  8790. return (0, _request.default)({
  8791. url: '/api/coupons/user/' + types,
  8792. method: 'get',
  8793. data: data });
  8794. }
  8795. //领取优惠券
  8796. function setCoupons(data) {
  8797. return (0, _request.default)({
  8798. url: '/api/coupon/receive',
  8799. method: 'post',
  8800. data: data });
  8801. }
  8802. //获取可使用优惠券
  8803. function couponsOrder(data, price) {
  8804. return (0, _request.default)({
  8805. url: '/api/coupons/order/' + price,
  8806. method: 'get',
  8807. data: data });
  8808. }
  8809. // 积分列表
  8810. function integrallist(data) {
  8811. return (0, _request.default)({
  8812. url: '/api/integral/list',
  8813. method: 'get',
  8814. data: data });
  8815. }
  8816. // 获取签到列表
  8817. function signList(data) {
  8818. return (0, _request.default)({
  8819. url: '/api/sign/list',
  8820. method: 'get',
  8821. data: data });
  8822. }
  8823. // 点击签到
  8824. function integral(data) {
  8825. return (0, _request.default)({
  8826. url: '/api/sign/integral',
  8827. method: 'post',
  8828. data: data });
  8829. }
  8830. // 签到信息
  8831. function signUser(data) {
  8832. return (0, _request.default)({
  8833. url: '/api/sign/user',
  8834. method: 'post',
  8835. data: data });
  8836. }
  8837. /***/ }),
  8838. /***/ 32:
  8839. /*!******************************************!*\
  8840. !*** G:/gsxm/git/xinwang/api/product.js ***!
  8841. \******************************************/
  8842. /*! no static exports found */
  8843. /***/ (function(module, exports, __webpack_require__) {
  8844. "use strict";
  8845. Object.defineProperty(exports, "__esModule", { value: true });exports.getProducts = getProducts;exports.goodsDetail = goodsDetail;exports.getBargainList = getBargainList;exports.cartAdd = cartAdd;exports.collectAdd = collectAdd;exports.collectDel = collectDel;exports.searchKeyword = searchKeyword;exports.groomList = groomList;exports.seckillGoods = seckillGoods;exports.groupGoods = groupGoods;exports.getCategoryList = getCategoryList;exports.getCombinationList = getCombinationList;exports.getCombinationLisRemove = getCombinationLisRemove;exports.getCombinationLisPink = getCombinationLisPink;exports.getCombinationPoster = getCombinationPoster;exports.getSeckillClass = getSeckillClass;exports.getSeckillList = getSeckillList;exports.reply_config = reply_config;exports.reply_list = reply_list;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8846. // 获取商品列表
  8847. function getProducts(data) {
  8848. // {
  8849. // 参数名称 是否必须 示例 备注
  8850. // sid 否 二级分类编号
  8851. // cid 否 一级分类编号(!)
  8852. // keyword 否 搜索
  8853. // priceOrder 否 价格排序
  8854. // salesOrder 否 销量排序
  8855. // news 否 是否新品
  8856. // page 否 分页参数起始值
  8857. // limit 否 分页数步长值
  8858. // }
  8859. return (0, _request.default)({
  8860. url: '/api/products',
  8861. method: 'get',
  8862. data: data });
  8863. }
  8864. // 获取商品详情
  8865. function goodsDetail(data, id) {
  8866. return (0, _request.default)({
  8867. url: '/api/product/detail/' + id,
  8868. method: 'get',
  8869. data: data });
  8870. }
  8871. // 砍价列表
  8872. function getBargainList(data) {
  8873. return (0, _request.default)({
  8874. url: '/api/bargain/list',
  8875. method: 'get',
  8876. data: data });
  8877. }
  8878. // 加入购物车
  8879. function cartAdd(data) {
  8880. return (0, _request.default)({
  8881. url: '/api/cart/add',
  8882. method: 'post',
  8883. data: data });
  8884. }
  8885. // 收藏商品
  8886. function collectAdd(data) {
  8887. return (0, _request.default)({
  8888. url: '/api/collect/add',
  8889. method: 'post',
  8890. data: data });
  8891. }
  8892. // 取消收藏商品
  8893. function collectDel(data) {
  8894. return (0, _request.default)({
  8895. url: '/api/collect/del',
  8896. method: 'post',
  8897. data: data });
  8898. }
  8899. // 获取搜搜关键字
  8900. function searchKeyword(data) {
  8901. return (0, _request.default)({
  8902. url: '/api/search/keyword',
  8903. method: 'get',
  8904. data: data });
  8905. }
  8906. // 获取热门分类信息
  8907. function groomList(data, type) {
  8908. // 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
  8909. return (0, _request.default)({
  8910. url: '/api/groom/list/' + type,
  8911. method: 'get',
  8912. data: data });
  8913. }
  8914. // 获取秒杀商品详细
  8915. function seckillGoods(data, id) {
  8916. return (0, _request.default)({
  8917. url: '/api/seckill/detail/' + id,
  8918. method: 'get',
  8919. data: data });
  8920. }
  8921. // 获取拼团商品详细
  8922. function groupGoods(data, id) {
  8923. return (0, _request.default)({
  8924. url: '/api/combination/detail/' + id,
  8925. method: 'get',
  8926. data: data });
  8927. }
  8928. // 获取商品分类
  8929. function getCategoryList(data) {
  8930. return (0, _request.default)({
  8931. url: '/api/category',
  8932. method: 'get',
  8933. data: data });
  8934. }
  8935. // 获取拼团列表
  8936. function getCombinationList(data) {
  8937. return (0, _request.default)({
  8938. url: '/api/combination/list',
  8939. method: 'get',
  8940. data: data });
  8941. }
  8942. //取消拼团
  8943. function getCombinationLisRemove(data, id) {
  8944. return (0, _request.default)({
  8945. url: '/api/combination/remove' + id,
  8946. method: 'get',
  8947. data: data });
  8948. }
  8949. //拼团开团页面数据
  8950. function getCombinationLisPink(data, id) {
  8951. return (0, _request.default)({
  8952. url: '/api/combination/pink/' + id,
  8953. method: 'get',
  8954. data: data });
  8955. }
  8956. // 获取拼团海报
  8957. function getCombinationPoster(data) {
  8958. return (0, _request.default)({
  8959. url: '/api/combination/poster',
  8960. method: 'post',
  8961. data: data });
  8962. }
  8963. // 获取秒杀分类
  8964. function getSeckillClass(data) {
  8965. return (0, _request.default)({
  8966. url: '/api/seckill/index',
  8967. method: 'get',
  8968. data: data });
  8969. }
  8970. // 获取秒杀列表
  8971. function getSeckillList(data, id) {
  8972. return (0, _request.default)({
  8973. url: '/api/seckill/list/' + id,
  8974. method: 'get',
  8975. data: data });
  8976. }
  8977. // 产品评价数量和好评度
  8978. function reply_config(data, id) {
  8979. return (0, _request.default)({
  8980. url: '/api/reply/config/' + id,
  8981. method: 'get',
  8982. data: data });
  8983. }
  8984. // 获取产品评论
  8985. function reply_list(data, id) {
  8986. return (0, _request.default)({
  8987. url: '/api/reply/list/' + id,
  8988. method: 'get',
  8989. data: data });
  8990. }
  8991. /***/ }),
  8992. /***/ 4:
  8993. /*!**************************************!*\
  8994. !*** G:/gsxm/git/xinwang/pages.json ***!
  8995. \**************************************/
  8996. /*! no static exports found */
  8997. /***/ (function(module, exports) {
  8998. /***/ }),
  8999. /***/ 41:
  9000. /*!****************************************!*\
  9001. !*** G:/gsxm/git/xinwang/api/login.js ***!
  9002. \****************************************/
  9003. /*! no static exports found */
  9004. /***/ (function(module, exports, __webpack_require__) {
  9005. "use strict";
  9006. Object.defineProperty(exports, "__esModule", { value: true });exports.login = login;exports.register = register;exports.verify = verify;exports.getUserInfo = getUserInfo;exports.loginMobile = loginMobile;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9007. // 登录
  9008. function login(data) {
  9009. return (0, _request.default)({
  9010. url: '/api/login',
  9011. method: 'post',
  9012. data: data });
  9013. }
  9014. // 注册
  9015. function register(data) {
  9016. return (0, _request.default)({
  9017. url: '/api/register',
  9018. method: 'post',
  9019. data: data });
  9020. }
  9021. // 验证码
  9022. function verify(data) {
  9023. // type=register为注册
  9024. // type=login为登录
  9025. return (0, _request.default)({
  9026. url: '/api/register/verify',
  9027. method: 'post',
  9028. data: data });
  9029. }
  9030. // 获取用户信息
  9031. function getUserInfo(data) {
  9032. return (0, _request.default)({
  9033. url: '/api/userinfo',
  9034. method: 'get',
  9035. data: data });
  9036. }
  9037. // 短信登录
  9038. function loginMobile(data) {
  9039. return (0, _request.default)({
  9040. url: '/api/login/mobile',
  9041. method: 'post',
  9042. data: data });
  9043. }
  9044. /***/ }),
  9045. /***/ 487:
  9046. /*!*********************************************************!*\
  9047. !*** G:/gsxm/git/xinwang/components/uni-icons/icons.js ***!
  9048. \*********************************************************/
  9049. /*! no static exports found */
  9050. /***/ (function(module, exports, __webpack_require__) {
  9051. "use strict";
  9052. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  9053. 'contact': "\uE100",
  9054. 'person': "\uE101",
  9055. 'personadd': "\uE102",
  9056. 'contact-filled': "\uE130",
  9057. 'person-filled': "\uE131",
  9058. 'personadd-filled': "\uE132",
  9059. 'phone': "\uE200",
  9060. 'email': "\uE201",
  9061. 'chatbubble': "\uE202",
  9062. 'chatboxes': "\uE203",
  9063. 'phone-filled': "\uE230",
  9064. 'email-filled': "\uE231",
  9065. 'chatbubble-filled': "\uE232",
  9066. 'chatboxes-filled': "\uE233",
  9067. 'weibo': "\uE260",
  9068. 'weixin': "\uE261",
  9069. 'pengyouquan': "\uE262",
  9070. 'chat': "\uE263",
  9071. 'qq': "\uE264",
  9072. 'videocam': "\uE300",
  9073. 'camera': "\uE301",
  9074. 'mic': "\uE302",
  9075. 'location': "\uE303",
  9076. 'mic-filled': "\uE332",
  9077. 'speech': "\uE332",
  9078. 'location-filled': "\uE333",
  9079. 'micoff': "\uE360",
  9080. 'image': "\uE363",
  9081. 'map': "\uE364",
  9082. 'compose': "\uE400",
  9083. 'trash': "\uE401",
  9084. 'upload': "\uE402",
  9085. 'download': "\uE403",
  9086. 'close': "\uE404",
  9087. 'redo': "\uE405",
  9088. 'undo': "\uE406",
  9089. 'refresh': "\uE407",
  9090. 'star': "\uE408",
  9091. 'plus': "\uE409",
  9092. 'minus': "\uE410",
  9093. 'circle': "\uE411",
  9094. 'checkbox': "\uE411",
  9095. 'close-filled': "\uE434",
  9096. 'clear': "\uE434",
  9097. 'refresh-filled': "\uE437",
  9098. 'star-filled': "\uE438",
  9099. 'plus-filled': "\uE439",
  9100. 'minus-filled': "\uE440",
  9101. 'circle-filled': "\uE441",
  9102. 'checkbox-filled': "\uE442",
  9103. 'closeempty': "\uE460",
  9104. 'refreshempty': "\uE461",
  9105. 'reload': "\uE462",
  9106. 'starhalf': "\uE463",
  9107. 'spinner': "\uE464",
  9108. 'spinner-cycle': "\uE465",
  9109. 'search': "\uE466",
  9110. 'plusempty': "\uE468",
  9111. 'forward': "\uE470",
  9112. 'back': "\uE471",
  9113. 'left-nav': "\uE471",
  9114. 'checkmarkempty': "\uE472",
  9115. 'home': "\uE500",
  9116. 'navigate': "\uE501",
  9117. 'gear': "\uE502",
  9118. 'paperplane': "\uE503",
  9119. 'info': "\uE504",
  9120. 'help': "\uE505",
  9121. 'locked': "\uE506",
  9122. 'more': "\uE507",
  9123. 'flag': "\uE508",
  9124. 'home-filled': "\uE530",
  9125. 'gear-filled': "\uE532",
  9126. 'info-filled': "\uE534",
  9127. 'help-filled': "\uE535",
  9128. 'more-filled': "\uE537",
  9129. 'settings': "\uE560",
  9130. 'list': "\uE562",
  9131. 'bars': "\uE563",
  9132. 'loop': "\uE565",
  9133. 'paperclip': "\uE567",
  9134. 'eye': "\uE568",
  9135. 'arrowup': "\uE580",
  9136. 'arrowdown': "\uE581",
  9137. 'arrowleft': "\uE582",
  9138. 'arrowright': "\uE583",
  9139. 'arrowthinup': "\uE584",
  9140. 'arrowthindown': "\uE585",
  9141. 'arrowthinleft': "\uE586",
  9142. 'arrowthinright': "\uE587",
  9143. 'pulldown': "\uE588",
  9144. 'closefill': "\uE589",
  9145. 'sound': "\uE590",
  9146. 'scan': "\uE612" };exports.default = _default;
  9147. /***/ }),
  9148. /***/ 5:
  9149. /*!******************************************!*\
  9150. !*** G:/gsxm/git/xinwang/store/index.js ***!
  9151. \******************************************/
  9152. /*! no static exports found */
  9153. /***/ (function(module, exports, __webpack_require__) {
  9154. "use strict";
  9155. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  9156. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 6));
  9157. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 7));
  9158. var _address = _interopRequireDefault(__webpack_require__(/*! ./model/address */ 8));
  9159. var _latlon = _interopRequireDefault(__webpack_require__(/*! ./model/latlon.js */ 9));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9160. _vue.default.use(_vuex.default);
  9161. var store = new _vuex.default.Store({
  9162. state: {
  9163. // baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置
  9164. baseURL: 'http://xw.liuniu946.com', //请求地址配置
  9165. urlFile: '/index', //项目部署所在文件夹
  9166. userInfo: {}, //登录信息
  9167. loginInterceptor: false, //是否打开强制登录
  9168. weichatInfo: {}, //保存微信注册信息
  9169. weichatObj: '' //微信对象
  9170. // hasLogin:false,
  9171. },
  9172. mutations: {
  9173. //保存微信信息
  9174. setWeiChatInfo: function setWeiChatInfo(state, provider) {
  9175. state.weichatInfo = provider;
  9176. },
  9177. //保存微信对象
  9178. setWeiChatObj: function setWeiChatObj(state, provider) {
  9179. state.weichatObj = provider;
  9180. },
  9181. //保存经度
  9182. setLatitude: function setLatitude(state, provider) {
  9183. state.latitude = provider;
  9184. } },
  9185. modules: {
  9186. user: _user.default,
  9187. address: _address.default,
  9188. latlon: _latlon.default },
  9189. actions: {} });var _default =
  9190. store;exports.default = _default;
  9191. /***/ }),
  9192. /***/ 58:
  9193. /*!*************************************!*\
  9194. !*** G:/gsxm/git/xinwang/api/wx.js ***!
  9195. \*************************************/
  9196. /*! no static exports found */
  9197. /***/ (function(module, exports, __webpack_require__) {
  9198. "use strict";
  9199. Object.defineProperty(exports, "__esModule", { value: true });exports.wechatMpAuth = wechatMpAuth;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 27));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9200. // 微信code地址
  9201. function wechatMpAuth(data) {
  9202. return (0, _request.default)({
  9203. url: '/api/wechat/mp_auth',
  9204. method: 'post',
  9205. data: data });
  9206. }
  9207. /***/ }),
  9208. /***/ 6:
  9209. /*!********************************************!*\
  9210. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  9211. \********************************************/
  9212. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  9213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9214. "use strict";
  9215. __webpack_require__.r(__webpack_exports__);
  9216. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  9217. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  9218. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  9219. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  9220. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  9221. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  9222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  9223. /*!
  9224. * vuex v3.4.0
  9225. * (c) 2020 Evan You
  9226. * @license MIT
  9227. */
  9228. function applyMixin (Vue) {
  9229. var version = Number(Vue.version.split('.')[0]);
  9230. if (version >= 2) {
  9231. Vue.mixin({ beforeCreate: vuexInit });
  9232. } else {
  9233. // override init and inject vuex init procedure
  9234. // for 1.x backwards compatibility.
  9235. var _init = Vue.prototype._init;
  9236. Vue.prototype._init = function (options) {
  9237. if ( options === void 0 ) options = {};
  9238. options.init = options.init
  9239. ? [vuexInit].concat(options.init)
  9240. : vuexInit;
  9241. _init.call(this, options);
  9242. };
  9243. }
  9244. /**
  9245. * Vuex init hook, injected into each instances init hooks list.
  9246. */
  9247. function vuexInit () {
  9248. var options = this.$options;
  9249. // store injection
  9250. if (options.store) {
  9251. this.$store = typeof options.store === 'function'
  9252. ? options.store()
  9253. : options.store;
  9254. } else if (options.parent && options.parent.$store) {
  9255. this.$store = options.parent.$store;
  9256. }
  9257. }
  9258. }
  9259. var target = typeof window !== 'undefined'
  9260. ? window
  9261. : typeof global !== 'undefined'
  9262. ? global
  9263. : {};
  9264. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  9265. function devtoolPlugin (store) {
  9266. if (!devtoolHook) { return }
  9267. store._devtoolHook = devtoolHook;
  9268. devtoolHook.emit('vuex:init', store);
  9269. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  9270. store.replaceState(targetState);
  9271. });
  9272. store.subscribe(function (mutation, state) {
  9273. devtoolHook.emit('vuex:mutation', mutation, state);
  9274. }, { prepend: true });
  9275. store.subscribeAction(function (action, state) {
  9276. devtoolHook.emit('vuex:action', action, state);
  9277. }, { prepend: true });
  9278. }
  9279. /**
  9280. * Get the first item that pass the test
  9281. * by second argument function
  9282. *
  9283. * @param {Array} list
  9284. * @param {Function} f
  9285. * @return {*}
  9286. */
  9287. /**
  9288. * forEach for object
  9289. */
  9290. function forEachValue (obj, fn) {
  9291. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  9292. }
  9293. function isObject (obj) {
  9294. return obj !== null && typeof obj === 'object'
  9295. }
  9296. function isPromise (val) {
  9297. return val && typeof val.then === 'function'
  9298. }
  9299. function assert (condition, msg) {
  9300. if (!condition) { throw new Error(("[vuex] " + msg)) }
  9301. }
  9302. function partial (fn, arg) {
  9303. return function () {
  9304. return fn(arg)
  9305. }
  9306. }
  9307. // Base data struct for store's module, package with some attribute and method
  9308. var Module = function Module (rawModule, runtime) {
  9309. this.runtime = runtime;
  9310. // Store some children item
  9311. this._children = Object.create(null);
  9312. // Store the origin module object which passed by programmer
  9313. this._rawModule = rawModule;
  9314. var rawState = rawModule.state;
  9315. // Store the origin module's state
  9316. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  9317. };
  9318. var prototypeAccessors = { namespaced: { configurable: true } };
  9319. prototypeAccessors.namespaced.get = function () {
  9320. return !!this._rawModule.namespaced
  9321. };
  9322. Module.prototype.addChild = function addChild (key, module) {
  9323. this._children[key] = module;
  9324. };
  9325. Module.prototype.removeChild = function removeChild (key) {
  9326. delete this._children[key];
  9327. };
  9328. Module.prototype.getChild = function getChild (key) {
  9329. return this._children[key]
  9330. };
  9331. Module.prototype.hasChild = function hasChild (key) {
  9332. return key in this._children
  9333. };
  9334. Module.prototype.update = function update (rawModule) {
  9335. this._rawModule.namespaced = rawModule.namespaced;
  9336. if (rawModule.actions) {
  9337. this._rawModule.actions = rawModule.actions;
  9338. }
  9339. if (rawModule.mutations) {
  9340. this._rawModule.mutations = rawModule.mutations;
  9341. }
  9342. if (rawModule.getters) {
  9343. this._rawModule.getters = rawModule.getters;
  9344. }
  9345. };
  9346. Module.prototype.forEachChild = function forEachChild (fn) {
  9347. forEachValue(this._children, fn);
  9348. };
  9349. Module.prototype.forEachGetter = function forEachGetter (fn) {
  9350. if (this._rawModule.getters) {
  9351. forEachValue(this._rawModule.getters, fn);
  9352. }
  9353. };
  9354. Module.prototype.forEachAction = function forEachAction (fn) {
  9355. if (this._rawModule.actions) {
  9356. forEachValue(this._rawModule.actions, fn);
  9357. }
  9358. };
  9359. Module.prototype.forEachMutation = function forEachMutation (fn) {
  9360. if (this._rawModule.mutations) {
  9361. forEachValue(this._rawModule.mutations, fn);
  9362. }
  9363. };
  9364. Object.defineProperties( Module.prototype, prototypeAccessors );
  9365. var ModuleCollection = function ModuleCollection (rawRootModule) {
  9366. // register root module (Vuex.Store options)
  9367. this.register([], rawRootModule, false);
  9368. };
  9369. ModuleCollection.prototype.get = function get (path) {
  9370. return path.reduce(function (module, key) {
  9371. return module.getChild(key)
  9372. }, this.root)
  9373. };
  9374. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  9375. var module = this.root;
  9376. return path.reduce(function (namespace, key) {
  9377. module = module.getChild(key);
  9378. return namespace + (module.namespaced ? key + '/' : '')
  9379. }, '')
  9380. };
  9381. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  9382. update([], this.root, rawRootModule);
  9383. };
  9384. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  9385. var this$1 = this;
  9386. if ( runtime === void 0 ) runtime = true;
  9387. if ((true)) {
  9388. assertRawModule(path, rawModule);
  9389. }
  9390. var newModule = new Module(rawModule, runtime);
  9391. if (path.length === 0) {
  9392. this.root = newModule;
  9393. } else {
  9394. var parent = this.get(path.slice(0, -1));
  9395. parent.addChild(path[path.length - 1], newModule);
  9396. }
  9397. // register nested modules
  9398. if (rawModule.modules) {
  9399. forEachValue(rawModule.modules, function (rawChildModule, key) {
  9400. this$1.register(path.concat(key), rawChildModule, runtime);
  9401. });
  9402. }
  9403. };
  9404. ModuleCollection.prototype.unregister = function unregister (path) {
  9405. var parent = this.get(path.slice(0, -1));
  9406. var key = path[path.length - 1];
  9407. if (!parent.getChild(key).runtime) { return }
  9408. parent.removeChild(key);
  9409. };
  9410. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  9411. var parent = this.get(path.slice(0, -1));
  9412. var key = path[path.length - 1];
  9413. return parent.hasChild(key)
  9414. };
  9415. function update (path, targetModule, newModule) {
  9416. if ((true)) {
  9417. assertRawModule(path, newModule);
  9418. }
  9419. // update target module
  9420. targetModule.update(newModule);
  9421. // update nested modules
  9422. if (newModule.modules) {
  9423. for (var key in newModule.modules) {
  9424. if (!targetModule.getChild(key)) {
  9425. if ((true)) {
  9426. console.warn(
  9427. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  9428. 'manual reload is needed'
  9429. );
  9430. }
  9431. return
  9432. }
  9433. update(
  9434. path.concat(key),
  9435. targetModule.getChild(key),
  9436. newModule.modules[key]
  9437. );
  9438. }
  9439. }
  9440. }
  9441. var functionAssert = {
  9442. assert: function (value) { return typeof value === 'function'; },
  9443. expected: 'function'
  9444. };
  9445. var objectAssert = {
  9446. assert: function (value) { return typeof value === 'function' ||
  9447. (typeof value === 'object' && typeof value.handler === 'function'); },
  9448. expected: 'function or object with "handler" function'
  9449. };
  9450. var assertTypes = {
  9451. getters: functionAssert,
  9452. mutations: functionAssert,
  9453. actions: objectAssert
  9454. };
  9455. function assertRawModule (path, rawModule) {
  9456. Object.keys(assertTypes).forEach(function (key) {
  9457. if (!rawModule[key]) { return }
  9458. var assertOptions = assertTypes[key];
  9459. forEachValue(rawModule[key], function (value, type) {
  9460. assert(
  9461. assertOptions.assert(value),
  9462. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  9463. );
  9464. });
  9465. });
  9466. }
  9467. function makeAssertionMessage (path, key, type, value, expected) {
  9468. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  9469. if (path.length > 0) {
  9470. buf += " in module \"" + (path.join('.')) + "\"";
  9471. }
  9472. buf += " is " + (JSON.stringify(value)) + ".";
  9473. return buf
  9474. }
  9475. var Vue; // bind on install
  9476. var Store = function Store (options) {
  9477. var this$1 = this;
  9478. if ( options === void 0 ) options = {};
  9479. // Auto install if it is not done yet and `window` has `Vue`.
  9480. // To allow users to avoid auto-installation in some cases,
  9481. // this code should be placed here. See #731
  9482. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  9483. install(window.Vue);
  9484. }
  9485. if ((true)) {
  9486. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  9487. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  9488. assert(this instanceof Store, "store must be called with the new operator.");
  9489. }
  9490. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  9491. var strict = options.strict; if ( strict === void 0 ) strict = false;
  9492. // store internal state
  9493. this._committing = false;
  9494. this._actions = Object.create(null);
  9495. this._actionSubscribers = [];
  9496. this._mutations = Object.create(null);
  9497. this._wrappedGetters = Object.create(null);
  9498. this._modules = new ModuleCollection(options);
  9499. this._modulesNamespaceMap = Object.create(null);
  9500. this._subscribers = [];
  9501. this._watcherVM = new Vue();
  9502. this._makeLocalGettersCache = Object.create(null);
  9503. // bind commit and dispatch to self
  9504. var store = this;
  9505. var ref = this;
  9506. var dispatch = ref.dispatch;
  9507. var commit = ref.commit;
  9508. this.dispatch = function boundDispatch (type, payload) {
  9509. return dispatch.call(store, type, payload)
  9510. };
  9511. this.commit = function boundCommit (type, payload, options) {
  9512. return commit.call(store, type, payload, options)
  9513. };
  9514. // strict mode
  9515. this.strict = strict;
  9516. var state = this._modules.root.state;
  9517. // init root module.
  9518. // this also recursively registers all sub-modules
  9519. // and collects all module getters inside this._wrappedGetters
  9520. installModule(this, state, [], this._modules.root);
  9521. // initialize the store vm, which is responsible for the reactivity
  9522. // (also registers _wrappedGetters as computed properties)
  9523. resetStoreVM(this, state);
  9524. // apply plugins
  9525. plugins.forEach(function (plugin) { return plugin(this$1); });
  9526. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  9527. if (useDevtools) {
  9528. devtoolPlugin(this);
  9529. }
  9530. };
  9531. var prototypeAccessors$1 = { state: { configurable: true } };
  9532. prototypeAccessors$1.state.get = function () {
  9533. return this._vm._data.$$state
  9534. };
  9535. prototypeAccessors$1.state.set = function (v) {
  9536. if ((true)) {
  9537. assert(false, "use store.replaceState() to explicit replace store state.");
  9538. }
  9539. };
  9540. Store.prototype.commit = function commit (_type, _payload, _options) {
  9541. var this$1 = this;
  9542. // check object-style commit
  9543. var ref = unifyObjectStyle(_type, _payload, _options);
  9544. var type = ref.type;
  9545. var payload = ref.payload;
  9546. var options = ref.options;
  9547. var mutation = { type: type, payload: payload };
  9548. var entry = this._mutations[type];
  9549. if (!entry) {
  9550. if ((true)) {
  9551. console.error(("[vuex] unknown mutation type: " + type));
  9552. }
  9553. return
  9554. }
  9555. this._withCommit(function () {
  9556. entry.forEach(function commitIterator (handler) {
  9557. handler(payload);
  9558. });
  9559. });
  9560. this._subscribers
  9561. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9562. .forEach(function (sub) { return sub(mutation, this$1.state); });
  9563. if (
  9564. ( true) &&
  9565. options && options.silent
  9566. ) {
  9567. console.warn(
  9568. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  9569. 'Use the filter functionality in the vue-devtools'
  9570. );
  9571. }
  9572. };
  9573. Store.prototype.dispatch = function dispatch (_type, _payload) {
  9574. var this$1 = this;
  9575. // check object-style dispatch
  9576. var ref = unifyObjectStyle(_type, _payload);
  9577. var type = ref.type;
  9578. var payload = ref.payload;
  9579. var action = { type: type, payload: payload };
  9580. var entry = this._actions[type];
  9581. if (!entry) {
  9582. if ((true)) {
  9583. console.error(("[vuex] unknown action type: " + type));
  9584. }
  9585. return
  9586. }
  9587. try {
  9588. this._actionSubscribers
  9589. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9590. .filter(function (sub) { return sub.before; })
  9591. .forEach(function (sub) { return sub.before(action, this$1.state); });
  9592. } catch (e) {
  9593. if ((true)) {
  9594. console.warn("[vuex] error in before action subscribers: ");
  9595. console.error(e);
  9596. }
  9597. }
  9598. var result = entry.length > 1
  9599. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  9600. : entry[0](payload);
  9601. return new Promise(function (resolve, reject) {
  9602. result.then(function (res) {
  9603. try {
  9604. this$1._actionSubscribers
  9605. .filter(function (sub) { return sub.after; })
  9606. .forEach(function (sub) { return sub.after(action, this$1.state); });
  9607. } catch (e) {
  9608. if ((true)) {
  9609. console.warn("[vuex] error in after action subscribers: ");
  9610. console.error(e);
  9611. }
  9612. }
  9613. resolve(res);
  9614. }, function (error) {
  9615. try {
  9616. this$1._actionSubscribers
  9617. .filter(function (sub) { return sub.error; })
  9618. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  9619. } catch (e) {
  9620. if ((true)) {
  9621. console.warn("[vuex] error in error action subscribers: ");
  9622. console.error(e);
  9623. }
  9624. }
  9625. reject(error);
  9626. });
  9627. })
  9628. };
  9629. Store.prototype.subscribe = function subscribe (fn, options) {
  9630. return genericSubscribe(fn, this._subscribers, options)
  9631. };
  9632. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  9633. var subs = typeof fn === 'function' ? { before: fn } : fn;
  9634. return genericSubscribe(subs, this._actionSubscribers, options)
  9635. };
  9636. Store.prototype.watch = function watch (getter, cb, options) {
  9637. var this$1 = this;
  9638. if ((true)) {
  9639. assert(typeof getter === 'function', "store.watch only accepts a function.");
  9640. }
  9641. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  9642. };
  9643. Store.prototype.replaceState = function replaceState (state) {
  9644. var this$1 = this;
  9645. this._withCommit(function () {
  9646. this$1._vm._data.$$state = state;
  9647. });
  9648. };
  9649. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  9650. if ( options === void 0 ) options = {};
  9651. if (typeof path === 'string') { path = [path]; }
  9652. if ((true)) {
  9653. assert(Array.isArray(path), "module path must be a string or an Array.");
  9654. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  9655. }
  9656. this._modules.register(path, rawModule);
  9657. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  9658. // reset store to update getters...
  9659. resetStoreVM(this, this.state);
  9660. };
  9661. Store.prototype.unregisterModule = function unregisterModule (path) {
  9662. var this$1 = this;
  9663. if (typeof path === 'string') { path = [path]; }
  9664. if ((true)) {
  9665. assert(Array.isArray(path), "module path must be a string or an Array.");
  9666. }
  9667. this._modules.unregister(path);
  9668. this._withCommit(function () {
  9669. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  9670. Vue.delete(parentState, path[path.length - 1]);
  9671. });
  9672. resetStore(this);
  9673. };
  9674. Store.prototype.hasModule = function hasModule (path) {
  9675. if (typeof path === 'string') { path = [path]; }
  9676. if ((true)) {
  9677. assert(Array.isArray(path), "module path must be a string or an Array.");
  9678. }
  9679. return this._modules.isRegistered(path)
  9680. };
  9681. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  9682. this._modules.update(newOptions);
  9683. resetStore(this, true);
  9684. };
  9685. Store.prototype._withCommit = function _withCommit (fn) {
  9686. var committing = this._committing;
  9687. this._committing = true;
  9688. fn();
  9689. this._committing = committing;
  9690. };
  9691. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  9692. function genericSubscribe (fn, subs, options) {
  9693. if (subs.indexOf(fn) < 0) {
  9694. options && options.prepend
  9695. ? subs.unshift(fn)
  9696. : subs.push(fn);
  9697. }
  9698. return function () {
  9699. var i = subs.indexOf(fn);
  9700. if (i > -1) {
  9701. subs.splice(i, 1);
  9702. }
  9703. }
  9704. }
  9705. function resetStore (store, hot) {
  9706. store._actions = Object.create(null);
  9707. store._mutations = Object.create(null);
  9708. store._wrappedGetters = Object.create(null);
  9709. store._modulesNamespaceMap = Object.create(null);
  9710. var state = store.state;
  9711. // init all modules
  9712. installModule(store, state, [], store._modules.root, true);
  9713. // reset vm
  9714. resetStoreVM(store, state, hot);
  9715. }
  9716. function resetStoreVM (store, state, hot) {
  9717. var oldVm = store._vm;
  9718. // bind store public getters
  9719. store.getters = {};
  9720. // reset local getters cache
  9721. store._makeLocalGettersCache = Object.create(null);
  9722. var wrappedGetters = store._wrappedGetters;
  9723. var computed = {};
  9724. forEachValue(wrappedGetters, function (fn, key) {
  9725. // use computed to leverage its lazy-caching mechanism
  9726. // direct inline function use will lead to closure preserving oldVm.
  9727. // using partial to return function with only arguments preserved in closure environment.
  9728. computed[key] = partial(fn, store);
  9729. Object.defineProperty(store.getters, key, {
  9730. get: function () { return store._vm[key]; },
  9731. enumerable: true // for local getters
  9732. });
  9733. });
  9734. // use a Vue instance to store the state tree
  9735. // suppress warnings just in case the user has added
  9736. // some funky global mixins
  9737. var silent = Vue.config.silent;
  9738. Vue.config.silent = true;
  9739. store._vm = new Vue({
  9740. data: {
  9741. $$state: state
  9742. },
  9743. computed: computed
  9744. });
  9745. Vue.config.silent = silent;
  9746. // enable strict mode for new vm
  9747. if (store.strict) {
  9748. enableStrictMode(store);
  9749. }
  9750. if (oldVm) {
  9751. if (hot) {
  9752. // dispatch changes in all subscribed watchers
  9753. // to force getter re-evaluation for hot reloading.
  9754. store._withCommit(function () {
  9755. oldVm._data.$$state = null;
  9756. });
  9757. }
  9758. Vue.nextTick(function () { return oldVm.$destroy(); });
  9759. }
  9760. }
  9761. function installModule (store, rootState, path, module, hot) {
  9762. var isRoot = !path.length;
  9763. var namespace = store._modules.getNamespace(path);
  9764. // register in namespace map
  9765. if (module.namespaced) {
  9766. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  9767. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  9768. }
  9769. store._modulesNamespaceMap[namespace] = module;
  9770. }
  9771. // set state
  9772. if (!isRoot && !hot) {
  9773. var parentState = getNestedState(rootState, path.slice(0, -1));
  9774. var moduleName = path[path.length - 1];
  9775. store._withCommit(function () {
  9776. if ((true)) {
  9777. if (moduleName in parentState) {
  9778. console.warn(
  9779. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  9780. );
  9781. }
  9782. }
  9783. Vue.set(parentState, moduleName, module.state);
  9784. });
  9785. }
  9786. var local = module.context = makeLocalContext(store, namespace, path);
  9787. module.forEachMutation(function (mutation, key) {
  9788. var namespacedType = namespace + key;
  9789. registerMutation(store, namespacedType, mutation, local);
  9790. });
  9791. module.forEachAction(function (action, key) {
  9792. var type = action.root ? key : namespace + key;
  9793. var handler = action.handler || action;
  9794. registerAction(store, type, handler, local);
  9795. });
  9796. module.forEachGetter(function (getter, key) {
  9797. var namespacedType = namespace + key;
  9798. registerGetter(store, namespacedType, getter, local);
  9799. });
  9800. module.forEachChild(function (child, key) {
  9801. installModule(store, rootState, path.concat(key), child, hot);
  9802. });
  9803. }
  9804. /**
  9805. * make localized dispatch, commit, getters and state
  9806. * if there is no namespace, just use root ones
  9807. */
  9808. function makeLocalContext (store, namespace, path) {
  9809. var noNamespace = namespace === '';
  9810. var local = {
  9811. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  9812. var args = unifyObjectStyle(_type, _payload, _options);
  9813. var payload = args.payload;
  9814. var options = args.options;
  9815. var type = args.type;
  9816. if (!options || !options.root) {
  9817. type = namespace + type;
  9818. if (( true) && !store._actions[type]) {
  9819. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  9820. return
  9821. }
  9822. }
  9823. return store.dispatch(type, payload)
  9824. },
  9825. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  9826. var args = unifyObjectStyle(_type, _payload, _options);
  9827. var payload = args.payload;
  9828. var options = args.options;
  9829. var type = args.type;
  9830. if (!options || !options.root) {
  9831. type = namespace + type;
  9832. if (( true) && !store._mutations[type]) {
  9833. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  9834. return
  9835. }
  9836. }
  9837. store.commit(type, payload, options);
  9838. }
  9839. };
  9840. // getters and state object must be gotten lazily
  9841. // because they will be changed by vm update
  9842. Object.defineProperties(local, {
  9843. getters: {
  9844. get: noNamespace
  9845. ? function () { return store.getters; }
  9846. : function () { return makeLocalGetters(store, namespace); }
  9847. },
  9848. state: {
  9849. get: function () { return getNestedState(store.state, path); }
  9850. }
  9851. });
  9852. return local
  9853. }
  9854. function makeLocalGetters (store, namespace) {
  9855. if (!store._makeLocalGettersCache[namespace]) {
  9856. var gettersProxy = {};
  9857. var splitPos = namespace.length;
  9858. Object.keys(store.getters).forEach(function (type) {
  9859. // skip if the target getter is not match this namespace
  9860. if (type.slice(0, splitPos) !== namespace) { return }
  9861. // extract local getter type
  9862. var localType = type.slice(splitPos);
  9863. // Add a port to the getters proxy.
  9864. // Define as getter property because
  9865. // we do not want to evaluate the getters in this time.
  9866. Object.defineProperty(gettersProxy, localType, {
  9867. get: function () { return store.getters[type]; },
  9868. enumerable: true
  9869. });
  9870. });
  9871. store._makeLocalGettersCache[namespace] = gettersProxy;
  9872. }
  9873. return store._makeLocalGettersCache[namespace]
  9874. }
  9875. function registerMutation (store, type, handler, local) {
  9876. var entry = store._mutations[type] || (store._mutations[type] = []);
  9877. entry.push(function wrappedMutationHandler (payload) {
  9878. handler.call(store, local.state, payload);
  9879. });
  9880. }
  9881. function registerAction (store, type, handler, local) {
  9882. var entry = store._actions[type] || (store._actions[type] = []);
  9883. entry.push(function wrappedActionHandler (payload) {
  9884. var res = handler.call(store, {
  9885. dispatch: local.dispatch,
  9886. commit: local.commit,
  9887. getters: local.getters,
  9888. state: local.state,
  9889. rootGetters: store.getters,
  9890. rootState: store.state
  9891. }, payload);
  9892. if (!isPromise(res)) {
  9893. res = Promise.resolve(res);
  9894. }
  9895. if (store._devtoolHook) {
  9896. return res.catch(function (err) {
  9897. store._devtoolHook.emit('vuex:error', err);
  9898. throw err
  9899. })
  9900. } else {
  9901. return res
  9902. }
  9903. });
  9904. }
  9905. function registerGetter (store, type, rawGetter, local) {
  9906. if (store._wrappedGetters[type]) {
  9907. if ((true)) {
  9908. console.error(("[vuex] duplicate getter key: " + type));
  9909. }
  9910. return
  9911. }
  9912. store._wrappedGetters[type] = function wrappedGetter (store) {
  9913. return rawGetter(
  9914. local.state, // local state
  9915. local.getters, // local getters
  9916. store.state, // root state
  9917. store.getters // root getters
  9918. )
  9919. };
  9920. }
  9921. function enableStrictMode (store) {
  9922. store._vm.$watch(function () { return this._data.$$state }, function () {
  9923. if ((true)) {
  9924. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  9925. }
  9926. }, { deep: true, sync: true });
  9927. }
  9928. function getNestedState (state, path) {
  9929. return path.reduce(function (state, key) { return state[key]; }, state)
  9930. }
  9931. function unifyObjectStyle (type, payload, options) {
  9932. if (isObject(type) && type.type) {
  9933. options = payload;
  9934. payload = type;
  9935. type = type.type;
  9936. }
  9937. if ((true)) {
  9938. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  9939. }
  9940. return { type: type, payload: payload, options: options }
  9941. }
  9942. function install (_Vue) {
  9943. if (Vue && _Vue === Vue) {
  9944. if ((true)) {
  9945. console.error(
  9946. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  9947. );
  9948. }
  9949. return
  9950. }
  9951. Vue = _Vue;
  9952. applyMixin(Vue);
  9953. }
  9954. /**
  9955. * Reduce the code which written in Vue.js for getting the state.
  9956. * @param {String} [namespace] - Module's namespace
  9957. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  9958. * @param {Object}
  9959. */
  9960. var mapState = normalizeNamespace(function (namespace, states) {
  9961. var res = {};
  9962. if (( true) && !isValidMap(states)) {
  9963. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  9964. }
  9965. normalizeMap(states).forEach(function (ref) {
  9966. var key = ref.key;
  9967. var val = ref.val;
  9968. res[key] = function mappedState () {
  9969. var state = this.$store.state;
  9970. var getters = this.$store.getters;
  9971. if (namespace) {
  9972. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  9973. if (!module) {
  9974. return
  9975. }
  9976. state = module.context.state;
  9977. getters = module.context.getters;
  9978. }
  9979. return typeof val === 'function'
  9980. ? val.call(this, state, getters)
  9981. : state[val]
  9982. };
  9983. // mark vuex getter for devtools
  9984. res[key].vuex = true;
  9985. });
  9986. return res
  9987. });
  9988. /**
  9989. * Reduce the code which written in Vue.js for committing the mutation
  9990. * @param {String} [namespace] - Module's namespace
  9991. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  9992. * @return {Object}
  9993. */
  9994. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  9995. var res = {};
  9996. if (( true) && !isValidMap(mutations)) {
  9997. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  9998. }
  9999. normalizeMap(mutations).forEach(function (ref) {
  10000. var key = ref.key;
  10001. var val = ref.val;
  10002. res[key] = function mappedMutation () {
  10003. var args = [], len = arguments.length;
  10004. while ( len-- ) args[ len ] = arguments[ len ];
  10005. // Get the commit method from store
  10006. var commit = this.$store.commit;
  10007. if (namespace) {
  10008. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10009. if (!module) {
  10010. return
  10011. }
  10012. commit = module.context.commit;
  10013. }
  10014. return typeof val === 'function'
  10015. ? val.apply(this, [commit].concat(args))
  10016. : commit.apply(this.$store, [val].concat(args))
  10017. };
  10018. });
  10019. return res
  10020. });
  10021. /**
  10022. * Reduce the code which written in Vue.js for getting the getters
  10023. * @param {String} [namespace] - Module's namespace
  10024. * @param {Object|Array} getters
  10025. * @return {Object}
  10026. */
  10027. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10028. var res = {};
  10029. if (( true) && !isValidMap(getters)) {
  10030. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10031. }
  10032. normalizeMap(getters).forEach(function (ref) {
  10033. var key = ref.key;
  10034. var val = ref.val;
  10035. // The namespace has been mutated by normalizeNamespace
  10036. val = namespace + val;
  10037. res[key] = function mappedGetter () {
  10038. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10039. return
  10040. }
  10041. if (( true) && !(val in this.$store.getters)) {
  10042. console.error(("[vuex] unknown getter: " + val));
  10043. return
  10044. }
  10045. return this.$store.getters[val]
  10046. };
  10047. // mark vuex getter for devtools
  10048. res[key].vuex = true;
  10049. });
  10050. return res
  10051. });
  10052. /**
  10053. * Reduce the code which written in Vue.js for dispatch the action
  10054. * @param {String} [namespace] - Module's namespace
  10055. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10056. * @return {Object}
  10057. */
  10058. var mapActions = normalizeNamespace(function (namespace, actions) {
  10059. var res = {};
  10060. if (( true) && !isValidMap(actions)) {
  10061. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10062. }
  10063. normalizeMap(actions).forEach(function (ref) {
  10064. var key = ref.key;
  10065. var val = ref.val;
  10066. res[key] = function mappedAction () {
  10067. var args = [], len = arguments.length;
  10068. while ( len-- ) args[ len ] = arguments[ len ];
  10069. // get dispatch function from store
  10070. var dispatch = this.$store.dispatch;
  10071. if (namespace) {
  10072. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  10073. if (!module) {
  10074. return
  10075. }
  10076. dispatch = module.context.dispatch;
  10077. }
  10078. return typeof val === 'function'
  10079. ? val.apply(this, [dispatch].concat(args))
  10080. : dispatch.apply(this.$store, [val].concat(args))
  10081. };
  10082. });
  10083. return res
  10084. });
  10085. /**
  10086. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  10087. * @param {String} namespace
  10088. * @return {Object}
  10089. */
  10090. var createNamespacedHelpers = function (namespace) { return ({
  10091. mapState: mapState.bind(null, namespace),
  10092. mapGetters: mapGetters.bind(null, namespace),
  10093. mapMutations: mapMutations.bind(null, namespace),
  10094. mapActions: mapActions.bind(null, namespace)
  10095. }); };
  10096. /**
  10097. * Normalize the map
  10098. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  10099. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  10100. * @param {Array|Object} map
  10101. * @return {Object}
  10102. */
  10103. function normalizeMap (map) {
  10104. if (!isValidMap(map)) {
  10105. return []
  10106. }
  10107. return Array.isArray(map)
  10108. ? map.map(function (key) { return ({ key: key, val: key }); })
  10109. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  10110. }
  10111. /**
  10112. * Validate whether given map is valid or not
  10113. * @param {*} map
  10114. * @return {Boolean}
  10115. */
  10116. function isValidMap (map) {
  10117. return Array.isArray(map) || isObject(map)
  10118. }
  10119. /**
  10120. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  10121. * @param {Function} fn
  10122. * @return {Function}
  10123. */
  10124. function normalizeNamespace (fn) {
  10125. return function (namespace, map) {
  10126. if (typeof namespace !== 'string') {
  10127. map = namespace;
  10128. namespace = '';
  10129. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  10130. namespace += '/';
  10131. }
  10132. return fn(namespace, map)
  10133. }
  10134. }
  10135. /**
  10136. * Search a special module from store by namespace. if module not exist, print error message.
  10137. * @param {Object} store
  10138. * @param {String} helper
  10139. * @param {String} namespace
  10140. * @return {Object}
  10141. */
  10142. function getModuleByNamespace (store, helper, namespace) {
  10143. var module = store._modulesNamespaceMap[namespace];
  10144. if (( true) && !module) {
  10145. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  10146. }
  10147. return module
  10148. }
  10149. var index = {
  10150. Store: Store,
  10151. install: install,
  10152. version: '3.4.0',
  10153. mapState: mapState,
  10154. mapMutations: mapMutations,
  10155. mapGetters: mapGetters,
  10156. mapActions: mapActions,
  10157. createNamespacedHelpers: createNamespacedHelpers
  10158. };
  10159. /* harmony default export */ __webpack_exports__["default"] = (index);
  10160. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  10161. /***/ }),
  10162. /***/ 7:
  10163. /*!***********************************************!*\
  10164. !*** G:/gsxm/git/xinwang/store/model/user.js ***!
  10165. \***********************************************/
  10166. /*! no static exports found */
  10167. /***/ (function(module, exports, __webpack_require__) {
  10168. "use strict";
  10169. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  10170. userInfo: {}, //用户信息
  10171. orderInfo: {
  10172. complete_count: 0, //完成
  10173. received_count: 0, //待收货
  10174. unshipped_count: 0, //待发货
  10175. order_count: 0, //订单总数
  10176. unpaid_count: 0 //待付款
  10177. }, //订单信息
  10178. hasLogin: false //是否登录
  10179. };
  10180. var mutations = {
  10181. // 登录
  10182. login: function login(state) {
  10183. state.hasLogin = true;
  10184. },
  10185. // 退出登录
  10186. logout: function logout(state, provider) {
  10187. state.hasLogin = false;
  10188. // 清空基础信息
  10189. state.userInfo = {};
  10190. state.orderInfo = {
  10191. complete_count: 0, //完成
  10192. received_count: 0, //待收货
  10193. unshipped_count: 0, //待发货
  10194. order_count: 0, //订单总数
  10195. unpaid_count: 0 //待付款
  10196. };
  10197. // 清除缓存用户信息
  10198. uni.removeStorage({
  10199. key: 'userInfo' });
  10200. // 清除缓存token
  10201. uni.removeStorage({
  10202. key: 'token' });
  10203. },
  10204. // 保存用户信息
  10205. setUserInfo: function setUserInfo(state, provider) {
  10206. state.userInfo = provider;
  10207. uni.setStorage({ //缓存用户登陆状态
  10208. key: 'userInfo',
  10209. data: provider });
  10210. },
  10211. // 保存订单信息
  10212. setOrderInfo: function setOrderInfo(state, provider) {
  10213. state.orderInfo = provider;
  10214. } };
  10215. var getters = {};var _default =
  10216. {
  10217. namespaced: true,
  10218. state: state,
  10219. mutations: mutations,
  10220. getters: getters };exports.default = _default;
  10221. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10222. /***/ }),
  10223. /***/ 8:
  10224. /*!**************************************************!*\
  10225. !*** G:/gsxm/git/xinwang/store/model/address.js ***!
  10226. \**************************************************/
  10227. /*! no static exports found */
  10228. /***/ (function(module, exports, __webpack_require__) {
  10229. "use strict";
  10230. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  10231. area: [], //省市区数据
  10232. city: [] //村镇数据
  10233. };
  10234. var mutations = {
  10235. // 设置省市区
  10236. setArea: function setArea(state, data) {
  10237. state.area = data;
  10238. },
  10239. // 设置村镇
  10240. setCity: function setCity(state, data) {
  10241. state.city = data;
  10242. } };
  10243. var getters = {};var _default =
  10244. {
  10245. namespaced: true,
  10246. state: state,
  10247. mutations: mutations,
  10248. getters: getters };exports.default = _default;
  10249. /***/ }),
  10250. /***/ 9:
  10251. /*!*************************************************!*\
  10252. !*** G:/gsxm/git/xinwang/store/model/latlon.js ***!
  10253. \*************************************************/
  10254. /*! no static exports found */
  10255. /***/ (function(module, exports, __webpack_require__) {
  10256. "use strict";
  10257. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  10258. lat: '', //纬度数据
  10259. lon: '' //经度数据
  10260. };
  10261. var mutations = {
  10262. // 设置纬度数据
  10263. setLat: function setLat(state, data) {
  10264. state.lat = data;
  10265. },
  10266. // 设置经度数据
  10267. setLon: function setLon(state, data) {
  10268. state.lon = data;
  10269. } };
  10270. var getters = {};var _default =
  10271. {
  10272. namespaced: true,
  10273. state: state,
  10274. mutations: mutations,
  10275. getters: getters };exports.default = _default;
  10276. /***/ })
  10277. }]);
  10278. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map