vendor.js 361 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. 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;}
  11. function b64DecodeUnicode(str) {
  12. return decodeURIComponent(atob(str).split('').map(function (c) {
  13. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  14. }).join(''));
  15. }
  16. function getCurrentUserInfo() {
  17. var token = wx.getStorageSync('uni_id_token') || '';
  18. var tokenArr = token.split('.');
  19. if (!token || tokenArr.length !== 3) {
  20. return {
  21. uid: null,
  22. role: [],
  23. permission: [],
  24. tokenExpired: 0 };
  25. }
  26. var userInfo;
  27. try {
  28. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  29. } catch (error) {
  30. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  31. }
  32. userInfo.tokenExpired = userInfo.exp * 1000;
  33. delete userInfo.exp;
  34. delete userInfo.iat;
  35. return userInfo;
  36. }
  37. function uniIdMixin(Vue) {
  38. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  39. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  40. return role.indexOf(roleId) > -1;
  41. };
  42. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  43. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  44. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  45. };
  46. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  47. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  48. return tokenExpired > Date.now();
  49. };
  50. }
  51. var _toString = Object.prototype.toString;
  52. var hasOwnProperty = Object.prototype.hasOwnProperty;
  53. function isFn(fn) {
  54. return typeof fn === 'function';
  55. }
  56. function isStr(str) {
  57. return typeof str === 'string';
  58. }
  59. function isPlainObject(obj) {
  60. return _toString.call(obj) === '[object Object]';
  61. }
  62. function hasOwn(obj, key) {
  63. return hasOwnProperty.call(obj, key);
  64. }
  65. function noop() {}
  66. /**
  67. * Create a cached version of a pure function.
  68. */
  69. function cached(fn) {
  70. var cache = Object.create(null);
  71. return function cachedFn(str) {
  72. var hit = cache[str];
  73. return hit || (cache[str] = fn(str));
  74. };
  75. }
  76. /**
  77. * Camelize a hyphen-delimited string.
  78. */
  79. var camelizeRE = /-(\w)/g;
  80. var camelize = cached(function (str) {
  81. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  82. });
  83. var HOOKS = [
  84. 'invoke',
  85. 'success',
  86. 'fail',
  87. 'complete',
  88. 'returnValue'];
  89. var globalInterceptors = {};
  90. var scopedInterceptors = {};
  91. function mergeHook(parentVal, childVal) {
  92. var res = childVal ?
  93. parentVal ?
  94. parentVal.concat(childVal) :
  95. Array.isArray(childVal) ?
  96. childVal : [childVal] :
  97. parentVal;
  98. return res ?
  99. dedupeHooks(res) :
  100. res;
  101. }
  102. function dedupeHooks(hooks) {
  103. var res = [];
  104. for (var i = 0; i < hooks.length; i++) {
  105. if (res.indexOf(hooks[i]) === -1) {
  106. res.push(hooks[i]);
  107. }
  108. }
  109. return res;
  110. }
  111. function removeHook(hooks, hook) {
  112. var index = hooks.indexOf(hook);
  113. if (index !== -1) {
  114. hooks.splice(index, 1);
  115. }
  116. }
  117. function mergeInterceptorHook(interceptor, option) {
  118. Object.keys(option).forEach(function (hook) {
  119. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  120. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  121. }
  122. });
  123. }
  124. function removeInterceptorHook(interceptor, option) {
  125. if (!interceptor || !option) {
  126. return;
  127. }
  128. Object.keys(option).forEach(function (hook) {
  129. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  130. removeHook(interceptor[hook], option[hook]);
  131. }
  132. });
  133. }
  134. function addInterceptor(method, option) {
  135. if (typeof method === 'string' && isPlainObject(option)) {
  136. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  137. } else if (isPlainObject(method)) {
  138. mergeInterceptorHook(globalInterceptors, method);
  139. }
  140. }
  141. function removeInterceptor(method, option) {
  142. if (typeof method === 'string') {
  143. if (isPlainObject(option)) {
  144. removeInterceptorHook(scopedInterceptors[method], option);
  145. } else {
  146. delete scopedInterceptors[method];
  147. }
  148. } else if (isPlainObject(method)) {
  149. removeInterceptorHook(globalInterceptors, method);
  150. }
  151. }
  152. function wrapperHook(hook) {
  153. return function (data) {
  154. return hook(data) || data;
  155. };
  156. }
  157. function isPromise(obj) {
  158. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  159. }
  160. function queue(hooks, data) {
  161. var promise = false;
  162. for (var i = 0; i < hooks.length; i++) {
  163. var hook = hooks[i];
  164. if (promise) {
  165. promise = Promise.resolve(wrapperHook(hook));
  166. } else {
  167. var res = hook(data);
  168. if (isPromise(res)) {
  169. promise = Promise.resolve(res);
  170. }
  171. if (res === false) {
  172. return {
  173. then: function then() {} };
  174. }
  175. }
  176. }
  177. return promise || {
  178. then: function then(callback) {
  179. return callback(data);
  180. } };
  181. }
  182. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  183. ['success', 'fail', 'complete'].forEach(function (name) {
  184. if (Array.isArray(interceptor[name])) {
  185. var oldCallback = options[name];
  186. options[name] = function callbackInterceptor(res) {
  187. queue(interceptor[name], res).then(function (res) {
  188. /* eslint-disable no-mixed-operators */
  189. return isFn(oldCallback) && oldCallback(res) || res;
  190. });
  191. };
  192. }
  193. });
  194. return options;
  195. }
  196. function wrapperReturnValue(method, returnValue) {
  197. var returnValueHooks = [];
  198. if (Array.isArray(globalInterceptors.returnValue)) {
  199. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  200. }
  201. var interceptor = scopedInterceptors[method];
  202. if (interceptor && Array.isArray(interceptor.returnValue)) {
  203. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  204. }
  205. returnValueHooks.forEach(function (hook) {
  206. returnValue = hook(returnValue) || returnValue;
  207. });
  208. return returnValue;
  209. }
  210. function getApiInterceptorHooks(method) {
  211. var interceptor = Object.create(null);
  212. Object.keys(globalInterceptors).forEach(function (hook) {
  213. if (hook !== 'returnValue') {
  214. interceptor[hook] = globalInterceptors[hook].slice();
  215. }
  216. });
  217. var scopedInterceptor = scopedInterceptors[method];
  218. if (scopedInterceptor) {
  219. Object.keys(scopedInterceptor).forEach(function (hook) {
  220. if (hook !== 'returnValue') {
  221. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  222. }
  223. });
  224. }
  225. return interceptor;
  226. }
  227. 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];}
  228. var interceptor = getApiInterceptorHooks(method);
  229. if (interceptor && Object.keys(interceptor).length) {
  230. if (Array.isArray(interceptor.invoke)) {
  231. var res = queue(interceptor.invoke, options);
  232. return res.then(function (options) {
  233. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  234. });
  235. } else {
  236. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  237. }
  238. }
  239. return api.apply(void 0, [options].concat(params));
  240. }
  241. var promiseInterceptor = {
  242. returnValue: function returnValue(res) {
  243. if (!isPromise(res)) {
  244. return res;
  245. }
  246. return res.then(function (res) {
  247. return res[1];
  248. }).catch(function (res) {
  249. return res[0];
  250. });
  251. } };
  252. var SYNC_API_RE =
  253. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  254. var CONTEXT_API_RE = /^create|Manager$/;
  255. // Context例外情况
  256. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  257. // 同步例外情况
  258. var ASYNC_API = ['createBLEConnection'];
  259. var CALLBACK_API_RE = /^on|^off/;
  260. function isContextApi(name) {
  261. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  262. }
  263. function isSyncApi(name) {
  264. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  265. }
  266. function isCallbackApi(name) {
  267. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  268. }
  269. function handlePromise(promise) {
  270. return promise.then(function (data) {
  271. return [null, data];
  272. }).
  273. catch(function (err) {return [err];});
  274. }
  275. function shouldPromise(name) {
  276. if (
  277. isContextApi(name) ||
  278. isSyncApi(name) ||
  279. isCallbackApi(name))
  280. {
  281. return false;
  282. }
  283. return true;
  284. }
  285. /* eslint-disable no-extend-native */
  286. if (!Promise.prototype.finally) {
  287. Promise.prototype.finally = function (callback) {
  288. var promise = this.constructor;
  289. return this.then(
  290. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  291. function (reason) {return promise.resolve(callback()).then(function () {
  292. throw reason;
  293. });});
  294. };
  295. }
  296. function promisify(name, api) {
  297. if (!shouldPromise(name)) {
  298. return api;
  299. }
  300. 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];}
  301. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  302. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  303. }
  304. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  305. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  306. success: resolve,
  307. fail: reject })].concat(
  308. params));
  309. })));
  310. };
  311. }
  312. var EPS = 1e-4;
  313. var BASE_DEVICE_WIDTH = 750;
  314. var isIOS = false;
  315. var deviceWidth = 0;
  316. var deviceDPR = 0;
  317. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  318. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  319. deviceWidth = windowWidth;
  320. deviceDPR = pixelRatio;
  321. isIOS = platform === 'ios';
  322. }
  323. function upx2px(number, newDeviceWidth) {
  324. if (deviceWidth === 0) {
  325. checkDeviceWidth();
  326. }
  327. number = Number(number);
  328. if (number === 0) {
  329. return 0;
  330. }
  331. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  332. if (result < 0) {
  333. result = -result;
  334. }
  335. result = Math.floor(result + EPS);
  336. if (result === 0) {
  337. if (deviceDPR === 1 || !isIOS) {
  338. result = 1;
  339. } else {
  340. result = 0.5;
  341. }
  342. }
  343. return number < 0 ? -result : result;
  344. }
  345. var interceptors = {
  346. promiseInterceptor: promiseInterceptor };
  347. var baseApi = /*#__PURE__*/Object.freeze({
  348. __proto__: null,
  349. upx2px: upx2px,
  350. addInterceptor: addInterceptor,
  351. removeInterceptor: removeInterceptor,
  352. interceptors: interceptors });
  353. function findExistsPageIndex(url) {
  354. var pages = getCurrentPages();
  355. var len = pages.length;
  356. while (len--) {
  357. var page = pages[len];
  358. if (page.$page && page.$page.fullPath === url) {
  359. return len;
  360. }
  361. }
  362. return -1;
  363. }
  364. var redirectTo = {
  365. name: function name(fromArgs) {
  366. if (fromArgs.exists === 'back' && fromArgs.delta) {
  367. return 'navigateBack';
  368. }
  369. return 'redirectTo';
  370. },
  371. args: function args(fromArgs) {
  372. if (fromArgs.exists === 'back' && fromArgs.url) {
  373. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  374. if (existsPageIndex !== -1) {
  375. var delta = getCurrentPages().length - 1 - existsPageIndex;
  376. if (delta > 0) {
  377. fromArgs.delta = delta;
  378. }
  379. }
  380. }
  381. } };
  382. var previewImage = {
  383. args: function args(fromArgs) {
  384. var currentIndex = parseInt(fromArgs.current);
  385. if (isNaN(currentIndex)) {
  386. return;
  387. }
  388. var urls = fromArgs.urls;
  389. if (!Array.isArray(urls)) {
  390. return;
  391. }
  392. var len = urls.length;
  393. if (!len) {
  394. return;
  395. }
  396. if (currentIndex < 0) {
  397. currentIndex = 0;
  398. } else if (currentIndex >= len) {
  399. currentIndex = len - 1;
  400. }
  401. if (currentIndex > 0) {
  402. fromArgs.current = urls[currentIndex];
  403. fromArgs.urls = urls.filter(
  404. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  405. } else {
  406. fromArgs.current = urls[0];
  407. }
  408. return {
  409. indicator: false,
  410. loop: false };
  411. } };
  412. var UUID_KEY = '__DC_STAT_UUID';
  413. var deviceId;
  414. function addUuid(result) {
  415. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  416. if (!deviceId) {
  417. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  418. wx.setStorage({
  419. key: UUID_KEY,
  420. data: deviceId });
  421. }
  422. result.deviceId = deviceId;
  423. }
  424. function addSafeAreaInsets(result) {
  425. if (result.safeArea) {
  426. var safeArea = result.safeArea;
  427. result.safeAreaInsets = {
  428. top: safeArea.top,
  429. left: safeArea.left,
  430. right: result.windowWidth - safeArea.right,
  431. bottom: result.windowHeight - safeArea.bottom };
  432. }
  433. }
  434. var getSystemInfo = {
  435. returnValue: function returnValue(result) {
  436. addUuid(result);
  437. addSafeAreaInsets(result);
  438. } };
  439. // import navigateTo from 'uni-helpers/navigate-to'
  440. var protocols = {
  441. redirectTo: redirectTo,
  442. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  443. previewImage: previewImage,
  444. getSystemInfo: getSystemInfo,
  445. getSystemInfoSync: getSystemInfo };
  446. var todos = [
  447. 'vibrate',
  448. 'preloadPage',
  449. 'unPreloadPage',
  450. 'loadSubPackage'];
  451. var canIUses = [];
  452. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  453. function processCallback(methodName, method, returnValue) {
  454. return function (res) {
  455. return method(processReturnValue(methodName, res, returnValue));
  456. };
  457. }
  458. 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;
  459. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  460. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  461. if (isFn(argsOption)) {
  462. argsOption = argsOption(fromArgs, toArgs) || {};
  463. }
  464. for (var key in fromArgs) {
  465. if (hasOwn(argsOption, key)) {
  466. var keyOption = argsOption[key];
  467. if (isFn(keyOption)) {
  468. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  469. }
  470. if (!keyOption) {// 不支持的参数
  471. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  472. } else if (isStr(keyOption)) {// 重写参数 key
  473. toArgs[keyOption] = fromArgs[key];
  474. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  475. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  476. }
  477. } else if (CALLBACKS.indexOf(key) !== -1) {
  478. if (isFn(fromArgs[key])) {
  479. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  480. }
  481. } else {
  482. if (!keepFromArgs) {
  483. toArgs[key] = fromArgs[key];
  484. }
  485. }
  486. }
  487. return toArgs;
  488. } else if (isFn(fromArgs)) {
  489. fromArgs = processCallback(methodName, fromArgs, returnValue);
  490. }
  491. return fromArgs;
  492. }
  493. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  494. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  495. res = protocols.returnValue(methodName, res);
  496. }
  497. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  498. }
  499. function wrapper(methodName, method) {
  500. if (hasOwn(protocols, methodName)) {
  501. var protocol = protocols[methodName];
  502. if (!protocol) {// 暂不支持的 api
  503. return function () {
  504. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  505. };
  506. }
  507. return function (arg1, arg2) {// 目前 api 最多两个参数
  508. var options = protocol;
  509. if (isFn(protocol)) {
  510. options = protocol(arg1);
  511. }
  512. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  513. var args = [arg1];
  514. if (typeof arg2 !== 'undefined') {
  515. args.push(arg2);
  516. }
  517. if (isFn(options.name)) {
  518. methodName = options.name(arg1);
  519. } else if (isStr(options.name)) {
  520. methodName = options.name;
  521. }
  522. var returnValue = wx[methodName].apply(wx, args);
  523. if (isSyncApi(methodName)) {// 同步 api
  524. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  525. }
  526. return returnValue;
  527. };
  528. }
  529. return method;
  530. }
  531. var todoApis = Object.create(null);
  532. var TODOS = [
  533. 'onTabBarMidButtonTap',
  534. 'subscribePush',
  535. 'unsubscribePush',
  536. 'onPush',
  537. 'offPush',
  538. 'share'];
  539. function createTodoApi(name) {
  540. return function todoApi(_ref)
  541. {var fail = _ref.fail,complete = _ref.complete;
  542. var res = {
  543. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  544. isFn(fail) && fail(res);
  545. isFn(complete) && complete(res);
  546. };
  547. }
  548. TODOS.forEach(function (name) {
  549. todoApis[name] = createTodoApi(name);
  550. });
  551. var providers = {
  552. oauth: ['weixin'],
  553. share: ['weixin'],
  554. payment: ['wxpay'],
  555. push: ['weixin'] };
  556. function getProvider(_ref2)
  557. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  558. var res = false;
  559. if (providers[service]) {
  560. res = {
  561. errMsg: 'getProvider:ok',
  562. service: service,
  563. provider: providers[service] };
  564. isFn(success) && success(res);
  565. } else {
  566. res = {
  567. errMsg: 'getProvider:fail service not found' };
  568. isFn(fail) && fail(res);
  569. }
  570. isFn(complete) && complete(res);
  571. }
  572. var extraApi = /*#__PURE__*/Object.freeze({
  573. __proto__: null,
  574. getProvider: getProvider });
  575. var getEmitter = function () {
  576. var Emitter;
  577. return function getUniEmitter() {
  578. if (!Emitter) {
  579. Emitter = new _vue.default();
  580. }
  581. return Emitter;
  582. };
  583. }();
  584. function apply(ctx, method, args) {
  585. return ctx[method].apply(ctx, args);
  586. }
  587. function $on() {
  588. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  589. }
  590. function $off() {
  591. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  592. }
  593. function $once() {
  594. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  595. }
  596. function $emit() {
  597. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  598. }
  599. var eventApi = /*#__PURE__*/Object.freeze({
  600. __proto__: null,
  601. $on: $on,
  602. $off: $off,
  603. $once: $once,
  604. $emit: $emit });
  605. var api = /*#__PURE__*/Object.freeze({
  606. __proto__: null });
  607. var MPPage = Page;
  608. var MPComponent = Component;
  609. var customizeRE = /:/g;
  610. var customize = cached(function (str) {
  611. return camelize(str.replace(customizeRE, '-'));
  612. });
  613. function initTriggerEvent(mpInstance) {
  614. {
  615. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  616. return;
  617. }
  618. }
  619. var oldTriggerEvent = mpInstance.triggerEvent;
  620. 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];}
  621. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  622. };
  623. }
  624. function initHook(name, options) {
  625. var oldHook = options[name];
  626. if (!oldHook) {
  627. options[name] = function () {
  628. initTriggerEvent(this);
  629. };
  630. } else {
  631. options[name] = function () {
  632. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  633. return oldHook.apply(this, args);
  634. };
  635. }
  636. }
  637. if (!MPPage.__$wrappered) {
  638. MPPage.__$wrappered = true;
  639. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  640. initHook('onLoad', options);
  641. return MPPage(options);
  642. };
  643. Page.after = MPPage.after;
  644. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  645. initHook('created', options);
  646. return MPComponent(options);
  647. };
  648. }
  649. var PAGE_EVENT_HOOKS = [
  650. 'onPullDownRefresh',
  651. 'onReachBottom',
  652. 'onAddToFavorites',
  653. 'onShareTimeline',
  654. 'onShareAppMessage',
  655. 'onPageScroll',
  656. 'onResize',
  657. 'onTabItemTap'];
  658. function initMocks(vm, mocks) {
  659. var mpInstance = vm.$mp[vm.mpType];
  660. mocks.forEach(function (mock) {
  661. if (hasOwn(mpInstance, mock)) {
  662. vm[mock] = mpInstance[mock];
  663. }
  664. });
  665. }
  666. function hasHook(hook, vueOptions) {
  667. if (!vueOptions) {
  668. return true;
  669. }
  670. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  671. return true;
  672. }
  673. vueOptions = vueOptions.default || vueOptions;
  674. if (isFn(vueOptions)) {
  675. if (isFn(vueOptions.extendOptions[hook])) {
  676. return true;
  677. }
  678. if (vueOptions.super &&
  679. vueOptions.super.options &&
  680. Array.isArray(vueOptions.super.options[hook])) {
  681. return true;
  682. }
  683. return false;
  684. }
  685. if (isFn(vueOptions[hook])) {
  686. return true;
  687. }
  688. var mixins = vueOptions.mixins;
  689. if (Array.isArray(mixins)) {
  690. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  691. }
  692. }
  693. function initHooks(mpOptions, hooks, vueOptions) {
  694. hooks.forEach(function (hook) {
  695. if (hasHook(hook, vueOptions)) {
  696. mpOptions[hook] = function (args) {
  697. return this.$vm && this.$vm.__call_hook(hook, args);
  698. };
  699. }
  700. });
  701. }
  702. function initVueComponent(Vue, vueOptions) {
  703. vueOptions = vueOptions.default || vueOptions;
  704. var VueComponent;
  705. if (isFn(vueOptions)) {
  706. VueComponent = vueOptions;
  707. } else {
  708. VueComponent = Vue.extend(vueOptions);
  709. }
  710. vueOptions = VueComponent.options;
  711. return [VueComponent, vueOptions];
  712. }
  713. function initSlots(vm, vueSlots) {
  714. if (Array.isArray(vueSlots) && vueSlots.length) {
  715. var $slots = Object.create(null);
  716. vueSlots.forEach(function (slotName) {
  717. $slots[slotName] = true;
  718. });
  719. vm.$scopedSlots = vm.$slots = $slots;
  720. }
  721. }
  722. function initVueIds(vueIds, mpInstance) {
  723. vueIds = (vueIds || '').split(',');
  724. var len = vueIds.length;
  725. if (len === 1) {
  726. mpInstance._$vueId = vueIds[0];
  727. } else if (len === 2) {
  728. mpInstance._$vueId = vueIds[0];
  729. mpInstance._$vuePid = vueIds[1];
  730. }
  731. }
  732. function initData(vueOptions, context) {
  733. var data = vueOptions.data || {};
  734. var methods = vueOptions.methods || {};
  735. if (typeof data === 'function') {
  736. try {
  737. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  738. } catch (e) {
  739. if (Object({"VUE_APP_NAME":"添利","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  740. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  741. }
  742. }
  743. } else {
  744. try {
  745. // 对 data 格式化
  746. data = JSON.parse(JSON.stringify(data));
  747. } catch (e) {}
  748. }
  749. if (!isPlainObject(data)) {
  750. data = {};
  751. }
  752. Object.keys(methods).forEach(function (methodName) {
  753. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  754. data[methodName] = methods[methodName];
  755. }
  756. });
  757. return data;
  758. }
  759. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  760. function createObserver(name) {
  761. return function observer(newVal, oldVal) {
  762. if (this.$vm) {
  763. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  764. }
  765. };
  766. }
  767. function initBehaviors(vueOptions, initBehavior) {
  768. var vueBehaviors = vueOptions.behaviors;
  769. var vueExtends = vueOptions.extends;
  770. var vueMixins = vueOptions.mixins;
  771. var vueProps = vueOptions.props;
  772. if (!vueProps) {
  773. vueOptions.props = vueProps = [];
  774. }
  775. var behaviors = [];
  776. if (Array.isArray(vueBehaviors)) {
  777. vueBehaviors.forEach(function (behavior) {
  778. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  779. if (behavior === 'uni://form-field') {
  780. if (Array.isArray(vueProps)) {
  781. vueProps.push('name');
  782. vueProps.push('value');
  783. } else {
  784. vueProps.name = {
  785. type: String,
  786. default: '' };
  787. vueProps.value = {
  788. type: [String, Number, Boolean, Array, Object, Date],
  789. default: '' };
  790. }
  791. }
  792. });
  793. }
  794. if (isPlainObject(vueExtends) && vueExtends.props) {
  795. behaviors.push(
  796. initBehavior({
  797. properties: initProperties(vueExtends.props, true) }));
  798. }
  799. if (Array.isArray(vueMixins)) {
  800. vueMixins.forEach(function (vueMixin) {
  801. if (isPlainObject(vueMixin) && vueMixin.props) {
  802. behaviors.push(
  803. initBehavior({
  804. properties: initProperties(vueMixin.props, true) }));
  805. }
  806. });
  807. }
  808. return behaviors;
  809. }
  810. function parsePropType(key, type, defaultValue, file) {
  811. // [String]=>String
  812. if (Array.isArray(type) && type.length === 1) {
  813. return type[0];
  814. }
  815. return type;
  816. }
  817. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  818. var properties = {};
  819. if (!isBehavior) {
  820. properties.vueId = {
  821. type: String,
  822. value: '' };
  823. // 用于字节跳动小程序模拟抽象节点
  824. properties.generic = {
  825. type: Object,
  826. value: null };
  827. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  828. type: null,
  829. value: [],
  830. observer: function observer(newVal, oldVal) {
  831. var $slots = Object.create(null);
  832. newVal.forEach(function (slotName) {
  833. $slots[slotName] = true;
  834. });
  835. this.setData({
  836. $slots: $slots });
  837. } };
  838. }
  839. if (Array.isArray(props)) {// ['title']
  840. props.forEach(function (key) {
  841. properties[key] = {
  842. type: null,
  843. observer: createObserver(key) };
  844. });
  845. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  846. Object.keys(props).forEach(function (key) {
  847. var opts = props[key];
  848. if (isPlainObject(opts)) {// title:{type:String,default:''}
  849. var value = opts.default;
  850. if (isFn(value)) {
  851. value = value();
  852. }
  853. opts.type = parsePropType(key, opts.type);
  854. properties[key] = {
  855. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  856. value: value,
  857. observer: createObserver(key) };
  858. } else {// content:String
  859. var type = parsePropType(key, opts);
  860. properties[key] = {
  861. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  862. observer: createObserver(key) };
  863. }
  864. });
  865. }
  866. return properties;
  867. }
  868. function wrapper$1(event) {
  869. // TODO 又得兼容 mpvue 的 mp 对象
  870. try {
  871. event.mp = JSON.parse(JSON.stringify(event));
  872. } catch (e) {}
  873. event.stopPropagation = noop;
  874. event.preventDefault = noop;
  875. event.target = event.target || {};
  876. if (!hasOwn(event, 'detail')) {
  877. event.detail = {};
  878. }
  879. if (hasOwn(event, 'markerId')) {
  880. event.detail = typeof event.detail === 'object' ? event.detail : {};
  881. event.detail.markerId = event.markerId;
  882. }
  883. if (isPlainObject(event.detail)) {
  884. event.target = Object.assign({}, event.target, event.detail);
  885. }
  886. return event;
  887. }
  888. function getExtraValue(vm, dataPathsArray) {
  889. var context = vm;
  890. dataPathsArray.forEach(function (dataPathArray) {
  891. var dataPath = dataPathArray[0];
  892. var value = dataPathArray[2];
  893. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  894. var propPath = dataPathArray[1];
  895. var valuePath = dataPathArray[3];
  896. var vFor;
  897. if (Number.isInteger(dataPath)) {
  898. vFor = dataPath;
  899. } else if (!dataPath) {
  900. vFor = context;
  901. } else if (typeof dataPath === 'string' && dataPath) {
  902. if (dataPath.indexOf('#s#') === 0) {
  903. vFor = dataPath.substr(3);
  904. } else {
  905. vFor = vm.__get_value(dataPath, context);
  906. }
  907. }
  908. if (Number.isInteger(vFor)) {
  909. context = value;
  910. } else if (!propPath) {
  911. context = vFor[value];
  912. } else {
  913. if (Array.isArray(vFor)) {
  914. context = vFor.find(function (vForItem) {
  915. return vm.__get_value(propPath, vForItem) === value;
  916. });
  917. } else if (isPlainObject(vFor)) {
  918. context = Object.keys(vFor).find(function (vForKey) {
  919. return vm.__get_value(propPath, vFor[vForKey]) === value;
  920. });
  921. } else {
  922. console.error('v-for 暂不支持循环数据:', vFor);
  923. }
  924. }
  925. if (valuePath) {
  926. context = vm.__get_value(valuePath, context);
  927. }
  928. }
  929. });
  930. return context;
  931. }
  932. function processEventExtra(vm, extra, event) {
  933. var extraObj = {};
  934. if (Array.isArray(extra) && extra.length) {
  935. /**
  936. *[
  937. * ['data.items', 'data.id', item.data.id],
  938. * ['metas', 'id', meta.id]
  939. *],
  940. *[
  941. * ['data.items', 'data.id', item.data.id],
  942. * ['metas', 'id', meta.id]
  943. *],
  944. *'test'
  945. */
  946. extra.forEach(function (dataPath, index) {
  947. if (typeof dataPath === 'string') {
  948. if (!dataPath) {// model,prop.sync
  949. extraObj['$' + index] = vm;
  950. } else {
  951. if (dataPath === '$event') {// $event
  952. extraObj['$' + index] = event;
  953. } else if (dataPath === 'arguments') {
  954. if (event.detail && event.detail.__args__) {
  955. extraObj['$' + index] = event.detail.__args__;
  956. } else {
  957. extraObj['$' + index] = [event];
  958. }
  959. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  960. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  961. } else {
  962. extraObj['$' + index] = vm.__get_value(dataPath);
  963. }
  964. }
  965. } else {
  966. extraObj['$' + index] = getExtraValue(vm, dataPath);
  967. }
  968. });
  969. }
  970. return extraObj;
  971. }
  972. function getObjByArray(arr) {
  973. var obj = {};
  974. for (var i = 1; i < arr.length; i++) {
  975. var element = arr[i];
  976. obj[element[0]] = element[1];
  977. }
  978. return obj;
  979. }
  980. 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;
  981. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  982. if (isCustom) {// 自定义事件
  983. isCustomMPEvent = event.currentTarget &&
  984. event.currentTarget.dataset &&
  985. event.currentTarget.dataset.comType === 'wx';
  986. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  987. if (isCustomMPEvent) {
  988. return [event];
  989. }
  990. return event.detail.__args__ || event.detail;
  991. }
  992. }
  993. var extraObj = processEventExtra(vm, extra, event);
  994. var ret = [];
  995. args.forEach(function (arg) {
  996. if (arg === '$event') {
  997. if (methodName === '__set_model' && !isCustom) {// input v-model value
  998. ret.push(event.target.value);
  999. } else {
  1000. if (isCustom && !isCustomMPEvent) {
  1001. ret.push(event.detail.__args__[0]);
  1002. } else {// wxcomponent 组件或内置组件
  1003. ret.push(event);
  1004. }
  1005. }
  1006. } else {
  1007. if (Array.isArray(arg) && arg[0] === 'o') {
  1008. ret.push(getObjByArray(arg));
  1009. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1010. ret.push(extraObj[arg]);
  1011. } else {
  1012. ret.push(arg);
  1013. }
  1014. }
  1015. });
  1016. return ret;
  1017. }
  1018. var ONCE = '~';
  1019. var CUSTOM = '^';
  1020. function isMatchEventType(eventType, optType) {
  1021. return eventType === optType ||
  1022. optType === 'regionchange' && (
  1023. eventType === 'begin' ||
  1024. eventType === 'end');
  1025. }
  1026. function getContextVm(vm) {
  1027. var $parent = vm.$parent;
  1028. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1029. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1030. $parent = $parent.$parent;
  1031. }
  1032. return $parent && $parent.$parent;
  1033. }
  1034. function handleEvent(event) {var _this = this;
  1035. event = wrapper$1(event);
  1036. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1037. var dataset = (event.currentTarget || event.target).dataset;
  1038. if (!dataset) {
  1039. return console.warn('事件信息不存在');
  1040. }
  1041. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1042. if (!eventOpts) {
  1043. return console.warn('事件信息不存在');
  1044. }
  1045. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1046. var eventType = event.type;
  1047. var ret = [];
  1048. eventOpts.forEach(function (eventOpt) {
  1049. var type = eventOpt[0];
  1050. var eventsArray = eventOpt[1];
  1051. var isCustom = type.charAt(0) === CUSTOM;
  1052. type = isCustom ? type.slice(1) : type;
  1053. var isOnce = type.charAt(0) === ONCE;
  1054. type = isOnce ? type.slice(1) : type;
  1055. if (eventsArray && isMatchEventType(eventType, type)) {
  1056. eventsArray.forEach(function (eventArray) {
  1057. var methodName = eventArray[0];
  1058. if (methodName) {
  1059. var handlerCtx = _this.$vm;
  1060. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1061. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1062. }
  1063. if (methodName === '$emit') {
  1064. handlerCtx.$emit.apply(handlerCtx,
  1065. processEventArgs(
  1066. _this.$vm,
  1067. event,
  1068. eventArray[1],
  1069. eventArray[2],
  1070. isCustom,
  1071. methodName));
  1072. return;
  1073. }
  1074. var handler = handlerCtx[methodName];
  1075. if (!isFn(handler)) {
  1076. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1077. }
  1078. if (isOnce) {
  1079. if (handler.once) {
  1080. return;
  1081. }
  1082. handler.once = true;
  1083. }
  1084. var params = processEventArgs(
  1085. _this.$vm,
  1086. event,
  1087. eventArray[1],
  1088. eventArray[2],
  1089. isCustom,
  1090. methodName);
  1091. params = Array.isArray(params) ? params : [];
  1092. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1093. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1094. // eslint-disable-next-line no-sparse-arrays
  1095. params = params.concat([,,,,,,,,,, event]);
  1096. }
  1097. ret.push(handler.apply(handlerCtx, params));
  1098. }
  1099. });
  1100. }
  1101. });
  1102. if (
  1103. eventType === 'input' &&
  1104. ret.length === 1 &&
  1105. typeof ret[0] !== 'undefined')
  1106. {
  1107. return ret[0];
  1108. }
  1109. }
  1110. var eventChannels = {};
  1111. var eventChannelStack = [];
  1112. function getEventChannel(id) {
  1113. if (id) {
  1114. var eventChannel = eventChannels[id];
  1115. delete eventChannels[id];
  1116. return eventChannel;
  1117. }
  1118. return eventChannelStack.shift();
  1119. }
  1120. var hooks = [
  1121. 'onShow',
  1122. 'onHide',
  1123. 'onError',
  1124. 'onPageNotFound',
  1125. 'onThemeChange',
  1126. 'onUnhandledRejection'];
  1127. function initEventChannel() {
  1128. _vue.default.prototype.getOpenerEventChannel = function () {
  1129. // 微信小程序使用自身getOpenerEventChannel
  1130. {
  1131. return this.$scope.getOpenerEventChannel();
  1132. }
  1133. };
  1134. var callHook = _vue.default.prototype.__call_hook;
  1135. _vue.default.prototype.__call_hook = function (hook, args) {
  1136. if (hook === 'onLoad' && args && args.__id__) {
  1137. this.__eventChannel__ = getEventChannel(args.__id__);
  1138. delete args.__id__;
  1139. }
  1140. return callHook.call(this, hook, args);
  1141. };
  1142. }
  1143. function initScopedSlotsParams() {
  1144. var center = {};
  1145. var parents = {};
  1146. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1147. var has = center[vueId];
  1148. if (!has) {
  1149. parents[vueId] = this;
  1150. this.$on('hook:destory', function () {
  1151. delete parents[vueId];
  1152. });
  1153. }
  1154. return has;
  1155. };
  1156. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1157. var data = center[vueId];
  1158. if (data) {
  1159. var object = data[name] || {};
  1160. return key ? object[key] : object;
  1161. } else {
  1162. parents[vueId] = this;
  1163. this.$on('hook:destory', function () {
  1164. delete parents[vueId];
  1165. });
  1166. }
  1167. };
  1168. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1169. var vueId = this.$options.propsData.vueId;
  1170. var object = center[vueId] = center[vueId] || {};
  1171. object[name] = value;
  1172. if (parents[vueId]) {
  1173. parents[vueId].$forceUpdate();
  1174. }
  1175. };
  1176. _vue.default.mixin({
  1177. destroyed: function destroyed() {
  1178. var propsData = this.$options.propsData;
  1179. var vueId = propsData && propsData.vueId;
  1180. if (vueId) {
  1181. delete center[vueId];
  1182. delete parents[vueId];
  1183. }
  1184. } });
  1185. }
  1186. function parseBaseApp(vm, _ref3)
  1187. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1188. initEventChannel();
  1189. {
  1190. initScopedSlotsParams();
  1191. }
  1192. if (vm.$options.store) {
  1193. _vue.default.prototype.$store = vm.$options.store;
  1194. }
  1195. uniIdMixin(_vue.default);
  1196. _vue.default.prototype.mpHost = "mp-weixin";
  1197. _vue.default.mixin({
  1198. beforeCreate: function beforeCreate() {
  1199. if (!this.$options.mpType) {
  1200. return;
  1201. }
  1202. this.mpType = this.$options.mpType;
  1203. this.$mp = _defineProperty({
  1204. data: {} },
  1205. this.mpType, this.$options.mpInstance);
  1206. this.$scope = this.$options.mpInstance;
  1207. delete this.$options.mpType;
  1208. delete this.$options.mpInstance;
  1209. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1210. var app = getApp();
  1211. if (app.$vm && app.$vm.$i18n) {
  1212. this._i18n = app.$vm.$i18n;
  1213. }
  1214. }
  1215. if (this.mpType !== 'app') {
  1216. initRefs(this);
  1217. initMocks(this, mocks);
  1218. }
  1219. } });
  1220. var appOptions = {
  1221. onLaunch: function onLaunch(args) {
  1222. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1223. return;
  1224. }
  1225. {
  1226. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1227. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1228. }
  1229. }
  1230. this.$vm = vm;
  1231. this.$vm.$mp = {
  1232. app: this };
  1233. this.$vm.$scope = this;
  1234. // vm 上也挂载 globalData
  1235. this.$vm.globalData = this.globalData;
  1236. this.$vm._isMounted = true;
  1237. this.$vm.__call_hook('mounted', args);
  1238. this.$vm.__call_hook('onLaunch', args);
  1239. } };
  1240. // 兼容旧版本 globalData
  1241. appOptions.globalData = vm.$options.globalData || {};
  1242. // 将 methods 中的方法挂在 getApp() 中
  1243. var methods = vm.$options.methods;
  1244. if (methods) {
  1245. Object.keys(methods).forEach(function (name) {
  1246. appOptions[name] = methods[name];
  1247. });
  1248. }
  1249. initHooks(appOptions, hooks);
  1250. return appOptions;
  1251. }
  1252. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1253. function findVmByVueId(vm, vuePid) {
  1254. var $children = vm.$children;
  1255. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1256. for (var i = $children.length - 1; i >= 0; i--) {
  1257. var childVm = $children[i];
  1258. if (childVm.$scope._$vueId === vuePid) {
  1259. return childVm;
  1260. }
  1261. }
  1262. // 反向递归查找
  1263. var parentVm;
  1264. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1265. parentVm = findVmByVueId($children[_i], vuePid);
  1266. if (parentVm) {
  1267. return parentVm;
  1268. }
  1269. }
  1270. }
  1271. function initBehavior(options) {
  1272. return Behavior(options);
  1273. }
  1274. function isPage() {
  1275. return !!this.route;
  1276. }
  1277. function initRelation(detail) {
  1278. this.triggerEvent('__l', detail);
  1279. }
  1280. function selectAllComponents(mpInstance, selector, $refs) {
  1281. var components = mpInstance.selectAllComponents(selector);
  1282. components.forEach(function (component) {
  1283. var ref = component.dataset.ref;
  1284. $refs[ref] = component.$vm || component;
  1285. {
  1286. if (component.dataset.vueGeneric === 'scoped') {
  1287. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1288. selectAllComponents(scopedComponent, selector, $refs);
  1289. });
  1290. }
  1291. }
  1292. });
  1293. }
  1294. function initRefs(vm) {
  1295. var mpInstance = vm.$scope;
  1296. Object.defineProperty(vm, '$refs', {
  1297. get: function get() {
  1298. var $refs = {};
  1299. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1300. // TODO 暂不考虑 for 中的 scoped
  1301. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1302. forComponents.forEach(function (component) {
  1303. var ref = component.dataset.ref;
  1304. if (!$refs[ref]) {
  1305. $refs[ref] = [];
  1306. }
  1307. $refs[ref].push(component.$vm || component);
  1308. });
  1309. return $refs;
  1310. } });
  1311. }
  1312. function handleLink(event) {var _ref4 =
  1313. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1314. var parentVm;
  1315. if (vuePid) {
  1316. parentVm = findVmByVueId(this.$vm, vuePid);
  1317. }
  1318. if (!parentVm) {
  1319. parentVm = this.$vm;
  1320. }
  1321. vueOptions.parent = parentVm;
  1322. }
  1323. function parseApp(vm) {
  1324. return parseBaseApp(vm, {
  1325. mocks: mocks,
  1326. initRefs: initRefs });
  1327. }
  1328. function createApp(vm) {
  1329. App(parseApp(vm));
  1330. return vm;
  1331. }
  1332. var encodeReserveRE = /[!'()*]/g;
  1333. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1334. var commaRE = /%2C/g;
  1335. // fixed encodeURIComponent which is more conformant to RFC3986:
  1336. // - escapes [!'()*]
  1337. // - preserve commas
  1338. var encode = function encode(str) {return encodeURIComponent(str).
  1339. replace(encodeReserveRE, encodeReserveReplacer).
  1340. replace(commaRE, ',');};
  1341. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1342. var res = obj ? Object.keys(obj).map(function (key) {
  1343. var val = obj[key];
  1344. if (val === undefined) {
  1345. return '';
  1346. }
  1347. if (val === null) {
  1348. return encodeStr(key);
  1349. }
  1350. if (Array.isArray(val)) {
  1351. var result = [];
  1352. val.forEach(function (val2) {
  1353. if (val2 === undefined) {
  1354. return;
  1355. }
  1356. if (val2 === null) {
  1357. result.push(encodeStr(key));
  1358. } else {
  1359. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1360. }
  1361. });
  1362. return result.join('&');
  1363. }
  1364. return encodeStr(key) + '=' + encodeStr(val);
  1365. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1366. return res ? "?".concat(res) : '';
  1367. }
  1368. function parseBaseComponent(vueComponentOptions)
  1369. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1370. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1371. var options = _objectSpread({
  1372. multipleSlots: true,
  1373. addGlobalClass: true },
  1374. vueOptions.options || {});
  1375. {
  1376. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1377. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1378. Object.assign(options, vueOptions['mp-weixin'].options);
  1379. }
  1380. }
  1381. var componentOptions = {
  1382. options: options,
  1383. data: initData(vueOptions, _vue.default.prototype),
  1384. behaviors: initBehaviors(vueOptions, initBehavior),
  1385. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1386. lifetimes: {
  1387. attached: function attached() {
  1388. var properties = this.properties;
  1389. var options = {
  1390. mpType: isPage.call(this) ? 'page' : 'component',
  1391. mpInstance: this,
  1392. propsData: properties };
  1393. initVueIds(properties.vueId, this);
  1394. // 处理父子关系
  1395. initRelation.call(this, {
  1396. vuePid: this._$vuePid,
  1397. vueOptions: options });
  1398. // 初始化 vue 实例
  1399. this.$vm = new VueComponent(options);
  1400. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1401. initSlots(this.$vm, properties.vueSlots);
  1402. // 触发首次 setData
  1403. this.$vm.$mount();
  1404. },
  1405. ready: function ready() {
  1406. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1407. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1408. if (this.$vm) {
  1409. this.$vm._isMounted = true;
  1410. this.$vm.__call_hook('mounted');
  1411. this.$vm.__call_hook('onReady');
  1412. }
  1413. },
  1414. detached: function detached() {
  1415. this.$vm && this.$vm.$destroy();
  1416. } },
  1417. pageLifetimes: {
  1418. show: function show(args) {
  1419. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1420. },
  1421. hide: function hide() {
  1422. this.$vm && this.$vm.__call_hook('onPageHide');
  1423. },
  1424. resize: function resize(size) {
  1425. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1426. } },
  1427. methods: {
  1428. __l: handleLink,
  1429. __e: handleEvent } };
  1430. // externalClasses
  1431. if (vueOptions.externalClasses) {
  1432. componentOptions.externalClasses = vueOptions.externalClasses;
  1433. }
  1434. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1435. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1436. componentOptions.methods[callMethod] = function (args) {
  1437. return this.$vm[callMethod](args);
  1438. };
  1439. });
  1440. }
  1441. if (isPage) {
  1442. return componentOptions;
  1443. }
  1444. return [componentOptions, VueComponent];
  1445. }
  1446. function parseComponent(vueComponentOptions) {
  1447. return parseBaseComponent(vueComponentOptions, {
  1448. isPage: isPage,
  1449. initRelation: initRelation });
  1450. }
  1451. var hooks$1 = [
  1452. 'onShow',
  1453. 'onHide',
  1454. 'onUnload'];
  1455. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1456. function parseBasePage(vuePageOptions, _ref6)
  1457. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1458. var pageOptions = parseComponent(vuePageOptions);
  1459. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1460. pageOptions.methods.onLoad = function (query) {
  1461. this.options = query;
  1462. var copyQuery = Object.assign({}, query);
  1463. delete copyQuery.__id__;
  1464. this.$page = {
  1465. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1466. this.$vm.$mp.query = query; // 兼容 mpvue
  1467. this.$vm.__call_hook('onLoad', query);
  1468. };
  1469. return pageOptions;
  1470. }
  1471. function parsePage(vuePageOptions) {
  1472. return parseBasePage(vuePageOptions, {
  1473. isPage: isPage,
  1474. initRelation: initRelation });
  1475. }
  1476. function createPage(vuePageOptions) {
  1477. {
  1478. return Component(parsePage(vuePageOptions));
  1479. }
  1480. }
  1481. function createComponent(vueOptions) {
  1482. {
  1483. return Component(parseComponent(vueOptions));
  1484. }
  1485. }
  1486. function createSubpackageApp(vm) {
  1487. var appOptions = parseApp(vm);
  1488. var app = getApp({
  1489. allowDefault: true });
  1490. var globalData = app.globalData;
  1491. if (globalData) {
  1492. Object.keys(appOptions.globalData).forEach(function (name) {
  1493. if (!hasOwn(globalData, name)) {
  1494. globalData[name] = appOptions.globalData[name];
  1495. }
  1496. });
  1497. }
  1498. Object.keys(appOptions).forEach(function (name) {
  1499. if (!hasOwn(app, name)) {
  1500. app[name] = appOptions[name];
  1501. }
  1502. });
  1503. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1504. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1505. appOptions.onShow.apply(app, args);
  1506. });
  1507. }
  1508. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1509. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1510. appOptions.onHide.apply(app, args);
  1511. });
  1512. }
  1513. if (isFn(appOptions.onLaunch)) {
  1514. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1515. appOptions.onLaunch.call(app, args);
  1516. }
  1517. return vm;
  1518. }
  1519. function createPlugin(vm) {
  1520. var appOptions = parseApp(vm);
  1521. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1522. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1523. appOptions.onShow.apply(vm, args);
  1524. });
  1525. }
  1526. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1527. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1528. appOptions.onHide.apply(vm, args);
  1529. });
  1530. }
  1531. if (isFn(appOptions.onLaunch)) {
  1532. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1533. appOptions.onLaunch.call(vm, args);
  1534. }
  1535. return vm;
  1536. }
  1537. todos.forEach(function (todoApi) {
  1538. protocols[todoApi] = false;
  1539. });
  1540. canIUses.forEach(function (canIUseApi) {
  1541. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1542. canIUseApi;
  1543. if (!wx.canIUse(apiName)) {
  1544. protocols[canIUseApi] = false;
  1545. }
  1546. });
  1547. var uni = {};
  1548. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1549. uni = new Proxy({}, {
  1550. get: function get(target, name) {
  1551. if (hasOwn(target, name)) {
  1552. return target[name];
  1553. }
  1554. if (baseApi[name]) {
  1555. return baseApi[name];
  1556. }
  1557. if (api[name]) {
  1558. return promisify(name, api[name]);
  1559. }
  1560. {
  1561. if (extraApi[name]) {
  1562. return promisify(name, extraApi[name]);
  1563. }
  1564. if (todoApis[name]) {
  1565. return promisify(name, todoApis[name]);
  1566. }
  1567. }
  1568. if (eventApi[name]) {
  1569. return eventApi[name];
  1570. }
  1571. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1572. return;
  1573. }
  1574. return promisify(name, wrapper(name, wx[name]));
  1575. },
  1576. set: function set(target, name, value) {
  1577. target[name] = value;
  1578. return true;
  1579. } });
  1580. } else {
  1581. Object.keys(baseApi).forEach(function (name) {
  1582. uni[name] = baseApi[name];
  1583. });
  1584. {
  1585. Object.keys(todoApis).forEach(function (name) {
  1586. uni[name] = promisify(name, todoApis[name]);
  1587. });
  1588. Object.keys(extraApi).forEach(function (name) {
  1589. uni[name] = promisify(name, todoApis[name]);
  1590. });
  1591. }
  1592. Object.keys(eventApi).forEach(function (name) {
  1593. uni[name] = eventApi[name];
  1594. });
  1595. Object.keys(api).forEach(function (name) {
  1596. uni[name] = promisify(name, api[name]);
  1597. });
  1598. Object.keys(wx).forEach(function (name) {
  1599. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1600. uni[name] = promisify(name, wrapper(name, wx[name]));
  1601. }
  1602. });
  1603. }
  1604. wx.createApp = createApp;
  1605. wx.createPage = createPage;
  1606. wx.createComponent = createComponent;
  1607. wx.createSubpackageApp = createSubpackageApp;
  1608. wx.createPlugin = createPlugin;
  1609. var uni$1 = uni;var _default =
  1610. uni$1;exports.default = _default;
  1611. /***/ }),
  1612. /* 2 */
  1613. /*!******************************************************************************************!*\
  1614. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1615. \******************************************************************************************/
  1616. /*! exports provided: default */
  1617. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1618. "use strict";
  1619. __webpack_require__.r(__webpack_exports__);
  1620. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1621. * Vue.js v2.6.11
  1622. * (c) 2014-2021 Evan You
  1623. * Released under the MIT License.
  1624. */
  1625. /* */
  1626. var emptyObject = Object.freeze({});
  1627. // These helpers produce better VM code in JS engines due to their
  1628. // explicitness and function inlining.
  1629. function isUndef (v) {
  1630. return v === undefined || v === null
  1631. }
  1632. function isDef (v) {
  1633. return v !== undefined && v !== null
  1634. }
  1635. function isTrue (v) {
  1636. return v === true
  1637. }
  1638. function isFalse (v) {
  1639. return v === false
  1640. }
  1641. /**
  1642. * Check if value is primitive.
  1643. */
  1644. function isPrimitive (value) {
  1645. return (
  1646. typeof value === 'string' ||
  1647. typeof value === 'number' ||
  1648. // $flow-disable-line
  1649. typeof value === 'symbol' ||
  1650. typeof value === 'boolean'
  1651. )
  1652. }
  1653. /**
  1654. * Quick object check - this is primarily used to tell
  1655. * Objects from primitive values when we know the value
  1656. * is a JSON-compliant type.
  1657. */
  1658. function isObject (obj) {
  1659. return obj !== null && typeof obj === 'object'
  1660. }
  1661. /**
  1662. * Get the raw type string of a value, e.g., [object Object].
  1663. */
  1664. var _toString = Object.prototype.toString;
  1665. function toRawType (value) {
  1666. return _toString.call(value).slice(8, -1)
  1667. }
  1668. /**
  1669. * Strict object type check. Only returns true
  1670. * for plain JavaScript objects.
  1671. */
  1672. function isPlainObject (obj) {
  1673. return _toString.call(obj) === '[object Object]'
  1674. }
  1675. function isRegExp (v) {
  1676. return _toString.call(v) === '[object RegExp]'
  1677. }
  1678. /**
  1679. * Check if val is a valid array index.
  1680. */
  1681. function isValidArrayIndex (val) {
  1682. var n = parseFloat(String(val));
  1683. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1684. }
  1685. function isPromise (val) {
  1686. return (
  1687. isDef(val) &&
  1688. typeof val.then === 'function' &&
  1689. typeof val.catch === 'function'
  1690. )
  1691. }
  1692. /**
  1693. * Convert a value to a string that is actually rendered.
  1694. */
  1695. function toString (val) {
  1696. return val == null
  1697. ? ''
  1698. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1699. ? JSON.stringify(val, null, 2)
  1700. : String(val)
  1701. }
  1702. /**
  1703. * Convert an input value to a number for persistence.
  1704. * If the conversion fails, return original string.
  1705. */
  1706. function toNumber (val) {
  1707. var n = parseFloat(val);
  1708. return isNaN(n) ? val : n
  1709. }
  1710. /**
  1711. * Make a map and return a function for checking if a key
  1712. * is in that map.
  1713. */
  1714. function makeMap (
  1715. str,
  1716. expectsLowerCase
  1717. ) {
  1718. var map = Object.create(null);
  1719. var list = str.split(',');
  1720. for (var i = 0; i < list.length; i++) {
  1721. map[list[i]] = true;
  1722. }
  1723. return expectsLowerCase
  1724. ? function (val) { return map[val.toLowerCase()]; }
  1725. : function (val) { return map[val]; }
  1726. }
  1727. /**
  1728. * Check if a tag is a built-in tag.
  1729. */
  1730. var isBuiltInTag = makeMap('slot,component', true);
  1731. /**
  1732. * Check if an attribute is a reserved attribute.
  1733. */
  1734. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1735. /**
  1736. * Remove an item from an array.
  1737. */
  1738. function remove (arr, item) {
  1739. if (arr.length) {
  1740. var index = arr.indexOf(item);
  1741. if (index > -1) {
  1742. return arr.splice(index, 1)
  1743. }
  1744. }
  1745. }
  1746. /**
  1747. * Check whether an object has the property.
  1748. */
  1749. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1750. function hasOwn (obj, key) {
  1751. return hasOwnProperty.call(obj, key)
  1752. }
  1753. /**
  1754. * Create a cached version of a pure function.
  1755. */
  1756. function cached (fn) {
  1757. var cache = Object.create(null);
  1758. return (function cachedFn (str) {
  1759. var hit = cache[str];
  1760. return hit || (cache[str] = fn(str))
  1761. })
  1762. }
  1763. /**
  1764. * Camelize a hyphen-delimited string.
  1765. */
  1766. var camelizeRE = /-(\w)/g;
  1767. var camelize = cached(function (str) {
  1768. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1769. });
  1770. /**
  1771. * Capitalize a string.
  1772. */
  1773. var capitalize = cached(function (str) {
  1774. return str.charAt(0).toUpperCase() + str.slice(1)
  1775. });
  1776. /**
  1777. * Hyphenate a camelCase string.
  1778. */
  1779. var hyphenateRE = /\B([A-Z])/g;
  1780. var hyphenate = cached(function (str) {
  1781. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1782. });
  1783. /**
  1784. * Simple bind polyfill for environments that do not support it,
  1785. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1786. * since native bind is now performant enough in most browsers.
  1787. * But removing it would mean breaking code that was able to run in
  1788. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1789. */
  1790. /* istanbul ignore next */
  1791. function polyfillBind (fn, ctx) {
  1792. function boundFn (a) {
  1793. var l = arguments.length;
  1794. return l
  1795. ? l > 1
  1796. ? fn.apply(ctx, arguments)
  1797. : fn.call(ctx, a)
  1798. : fn.call(ctx)
  1799. }
  1800. boundFn._length = fn.length;
  1801. return boundFn
  1802. }
  1803. function nativeBind (fn, ctx) {
  1804. return fn.bind(ctx)
  1805. }
  1806. var bind = Function.prototype.bind
  1807. ? nativeBind
  1808. : polyfillBind;
  1809. /**
  1810. * Convert an Array-like object to a real Array.
  1811. */
  1812. function toArray (list, start) {
  1813. start = start || 0;
  1814. var i = list.length - start;
  1815. var ret = new Array(i);
  1816. while (i--) {
  1817. ret[i] = list[i + start];
  1818. }
  1819. return ret
  1820. }
  1821. /**
  1822. * Mix properties into target object.
  1823. */
  1824. function extend (to, _from) {
  1825. for (var key in _from) {
  1826. to[key] = _from[key];
  1827. }
  1828. return to
  1829. }
  1830. /**
  1831. * Merge an Array of Objects into a single Object.
  1832. */
  1833. function toObject (arr) {
  1834. var res = {};
  1835. for (var i = 0; i < arr.length; i++) {
  1836. if (arr[i]) {
  1837. extend(res, arr[i]);
  1838. }
  1839. }
  1840. return res
  1841. }
  1842. /* eslint-disable no-unused-vars */
  1843. /**
  1844. * Perform no operation.
  1845. * Stubbing args to make Flow happy without leaving useless transpiled code
  1846. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1847. */
  1848. function noop (a, b, c) {}
  1849. /**
  1850. * Always return false.
  1851. */
  1852. var no = function (a, b, c) { return false; };
  1853. /* eslint-enable no-unused-vars */
  1854. /**
  1855. * Return the same value.
  1856. */
  1857. var identity = function (_) { return _; };
  1858. /**
  1859. * Check if two values are loosely equal - that is,
  1860. * if they are plain objects, do they have the same shape?
  1861. */
  1862. function looseEqual (a, b) {
  1863. if (a === b) { return true }
  1864. var isObjectA = isObject(a);
  1865. var isObjectB = isObject(b);
  1866. if (isObjectA && isObjectB) {
  1867. try {
  1868. var isArrayA = Array.isArray(a);
  1869. var isArrayB = Array.isArray(b);
  1870. if (isArrayA && isArrayB) {
  1871. return a.length === b.length && a.every(function (e, i) {
  1872. return looseEqual(e, b[i])
  1873. })
  1874. } else if (a instanceof Date && b instanceof Date) {
  1875. return a.getTime() === b.getTime()
  1876. } else if (!isArrayA && !isArrayB) {
  1877. var keysA = Object.keys(a);
  1878. var keysB = Object.keys(b);
  1879. return keysA.length === keysB.length && keysA.every(function (key) {
  1880. return looseEqual(a[key], b[key])
  1881. })
  1882. } else {
  1883. /* istanbul ignore next */
  1884. return false
  1885. }
  1886. } catch (e) {
  1887. /* istanbul ignore next */
  1888. return false
  1889. }
  1890. } else if (!isObjectA && !isObjectB) {
  1891. return String(a) === String(b)
  1892. } else {
  1893. return false
  1894. }
  1895. }
  1896. /**
  1897. * Return the first index at which a loosely equal value can be
  1898. * found in the array (if value is a plain object, the array must
  1899. * contain an object of the same shape), or -1 if it is not present.
  1900. */
  1901. function looseIndexOf (arr, val) {
  1902. for (var i = 0; i < arr.length; i++) {
  1903. if (looseEqual(arr[i], val)) { return i }
  1904. }
  1905. return -1
  1906. }
  1907. /**
  1908. * Ensure a function is called only once.
  1909. */
  1910. function once (fn) {
  1911. var called = false;
  1912. return function () {
  1913. if (!called) {
  1914. called = true;
  1915. fn.apply(this, arguments);
  1916. }
  1917. }
  1918. }
  1919. var ASSET_TYPES = [
  1920. 'component',
  1921. 'directive',
  1922. 'filter'
  1923. ];
  1924. var LIFECYCLE_HOOKS = [
  1925. 'beforeCreate',
  1926. 'created',
  1927. 'beforeMount',
  1928. 'mounted',
  1929. 'beforeUpdate',
  1930. 'updated',
  1931. 'beforeDestroy',
  1932. 'destroyed',
  1933. 'activated',
  1934. 'deactivated',
  1935. 'errorCaptured',
  1936. 'serverPrefetch'
  1937. ];
  1938. /* */
  1939. var config = ({
  1940. /**
  1941. * Option merge strategies (used in core/util/options)
  1942. */
  1943. // $flow-disable-line
  1944. optionMergeStrategies: Object.create(null),
  1945. /**
  1946. * Whether to suppress warnings.
  1947. */
  1948. silent: false,
  1949. /**
  1950. * Show production mode tip message on boot?
  1951. */
  1952. productionTip: "development" !== 'production',
  1953. /**
  1954. * Whether to enable devtools
  1955. */
  1956. devtools: "development" !== 'production',
  1957. /**
  1958. * Whether to record perf
  1959. */
  1960. performance: false,
  1961. /**
  1962. * Error handler for watcher errors
  1963. */
  1964. errorHandler: null,
  1965. /**
  1966. * Warn handler for watcher warns
  1967. */
  1968. warnHandler: null,
  1969. /**
  1970. * Ignore certain custom elements
  1971. */
  1972. ignoredElements: [],
  1973. /**
  1974. * Custom user key aliases for v-on
  1975. */
  1976. // $flow-disable-line
  1977. keyCodes: Object.create(null),
  1978. /**
  1979. * Check if a tag is reserved so that it cannot be registered as a
  1980. * component. This is platform-dependent and may be overwritten.
  1981. */
  1982. isReservedTag: no,
  1983. /**
  1984. * Check if an attribute is reserved so that it cannot be used as a component
  1985. * prop. This is platform-dependent and may be overwritten.
  1986. */
  1987. isReservedAttr: no,
  1988. /**
  1989. * Check if a tag is an unknown element.
  1990. * Platform-dependent.
  1991. */
  1992. isUnknownElement: no,
  1993. /**
  1994. * Get the namespace of an element
  1995. */
  1996. getTagNamespace: noop,
  1997. /**
  1998. * Parse the real tag name for the specific platform.
  1999. */
  2000. parsePlatformTagName: identity,
  2001. /**
  2002. * Check if an attribute must be bound using property, e.g. value
  2003. * Platform-dependent.
  2004. */
  2005. mustUseProp: no,
  2006. /**
  2007. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2008. * This will significantly reduce performance if set to false.
  2009. */
  2010. async: true,
  2011. /**
  2012. * Exposed for legacy reasons
  2013. */
  2014. _lifecycleHooks: LIFECYCLE_HOOKS
  2015. });
  2016. /* */
  2017. /**
  2018. * unicode letters used for parsing html tags, component names and property paths.
  2019. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2020. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2021. */
  2022. 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/;
  2023. /**
  2024. * Check if a string starts with $ or _
  2025. */
  2026. function isReserved (str) {
  2027. var c = (str + '').charCodeAt(0);
  2028. return c === 0x24 || c === 0x5F
  2029. }
  2030. /**
  2031. * Define a property.
  2032. */
  2033. function def (obj, key, val, enumerable) {
  2034. Object.defineProperty(obj, key, {
  2035. value: val,
  2036. enumerable: !!enumerable,
  2037. writable: true,
  2038. configurable: true
  2039. });
  2040. }
  2041. /**
  2042. * Parse simple path.
  2043. */
  2044. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2045. function parsePath (path) {
  2046. if (bailRE.test(path)) {
  2047. return
  2048. }
  2049. var segments = path.split('.');
  2050. return function (obj) {
  2051. for (var i = 0; i < segments.length; i++) {
  2052. if (!obj) { return }
  2053. obj = obj[segments[i]];
  2054. }
  2055. return obj
  2056. }
  2057. }
  2058. /* */
  2059. // can we use __proto__?
  2060. var hasProto = '__proto__' in {};
  2061. // Browser environment sniffing
  2062. var inBrowser = typeof window !== 'undefined';
  2063. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2064. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2065. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2066. var isIE = UA && /msie|trident/.test(UA);
  2067. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2068. var isEdge = UA && UA.indexOf('edge/') > 0;
  2069. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2070. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2071. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2072. var isPhantomJS = UA && /phantomjs/.test(UA);
  2073. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2074. // Firefox has a "watch" function on Object.prototype...
  2075. var nativeWatch = ({}).watch;
  2076. if (inBrowser) {
  2077. try {
  2078. var opts = {};
  2079. Object.defineProperty(opts, 'passive', ({
  2080. get: function get () {
  2081. }
  2082. })); // https://github.com/facebook/flow/issues/285
  2083. window.addEventListener('test-passive', null, opts);
  2084. } catch (e) {}
  2085. }
  2086. // this needs to be lazy-evaled because vue may be required before
  2087. // vue-server-renderer can set VUE_ENV
  2088. var _isServer;
  2089. var isServerRendering = function () {
  2090. if (_isServer === undefined) {
  2091. /* istanbul ignore if */
  2092. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2093. // detect presence of vue-server-renderer and avoid
  2094. // Webpack shimming the process
  2095. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2096. } else {
  2097. _isServer = false;
  2098. }
  2099. }
  2100. return _isServer
  2101. };
  2102. // detect devtools
  2103. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2104. /* istanbul ignore next */
  2105. function isNative (Ctor) {
  2106. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2107. }
  2108. var hasSymbol =
  2109. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2110. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2111. var _Set;
  2112. /* istanbul ignore if */ // $flow-disable-line
  2113. if (typeof Set !== 'undefined' && isNative(Set)) {
  2114. // use native Set when available.
  2115. _Set = Set;
  2116. } else {
  2117. // a non-standard Set polyfill that only works with primitive keys.
  2118. _Set = /*@__PURE__*/(function () {
  2119. function Set () {
  2120. this.set = Object.create(null);
  2121. }
  2122. Set.prototype.has = function has (key) {
  2123. return this.set[key] === true
  2124. };
  2125. Set.prototype.add = function add (key) {
  2126. this.set[key] = true;
  2127. };
  2128. Set.prototype.clear = function clear () {
  2129. this.set = Object.create(null);
  2130. };
  2131. return Set;
  2132. }());
  2133. }
  2134. /* */
  2135. var warn = noop;
  2136. var tip = noop;
  2137. var generateComponentTrace = (noop); // work around flow check
  2138. var formatComponentName = (noop);
  2139. if (true) {
  2140. var hasConsole = typeof console !== 'undefined';
  2141. var classifyRE = /(?:^|[-_])(\w)/g;
  2142. var classify = function (str) { return str
  2143. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2144. .replace(/[-_]/g, ''); };
  2145. warn = function (msg, vm) {
  2146. var trace = vm ? generateComponentTrace(vm) : '';
  2147. if (config.warnHandler) {
  2148. config.warnHandler.call(null, msg, vm, trace);
  2149. } else if (hasConsole && (!config.silent)) {
  2150. console.error(("[Vue warn]: " + msg + trace));
  2151. }
  2152. };
  2153. tip = function (msg, vm) {
  2154. if (hasConsole && (!config.silent)) {
  2155. console.warn("[Vue tip]: " + msg + (
  2156. vm ? generateComponentTrace(vm) : ''
  2157. ));
  2158. }
  2159. };
  2160. formatComponentName = function (vm, includeFile) {
  2161. if (vm.$root === vm) {
  2162. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2163. return ('') + vm.$options.__file
  2164. }
  2165. return '<Root>'
  2166. }
  2167. var options = typeof vm === 'function' && vm.cid != null
  2168. ? vm.options
  2169. : vm._isVue
  2170. ? vm.$options || vm.constructor.options
  2171. : vm;
  2172. var name = options.name || options._componentTag;
  2173. var file = options.__file;
  2174. if (!name && file) {
  2175. var match = file.match(/([^/\\]+)\.vue$/);
  2176. name = match && match[1];
  2177. }
  2178. return (
  2179. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2180. (file && includeFile !== false ? (" at " + file) : '')
  2181. )
  2182. };
  2183. var repeat = function (str, n) {
  2184. var res = '';
  2185. while (n) {
  2186. if (n % 2 === 1) { res += str; }
  2187. if (n > 1) { str += str; }
  2188. n >>= 1;
  2189. }
  2190. return res
  2191. };
  2192. generateComponentTrace = function (vm) {
  2193. if (vm._isVue && vm.$parent) {
  2194. var tree = [];
  2195. var currentRecursiveSequence = 0;
  2196. while (vm && vm.$options.name !== 'PageBody') {
  2197. if (tree.length > 0) {
  2198. var last = tree[tree.length - 1];
  2199. if (last.constructor === vm.constructor) {
  2200. currentRecursiveSequence++;
  2201. vm = vm.$parent;
  2202. continue
  2203. } else if (currentRecursiveSequence > 0) {
  2204. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2205. currentRecursiveSequence = 0;
  2206. }
  2207. }
  2208. !vm.$options.isReserved && tree.push(vm);
  2209. vm = vm.$parent;
  2210. }
  2211. return '\n\nfound in\n\n' + tree
  2212. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2213. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2214. : formatComponentName(vm))); })
  2215. .join('\n')
  2216. } else {
  2217. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2218. }
  2219. };
  2220. }
  2221. /* */
  2222. var uid = 0;
  2223. /**
  2224. * A dep is an observable that can have multiple
  2225. * directives subscribing to it.
  2226. */
  2227. var Dep = function Dep () {
  2228. this.id = uid++;
  2229. this.subs = [];
  2230. };
  2231. Dep.prototype.addSub = function addSub (sub) {
  2232. this.subs.push(sub);
  2233. };
  2234. Dep.prototype.removeSub = function removeSub (sub) {
  2235. remove(this.subs, sub);
  2236. };
  2237. Dep.prototype.depend = function depend () {
  2238. if (Dep.SharedObject.target) {
  2239. Dep.SharedObject.target.addDep(this);
  2240. }
  2241. };
  2242. Dep.prototype.notify = function notify () {
  2243. // stabilize the subscriber list first
  2244. var subs = this.subs.slice();
  2245. if ( true && !config.async) {
  2246. // subs aren't sorted in scheduler if not running async
  2247. // we need to sort them now to make sure they fire in correct
  2248. // order
  2249. subs.sort(function (a, b) { return a.id - b.id; });
  2250. }
  2251. for (var i = 0, l = subs.length; i < l; i++) {
  2252. subs[i].update();
  2253. }
  2254. };
  2255. // The current target watcher being evaluated.
  2256. // This is globally unique because only one watcher
  2257. // can be evaluated at a time.
  2258. // fixed by xxxxxx (nvue shared vuex)
  2259. /* eslint-disable no-undef */
  2260. Dep.SharedObject = {};
  2261. Dep.SharedObject.target = null;
  2262. Dep.SharedObject.targetStack = [];
  2263. function pushTarget (target) {
  2264. Dep.SharedObject.targetStack.push(target);
  2265. Dep.SharedObject.target = target;
  2266. Dep.target = target;
  2267. }
  2268. function popTarget () {
  2269. Dep.SharedObject.targetStack.pop();
  2270. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2271. Dep.target = Dep.SharedObject.target;
  2272. }
  2273. /* */
  2274. var VNode = function VNode (
  2275. tag,
  2276. data,
  2277. children,
  2278. text,
  2279. elm,
  2280. context,
  2281. componentOptions,
  2282. asyncFactory
  2283. ) {
  2284. this.tag = tag;
  2285. this.data = data;
  2286. this.children = children;
  2287. this.text = text;
  2288. this.elm = elm;
  2289. this.ns = undefined;
  2290. this.context = context;
  2291. this.fnContext = undefined;
  2292. this.fnOptions = undefined;
  2293. this.fnScopeId = undefined;
  2294. this.key = data && data.key;
  2295. this.componentOptions = componentOptions;
  2296. this.componentInstance = undefined;
  2297. this.parent = undefined;
  2298. this.raw = false;
  2299. this.isStatic = false;
  2300. this.isRootInsert = true;
  2301. this.isComment = false;
  2302. this.isCloned = false;
  2303. this.isOnce = false;
  2304. this.asyncFactory = asyncFactory;
  2305. this.asyncMeta = undefined;
  2306. this.isAsyncPlaceholder = false;
  2307. };
  2308. var prototypeAccessors = { child: { configurable: true } };
  2309. // DEPRECATED: alias for componentInstance for backwards compat.
  2310. /* istanbul ignore next */
  2311. prototypeAccessors.child.get = function () {
  2312. return this.componentInstance
  2313. };
  2314. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2315. var createEmptyVNode = function (text) {
  2316. if ( text === void 0 ) text = '';
  2317. var node = new VNode();
  2318. node.text = text;
  2319. node.isComment = true;
  2320. return node
  2321. };
  2322. function createTextVNode (val) {
  2323. return new VNode(undefined, undefined, undefined, String(val))
  2324. }
  2325. // optimized shallow clone
  2326. // used for static nodes and slot nodes because they may be reused across
  2327. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2328. // on their elm reference.
  2329. function cloneVNode (vnode) {
  2330. var cloned = new VNode(
  2331. vnode.tag,
  2332. vnode.data,
  2333. // #7975
  2334. // clone children array to avoid mutating original in case of cloning
  2335. // a child.
  2336. vnode.children && vnode.children.slice(),
  2337. vnode.text,
  2338. vnode.elm,
  2339. vnode.context,
  2340. vnode.componentOptions,
  2341. vnode.asyncFactory
  2342. );
  2343. cloned.ns = vnode.ns;
  2344. cloned.isStatic = vnode.isStatic;
  2345. cloned.key = vnode.key;
  2346. cloned.isComment = vnode.isComment;
  2347. cloned.fnContext = vnode.fnContext;
  2348. cloned.fnOptions = vnode.fnOptions;
  2349. cloned.fnScopeId = vnode.fnScopeId;
  2350. cloned.asyncMeta = vnode.asyncMeta;
  2351. cloned.isCloned = true;
  2352. return cloned
  2353. }
  2354. /*
  2355. * not type checking this file because flow doesn't play well with
  2356. * dynamically accessing methods on Array prototype
  2357. */
  2358. var arrayProto = Array.prototype;
  2359. var arrayMethods = Object.create(arrayProto);
  2360. var methodsToPatch = [
  2361. 'push',
  2362. 'pop',
  2363. 'shift',
  2364. 'unshift',
  2365. 'splice',
  2366. 'sort',
  2367. 'reverse'
  2368. ];
  2369. /**
  2370. * Intercept mutating methods and emit events
  2371. */
  2372. methodsToPatch.forEach(function (method) {
  2373. // cache original method
  2374. var original = arrayProto[method];
  2375. def(arrayMethods, method, function mutator () {
  2376. var args = [], len = arguments.length;
  2377. while ( len-- ) args[ len ] = arguments[ len ];
  2378. var result = original.apply(this, args);
  2379. var ob = this.__ob__;
  2380. var inserted;
  2381. switch (method) {
  2382. case 'push':
  2383. case 'unshift':
  2384. inserted = args;
  2385. break
  2386. case 'splice':
  2387. inserted = args.slice(2);
  2388. break
  2389. }
  2390. if (inserted) { ob.observeArray(inserted); }
  2391. // notify change
  2392. ob.dep.notify();
  2393. return result
  2394. });
  2395. });
  2396. /* */
  2397. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2398. /**
  2399. * In some cases we may want to disable observation inside a component's
  2400. * update computation.
  2401. */
  2402. var shouldObserve = true;
  2403. function toggleObserving (value) {
  2404. shouldObserve = value;
  2405. }
  2406. /**
  2407. * Observer class that is attached to each observed
  2408. * object. Once attached, the observer converts the target
  2409. * object's property keys into getter/setters that
  2410. * collect dependencies and dispatch updates.
  2411. */
  2412. var Observer = function Observer (value) {
  2413. this.value = value;
  2414. this.dep = new Dep();
  2415. this.vmCount = 0;
  2416. def(value, '__ob__', this);
  2417. if (Array.isArray(value)) {
  2418. if (hasProto) {
  2419. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2420. if(value.push !== value.__proto__.push){
  2421. copyAugment(value, arrayMethods, arrayKeys);
  2422. } else {
  2423. protoAugment(value, arrayMethods);
  2424. }
  2425. }
  2426. } else {
  2427. copyAugment(value, arrayMethods, arrayKeys);
  2428. }
  2429. this.observeArray(value);
  2430. } else {
  2431. this.walk(value);
  2432. }
  2433. };
  2434. /**
  2435. * Walk through all properties and convert them into
  2436. * getter/setters. This method should only be called when
  2437. * value type is Object.
  2438. */
  2439. Observer.prototype.walk = function walk (obj) {
  2440. var keys = Object.keys(obj);
  2441. for (var i = 0; i < keys.length; i++) {
  2442. defineReactive$$1(obj, keys[i]);
  2443. }
  2444. };
  2445. /**
  2446. * Observe a list of Array items.
  2447. */
  2448. Observer.prototype.observeArray = function observeArray (items) {
  2449. for (var i = 0, l = items.length; i < l; i++) {
  2450. observe(items[i]);
  2451. }
  2452. };
  2453. // helpers
  2454. /**
  2455. * Augment a target Object or Array by intercepting
  2456. * the prototype chain using __proto__
  2457. */
  2458. function protoAugment (target, src) {
  2459. /* eslint-disable no-proto */
  2460. target.__proto__ = src;
  2461. /* eslint-enable no-proto */
  2462. }
  2463. /**
  2464. * Augment a target Object or Array by defining
  2465. * hidden properties.
  2466. */
  2467. /* istanbul ignore next */
  2468. function copyAugment (target, src, keys) {
  2469. for (var i = 0, l = keys.length; i < l; i++) {
  2470. var key = keys[i];
  2471. def(target, key, src[key]);
  2472. }
  2473. }
  2474. /**
  2475. * Attempt to create an observer instance for a value,
  2476. * returns the new observer if successfully observed,
  2477. * or the existing observer if the value already has one.
  2478. */
  2479. function observe (value, asRootData) {
  2480. if (!isObject(value) || value instanceof VNode) {
  2481. return
  2482. }
  2483. var ob;
  2484. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2485. ob = value.__ob__;
  2486. } else if (
  2487. shouldObserve &&
  2488. !isServerRendering() &&
  2489. (Array.isArray(value) || isPlainObject(value)) &&
  2490. Object.isExtensible(value) &&
  2491. !value._isVue
  2492. ) {
  2493. ob = new Observer(value);
  2494. }
  2495. if (asRootData && ob) {
  2496. ob.vmCount++;
  2497. }
  2498. return ob
  2499. }
  2500. /**
  2501. * Define a reactive property on an Object.
  2502. */
  2503. function defineReactive$$1 (
  2504. obj,
  2505. key,
  2506. val,
  2507. customSetter,
  2508. shallow
  2509. ) {
  2510. var dep = new Dep();
  2511. var property = Object.getOwnPropertyDescriptor(obj, key);
  2512. if (property && property.configurable === false) {
  2513. return
  2514. }
  2515. // cater for pre-defined getter/setters
  2516. var getter = property && property.get;
  2517. var setter = property && property.set;
  2518. if ((!getter || setter) && arguments.length === 2) {
  2519. val = obj[key];
  2520. }
  2521. var childOb = !shallow && observe(val);
  2522. Object.defineProperty(obj, key, {
  2523. enumerable: true,
  2524. configurable: true,
  2525. get: function reactiveGetter () {
  2526. var value = getter ? getter.call(obj) : val;
  2527. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2528. dep.depend();
  2529. if (childOb) {
  2530. childOb.dep.depend();
  2531. if (Array.isArray(value)) {
  2532. dependArray(value);
  2533. }
  2534. }
  2535. }
  2536. return value
  2537. },
  2538. set: function reactiveSetter (newVal) {
  2539. var value = getter ? getter.call(obj) : val;
  2540. /* eslint-disable no-self-compare */
  2541. if (newVal === value || (newVal !== newVal && value !== value)) {
  2542. return
  2543. }
  2544. /* eslint-enable no-self-compare */
  2545. if ( true && customSetter) {
  2546. customSetter();
  2547. }
  2548. // #7981: for accessor properties without setter
  2549. if (getter && !setter) { return }
  2550. if (setter) {
  2551. setter.call(obj, newVal);
  2552. } else {
  2553. val = newVal;
  2554. }
  2555. childOb = !shallow && observe(newVal);
  2556. dep.notify();
  2557. }
  2558. });
  2559. }
  2560. /**
  2561. * Set a property on an object. Adds the new property and
  2562. * triggers change notification if the property doesn't
  2563. * already exist.
  2564. */
  2565. function set (target, key, val) {
  2566. if ( true &&
  2567. (isUndef(target) || isPrimitive(target))
  2568. ) {
  2569. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2570. }
  2571. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2572. target.length = Math.max(target.length, key);
  2573. target.splice(key, 1, val);
  2574. return val
  2575. }
  2576. if (key in target && !(key in Object.prototype)) {
  2577. target[key] = val;
  2578. return val
  2579. }
  2580. var ob = (target).__ob__;
  2581. if (target._isVue || (ob && ob.vmCount)) {
  2582. true && warn(
  2583. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2584. 'at runtime - declare it upfront in the data option.'
  2585. );
  2586. return val
  2587. }
  2588. if (!ob) {
  2589. target[key] = val;
  2590. return val
  2591. }
  2592. defineReactive$$1(ob.value, key, val);
  2593. ob.dep.notify();
  2594. return val
  2595. }
  2596. /**
  2597. * Delete a property and trigger change if necessary.
  2598. */
  2599. function del (target, key) {
  2600. if ( true &&
  2601. (isUndef(target) || isPrimitive(target))
  2602. ) {
  2603. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2604. }
  2605. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2606. target.splice(key, 1);
  2607. return
  2608. }
  2609. var ob = (target).__ob__;
  2610. if (target._isVue || (ob && ob.vmCount)) {
  2611. true && warn(
  2612. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2613. '- just set it to null.'
  2614. );
  2615. return
  2616. }
  2617. if (!hasOwn(target, key)) {
  2618. return
  2619. }
  2620. delete target[key];
  2621. if (!ob) {
  2622. return
  2623. }
  2624. ob.dep.notify();
  2625. }
  2626. /**
  2627. * Collect dependencies on array elements when the array is touched, since
  2628. * we cannot intercept array element access like property getters.
  2629. */
  2630. function dependArray (value) {
  2631. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2632. e = value[i];
  2633. e && e.__ob__ && e.__ob__.dep.depend();
  2634. if (Array.isArray(e)) {
  2635. dependArray(e);
  2636. }
  2637. }
  2638. }
  2639. /* */
  2640. /**
  2641. * Option overwriting strategies are functions that handle
  2642. * how to merge a parent option value and a child option
  2643. * value into the final value.
  2644. */
  2645. var strats = config.optionMergeStrategies;
  2646. /**
  2647. * Options with restrictions
  2648. */
  2649. if (true) {
  2650. strats.el = strats.propsData = function (parent, child, vm, key) {
  2651. if (!vm) {
  2652. warn(
  2653. "option \"" + key + "\" can only be used during instance " +
  2654. 'creation with the `new` keyword.'
  2655. );
  2656. }
  2657. return defaultStrat(parent, child)
  2658. };
  2659. }
  2660. /**
  2661. * Helper that recursively merges two data objects together.
  2662. */
  2663. function mergeData (to, from) {
  2664. if (!from) { return to }
  2665. var key, toVal, fromVal;
  2666. var keys = hasSymbol
  2667. ? Reflect.ownKeys(from)
  2668. : Object.keys(from);
  2669. for (var i = 0; i < keys.length; i++) {
  2670. key = keys[i];
  2671. // in case the object is already observed...
  2672. if (key === '__ob__') { continue }
  2673. toVal = to[key];
  2674. fromVal = from[key];
  2675. if (!hasOwn(to, key)) {
  2676. set(to, key, fromVal);
  2677. } else if (
  2678. toVal !== fromVal &&
  2679. isPlainObject(toVal) &&
  2680. isPlainObject(fromVal)
  2681. ) {
  2682. mergeData(toVal, fromVal);
  2683. }
  2684. }
  2685. return to
  2686. }
  2687. /**
  2688. * Data
  2689. */
  2690. function mergeDataOrFn (
  2691. parentVal,
  2692. childVal,
  2693. vm
  2694. ) {
  2695. if (!vm) {
  2696. // in a Vue.extend merge, both should be functions
  2697. if (!childVal) {
  2698. return parentVal
  2699. }
  2700. if (!parentVal) {
  2701. return childVal
  2702. }
  2703. // when parentVal & childVal are both present,
  2704. // we need to return a function that returns the
  2705. // merged result of both functions... no need to
  2706. // check if parentVal is a function here because
  2707. // it has to be a function to pass previous merges.
  2708. return function mergedDataFn () {
  2709. return mergeData(
  2710. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2711. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2712. )
  2713. }
  2714. } else {
  2715. return function mergedInstanceDataFn () {
  2716. // instance merge
  2717. var instanceData = typeof childVal === 'function'
  2718. ? childVal.call(vm, vm)
  2719. : childVal;
  2720. var defaultData = typeof parentVal === 'function'
  2721. ? parentVal.call(vm, vm)
  2722. : parentVal;
  2723. if (instanceData) {
  2724. return mergeData(instanceData, defaultData)
  2725. } else {
  2726. return defaultData
  2727. }
  2728. }
  2729. }
  2730. }
  2731. strats.data = function (
  2732. parentVal,
  2733. childVal,
  2734. vm
  2735. ) {
  2736. if (!vm) {
  2737. if (childVal && typeof childVal !== 'function') {
  2738. true && warn(
  2739. 'The "data" option should be a function ' +
  2740. 'that returns a per-instance value in component ' +
  2741. 'definitions.',
  2742. vm
  2743. );
  2744. return parentVal
  2745. }
  2746. return mergeDataOrFn(parentVal, childVal)
  2747. }
  2748. return mergeDataOrFn(parentVal, childVal, vm)
  2749. };
  2750. /**
  2751. * Hooks and props are merged as arrays.
  2752. */
  2753. function mergeHook (
  2754. parentVal,
  2755. childVal
  2756. ) {
  2757. var res = childVal
  2758. ? parentVal
  2759. ? parentVal.concat(childVal)
  2760. : Array.isArray(childVal)
  2761. ? childVal
  2762. : [childVal]
  2763. : parentVal;
  2764. return res
  2765. ? dedupeHooks(res)
  2766. : res
  2767. }
  2768. function dedupeHooks (hooks) {
  2769. var res = [];
  2770. for (var i = 0; i < hooks.length; i++) {
  2771. if (res.indexOf(hooks[i]) === -1) {
  2772. res.push(hooks[i]);
  2773. }
  2774. }
  2775. return res
  2776. }
  2777. LIFECYCLE_HOOKS.forEach(function (hook) {
  2778. strats[hook] = mergeHook;
  2779. });
  2780. /**
  2781. * Assets
  2782. *
  2783. * When a vm is present (instance creation), we need to do
  2784. * a three-way merge between constructor options, instance
  2785. * options and parent options.
  2786. */
  2787. function mergeAssets (
  2788. parentVal,
  2789. childVal,
  2790. vm,
  2791. key
  2792. ) {
  2793. var res = Object.create(parentVal || null);
  2794. if (childVal) {
  2795. true && assertObjectType(key, childVal, vm);
  2796. return extend(res, childVal)
  2797. } else {
  2798. return res
  2799. }
  2800. }
  2801. ASSET_TYPES.forEach(function (type) {
  2802. strats[type + 's'] = mergeAssets;
  2803. });
  2804. /**
  2805. * Watchers.
  2806. *
  2807. * Watchers hashes should not overwrite one
  2808. * another, so we merge them as arrays.
  2809. */
  2810. strats.watch = function (
  2811. parentVal,
  2812. childVal,
  2813. vm,
  2814. key
  2815. ) {
  2816. // work around Firefox's Object.prototype.watch...
  2817. if (parentVal === nativeWatch) { parentVal = undefined; }
  2818. if (childVal === nativeWatch) { childVal = undefined; }
  2819. /* istanbul ignore if */
  2820. if (!childVal) { return Object.create(parentVal || null) }
  2821. if (true) {
  2822. assertObjectType(key, childVal, vm);
  2823. }
  2824. if (!parentVal) { return childVal }
  2825. var ret = {};
  2826. extend(ret, parentVal);
  2827. for (var key$1 in childVal) {
  2828. var parent = ret[key$1];
  2829. var child = childVal[key$1];
  2830. if (parent && !Array.isArray(parent)) {
  2831. parent = [parent];
  2832. }
  2833. ret[key$1] = parent
  2834. ? parent.concat(child)
  2835. : Array.isArray(child) ? child : [child];
  2836. }
  2837. return ret
  2838. };
  2839. /**
  2840. * Other object hashes.
  2841. */
  2842. strats.props =
  2843. strats.methods =
  2844. strats.inject =
  2845. strats.computed = function (
  2846. parentVal,
  2847. childVal,
  2848. vm,
  2849. key
  2850. ) {
  2851. if (childVal && "development" !== 'production') {
  2852. assertObjectType(key, childVal, vm);
  2853. }
  2854. if (!parentVal) { return childVal }
  2855. var ret = Object.create(null);
  2856. extend(ret, parentVal);
  2857. if (childVal) { extend(ret, childVal); }
  2858. return ret
  2859. };
  2860. strats.provide = mergeDataOrFn;
  2861. /**
  2862. * Default strategy.
  2863. */
  2864. var defaultStrat = function (parentVal, childVal) {
  2865. return childVal === undefined
  2866. ? parentVal
  2867. : childVal
  2868. };
  2869. /**
  2870. * Validate component names
  2871. */
  2872. function checkComponents (options) {
  2873. for (var key in options.components) {
  2874. validateComponentName(key);
  2875. }
  2876. }
  2877. function validateComponentName (name) {
  2878. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2879. warn(
  2880. 'Invalid component name: "' + name + '". Component names ' +
  2881. 'should conform to valid custom element name in html5 specification.'
  2882. );
  2883. }
  2884. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2885. warn(
  2886. 'Do not use built-in or reserved HTML elements as component ' +
  2887. 'id: ' + name
  2888. );
  2889. }
  2890. }
  2891. /**
  2892. * Ensure all props option syntax are normalized into the
  2893. * Object-based format.
  2894. */
  2895. function normalizeProps (options, vm) {
  2896. var props = options.props;
  2897. if (!props) { return }
  2898. var res = {};
  2899. var i, val, name;
  2900. if (Array.isArray(props)) {
  2901. i = props.length;
  2902. while (i--) {
  2903. val = props[i];
  2904. if (typeof val === 'string') {
  2905. name = camelize(val);
  2906. res[name] = { type: null };
  2907. } else if (true) {
  2908. warn('props must be strings when using array syntax.');
  2909. }
  2910. }
  2911. } else if (isPlainObject(props)) {
  2912. for (var key in props) {
  2913. val = props[key];
  2914. name = camelize(key);
  2915. res[name] = isPlainObject(val)
  2916. ? val
  2917. : { type: val };
  2918. }
  2919. } else if (true) {
  2920. warn(
  2921. "Invalid value for option \"props\": expected an Array or an Object, " +
  2922. "but got " + (toRawType(props)) + ".",
  2923. vm
  2924. );
  2925. }
  2926. options.props = res;
  2927. }
  2928. /**
  2929. * Normalize all injections into Object-based format
  2930. */
  2931. function normalizeInject (options, vm) {
  2932. var inject = options.inject;
  2933. if (!inject) { return }
  2934. var normalized = options.inject = {};
  2935. if (Array.isArray(inject)) {
  2936. for (var i = 0; i < inject.length; i++) {
  2937. normalized[inject[i]] = { from: inject[i] };
  2938. }
  2939. } else if (isPlainObject(inject)) {
  2940. for (var key in inject) {
  2941. var val = inject[key];
  2942. normalized[key] = isPlainObject(val)
  2943. ? extend({ from: key }, val)
  2944. : { from: val };
  2945. }
  2946. } else if (true) {
  2947. warn(
  2948. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2949. "but got " + (toRawType(inject)) + ".",
  2950. vm
  2951. );
  2952. }
  2953. }
  2954. /**
  2955. * Normalize raw function directives into object format.
  2956. */
  2957. function normalizeDirectives (options) {
  2958. var dirs = options.directives;
  2959. if (dirs) {
  2960. for (var key in dirs) {
  2961. var def$$1 = dirs[key];
  2962. if (typeof def$$1 === 'function') {
  2963. dirs[key] = { bind: def$$1, update: def$$1 };
  2964. }
  2965. }
  2966. }
  2967. }
  2968. function assertObjectType (name, value, vm) {
  2969. if (!isPlainObject(value)) {
  2970. warn(
  2971. "Invalid value for option \"" + name + "\": expected an Object, " +
  2972. "but got " + (toRawType(value)) + ".",
  2973. vm
  2974. );
  2975. }
  2976. }
  2977. /**
  2978. * Merge two option objects into a new one.
  2979. * Core utility used in both instantiation and inheritance.
  2980. */
  2981. function mergeOptions (
  2982. parent,
  2983. child,
  2984. vm
  2985. ) {
  2986. if (true) {
  2987. checkComponents(child);
  2988. }
  2989. if (typeof child === 'function') {
  2990. child = child.options;
  2991. }
  2992. normalizeProps(child, vm);
  2993. normalizeInject(child, vm);
  2994. normalizeDirectives(child);
  2995. // Apply extends and mixins on the child options,
  2996. // but only if it is a raw options object that isn't
  2997. // the result of another mergeOptions call.
  2998. // Only merged options has the _base property.
  2999. if (!child._base) {
  3000. if (child.extends) {
  3001. parent = mergeOptions(parent, child.extends, vm);
  3002. }
  3003. if (child.mixins) {
  3004. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3005. parent = mergeOptions(parent, child.mixins[i], vm);
  3006. }
  3007. }
  3008. }
  3009. var options = {};
  3010. var key;
  3011. for (key in parent) {
  3012. mergeField(key);
  3013. }
  3014. for (key in child) {
  3015. if (!hasOwn(parent, key)) {
  3016. mergeField(key);
  3017. }
  3018. }
  3019. function mergeField (key) {
  3020. var strat = strats[key] || defaultStrat;
  3021. options[key] = strat(parent[key], child[key], vm, key);
  3022. }
  3023. return options
  3024. }
  3025. /**
  3026. * Resolve an asset.
  3027. * This function is used because child instances need access
  3028. * to assets defined in its ancestor chain.
  3029. */
  3030. function resolveAsset (
  3031. options,
  3032. type,
  3033. id,
  3034. warnMissing
  3035. ) {
  3036. /* istanbul ignore if */
  3037. if (typeof id !== 'string') {
  3038. return
  3039. }
  3040. var assets = options[type];
  3041. // check local registration variations first
  3042. if (hasOwn(assets, id)) { return assets[id] }
  3043. var camelizedId = camelize(id);
  3044. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3045. var PascalCaseId = capitalize(camelizedId);
  3046. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3047. // fallback to prototype chain
  3048. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3049. if ( true && warnMissing && !res) {
  3050. warn(
  3051. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3052. options
  3053. );
  3054. }
  3055. return res
  3056. }
  3057. /* */
  3058. function validateProp (
  3059. key,
  3060. propOptions,
  3061. propsData,
  3062. vm
  3063. ) {
  3064. var prop = propOptions[key];
  3065. var absent = !hasOwn(propsData, key);
  3066. var value = propsData[key];
  3067. // boolean casting
  3068. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3069. if (booleanIndex > -1) {
  3070. if (absent && !hasOwn(prop, 'default')) {
  3071. value = false;
  3072. } else if (value === '' || value === hyphenate(key)) {
  3073. // only cast empty string / same name to boolean if
  3074. // boolean has higher priority
  3075. var stringIndex = getTypeIndex(String, prop.type);
  3076. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3077. value = true;
  3078. }
  3079. }
  3080. }
  3081. // check default value
  3082. if (value === undefined) {
  3083. value = getPropDefaultValue(vm, prop, key);
  3084. // since the default value is a fresh copy,
  3085. // make sure to observe it.
  3086. var prevShouldObserve = shouldObserve;
  3087. toggleObserving(true);
  3088. observe(value);
  3089. toggleObserving(prevShouldObserve);
  3090. }
  3091. if (
  3092. true
  3093. ) {
  3094. assertProp(prop, key, value, vm, absent);
  3095. }
  3096. return value
  3097. }
  3098. /**
  3099. * Get the default value of a prop.
  3100. */
  3101. function getPropDefaultValue (vm, prop, key) {
  3102. // no default, return undefined
  3103. if (!hasOwn(prop, 'default')) {
  3104. return undefined
  3105. }
  3106. var def = prop.default;
  3107. // warn against non-factory defaults for Object & Array
  3108. if ( true && isObject(def)) {
  3109. warn(
  3110. 'Invalid default value for prop "' + key + '": ' +
  3111. 'Props with type Object/Array must use a factory function ' +
  3112. 'to return the default value.',
  3113. vm
  3114. );
  3115. }
  3116. // the raw prop value was also undefined from previous render,
  3117. // return previous default value to avoid unnecessary watcher trigger
  3118. if (vm && vm.$options.propsData &&
  3119. vm.$options.propsData[key] === undefined &&
  3120. vm._props[key] !== undefined
  3121. ) {
  3122. return vm._props[key]
  3123. }
  3124. // call factory function for non-Function types
  3125. // a value is Function if its prototype is function even across different execution context
  3126. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3127. ? def.call(vm)
  3128. : def
  3129. }
  3130. /**
  3131. * Assert whether a prop is valid.
  3132. */
  3133. function assertProp (
  3134. prop,
  3135. name,
  3136. value,
  3137. vm,
  3138. absent
  3139. ) {
  3140. if (prop.required && absent) {
  3141. warn(
  3142. 'Missing required prop: "' + name + '"',
  3143. vm
  3144. );
  3145. return
  3146. }
  3147. if (value == null && !prop.required) {
  3148. return
  3149. }
  3150. var type = prop.type;
  3151. var valid = !type || type === true;
  3152. var expectedTypes = [];
  3153. if (type) {
  3154. if (!Array.isArray(type)) {
  3155. type = [type];
  3156. }
  3157. for (var i = 0; i < type.length && !valid; i++) {
  3158. var assertedType = assertType(value, type[i]);
  3159. expectedTypes.push(assertedType.expectedType || '');
  3160. valid = assertedType.valid;
  3161. }
  3162. }
  3163. if (!valid) {
  3164. warn(
  3165. getInvalidTypeMessage(name, value, expectedTypes),
  3166. vm
  3167. );
  3168. return
  3169. }
  3170. var validator = prop.validator;
  3171. if (validator) {
  3172. if (!validator(value)) {
  3173. warn(
  3174. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3175. vm
  3176. );
  3177. }
  3178. }
  3179. }
  3180. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3181. function assertType (value, type) {
  3182. var valid;
  3183. var expectedType = getType(type);
  3184. if (simpleCheckRE.test(expectedType)) {
  3185. var t = typeof value;
  3186. valid = t === expectedType.toLowerCase();
  3187. // for primitive wrapper objects
  3188. if (!valid && t === 'object') {
  3189. valid = value instanceof type;
  3190. }
  3191. } else if (expectedType === 'Object') {
  3192. valid = isPlainObject(value);
  3193. } else if (expectedType === 'Array') {
  3194. valid = Array.isArray(value);
  3195. } else {
  3196. valid = value instanceof type;
  3197. }
  3198. return {
  3199. valid: valid,
  3200. expectedType: expectedType
  3201. }
  3202. }
  3203. /**
  3204. * Use function string name to check built-in types,
  3205. * because a simple equality check will fail when running
  3206. * across different vms / iframes.
  3207. */
  3208. function getType (fn) {
  3209. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3210. return match ? match[1] : ''
  3211. }
  3212. function isSameType (a, b) {
  3213. return getType(a) === getType(b)
  3214. }
  3215. function getTypeIndex (type, expectedTypes) {
  3216. if (!Array.isArray(expectedTypes)) {
  3217. return isSameType(expectedTypes, type) ? 0 : -1
  3218. }
  3219. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3220. if (isSameType(expectedTypes[i], type)) {
  3221. return i
  3222. }
  3223. }
  3224. return -1
  3225. }
  3226. function getInvalidTypeMessage (name, value, expectedTypes) {
  3227. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3228. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3229. var expectedType = expectedTypes[0];
  3230. var receivedType = toRawType(value);
  3231. var expectedValue = styleValue(value, expectedType);
  3232. var receivedValue = styleValue(value, receivedType);
  3233. // check if we need to specify expected value
  3234. if (expectedTypes.length === 1 &&
  3235. isExplicable(expectedType) &&
  3236. !isBoolean(expectedType, receivedType)) {
  3237. message += " with value " + expectedValue;
  3238. }
  3239. message += ", got " + receivedType + " ";
  3240. // check if we need to specify received value
  3241. if (isExplicable(receivedType)) {
  3242. message += "with value " + receivedValue + ".";
  3243. }
  3244. return message
  3245. }
  3246. function styleValue (value, type) {
  3247. if (type === 'String') {
  3248. return ("\"" + value + "\"")
  3249. } else if (type === 'Number') {
  3250. return ("" + (Number(value)))
  3251. } else {
  3252. return ("" + value)
  3253. }
  3254. }
  3255. function isExplicable (value) {
  3256. var explicitTypes = ['string', 'number', 'boolean'];
  3257. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3258. }
  3259. function isBoolean () {
  3260. var args = [], len = arguments.length;
  3261. while ( len-- ) args[ len ] = arguments[ len ];
  3262. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3263. }
  3264. /* */
  3265. function handleError (err, vm, info) {
  3266. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3267. // See: https://github.com/vuejs/vuex/issues/1505
  3268. pushTarget();
  3269. try {
  3270. if (vm) {
  3271. var cur = vm;
  3272. while ((cur = cur.$parent)) {
  3273. var hooks = cur.$options.errorCaptured;
  3274. if (hooks) {
  3275. for (var i = 0; i < hooks.length; i++) {
  3276. try {
  3277. var capture = hooks[i].call(cur, err, vm, info) === false;
  3278. if (capture) { return }
  3279. } catch (e) {
  3280. globalHandleError(e, cur, 'errorCaptured hook');
  3281. }
  3282. }
  3283. }
  3284. }
  3285. }
  3286. globalHandleError(err, vm, info);
  3287. } finally {
  3288. popTarget();
  3289. }
  3290. }
  3291. function invokeWithErrorHandling (
  3292. handler,
  3293. context,
  3294. args,
  3295. vm,
  3296. info
  3297. ) {
  3298. var res;
  3299. try {
  3300. res = args ? handler.apply(context, args) : handler.call(context);
  3301. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3302. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3303. // issue #9511
  3304. // avoid catch triggering multiple times when nested calls
  3305. res._handled = true;
  3306. }
  3307. } catch (e) {
  3308. handleError(e, vm, info);
  3309. }
  3310. return res
  3311. }
  3312. function globalHandleError (err, vm, info) {
  3313. if (config.errorHandler) {
  3314. try {
  3315. return config.errorHandler.call(null, err, vm, info)
  3316. } catch (e) {
  3317. // if the user intentionally throws the original error in the handler,
  3318. // do not log it twice
  3319. if (e !== err) {
  3320. logError(e, null, 'config.errorHandler');
  3321. }
  3322. }
  3323. }
  3324. logError(err, vm, info);
  3325. }
  3326. function logError (err, vm, info) {
  3327. if (true) {
  3328. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3329. }
  3330. /* istanbul ignore else */
  3331. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3332. console.error(err);
  3333. } else {
  3334. throw err
  3335. }
  3336. }
  3337. /* */
  3338. var callbacks = [];
  3339. var pending = false;
  3340. function flushCallbacks () {
  3341. pending = false;
  3342. var copies = callbacks.slice(0);
  3343. callbacks.length = 0;
  3344. for (var i = 0; i < copies.length; i++) {
  3345. copies[i]();
  3346. }
  3347. }
  3348. // Here we have async deferring wrappers using microtasks.
  3349. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3350. // However, it has subtle problems when state is changed right before repaint
  3351. // (e.g. #6813, out-in transitions).
  3352. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3353. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3354. // So we now use microtasks everywhere, again.
  3355. // A major drawback of this tradeoff is that there are some scenarios
  3356. // where microtasks have too high a priority and fire in between supposedly
  3357. // sequential events (e.g. #4521, #6690, which have workarounds)
  3358. // or even between bubbling of the same event (#6566).
  3359. var timerFunc;
  3360. // The nextTick behavior leverages the microtask queue, which can be accessed
  3361. // via either native Promise.then or MutationObserver.
  3362. // MutationObserver has wider support, however it is seriously bugged in
  3363. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3364. // completely stops working after triggering a few times... so, if native
  3365. // Promise is available, we will use it:
  3366. /* istanbul ignore next, $flow-disable-line */
  3367. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3368. var p = Promise.resolve();
  3369. timerFunc = function () {
  3370. p.then(flushCallbacks);
  3371. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3372. // it can get stuck in a weird state where callbacks are pushed into the
  3373. // microtask queue but the queue isn't being flushed, until the browser
  3374. // needs to do some other work, e.g. handle a timer. Therefore we can
  3375. // "force" the microtask queue to be flushed by adding an empty timer.
  3376. if (isIOS) { setTimeout(noop); }
  3377. };
  3378. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3379. isNative(MutationObserver) ||
  3380. // PhantomJS and iOS 7.x
  3381. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3382. )) {
  3383. // Use MutationObserver where native Promise is not available,
  3384. // e.g. PhantomJS, iOS7, Android 4.4
  3385. // (#6466 MutationObserver is unreliable in IE11)
  3386. var counter = 1;
  3387. var observer = new MutationObserver(flushCallbacks);
  3388. var textNode = document.createTextNode(String(counter));
  3389. observer.observe(textNode, {
  3390. characterData: true
  3391. });
  3392. timerFunc = function () {
  3393. counter = (counter + 1) % 2;
  3394. textNode.data = String(counter);
  3395. };
  3396. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3397. // Fallback to setImmediate.
  3398. // Technically it leverages the (macro) task queue,
  3399. // but it is still a better choice than setTimeout.
  3400. timerFunc = function () {
  3401. setImmediate(flushCallbacks);
  3402. };
  3403. } else {
  3404. // Fallback to setTimeout.
  3405. timerFunc = function () {
  3406. setTimeout(flushCallbacks, 0);
  3407. };
  3408. }
  3409. function nextTick (cb, ctx) {
  3410. var _resolve;
  3411. callbacks.push(function () {
  3412. if (cb) {
  3413. try {
  3414. cb.call(ctx);
  3415. } catch (e) {
  3416. handleError(e, ctx, 'nextTick');
  3417. }
  3418. } else if (_resolve) {
  3419. _resolve(ctx);
  3420. }
  3421. });
  3422. if (!pending) {
  3423. pending = true;
  3424. timerFunc();
  3425. }
  3426. // $flow-disable-line
  3427. if (!cb && typeof Promise !== 'undefined') {
  3428. return new Promise(function (resolve) {
  3429. _resolve = resolve;
  3430. })
  3431. }
  3432. }
  3433. /* */
  3434. /* not type checking this file because flow doesn't play well with Proxy */
  3435. var initProxy;
  3436. if (true) {
  3437. var allowedGlobals = makeMap(
  3438. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3439. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3440. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3441. 'require' // for Webpack/Browserify
  3442. );
  3443. var warnNonPresent = function (target, key) {
  3444. warn(
  3445. "Property or method \"" + key + "\" is not defined on the instance but " +
  3446. 'referenced during render. Make sure that this property is reactive, ' +
  3447. 'either in the data option, or for class-based components, by ' +
  3448. 'initializing the property. ' +
  3449. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3450. target
  3451. );
  3452. };
  3453. var warnReservedPrefix = function (target, key) {
  3454. warn(
  3455. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3456. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3457. 'prevent conflicts with Vue internals. ' +
  3458. 'See: https://vuejs.org/v2/api/#data',
  3459. target
  3460. );
  3461. };
  3462. var hasProxy =
  3463. typeof Proxy !== 'undefined' && isNative(Proxy);
  3464. if (hasProxy) {
  3465. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3466. config.keyCodes = new Proxy(config.keyCodes, {
  3467. set: function set (target, key, value) {
  3468. if (isBuiltInModifier(key)) {
  3469. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3470. return false
  3471. } else {
  3472. target[key] = value;
  3473. return true
  3474. }
  3475. }
  3476. });
  3477. }
  3478. var hasHandler = {
  3479. has: function has (target, key) {
  3480. var has = key in target;
  3481. var isAllowed = allowedGlobals(key) ||
  3482. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3483. if (!has && !isAllowed) {
  3484. if (key in target.$data) { warnReservedPrefix(target, key); }
  3485. else { warnNonPresent(target, key); }
  3486. }
  3487. return has || !isAllowed
  3488. }
  3489. };
  3490. var getHandler = {
  3491. get: function get (target, key) {
  3492. if (typeof key === 'string' && !(key in target)) {
  3493. if (key in target.$data) { warnReservedPrefix(target, key); }
  3494. else { warnNonPresent(target, key); }
  3495. }
  3496. return target[key]
  3497. }
  3498. };
  3499. initProxy = function initProxy (vm) {
  3500. if (hasProxy) {
  3501. // determine which proxy handler to use
  3502. var options = vm.$options;
  3503. var handlers = options.render && options.render._withStripped
  3504. ? getHandler
  3505. : hasHandler;
  3506. vm._renderProxy = new Proxy(vm, handlers);
  3507. } else {
  3508. vm._renderProxy = vm;
  3509. }
  3510. };
  3511. }
  3512. /* */
  3513. var seenObjects = new _Set();
  3514. /**
  3515. * Recursively traverse an object to evoke all converted
  3516. * getters, so that every nested property inside the object
  3517. * is collected as a "deep" dependency.
  3518. */
  3519. function traverse (val) {
  3520. _traverse(val, seenObjects);
  3521. seenObjects.clear();
  3522. }
  3523. function _traverse (val, seen) {
  3524. var i, keys;
  3525. var isA = Array.isArray(val);
  3526. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3527. return
  3528. }
  3529. if (val.__ob__) {
  3530. var depId = val.__ob__.dep.id;
  3531. if (seen.has(depId)) {
  3532. return
  3533. }
  3534. seen.add(depId);
  3535. }
  3536. if (isA) {
  3537. i = val.length;
  3538. while (i--) { _traverse(val[i], seen); }
  3539. } else {
  3540. keys = Object.keys(val);
  3541. i = keys.length;
  3542. while (i--) { _traverse(val[keys[i]], seen); }
  3543. }
  3544. }
  3545. var mark;
  3546. var measure;
  3547. if (true) {
  3548. var perf = inBrowser && window.performance;
  3549. /* istanbul ignore if */
  3550. if (
  3551. perf &&
  3552. perf.mark &&
  3553. perf.measure &&
  3554. perf.clearMarks &&
  3555. perf.clearMeasures
  3556. ) {
  3557. mark = function (tag) { return perf.mark(tag); };
  3558. measure = function (name, startTag, endTag) {
  3559. perf.measure(name, startTag, endTag);
  3560. perf.clearMarks(startTag);
  3561. perf.clearMarks(endTag);
  3562. // perf.clearMeasures(name)
  3563. };
  3564. }
  3565. }
  3566. /* */
  3567. var normalizeEvent = cached(function (name) {
  3568. var passive = name.charAt(0) === '&';
  3569. name = passive ? name.slice(1) : name;
  3570. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3571. name = once$$1 ? name.slice(1) : name;
  3572. var capture = name.charAt(0) === '!';
  3573. name = capture ? name.slice(1) : name;
  3574. return {
  3575. name: name,
  3576. once: once$$1,
  3577. capture: capture,
  3578. passive: passive
  3579. }
  3580. });
  3581. function createFnInvoker (fns, vm) {
  3582. function invoker () {
  3583. var arguments$1 = arguments;
  3584. var fns = invoker.fns;
  3585. if (Array.isArray(fns)) {
  3586. var cloned = fns.slice();
  3587. for (var i = 0; i < cloned.length; i++) {
  3588. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3589. }
  3590. } else {
  3591. // return handler return value for single handlers
  3592. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3593. }
  3594. }
  3595. invoker.fns = fns;
  3596. return invoker
  3597. }
  3598. function updateListeners (
  3599. on,
  3600. oldOn,
  3601. add,
  3602. remove$$1,
  3603. createOnceHandler,
  3604. vm
  3605. ) {
  3606. var name, def$$1, cur, old, event;
  3607. for (name in on) {
  3608. def$$1 = cur = on[name];
  3609. old = oldOn[name];
  3610. event = normalizeEvent(name);
  3611. if (isUndef(cur)) {
  3612. true && warn(
  3613. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3614. vm
  3615. );
  3616. } else if (isUndef(old)) {
  3617. if (isUndef(cur.fns)) {
  3618. cur = on[name] = createFnInvoker(cur, vm);
  3619. }
  3620. if (isTrue(event.once)) {
  3621. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3622. }
  3623. add(event.name, cur, event.capture, event.passive, event.params);
  3624. } else if (cur !== old) {
  3625. old.fns = cur;
  3626. on[name] = old;
  3627. }
  3628. }
  3629. for (name in oldOn) {
  3630. if (isUndef(on[name])) {
  3631. event = normalizeEvent(name);
  3632. remove$$1(event.name, oldOn[name], event.capture);
  3633. }
  3634. }
  3635. }
  3636. /* */
  3637. /* */
  3638. // fixed by xxxxxx (mp properties)
  3639. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3640. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3641. if (isUndef(propOptions)) {
  3642. return res
  3643. }
  3644. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3645. var attrs = data.attrs;
  3646. var props = data.props;
  3647. if (isDef(attrs) || isDef(props)) {
  3648. for (var key in propOptions) {
  3649. var altKey = hyphenate(key);
  3650. var result = checkProp(res, props, key, altKey, true) ||
  3651. checkProp(res, attrs, key, altKey, false);
  3652. // externalClass
  3653. if (
  3654. result &&
  3655. res[key] &&
  3656. externalClasses.indexOf(altKey) !== -1 &&
  3657. context[camelize(res[key])]
  3658. ) {
  3659. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3660. res[key] = context[camelize(res[key])];
  3661. }
  3662. }
  3663. }
  3664. return res
  3665. }
  3666. function extractPropsFromVNodeData (
  3667. data,
  3668. Ctor,
  3669. tag,
  3670. context// fixed by xxxxxx
  3671. ) {
  3672. // we are only extracting raw values here.
  3673. // validation and default values are handled in the child
  3674. // component itself.
  3675. var propOptions = Ctor.options.props;
  3676. if (isUndef(propOptions)) {
  3677. // fixed by xxxxxx
  3678. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3679. }
  3680. var res = {};
  3681. var attrs = data.attrs;
  3682. var props = data.props;
  3683. if (isDef(attrs) || isDef(props)) {
  3684. for (var key in propOptions) {
  3685. var altKey = hyphenate(key);
  3686. if (true) {
  3687. var keyInLowerCase = key.toLowerCase();
  3688. if (
  3689. key !== keyInLowerCase &&
  3690. attrs && hasOwn(attrs, keyInLowerCase)
  3691. ) {
  3692. tip(
  3693. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3694. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3695. " \"" + key + "\". " +
  3696. "Note that HTML attributes are case-insensitive and camelCased " +
  3697. "props need to use their kebab-case equivalents when using in-DOM " +
  3698. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3699. );
  3700. }
  3701. }
  3702. checkProp(res, props, key, altKey, true) ||
  3703. checkProp(res, attrs, key, altKey, false);
  3704. }
  3705. }
  3706. // fixed by xxxxxx
  3707. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3708. }
  3709. function checkProp (
  3710. res,
  3711. hash,
  3712. key,
  3713. altKey,
  3714. preserve
  3715. ) {
  3716. if (isDef(hash)) {
  3717. if (hasOwn(hash, key)) {
  3718. res[key] = hash[key];
  3719. if (!preserve) {
  3720. delete hash[key];
  3721. }
  3722. return true
  3723. } else if (hasOwn(hash, altKey)) {
  3724. res[key] = hash[altKey];
  3725. if (!preserve) {
  3726. delete hash[altKey];
  3727. }
  3728. return true
  3729. }
  3730. }
  3731. return false
  3732. }
  3733. /* */
  3734. // The template compiler attempts to minimize the need for normalization by
  3735. // statically analyzing the template at compile time.
  3736. //
  3737. // For plain HTML markup, normalization can be completely skipped because the
  3738. // generated render function is guaranteed to return Array<VNode>. There are
  3739. // two cases where extra normalization is needed:
  3740. // 1. When the children contains components - because a functional component
  3741. // may return an Array instead of a single root. In this case, just a simple
  3742. // normalization is needed - if any child is an Array, we flatten the whole
  3743. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3744. // because functional components already normalize their own children.
  3745. function simpleNormalizeChildren (children) {
  3746. for (var i = 0; i < children.length; i++) {
  3747. if (Array.isArray(children[i])) {
  3748. return Array.prototype.concat.apply([], children)
  3749. }
  3750. }
  3751. return children
  3752. }
  3753. // 2. When the children contains constructs that always generated nested Arrays,
  3754. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3755. // with hand-written render functions / JSX. In such cases a full normalization
  3756. // is needed to cater to all possible types of children values.
  3757. function normalizeChildren (children) {
  3758. return isPrimitive(children)
  3759. ? [createTextVNode(children)]
  3760. : Array.isArray(children)
  3761. ? normalizeArrayChildren(children)
  3762. : undefined
  3763. }
  3764. function isTextNode (node) {
  3765. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3766. }
  3767. function normalizeArrayChildren (children, nestedIndex) {
  3768. var res = [];
  3769. var i, c, lastIndex, last;
  3770. for (i = 0; i < children.length; i++) {
  3771. c = children[i];
  3772. if (isUndef(c) || typeof c === 'boolean') { continue }
  3773. lastIndex = res.length - 1;
  3774. last = res[lastIndex];
  3775. // nested
  3776. if (Array.isArray(c)) {
  3777. if (c.length > 0) {
  3778. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3779. // merge adjacent text nodes
  3780. if (isTextNode(c[0]) && isTextNode(last)) {
  3781. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3782. c.shift();
  3783. }
  3784. res.push.apply(res, c);
  3785. }
  3786. } else if (isPrimitive(c)) {
  3787. if (isTextNode(last)) {
  3788. // merge adjacent text nodes
  3789. // this is necessary for SSR hydration because text nodes are
  3790. // essentially merged when rendered to HTML strings
  3791. res[lastIndex] = createTextVNode(last.text + c);
  3792. } else if (c !== '') {
  3793. // convert primitive to vnode
  3794. res.push(createTextVNode(c));
  3795. }
  3796. } else {
  3797. if (isTextNode(c) && isTextNode(last)) {
  3798. // merge adjacent text nodes
  3799. res[lastIndex] = createTextVNode(last.text + c.text);
  3800. } else {
  3801. // default key for nested array children (likely generated by v-for)
  3802. if (isTrue(children._isVList) &&
  3803. isDef(c.tag) &&
  3804. isUndef(c.key) &&
  3805. isDef(nestedIndex)) {
  3806. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3807. }
  3808. res.push(c);
  3809. }
  3810. }
  3811. }
  3812. return res
  3813. }
  3814. /* */
  3815. function initProvide (vm) {
  3816. var provide = vm.$options.provide;
  3817. if (provide) {
  3818. vm._provided = typeof provide === 'function'
  3819. ? provide.call(vm)
  3820. : provide;
  3821. }
  3822. }
  3823. function initInjections (vm) {
  3824. var result = resolveInject(vm.$options.inject, vm);
  3825. if (result) {
  3826. toggleObserving(false);
  3827. Object.keys(result).forEach(function (key) {
  3828. /* istanbul ignore else */
  3829. if (true) {
  3830. defineReactive$$1(vm, key, result[key], function () {
  3831. warn(
  3832. "Avoid mutating an injected value directly since the changes will be " +
  3833. "overwritten whenever the provided component re-renders. " +
  3834. "injection being mutated: \"" + key + "\"",
  3835. vm
  3836. );
  3837. });
  3838. } else {}
  3839. });
  3840. toggleObserving(true);
  3841. }
  3842. }
  3843. function resolveInject (inject, vm) {
  3844. if (inject) {
  3845. // inject is :any because flow is not smart enough to figure out cached
  3846. var result = Object.create(null);
  3847. var keys = hasSymbol
  3848. ? Reflect.ownKeys(inject)
  3849. : Object.keys(inject);
  3850. for (var i = 0; i < keys.length; i++) {
  3851. var key = keys[i];
  3852. // #6574 in case the inject object is observed...
  3853. if (key === '__ob__') { continue }
  3854. var provideKey = inject[key].from;
  3855. var source = vm;
  3856. while (source) {
  3857. if (source._provided && hasOwn(source._provided, provideKey)) {
  3858. result[key] = source._provided[provideKey];
  3859. break
  3860. }
  3861. source = source.$parent;
  3862. }
  3863. if (!source) {
  3864. if ('default' in inject[key]) {
  3865. var provideDefault = inject[key].default;
  3866. result[key] = typeof provideDefault === 'function'
  3867. ? provideDefault.call(vm)
  3868. : provideDefault;
  3869. } else if (true) {
  3870. warn(("Injection \"" + key + "\" not found"), vm);
  3871. }
  3872. }
  3873. }
  3874. return result
  3875. }
  3876. }
  3877. /* */
  3878. /**
  3879. * Runtime helper for resolving raw children VNodes into a slot object.
  3880. */
  3881. function resolveSlots (
  3882. children,
  3883. context
  3884. ) {
  3885. if (!children || !children.length) {
  3886. return {}
  3887. }
  3888. var slots = {};
  3889. for (var i = 0, l = children.length; i < l; i++) {
  3890. var child = children[i];
  3891. var data = child.data;
  3892. // remove slot attribute if the node is resolved as a Vue slot node
  3893. if (data && data.attrs && data.attrs.slot) {
  3894. delete data.attrs.slot;
  3895. }
  3896. // named slots should only be respected if the vnode was rendered in the
  3897. // same context.
  3898. if ((child.context === context || child.fnContext === context) &&
  3899. data && data.slot != null
  3900. ) {
  3901. var name = data.slot;
  3902. var slot = (slots[name] || (slots[name] = []));
  3903. if (child.tag === 'template') {
  3904. slot.push.apply(slot, child.children || []);
  3905. } else {
  3906. slot.push(child);
  3907. }
  3908. } else {
  3909. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3910. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3911. (slots['page'] || (slots['page'] = [])).push(child);
  3912. }else{
  3913. (slots.default || (slots.default = [])).push(child);
  3914. }
  3915. }
  3916. }
  3917. // ignore slots that contains only whitespace
  3918. for (var name$1 in slots) {
  3919. if (slots[name$1].every(isWhitespace)) {
  3920. delete slots[name$1];
  3921. }
  3922. }
  3923. return slots
  3924. }
  3925. function isWhitespace (node) {
  3926. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3927. }
  3928. /* */
  3929. function normalizeScopedSlots (
  3930. slots,
  3931. normalSlots,
  3932. prevSlots
  3933. ) {
  3934. var res;
  3935. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3936. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3937. var key = slots && slots.$key;
  3938. if (!slots) {
  3939. res = {};
  3940. } else if (slots._normalized) {
  3941. // fast path 1: child component re-render only, parent did not change
  3942. return slots._normalized
  3943. } else if (
  3944. isStable &&
  3945. prevSlots &&
  3946. prevSlots !== emptyObject &&
  3947. key === prevSlots.$key &&
  3948. !hasNormalSlots &&
  3949. !prevSlots.$hasNormal
  3950. ) {
  3951. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3952. // only need to normalize once
  3953. return prevSlots
  3954. } else {
  3955. res = {};
  3956. for (var key$1 in slots) {
  3957. if (slots[key$1] && key$1[0] !== '$') {
  3958. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3959. }
  3960. }
  3961. }
  3962. // expose normal slots on scopedSlots
  3963. for (var key$2 in normalSlots) {
  3964. if (!(key$2 in res)) {
  3965. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3966. }
  3967. }
  3968. // avoriaz seems to mock a non-extensible $scopedSlots object
  3969. // and when that is passed down this would cause an error
  3970. if (slots && Object.isExtensible(slots)) {
  3971. (slots)._normalized = res;
  3972. }
  3973. def(res, '$stable', isStable);
  3974. def(res, '$key', key);
  3975. def(res, '$hasNormal', hasNormalSlots);
  3976. return res
  3977. }
  3978. function normalizeScopedSlot(normalSlots, key, fn) {
  3979. var normalized = function () {
  3980. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3981. res = res && typeof res === 'object' && !Array.isArray(res)
  3982. ? [res] // single vnode
  3983. : normalizeChildren(res);
  3984. return res && (
  3985. res.length === 0 ||
  3986. (res.length === 1 && res[0].isComment) // #9658
  3987. ) ? undefined
  3988. : res
  3989. };
  3990. // this is a slot using the new v-slot syntax without scope. although it is
  3991. // compiled as a scoped slot, render fn users would expect it to be present
  3992. // on this.$slots because the usage is semantically a normal slot.
  3993. if (fn.proxy) {
  3994. Object.defineProperty(normalSlots, key, {
  3995. get: normalized,
  3996. enumerable: true,
  3997. configurable: true
  3998. });
  3999. }
  4000. return normalized
  4001. }
  4002. function proxyNormalSlot(slots, key) {
  4003. return function () { return slots[key]; }
  4004. }
  4005. /* */
  4006. /**
  4007. * Runtime helper for rendering v-for lists.
  4008. */
  4009. function renderList (
  4010. val,
  4011. render
  4012. ) {
  4013. var ret, i, l, keys, key;
  4014. if (Array.isArray(val) || typeof val === 'string') {
  4015. ret = new Array(val.length);
  4016. for (i = 0, l = val.length; i < l; i++) {
  4017. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4018. }
  4019. } else if (typeof val === 'number') {
  4020. ret = new Array(val);
  4021. for (i = 0; i < val; i++) {
  4022. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4023. }
  4024. } else if (isObject(val)) {
  4025. if (hasSymbol && val[Symbol.iterator]) {
  4026. ret = [];
  4027. var iterator = val[Symbol.iterator]();
  4028. var result = iterator.next();
  4029. while (!result.done) {
  4030. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4031. result = iterator.next();
  4032. }
  4033. } else {
  4034. keys = Object.keys(val);
  4035. ret = new Array(keys.length);
  4036. for (i = 0, l = keys.length; i < l; i++) {
  4037. key = keys[i];
  4038. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4039. }
  4040. }
  4041. }
  4042. if (!isDef(ret)) {
  4043. ret = [];
  4044. }
  4045. (ret)._isVList = true;
  4046. return ret
  4047. }
  4048. /* */
  4049. /**
  4050. * Runtime helper for rendering <slot>
  4051. */
  4052. function renderSlot (
  4053. name,
  4054. fallback,
  4055. props,
  4056. bindObject
  4057. ) {
  4058. var scopedSlotFn = this.$scopedSlots[name];
  4059. var nodes;
  4060. if (scopedSlotFn) { // scoped slot
  4061. props = props || {};
  4062. if (bindObject) {
  4063. if ( true && !isObject(bindObject)) {
  4064. warn(
  4065. 'slot v-bind without argument expects an Object',
  4066. this
  4067. );
  4068. }
  4069. props = extend(extend({}, bindObject), props);
  4070. }
  4071. // fixed by xxxxxx app-plus scopedSlot
  4072. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4073. } else {
  4074. nodes = this.$slots[name] || fallback;
  4075. }
  4076. var target = props && props.slot;
  4077. if (target) {
  4078. return this.$createElement('template', { slot: target }, nodes)
  4079. } else {
  4080. return nodes
  4081. }
  4082. }
  4083. /* */
  4084. /**
  4085. * Runtime helper for resolving filters
  4086. */
  4087. function resolveFilter (id) {
  4088. return resolveAsset(this.$options, 'filters', id, true) || identity
  4089. }
  4090. /* */
  4091. function isKeyNotMatch (expect, actual) {
  4092. if (Array.isArray(expect)) {
  4093. return expect.indexOf(actual) === -1
  4094. } else {
  4095. return expect !== actual
  4096. }
  4097. }
  4098. /**
  4099. * Runtime helper for checking keyCodes from config.
  4100. * exposed as Vue.prototype._k
  4101. * passing in eventKeyName as last argument separately for backwards compat
  4102. */
  4103. function checkKeyCodes (
  4104. eventKeyCode,
  4105. key,
  4106. builtInKeyCode,
  4107. eventKeyName,
  4108. builtInKeyName
  4109. ) {
  4110. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4111. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4112. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4113. } else if (mappedKeyCode) {
  4114. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4115. } else if (eventKeyName) {
  4116. return hyphenate(eventKeyName) !== key
  4117. }
  4118. }
  4119. /* */
  4120. /**
  4121. * Runtime helper for merging v-bind="object" into a VNode's data.
  4122. */
  4123. function bindObjectProps (
  4124. data,
  4125. tag,
  4126. value,
  4127. asProp,
  4128. isSync
  4129. ) {
  4130. if (value) {
  4131. if (!isObject(value)) {
  4132. true && warn(
  4133. 'v-bind without argument expects an Object or Array value',
  4134. this
  4135. );
  4136. } else {
  4137. if (Array.isArray(value)) {
  4138. value = toObject(value);
  4139. }
  4140. var hash;
  4141. var loop = function ( key ) {
  4142. if (
  4143. key === 'class' ||
  4144. key === 'style' ||
  4145. isReservedAttribute(key)
  4146. ) {
  4147. hash = data;
  4148. } else {
  4149. var type = data.attrs && data.attrs.type;
  4150. hash = asProp || config.mustUseProp(tag, type, key)
  4151. ? data.domProps || (data.domProps = {})
  4152. : data.attrs || (data.attrs = {});
  4153. }
  4154. var camelizedKey = camelize(key);
  4155. var hyphenatedKey = hyphenate(key);
  4156. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4157. hash[key] = value[key];
  4158. if (isSync) {
  4159. var on = data.on || (data.on = {});
  4160. on[("update:" + key)] = function ($event) {
  4161. value[key] = $event;
  4162. };
  4163. }
  4164. }
  4165. };
  4166. for (var key in value) loop( key );
  4167. }
  4168. }
  4169. return data
  4170. }
  4171. /* */
  4172. /**
  4173. * Runtime helper for rendering static trees.
  4174. */
  4175. function renderStatic (
  4176. index,
  4177. isInFor
  4178. ) {
  4179. var cached = this._staticTrees || (this._staticTrees = []);
  4180. var tree = cached[index];
  4181. // if has already-rendered static tree and not inside v-for,
  4182. // we can reuse the same tree.
  4183. if (tree && !isInFor) {
  4184. return tree
  4185. }
  4186. // otherwise, render a fresh tree.
  4187. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4188. this._renderProxy,
  4189. null,
  4190. this // for render fns generated for functional component templates
  4191. );
  4192. markStatic(tree, ("__static__" + index), false);
  4193. return tree
  4194. }
  4195. /**
  4196. * Runtime helper for v-once.
  4197. * Effectively it means marking the node as static with a unique key.
  4198. */
  4199. function markOnce (
  4200. tree,
  4201. index,
  4202. key
  4203. ) {
  4204. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4205. return tree
  4206. }
  4207. function markStatic (
  4208. tree,
  4209. key,
  4210. isOnce
  4211. ) {
  4212. if (Array.isArray(tree)) {
  4213. for (var i = 0; i < tree.length; i++) {
  4214. if (tree[i] && typeof tree[i] !== 'string') {
  4215. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4216. }
  4217. }
  4218. } else {
  4219. markStaticNode(tree, key, isOnce);
  4220. }
  4221. }
  4222. function markStaticNode (node, key, isOnce) {
  4223. node.isStatic = true;
  4224. node.key = key;
  4225. node.isOnce = isOnce;
  4226. }
  4227. /* */
  4228. function bindObjectListeners (data, value) {
  4229. if (value) {
  4230. if (!isPlainObject(value)) {
  4231. true && warn(
  4232. 'v-on without argument expects an Object value',
  4233. this
  4234. );
  4235. } else {
  4236. var on = data.on = data.on ? extend({}, data.on) : {};
  4237. for (var key in value) {
  4238. var existing = on[key];
  4239. var ours = value[key];
  4240. on[key] = existing ? [].concat(existing, ours) : ours;
  4241. }
  4242. }
  4243. }
  4244. return data
  4245. }
  4246. /* */
  4247. function resolveScopedSlots (
  4248. fns, // see flow/vnode
  4249. res,
  4250. // the following are added in 2.6
  4251. hasDynamicKeys,
  4252. contentHashKey
  4253. ) {
  4254. res = res || { $stable: !hasDynamicKeys };
  4255. for (var i = 0; i < fns.length; i++) {
  4256. var slot = fns[i];
  4257. if (Array.isArray(slot)) {
  4258. resolveScopedSlots(slot, res, hasDynamicKeys);
  4259. } else if (slot) {
  4260. // marker for reverse proxying v-slot without scope on this.$slots
  4261. if (slot.proxy) {
  4262. slot.fn.proxy = true;
  4263. }
  4264. res[slot.key] = slot.fn;
  4265. }
  4266. }
  4267. if (contentHashKey) {
  4268. (res).$key = contentHashKey;
  4269. }
  4270. return res
  4271. }
  4272. /* */
  4273. function bindDynamicKeys (baseObj, values) {
  4274. for (var i = 0; i < values.length; i += 2) {
  4275. var key = values[i];
  4276. if (typeof key === 'string' && key) {
  4277. baseObj[values[i]] = values[i + 1];
  4278. } else if ( true && key !== '' && key !== null) {
  4279. // null is a special value for explicitly removing a binding
  4280. warn(
  4281. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4282. this
  4283. );
  4284. }
  4285. }
  4286. return baseObj
  4287. }
  4288. // helper to dynamically append modifier runtime markers to event names.
  4289. // ensure only append when value is already string, otherwise it will be cast
  4290. // to string and cause the type check to miss.
  4291. function prependModifier (value, symbol) {
  4292. return typeof value === 'string' ? symbol + value : value
  4293. }
  4294. /* */
  4295. function installRenderHelpers (target) {
  4296. target._o = markOnce;
  4297. target._n = toNumber;
  4298. target._s = toString;
  4299. target._l = renderList;
  4300. target._t = renderSlot;
  4301. target._q = looseEqual;
  4302. target._i = looseIndexOf;
  4303. target._m = renderStatic;
  4304. target._f = resolveFilter;
  4305. target._k = checkKeyCodes;
  4306. target._b = bindObjectProps;
  4307. target._v = createTextVNode;
  4308. target._e = createEmptyVNode;
  4309. target._u = resolveScopedSlots;
  4310. target._g = bindObjectListeners;
  4311. target._d = bindDynamicKeys;
  4312. target._p = prependModifier;
  4313. }
  4314. /* */
  4315. function FunctionalRenderContext (
  4316. data,
  4317. props,
  4318. children,
  4319. parent,
  4320. Ctor
  4321. ) {
  4322. var this$1 = this;
  4323. var options = Ctor.options;
  4324. // ensure the createElement function in functional components
  4325. // gets a unique context - this is necessary for correct named slot check
  4326. var contextVm;
  4327. if (hasOwn(parent, '_uid')) {
  4328. contextVm = Object.create(parent);
  4329. // $flow-disable-line
  4330. contextVm._original = parent;
  4331. } else {
  4332. // the context vm passed in is a functional context as well.
  4333. // in this case we want to make sure we are able to get a hold to the
  4334. // real context instance.
  4335. contextVm = parent;
  4336. // $flow-disable-line
  4337. parent = parent._original;
  4338. }
  4339. var isCompiled = isTrue(options._compiled);
  4340. var needNormalization = !isCompiled;
  4341. this.data = data;
  4342. this.props = props;
  4343. this.children = children;
  4344. this.parent = parent;
  4345. this.listeners = data.on || emptyObject;
  4346. this.injections = resolveInject(options.inject, parent);
  4347. this.slots = function () {
  4348. if (!this$1.$slots) {
  4349. normalizeScopedSlots(
  4350. data.scopedSlots,
  4351. this$1.$slots = resolveSlots(children, parent)
  4352. );
  4353. }
  4354. return this$1.$slots
  4355. };
  4356. Object.defineProperty(this, 'scopedSlots', ({
  4357. enumerable: true,
  4358. get: function get () {
  4359. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4360. }
  4361. }));
  4362. // support for compiled functional template
  4363. if (isCompiled) {
  4364. // exposing $options for renderStatic()
  4365. this.$options = options;
  4366. // pre-resolve slots for renderSlot()
  4367. this.$slots = this.slots();
  4368. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4369. }
  4370. if (options._scopeId) {
  4371. this._c = function (a, b, c, d) {
  4372. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4373. if (vnode && !Array.isArray(vnode)) {
  4374. vnode.fnScopeId = options._scopeId;
  4375. vnode.fnContext = parent;
  4376. }
  4377. return vnode
  4378. };
  4379. } else {
  4380. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4381. }
  4382. }
  4383. installRenderHelpers(FunctionalRenderContext.prototype);
  4384. function createFunctionalComponent (
  4385. Ctor,
  4386. propsData,
  4387. data,
  4388. contextVm,
  4389. children
  4390. ) {
  4391. var options = Ctor.options;
  4392. var props = {};
  4393. var propOptions = options.props;
  4394. if (isDef(propOptions)) {
  4395. for (var key in propOptions) {
  4396. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4397. }
  4398. } else {
  4399. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4400. if (isDef(data.props)) { mergeProps(props, data.props); }
  4401. }
  4402. var renderContext = new FunctionalRenderContext(
  4403. data,
  4404. props,
  4405. children,
  4406. contextVm,
  4407. Ctor
  4408. );
  4409. var vnode = options.render.call(null, renderContext._c, renderContext);
  4410. if (vnode instanceof VNode) {
  4411. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4412. } else if (Array.isArray(vnode)) {
  4413. var vnodes = normalizeChildren(vnode) || [];
  4414. var res = new Array(vnodes.length);
  4415. for (var i = 0; i < vnodes.length; i++) {
  4416. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4417. }
  4418. return res
  4419. }
  4420. }
  4421. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4422. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4423. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4424. // that should not be matched to match.
  4425. var clone = cloneVNode(vnode);
  4426. clone.fnContext = contextVm;
  4427. clone.fnOptions = options;
  4428. if (true) {
  4429. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4430. }
  4431. if (data.slot) {
  4432. (clone.data || (clone.data = {})).slot = data.slot;
  4433. }
  4434. return clone
  4435. }
  4436. function mergeProps (to, from) {
  4437. for (var key in from) {
  4438. to[camelize(key)] = from[key];
  4439. }
  4440. }
  4441. /* */
  4442. /* */
  4443. /* */
  4444. /* */
  4445. // inline hooks to be invoked on component VNodes during patch
  4446. var componentVNodeHooks = {
  4447. init: function init (vnode, hydrating) {
  4448. if (
  4449. vnode.componentInstance &&
  4450. !vnode.componentInstance._isDestroyed &&
  4451. vnode.data.keepAlive
  4452. ) {
  4453. // kept-alive components, treat as a patch
  4454. var mountedNode = vnode; // work around flow
  4455. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4456. } else {
  4457. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4458. vnode,
  4459. activeInstance
  4460. );
  4461. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4462. }
  4463. },
  4464. prepatch: function prepatch (oldVnode, vnode) {
  4465. var options = vnode.componentOptions;
  4466. var child = vnode.componentInstance = oldVnode.componentInstance;
  4467. updateChildComponent(
  4468. child,
  4469. options.propsData, // updated props
  4470. options.listeners, // updated listeners
  4471. vnode, // new parent vnode
  4472. options.children // new children
  4473. );
  4474. },
  4475. insert: function insert (vnode) {
  4476. var context = vnode.context;
  4477. var componentInstance = vnode.componentInstance;
  4478. if (!componentInstance._isMounted) {
  4479. callHook(componentInstance, 'onServiceCreated');
  4480. callHook(componentInstance, 'onServiceAttached');
  4481. componentInstance._isMounted = true;
  4482. callHook(componentInstance, 'mounted');
  4483. }
  4484. if (vnode.data.keepAlive) {
  4485. if (context._isMounted) {
  4486. // vue-router#1212
  4487. // During updates, a kept-alive component's child components may
  4488. // change, so directly walking the tree here may call activated hooks
  4489. // on incorrect children. Instead we push them into a queue which will
  4490. // be processed after the whole patch process ended.
  4491. queueActivatedComponent(componentInstance);
  4492. } else {
  4493. activateChildComponent(componentInstance, true /* direct */);
  4494. }
  4495. }
  4496. },
  4497. destroy: function destroy (vnode) {
  4498. var componentInstance = vnode.componentInstance;
  4499. if (!componentInstance._isDestroyed) {
  4500. if (!vnode.data.keepAlive) {
  4501. componentInstance.$destroy();
  4502. } else {
  4503. deactivateChildComponent(componentInstance, true /* direct */);
  4504. }
  4505. }
  4506. }
  4507. };
  4508. var hooksToMerge = Object.keys(componentVNodeHooks);
  4509. function createComponent (
  4510. Ctor,
  4511. data,
  4512. context,
  4513. children,
  4514. tag
  4515. ) {
  4516. if (isUndef(Ctor)) {
  4517. return
  4518. }
  4519. var baseCtor = context.$options._base;
  4520. // plain options object: turn it into a constructor
  4521. if (isObject(Ctor)) {
  4522. Ctor = baseCtor.extend(Ctor);
  4523. }
  4524. // if at this stage it's not a constructor or an async component factory,
  4525. // reject.
  4526. if (typeof Ctor !== 'function') {
  4527. if (true) {
  4528. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4529. }
  4530. return
  4531. }
  4532. // async component
  4533. var asyncFactory;
  4534. if (isUndef(Ctor.cid)) {
  4535. asyncFactory = Ctor;
  4536. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4537. if (Ctor === undefined) {
  4538. // return a placeholder node for async component, which is rendered
  4539. // as a comment node but preserves all the raw information for the node.
  4540. // the information will be used for async server-rendering and hydration.
  4541. return createAsyncPlaceholder(
  4542. asyncFactory,
  4543. data,
  4544. context,
  4545. children,
  4546. tag
  4547. )
  4548. }
  4549. }
  4550. data = data || {};
  4551. // resolve constructor options in case global mixins are applied after
  4552. // component constructor creation
  4553. resolveConstructorOptions(Ctor);
  4554. // transform component v-model data into props & events
  4555. if (isDef(data.model)) {
  4556. transformModel(Ctor.options, data);
  4557. }
  4558. // extract props
  4559. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4560. // functional component
  4561. if (isTrue(Ctor.options.functional)) {
  4562. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4563. }
  4564. // extract listeners, since these needs to be treated as
  4565. // child component listeners instead of DOM listeners
  4566. var listeners = data.on;
  4567. // replace with listeners with .native modifier
  4568. // so it gets processed during parent component patch.
  4569. data.on = data.nativeOn;
  4570. if (isTrue(Ctor.options.abstract)) {
  4571. // abstract components do not keep anything
  4572. // other than props & listeners & slot
  4573. // work around flow
  4574. var slot = data.slot;
  4575. data = {};
  4576. if (slot) {
  4577. data.slot = slot;
  4578. }
  4579. }
  4580. // install component management hooks onto the placeholder node
  4581. installComponentHooks(data);
  4582. // return a placeholder vnode
  4583. var name = Ctor.options.name || tag;
  4584. var vnode = new VNode(
  4585. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4586. data, undefined, undefined, undefined, context,
  4587. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4588. asyncFactory
  4589. );
  4590. return vnode
  4591. }
  4592. function createComponentInstanceForVnode (
  4593. vnode, // we know it's MountedComponentVNode but flow doesn't
  4594. parent // activeInstance in lifecycle state
  4595. ) {
  4596. var options = {
  4597. _isComponent: true,
  4598. _parentVnode: vnode,
  4599. parent: parent
  4600. };
  4601. // check inline-template render functions
  4602. var inlineTemplate = vnode.data.inlineTemplate;
  4603. if (isDef(inlineTemplate)) {
  4604. options.render = inlineTemplate.render;
  4605. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4606. }
  4607. return new vnode.componentOptions.Ctor(options)
  4608. }
  4609. function installComponentHooks (data) {
  4610. var hooks = data.hook || (data.hook = {});
  4611. for (var i = 0; i < hooksToMerge.length; i++) {
  4612. var key = hooksToMerge[i];
  4613. var existing = hooks[key];
  4614. var toMerge = componentVNodeHooks[key];
  4615. if (existing !== toMerge && !(existing && existing._merged)) {
  4616. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4617. }
  4618. }
  4619. }
  4620. function mergeHook$1 (f1, f2) {
  4621. var merged = function (a, b) {
  4622. // flow complains about extra args which is why we use any
  4623. f1(a, b);
  4624. f2(a, b);
  4625. };
  4626. merged._merged = true;
  4627. return merged
  4628. }
  4629. // transform component v-model info (value and callback) into
  4630. // prop and event handler respectively.
  4631. function transformModel (options, data) {
  4632. var prop = (options.model && options.model.prop) || 'value';
  4633. var event = (options.model && options.model.event) || 'input'
  4634. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4635. var on = data.on || (data.on = {});
  4636. var existing = on[event];
  4637. var callback = data.model.callback;
  4638. if (isDef(existing)) {
  4639. if (
  4640. Array.isArray(existing)
  4641. ? existing.indexOf(callback) === -1
  4642. : existing !== callback
  4643. ) {
  4644. on[event] = [callback].concat(existing);
  4645. }
  4646. } else {
  4647. on[event] = callback;
  4648. }
  4649. }
  4650. /* */
  4651. var SIMPLE_NORMALIZE = 1;
  4652. var ALWAYS_NORMALIZE = 2;
  4653. // wrapper function for providing a more flexible interface
  4654. // without getting yelled at by flow
  4655. function createElement (
  4656. context,
  4657. tag,
  4658. data,
  4659. children,
  4660. normalizationType,
  4661. alwaysNormalize
  4662. ) {
  4663. if (Array.isArray(data) || isPrimitive(data)) {
  4664. normalizationType = children;
  4665. children = data;
  4666. data = undefined;
  4667. }
  4668. if (isTrue(alwaysNormalize)) {
  4669. normalizationType = ALWAYS_NORMALIZE;
  4670. }
  4671. return _createElement(context, tag, data, children, normalizationType)
  4672. }
  4673. function _createElement (
  4674. context,
  4675. tag,
  4676. data,
  4677. children,
  4678. normalizationType
  4679. ) {
  4680. if (isDef(data) && isDef((data).__ob__)) {
  4681. true && warn(
  4682. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4683. 'Always create fresh vnode data objects in each render!',
  4684. context
  4685. );
  4686. return createEmptyVNode()
  4687. }
  4688. // object syntax in v-bind
  4689. if (isDef(data) && isDef(data.is)) {
  4690. tag = data.is;
  4691. }
  4692. if (!tag) {
  4693. // in case of component :is set to falsy value
  4694. return createEmptyVNode()
  4695. }
  4696. // warn against non-primitive key
  4697. if ( true &&
  4698. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4699. ) {
  4700. {
  4701. warn(
  4702. 'Avoid using non-primitive value as key, ' +
  4703. 'use string/number value instead.',
  4704. context
  4705. );
  4706. }
  4707. }
  4708. // support single function children as default scoped slot
  4709. if (Array.isArray(children) &&
  4710. typeof children[0] === 'function'
  4711. ) {
  4712. data = data || {};
  4713. data.scopedSlots = { default: children[0] };
  4714. children.length = 0;
  4715. }
  4716. if (normalizationType === ALWAYS_NORMALIZE) {
  4717. children = normalizeChildren(children);
  4718. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4719. children = simpleNormalizeChildren(children);
  4720. }
  4721. var vnode, ns;
  4722. if (typeof tag === 'string') {
  4723. var Ctor;
  4724. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4725. if (config.isReservedTag(tag)) {
  4726. // platform built-in elements
  4727. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4728. warn(
  4729. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4730. context
  4731. );
  4732. }
  4733. vnode = new VNode(
  4734. config.parsePlatformTagName(tag), data, children,
  4735. undefined, undefined, context
  4736. );
  4737. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4738. // component
  4739. vnode = createComponent(Ctor, data, context, children, tag);
  4740. } else {
  4741. // unknown or unlisted namespaced elements
  4742. // check at runtime because it may get assigned a namespace when its
  4743. // parent normalizes children
  4744. vnode = new VNode(
  4745. tag, data, children,
  4746. undefined, undefined, context
  4747. );
  4748. }
  4749. } else {
  4750. // direct component options / constructor
  4751. vnode = createComponent(tag, data, context, children);
  4752. }
  4753. if (Array.isArray(vnode)) {
  4754. return vnode
  4755. } else if (isDef(vnode)) {
  4756. if (isDef(ns)) { applyNS(vnode, ns); }
  4757. if (isDef(data)) { registerDeepBindings(data); }
  4758. return vnode
  4759. } else {
  4760. return createEmptyVNode()
  4761. }
  4762. }
  4763. function applyNS (vnode, ns, force) {
  4764. vnode.ns = ns;
  4765. if (vnode.tag === 'foreignObject') {
  4766. // use default namespace inside foreignObject
  4767. ns = undefined;
  4768. force = true;
  4769. }
  4770. if (isDef(vnode.children)) {
  4771. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4772. var child = vnode.children[i];
  4773. if (isDef(child.tag) && (
  4774. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4775. applyNS(child, ns, force);
  4776. }
  4777. }
  4778. }
  4779. }
  4780. // ref #5318
  4781. // necessary to ensure parent re-render when deep bindings like :style and
  4782. // :class are used on slot nodes
  4783. function registerDeepBindings (data) {
  4784. if (isObject(data.style)) {
  4785. traverse(data.style);
  4786. }
  4787. if (isObject(data.class)) {
  4788. traverse(data.class);
  4789. }
  4790. }
  4791. /* */
  4792. function initRender (vm) {
  4793. vm._vnode = null; // the root of the child tree
  4794. vm._staticTrees = null; // v-once cached trees
  4795. var options = vm.$options;
  4796. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4797. var renderContext = parentVnode && parentVnode.context;
  4798. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4799. vm.$scopedSlots = emptyObject;
  4800. // bind the createElement fn to this instance
  4801. // so that we get proper render context inside it.
  4802. // args order: tag, data, children, normalizationType, alwaysNormalize
  4803. // internal version is used by render functions compiled from templates
  4804. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4805. // normalization is always applied for the public version, used in
  4806. // user-written render functions.
  4807. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4808. // $attrs & $listeners are exposed for easier HOC creation.
  4809. // they need to be reactive so that HOCs using them are always updated
  4810. var parentData = parentVnode && parentVnode.data;
  4811. /* istanbul ignore else */
  4812. if (true) {
  4813. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4814. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4815. }, true);
  4816. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4817. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4818. }, true);
  4819. } else {}
  4820. }
  4821. var currentRenderingInstance = null;
  4822. function renderMixin (Vue) {
  4823. // install runtime convenience helpers
  4824. installRenderHelpers(Vue.prototype);
  4825. Vue.prototype.$nextTick = function (fn) {
  4826. return nextTick(fn, this)
  4827. };
  4828. Vue.prototype._render = function () {
  4829. var vm = this;
  4830. var ref = vm.$options;
  4831. var render = ref.render;
  4832. var _parentVnode = ref._parentVnode;
  4833. if (_parentVnode) {
  4834. vm.$scopedSlots = normalizeScopedSlots(
  4835. _parentVnode.data.scopedSlots,
  4836. vm.$slots,
  4837. vm.$scopedSlots
  4838. );
  4839. }
  4840. // set parent vnode. this allows render functions to have access
  4841. // to the data on the placeholder node.
  4842. vm.$vnode = _parentVnode;
  4843. // render self
  4844. var vnode;
  4845. try {
  4846. // There's no need to maintain a stack because all render fns are called
  4847. // separately from one another. Nested component's render fns are called
  4848. // when parent component is patched.
  4849. currentRenderingInstance = vm;
  4850. vnode = render.call(vm._renderProxy, vm.$createElement);
  4851. } catch (e) {
  4852. handleError(e, vm, "render");
  4853. // return error render result,
  4854. // or previous vnode to prevent render error causing blank component
  4855. /* istanbul ignore else */
  4856. if ( true && vm.$options.renderError) {
  4857. try {
  4858. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4859. } catch (e) {
  4860. handleError(e, vm, "renderError");
  4861. vnode = vm._vnode;
  4862. }
  4863. } else {
  4864. vnode = vm._vnode;
  4865. }
  4866. } finally {
  4867. currentRenderingInstance = null;
  4868. }
  4869. // if the returned array contains only a single node, allow it
  4870. if (Array.isArray(vnode) && vnode.length === 1) {
  4871. vnode = vnode[0];
  4872. }
  4873. // return empty vnode in case the render function errored out
  4874. if (!(vnode instanceof VNode)) {
  4875. if ( true && Array.isArray(vnode)) {
  4876. warn(
  4877. 'Multiple root nodes returned from render function. Render function ' +
  4878. 'should return a single root node.',
  4879. vm
  4880. );
  4881. }
  4882. vnode = createEmptyVNode();
  4883. }
  4884. // set parent
  4885. vnode.parent = _parentVnode;
  4886. return vnode
  4887. };
  4888. }
  4889. /* */
  4890. function ensureCtor (comp, base) {
  4891. if (
  4892. comp.__esModule ||
  4893. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4894. ) {
  4895. comp = comp.default;
  4896. }
  4897. return isObject(comp)
  4898. ? base.extend(comp)
  4899. : comp
  4900. }
  4901. function createAsyncPlaceholder (
  4902. factory,
  4903. data,
  4904. context,
  4905. children,
  4906. tag
  4907. ) {
  4908. var node = createEmptyVNode();
  4909. node.asyncFactory = factory;
  4910. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4911. return node
  4912. }
  4913. function resolveAsyncComponent (
  4914. factory,
  4915. baseCtor
  4916. ) {
  4917. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4918. return factory.errorComp
  4919. }
  4920. if (isDef(factory.resolved)) {
  4921. return factory.resolved
  4922. }
  4923. var owner = currentRenderingInstance;
  4924. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4925. // already pending
  4926. factory.owners.push(owner);
  4927. }
  4928. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4929. return factory.loadingComp
  4930. }
  4931. if (owner && !isDef(factory.owners)) {
  4932. var owners = factory.owners = [owner];
  4933. var sync = true;
  4934. var timerLoading = null;
  4935. var timerTimeout = null
  4936. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4937. var forceRender = function (renderCompleted) {
  4938. for (var i = 0, l = owners.length; i < l; i++) {
  4939. (owners[i]).$forceUpdate();
  4940. }
  4941. if (renderCompleted) {
  4942. owners.length = 0;
  4943. if (timerLoading !== null) {
  4944. clearTimeout(timerLoading);
  4945. timerLoading = null;
  4946. }
  4947. if (timerTimeout !== null) {
  4948. clearTimeout(timerTimeout);
  4949. timerTimeout = null;
  4950. }
  4951. }
  4952. };
  4953. var resolve = once(function (res) {
  4954. // cache resolved
  4955. factory.resolved = ensureCtor(res, baseCtor);
  4956. // invoke callbacks only if this is not a synchronous resolve
  4957. // (async resolves are shimmed as synchronous during SSR)
  4958. if (!sync) {
  4959. forceRender(true);
  4960. } else {
  4961. owners.length = 0;
  4962. }
  4963. });
  4964. var reject = once(function (reason) {
  4965. true && warn(
  4966. "Failed to resolve async component: " + (String(factory)) +
  4967. (reason ? ("\nReason: " + reason) : '')
  4968. );
  4969. if (isDef(factory.errorComp)) {
  4970. factory.error = true;
  4971. forceRender(true);
  4972. }
  4973. });
  4974. var res = factory(resolve, reject);
  4975. if (isObject(res)) {
  4976. if (isPromise(res)) {
  4977. // () => Promise
  4978. if (isUndef(factory.resolved)) {
  4979. res.then(resolve, reject);
  4980. }
  4981. } else if (isPromise(res.component)) {
  4982. res.component.then(resolve, reject);
  4983. if (isDef(res.error)) {
  4984. factory.errorComp = ensureCtor(res.error, baseCtor);
  4985. }
  4986. if (isDef(res.loading)) {
  4987. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4988. if (res.delay === 0) {
  4989. factory.loading = true;
  4990. } else {
  4991. timerLoading = setTimeout(function () {
  4992. timerLoading = null;
  4993. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4994. factory.loading = true;
  4995. forceRender(false);
  4996. }
  4997. }, res.delay || 200);
  4998. }
  4999. }
  5000. if (isDef(res.timeout)) {
  5001. timerTimeout = setTimeout(function () {
  5002. timerTimeout = null;
  5003. if (isUndef(factory.resolved)) {
  5004. reject(
  5005. true
  5006. ? ("timeout (" + (res.timeout) + "ms)")
  5007. : undefined
  5008. );
  5009. }
  5010. }, res.timeout);
  5011. }
  5012. }
  5013. }
  5014. sync = false;
  5015. // return in case resolved synchronously
  5016. return factory.loading
  5017. ? factory.loadingComp
  5018. : factory.resolved
  5019. }
  5020. }
  5021. /* */
  5022. function isAsyncPlaceholder (node) {
  5023. return node.isComment && node.asyncFactory
  5024. }
  5025. /* */
  5026. function getFirstComponentChild (children) {
  5027. if (Array.isArray(children)) {
  5028. for (var i = 0; i < children.length; i++) {
  5029. var c = children[i];
  5030. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5031. return c
  5032. }
  5033. }
  5034. }
  5035. }
  5036. /* */
  5037. /* */
  5038. function initEvents (vm) {
  5039. vm._events = Object.create(null);
  5040. vm._hasHookEvent = false;
  5041. // init parent attached events
  5042. var listeners = vm.$options._parentListeners;
  5043. if (listeners) {
  5044. updateComponentListeners(vm, listeners);
  5045. }
  5046. }
  5047. var target;
  5048. function add (event, fn) {
  5049. target.$on(event, fn);
  5050. }
  5051. function remove$1 (event, fn) {
  5052. target.$off(event, fn);
  5053. }
  5054. function createOnceHandler (event, fn) {
  5055. var _target = target;
  5056. return function onceHandler () {
  5057. var res = fn.apply(null, arguments);
  5058. if (res !== null) {
  5059. _target.$off(event, onceHandler);
  5060. }
  5061. }
  5062. }
  5063. function updateComponentListeners (
  5064. vm,
  5065. listeners,
  5066. oldListeners
  5067. ) {
  5068. target = vm;
  5069. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5070. target = undefined;
  5071. }
  5072. function eventsMixin (Vue) {
  5073. var hookRE = /^hook:/;
  5074. Vue.prototype.$on = function (event, fn) {
  5075. var vm = this;
  5076. if (Array.isArray(event)) {
  5077. for (var i = 0, l = event.length; i < l; i++) {
  5078. vm.$on(event[i], fn);
  5079. }
  5080. } else {
  5081. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5082. // optimize hook:event cost by using a boolean flag marked at registration
  5083. // instead of a hash lookup
  5084. if (hookRE.test(event)) {
  5085. vm._hasHookEvent = true;
  5086. }
  5087. }
  5088. return vm
  5089. };
  5090. Vue.prototype.$once = function (event, fn) {
  5091. var vm = this;
  5092. function on () {
  5093. vm.$off(event, on);
  5094. fn.apply(vm, arguments);
  5095. }
  5096. on.fn = fn;
  5097. vm.$on(event, on);
  5098. return vm
  5099. };
  5100. Vue.prototype.$off = function (event, fn) {
  5101. var vm = this;
  5102. // all
  5103. if (!arguments.length) {
  5104. vm._events = Object.create(null);
  5105. return vm
  5106. }
  5107. // array of events
  5108. if (Array.isArray(event)) {
  5109. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5110. vm.$off(event[i$1], fn);
  5111. }
  5112. return vm
  5113. }
  5114. // specific event
  5115. var cbs = vm._events[event];
  5116. if (!cbs) {
  5117. return vm
  5118. }
  5119. if (!fn) {
  5120. vm._events[event] = null;
  5121. return vm
  5122. }
  5123. // specific handler
  5124. var cb;
  5125. var i = cbs.length;
  5126. while (i--) {
  5127. cb = cbs[i];
  5128. if (cb === fn || cb.fn === fn) {
  5129. cbs.splice(i, 1);
  5130. break
  5131. }
  5132. }
  5133. return vm
  5134. };
  5135. Vue.prototype.$emit = function (event) {
  5136. var vm = this;
  5137. if (true) {
  5138. var lowerCaseEvent = event.toLowerCase();
  5139. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5140. tip(
  5141. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5142. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5143. "Note that HTML attributes are case-insensitive and you cannot use " +
  5144. "v-on to listen to camelCase events when using in-DOM templates. " +
  5145. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5146. );
  5147. }
  5148. }
  5149. var cbs = vm._events[event];
  5150. if (cbs) {
  5151. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5152. var args = toArray(arguments, 1);
  5153. var info = "event handler for \"" + event + "\"";
  5154. for (var i = 0, l = cbs.length; i < l; i++) {
  5155. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5156. }
  5157. }
  5158. return vm
  5159. };
  5160. }
  5161. /* */
  5162. var activeInstance = null;
  5163. var isUpdatingChildComponent = false;
  5164. function setActiveInstance(vm) {
  5165. var prevActiveInstance = activeInstance;
  5166. activeInstance = vm;
  5167. return function () {
  5168. activeInstance = prevActiveInstance;
  5169. }
  5170. }
  5171. function initLifecycle (vm) {
  5172. var options = vm.$options;
  5173. // locate first non-abstract parent
  5174. var parent = options.parent;
  5175. if (parent && !options.abstract) {
  5176. while (parent.$options.abstract && parent.$parent) {
  5177. parent = parent.$parent;
  5178. }
  5179. parent.$children.push(vm);
  5180. }
  5181. vm.$parent = parent;
  5182. vm.$root = parent ? parent.$root : vm;
  5183. vm.$children = [];
  5184. vm.$refs = {};
  5185. vm._watcher = null;
  5186. vm._inactive = null;
  5187. vm._directInactive = false;
  5188. vm._isMounted = false;
  5189. vm._isDestroyed = false;
  5190. vm._isBeingDestroyed = false;
  5191. }
  5192. function lifecycleMixin (Vue) {
  5193. Vue.prototype._update = function (vnode, hydrating) {
  5194. var vm = this;
  5195. var prevEl = vm.$el;
  5196. var prevVnode = vm._vnode;
  5197. var restoreActiveInstance = setActiveInstance(vm);
  5198. vm._vnode = vnode;
  5199. // Vue.prototype.__patch__ is injected in entry points
  5200. // based on the rendering backend used.
  5201. if (!prevVnode) {
  5202. // initial render
  5203. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5204. } else {
  5205. // updates
  5206. vm.$el = vm.__patch__(prevVnode, vnode);
  5207. }
  5208. restoreActiveInstance();
  5209. // update __vue__ reference
  5210. if (prevEl) {
  5211. prevEl.__vue__ = null;
  5212. }
  5213. if (vm.$el) {
  5214. vm.$el.__vue__ = vm;
  5215. }
  5216. // if parent is an HOC, update its $el as well
  5217. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5218. vm.$parent.$el = vm.$el;
  5219. }
  5220. // updated hook is called by the scheduler to ensure that children are
  5221. // updated in a parent's updated hook.
  5222. };
  5223. Vue.prototype.$forceUpdate = function () {
  5224. var vm = this;
  5225. if (vm._watcher) {
  5226. vm._watcher.update();
  5227. }
  5228. };
  5229. Vue.prototype.$destroy = function () {
  5230. var vm = this;
  5231. if (vm._isBeingDestroyed) {
  5232. return
  5233. }
  5234. callHook(vm, 'beforeDestroy');
  5235. vm._isBeingDestroyed = true;
  5236. // remove self from parent
  5237. var parent = vm.$parent;
  5238. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5239. remove(parent.$children, vm);
  5240. }
  5241. // teardown watchers
  5242. if (vm._watcher) {
  5243. vm._watcher.teardown();
  5244. }
  5245. var i = vm._watchers.length;
  5246. while (i--) {
  5247. vm._watchers[i].teardown();
  5248. }
  5249. // remove reference from data ob
  5250. // frozen object may not have observer.
  5251. if (vm._data.__ob__) {
  5252. vm._data.__ob__.vmCount--;
  5253. }
  5254. // call the last hook...
  5255. vm._isDestroyed = true;
  5256. // invoke destroy hooks on current rendered tree
  5257. vm.__patch__(vm._vnode, null);
  5258. // fire destroyed hook
  5259. callHook(vm, 'destroyed');
  5260. // turn off all instance listeners.
  5261. vm.$off();
  5262. // remove __vue__ reference
  5263. if (vm.$el) {
  5264. vm.$el.__vue__ = null;
  5265. }
  5266. // release circular reference (#6759)
  5267. if (vm.$vnode) {
  5268. vm.$vnode.parent = null;
  5269. }
  5270. };
  5271. }
  5272. function updateChildComponent (
  5273. vm,
  5274. propsData,
  5275. listeners,
  5276. parentVnode,
  5277. renderChildren
  5278. ) {
  5279. if (true) {
  5280. isUpdatingChildComponent = true;
  5281. }
  5282. // determine whether component has slot children
  5283. // we need to do this before overwriting $options._renderChildren.
  5284. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5285. // dynamic slot names). Static scoped slots compiled from template has the
  5286. // "$stable" marker.
  5287. var newScopedSlots = parentVnode.data.scopedSlots;
  5288. var oldScopedSlots = vm.$scopedSlots;
  5289. var hasDynamicScopedSlot = !!(
  5290. (newScopedSlots && !newScopedSlots.$stable) ||
  5291. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5292. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5293. );
  5294. // Any static slot children from the parent may have changed during parent's
  5295. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5296. // update is necessary to ensure correctness.
  5297. var needsForceUpdate = !!(
  5298. renderChildren || // has new static slots
  5299. vm.$options._renderChildren || // has old static slots
  5300. hasDynamicScopedSlot
  5301. );
  5302. vm.$options._parentVnode = parentVnode;
  5303. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5304. if (vm._vnode) { // update child tree's parent
  5305. vm._vnode.parent = parentVnode;
  5306. }
  5307. vm.$options._renderChildren = renderChildren;
  5308. // update $attrs and $listeners hash
  5309. // these are also reactive so they may trigger child update if the child
  5310. // used them during render
  5311. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5312. vm.$listeners = listeners || emptyObject;
  5313. // update props
  5314. if (propsData && vm.$options.props) {
  5315. toggleObserving(false);
  5316. var props = vm._props;
  5317. var propKeys = vm.$options._propKeys || [];
  5318. for (var i = 0; i < propKeys.length; i++) {
  5319. var key = propKeys[i];
  5320. var propOptions = vm.$options.props; // wtf flow?
  5321. props[key] = validateProp(key, propOptions, propsData, vm);
  5322. }
  5323. toggleObserving(true);
  5324. // keep a copy of raw propsData
  5325. vm.$options.propsData = propsData;
  5326. }
  5327. // fixed by xxxxxx update properties(mp runtime)
  5328. vm._$updateProperties && vm._$updateProperties(vm);
  5329. // update listeners
  5330. listeners = listeners || emptyObject;
  5331. var oldListeners = vm.$options._parentListeners;
  5332. vm.$options._parentListeners = listeners;
  5333. updateComponentListeners(vm, listeners, oldListeners);
  5334. // resolve slots + force update if has children
  5335. if (needsForceUpdate) {
  5336. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5337. vm.$forceUpdate();
  5338. }
  5339. if (true) {
  5340. isUpdatingChildComponent = false;
  5341. }
  5342. }
  5343. function isInInactiveTree (vm) {
  5344. while (vm && (vm = vm.$parent)) {
  5345. if (vm._inactive) { return true }
  5346. }
  5347. return false
  5348. }
  5349. function activateChildComponent (vm, direct) {
  5350. if (direct) {
  5351. vm._directInactive = false;
  5352. if (isInInactiveTree(vm)) {
  5353. return
  5354. }
  5355. } else if (vm._directInactive) {
  5356. return
  5357. }
  5358. if (vm._inactive || vm._inactive === null) {
  5359. vm._inactive = false;
  5360. for (var i = 0; i < vm.$children.length; i++) {
  5361. activateChildComponent(vm.$children[i]);
  5362. }
  5363. callHook(vm, 'activated');
  5364. }
  5365. }
  5366. function deactivateChildComponent (vm, direct) {
  5367. if (direct) {
  5368. vm._directInactive = true;
  5369. if (isInInactiveTree(vm)) {
  5370. return
  5371. }
  5372. }
  5373. if (!vm._inactive) {
  5374. vm._inactive = true;
  5375. for (var i = 0; i < vm.$children.length; i++) {
  5376. deactivateChildComponent(vm.$children[i]);
  5377. }
  5378. callHook(vm, 'deactivated');
  5379. }
  5380. }
  5381. function callHook (vm, hook) {
  5382. // #7573 disable dep collection when invoking lifecycle hooks
  5383. pushTarget();
  5384. var handlers = vm.$options[hook];
  5385. var info = hook + " hook";
  5386. if (handlers) {
  5387. for (var i = 0, j = handlers.length; i < j; i++) {
  5388. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5389. }
  5390. }
  5391. if (vm._hasHookEvent) {
  5392. vm.$emit('hook:' + hook);
  5393. }
  5394. popTarget();
  5395. }
  5396. /* */
  5397. var MAX_UPDATE_COUNT = 100;
  5398. var queue = [];
  5399. var activatedChildren = [];
  5400. var has = {};
  5401. var circular = {};
  5402. var waiting = false;
  5403. var flushing = false;
  5404. var index = 0;
  5405. /**
  5406. * Reset the scheduler's state.
  5407. */
  5408. function resetSchedulerState () {
  5409. index = queue.length = activatedChildren.length = 0;
  5410. has = {};
  5411. if (true) {
  5412. circular = {};
  5413. }
  5414. waiting = flushing = false;
  5415. }
  5416. // Async edge case #6566 requires saving the timestamp when event listeners are
  5417. // attached. However, calling performance.now() has a perf overhead especially
  5418. // if the page has thousands of event listeners. Instead, we take a timestamp
  5419. // every time the scheduler flushes and use that for all event listeners
  5420. // attached during that flush.
  5421. var currentFlushTimestamp = 0;
  5422. // Async edge case fix requires storing an event listener's attach timestamp.
  5423. var getNow = Date.now;
  5424. // Determine what event timestamp the browser is using. Annoyingly, the
  5425. // timestamp can either be hi-res (relative to page load) or low-res
  5426. // (relative to UNIX epoch), so in order to compare time we have to use the
  5427. // same timestamp type when saving the flush timestamp.
  5428. // All IE versions use low-res event timestamps, and have problematic clock
  5429. // implementations (#9632)
  5430. if (inBrowser && !isIE) {
  5431. var performance = window.performance;
  5432. if (
  5433. performance &&
  5434. typeof performance.now === 'function' &&
  5435. getNow() > document.createEvent('Event').timeStamp
  5436. ) {
  5437. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5438. // smaller than it, it means the event is using a hi-res timestamp,
  5439. // and we need to use the hi-res version for event listener timestamps as
  5440. // well.
  5441. getNow = function () { return performance.now(); };
  5442. }
  5443. }
  5444. /**
  5445. * Flush both queues and run the watchers.
  5446. */
  5447. function flushSchedulerQueue () {
  5448. currentFlushTimestamp = getNow();
  5449. flushing = true;
  5450. var watcher, id;
  5451. // Sort queue before flush.
  5452. // This ensures that:
  5453. // 1. Components are updated from parent to child. (because parent is always
  5454. // created before the child)
  5455. // 2. A component's user watchers are run before its render watcher (because
  5456. // user watchers are created before the render watcher)
  5457. // 3. If a component is destroyed during a parent component's watcher run,
  5458. // its watchers can be skipped.
  5459. queue.sort(function (a, b) { return a.id - b.id; });
  5460. // do not cache length because more watchers might be pushed
  5461. // as we run existing watchers
  5462. for (index = 0; index < queue.length; index++) {
  5463. watcher = queue[index];
  5464. if (watcher.before) {
  5465. watcher.before();
  5466. }
  5467. id = watcher.id;
  5468. has[id] = null;
  5469. watcher.run();
  5470. // in dev build, check and stop circular updates.
  5471. if ( true && has[id] != null) {
  5472. circular[id] = (circular[id] || 0) + 1;
  5473. if (circular[id] > MAX_UPDATE_COUNT) {
  5474. warn(
  5475. 'You may have an infinite update loop ' + (
  5476. watcher.user
  5477. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5478. : "in a component render function."
  5479. ),
  5480. watcher.vm
  5481. );
  5482. break
  5483. }
  5484. }
  5485. }
  5486. // keep copies of post queues before resetting state
  5487. var activatedQueue = activatedChildren.slice();
  5488. var updatedQueue = queue.slice();
  5489. resetSchedulerState();
  5490. // call component updated and activated hooks
  5491. callActivatedHooks(activatedQueue);
  5492. callUpdatedHooks(updatedQueue);
  5493. // devtool hook
  5494. /* istanbul ignore if */
  5495. if (devtools && config.devtools) {
  5496. devtools.emit('flush');
  5497. }
  5498. }
  5499. function callUpdatedHooks (queue) {
  5500. var i = queue.length;
  5501. while (i--) {
  5502. var watcher = queue[i];
  5503. var vm = watcher.vm;
  5504. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5505. callHook(vm, 'updated');
  5506. }
  5507. }
  5508. }
  5509. /**
  5510. * Queue a kept-alive component that was activated during patch.
  5511. * The queue will be processed after the entire tree has been patched.
  5512. */
  5513. function queueActivatedComponent (vm) {
  5514. // setting _inactive to false here so that a render function can
  5515. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5516. vm._inactive = false;
  5517. activatedChildren.push(vm);
  5518. }
  5519. function callActivatedHooks (queue) {
  5520. for (var i = 0; i < queue.length; i++) {
  5521. queue[i]._inactive = true;
  5522. activateChildComponent(queue[i], true /* true */);
  5523. }
  5524. }
  5525. /**
  5526. * Push a watcher into the watcher queue.
  5527. * Jobs with duplicate IDs will be skipped unless it's
  5528. * pushed when the queue is being flushed.
  5529. */
  5530. function queueWatcher (watcher) {
  5531. var id = watcher.id;
  5532. if (has[id] == null) {
  5533. has[id] = true;
  5534. if (!flushing) {
  5535. queue.push(watcher);
  5536. } else {
  5537. // if already flushing, splice the watcher based on its id
  5538. // if already past its id, it will be run next immediately.
  5539. var i = queue.length - 1;
  5540. while (i > index && queue[i].id > watcher.id) {
  5541. i--;
  5542. }
  5543. queue.splice(i + 1, 0, watcher);
  5544. }
  5545. // queue the flush
  5546. if (!waiting) {
  5547. waiting = true;
  5548. if ( true && !config.async) {
  5549. flushSchedulerQueue();
  5550. return
  5551. }
  5552. nextTick(flushSchedulerQueue);
  5553. }
  5554. }
  5555. }
  5556. /* */
  5557. var uid$2 = 0;
  5558. /**
  5559. * A watcher parses an expression, collects dependencies,
  5560. * and fires callback when the expression value changes.
  5561. * This is used for both the $watch() api and directives.
  5562. */
  5563. var Watcher = function Watcher (
  5564. vm,
  5565. expOrFn,
  5566. cb,
  5567. options,
  5568. isRenderWatcher
  5569. ) {
  5570. this.vm = vm;
  5571. if (isRenderWatcher) {
  5572. vm._watcher = this;
  5573. }
  5574. vm._watchers.push(this);
  5575. // options
  5576. if (options) {
  5577. this.deep = !!options.deep;
  5578. this.user = !!options.user;
  5579. this.lazy = !!options.lazy;
  5580. this.sync = !!options.sync;
  5581. this.before = options.before;
  5582. } else {
  5583. this.deep = this.user = this.lazy = this.sync = false;
  5584. }
  5585. this.cb = cb;
  5586. this.id = ++uid$2; // uid for batching
  5587. this.active = true;
  5588. this.dirty = this.lazy; // for lazy watchers
  5589. this.deps = [];
  5590. this.newDeps = [];
  5591. this.depIds = new _Set();
  5592. this.newDepIds = new _Set();
  5593. this.expression = true
  5594. ? expOrFn.toString()
  5595. : undefined;
  5596. // parse expression for getter
  5597. if (typeof expOrFn === 'function') {
  5598. this.getter = expOrFn;
  5599. } else {
  5600. this.getter = parsePath(expOrFn);
  5601. if (!this.getter) {
  5602. this.getter = noop;
  5603. true && warn(
  5604. "Failed watching path: \"" + expOrFn + "\" " +
  5605. 'Watcher only accepts simple dot-delimited paths. ' +
  5606. 'For full control, use a function instead.',
  5607. vm
  5608. );
  5609. }
  5610. }
  5611. this.value = this.lazy
  5612. ? undefined
  5613. : this.get();
  5614. };
  5615. /**
  5616. * Evaluate the getter, and re-collect dependencies.
  5617. */
  5618. Watcher.prototype.get = function get () {
  5619. pushTarget(this);
  5620. var value;
  5621. var vm = this.vm;
  5622. try {
  5623. value = this.getter.call(vm, vm);
  5624. } catch (e) {
  5625. if (this.user) {
  5626. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5627. } else {
  5628. throw e
  5629. }
  5630. } finally {
  5631. // "touch" every property so they are all tracked as
  5632. // dependencies for deep watching
  5633. if (this.deep) {
  5634. traverse(value);
  5635. }
  5636. popTarget();
  5637. this.cleanupDeps();
  5638. }
  5639. return value
  5640. };
  5641. /**
  5642. * Add a dependency to this directive.
  5643. */
  5644. Watcher.prototype.addDep = function addDep (dep) {
  5645. var id = dep.id;
  5646. if (!this.newDepIds.has(id)) {
  5647. this.newDepIds.add(id);
  5648. this.newDeps.push(dep);
  5649. if (!this.depIds.has(id)) {
  5650. dep.addSub(this);
  5651. }
  5652. }
  5653. };
  5654. /**
  5655. * Clean up for dependency collection.
  5656. */
  5657. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5658. var i = this.deps.length;
  5659. while (i--) {
  5660. var dep = this.deps[i];
  5661. if (!this.newDepIds.has(dep.id)) {
  5662. dep.removeSub(this);
  5663. }
  5664. }
  5665. var tmp = this.depIds;
  5666. this.depIds = this.newDepIds;
  5667. this.newDepIds = tmp;
  5668. this.newDepIds.clear();
  5669. tmp = this.deps;
  5670. this.deps = this.newDeps;
  5671. this.newDeps = tmp;
  5672. this.newDeps.length = 0;
  5673. };
  5674. /**
  5675. * Subscriber interface.
  5676. * Will be called when a dependency changes.
  5677. */
  5678. Watcher.prototype.update = function update () {
  5679. /* istanbul ignore else */
  5680. if (this.lazy) {
  5681. this.dirty = true;
  5682. } else if (this.sync) {
  5683. this.run();
  5684. } else {
  5685. queueWatcher(this);
  5686. }
  5687. };
  5688. /**
  5689. * Scheduler job interface.
  5690. * Will be called by the scheduler.
  5691. */
  5692. Watcher.prototype.run = function run () {
  5693. if (this.active) {
  5694. var value = this.get();
  5695. if (
  5696. value !== this.value ||
  5697. // Deep watchers and watchers on Object/Arrays should fire even
  5698. // when the value is the same, because the value may
  5699. // have mutated.
  5700. isObject(value) ||
  5701. this.deep
  5702. ) {
  5703. // set new value
  5704. var oldValue = this.value;
  5705. this.value = value;
  5706. if (this.user) {
  5707. try {
  5708. this.cb.call(this.vm, value, oldValue);
  5709. } catch (e) {
  5710. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5711. }
  5712. } else {
  5713. this.cb.call(this.vm, value, oldValue);
  5714. }
  5715. }
  5716. }
  5717. };
  5718. /**
  5719. * Evaluate the value of the watcher.
  5720. * This only gets called for lazy watchers.
  5721. */
  5722. Watcher.prototype.evaluate = function evaluate () {
  5723. this.value = this.get();
  5724. this.dirty = false;
  5725. };
  5726. /**
  5727. * Depend on all deps collected by this watcher.
  5728. */
  5729. Watcher.prototype.depend = function depend () {
  5730. var i = this.deps.length;
  5731. while (i--) {
  5732. this.deps[i].depend();
  5733. }
  5734. };
  5735. /**
  5736. * Remove self from all dependencies' subscriber list.
  5737. */
  5738. Watcher.prototype.teardown = function teardown () {
  5739. if (this.active) {
  5740. // remove self from vm's watcher list
  5741. // this is a somewhat expensive operation so we skip it
  5742. // if the vm is being destroyed.
  5743. if (!this.vm._isBeingDestroyed) {
  5744. remove(this.vm._watchers, this);
  5745. }
  5746. var i = this.deps.length;
  5747. while (i--) {
  5748. this.deps[i].removeSub(this);
  5749. }
  5750. this.active = false;
  5751. }
  5752. };
  5753. /* */
  5754. var sharedPropertyDefinition = {
  5755. enumerable: true,
  5756. configurable: true,
  5757. get: noop,
  5758. set: noop
  5759. };
  5760. function proxy (target, sourceKey, key) {
  5761. sharedPropertyDefinition.get = function proxyGetter () {
  5762. return this[sourceKey][key]
  5763. };
  5764. sharedPropertyDefinition.set = function proxySetter (val) {
  5765. this[sourceKey][key] = val;
  5766. };
  5767. Object.defineProperty(target, key, sharedPropertyDefinition);
  5768. }
  5769. function initState (vm) {
  5770. vm._watchers = [];
  5771. var opts = vm.$options;
  5772. if (opts.props) { initProps(vm, opts.props); }
  5773. if (opts.methods) { initMethods(vm, opts.methods); }
  5774. if (opts.data) {
  5775. initData(vm);
  5776. } else {
  5777. observe(vm._data = {}, true /* asRootData */);
  5778. }
  5779. if (opts.computed) { initComputed(vm, opts.computed); }
  5780. if (opts.watch && opts.watch !== nativeWatch) {
  5781. initWatch(vm, opts.watch);
  5782. }
  5783. }
  5784. function initProps (vm, propsOptions) {
  5785. var propsData = vm.$options.propsData || {};
  5786. var props = vm._props = {};
  5787. // cache prop keys so that future props updates can iterate using Array
  5788. // instead of dynamic object key enumeration.
  5789. var keys = vm.$options._propKeys = [];
  5790. var isRoot = !vm.$parent;
  5791. // root instance props should be converted
  5792. if (!isRoot) {
  5793. toggleObserving(false);
  5794. }
  5795. var loop = function ( key ) {
  5796. keys.push(key);
  5797. var value = validateProp(key, propsOptions, propsData, vm);
  5798. /* istanbul ignore else */
  5799. if (true) {
  5800. var hyphenatedKey = hyphenate(key);
  5801. if (isReservedAttribute(hyphenatedKey) ||
  5802. config.isReservedAttr(hyphenatedKey)) {
  5803. warn(
  5804. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5805. vm
  5806. );
  5807. }
  5808. defineReactive$$1(props, key, value, function () {
  5809. if (!isRoot && !isUpdatingChildComponent) {
  5810. {
  5811. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5812. return
  5813. }
  5814. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5815. if(
  5816. key === 'value' &&
  5817. Array.isArray(vm.$options.behaviors) &&
  5818. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5819. ){
  5820. return
  5821. }
  5822. if(vm._getFormData){
  5823. return
  5824. }
  5825. var $parent = vm.$parent;
  5826. while($parent){
  5827. if($parent.__next_tick_pending){
  5828. return
  5829. }
  5830. $parent = $parent.$parent;
  5831. }
  5832. }
  5833. warn(
  5834. "Avoid mutating a prop directly since the value will be " +
  5835. "overwritten whenever the parent component re-renders. " +
  5836. "Instead, use a data or computed property based on the prop's " +
  5837. "value. Prop being mutated: \"" + key + "\"",
  5838. vm
  5839. );
  5840. }
  5841. });
  5842. } else {}
  5843. // static props are already proxied on the component's prototype
  5844. // during Vue.extend(). We only need to proxy props defined at
  5845. // instantiation here.
  5846. if (!(key in vm)) {
  5847. proxy(vm, "_props", key);
  5848. }
  5849. };
  5850. for (var key in propsOptions) loop( key );
  5851. toggleObserving(true);
  5852. }
  5853. function initData (vm) {
  5854. var data = vm.$options.data;
  5855. data = vm._data = typeof data === 'function'
  5856. ? getData(data, vm)
  5857. : data || {};
  5858. if (!isPlainObject(data)) {
  5859. data = {};
  5860. true && warn(
  5861. 'data functions should return an object:\n' +
  5862. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5863. vm
  5864. );
  5865. }
  5866. // proxy data on instance
  5867. var keys = Object.keys(data);
  5868. var props = vm.$options.props;
  5869. var methods = vm.$options.methods;
  5870. var i = keys.length;
  5871. while (i--) {
  5872. var key = keys[i];
  5873. if (true) {
  5874. if (methods && hasOwn(methods, key)) {
  5875. warn(
  5876. ("Method \"" + key + "\" has already been defined as a data property."),
  5877. vm
  5878. );
  5879. }
  5880. }
  5881. if (props && hasOwn(props, key)) {
  5882. true && warn(
  5883. "The data property \"" + key + "\" is already declared as a prop. " +
  5884. "Use prop default value instead.",
  5885. vm
  5886. );
  5887. } else if (!isReserved(key)) {
  5888. proxy(vm, "_data", key);
  5889. }
  5890. }
  5891. // observe data
  5892. observe(data, true /* asRootData */);
  5893. }
  5894. function getData (data, vm) {
  5895. // #7573 disable dep collection when invoking data getters
  5896. pushTarget();
  5897. try {
  5898. return data.call(vm, vm)
  5899. } catch (e) {
  5900. handleError(e, vm, "data()");
  5901. return {}
  5902. } finally {
  5903. popTarget();
  5904. }
  5905. }
  5906. var computedWatcherOptions = { lazy: true };
  5907. function initComputed (vm, computed) {
  5908. // $flow-disable-line
  5909. var watchers = vm._computedWatchers = Object.create(null);
  5910. // computed properties are just getters during SSR
  5911. var isSSR = isServerRendering();
  5912. for (var key in computed) {
  5913. var userDef = computed[key];
  5914. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5915. if ( true && getter == null) {
  5916. warn(
  5917. ("Getter is missing for computed property \"" + key + "\"."),
  5918. vm
  5919. );
  5920. }
  5921. if (!isSSR) {
  5922. // create internal watcher for the computed property.
  5923. watchers[key] = new Watcher(
  5924. vm,
  5925. getter || noop,
  5926. noop,
  5927. computedWatcherOptions
  5928. );
  5929. }
  5930. // component-defined computed properties are already defined on the
  5931. // component prototype. We only need to define computed properties defined
  5932. // at instantiation here.
  5933. if (!(key in vm)) {
  5934. defineComputed(vm, key, userDef);
  5935. } else if (true) {
  5936. if (key in vm.$data) {
  5937. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5938. } else if (vm.$options.props && key in vm.$options.props) {
  5939. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5940. }
  5941. }
  5942. }
  5943. }
  5944. function defineComputed (
  5945. target,
  5946. key,
  5947. userDef
  5948. ) {
  5949. var shouldCache = !isServerRendering();
  5950. if (typeof userDef === 'function') {
  5951. sharedPropertyDefinition.get = shouldCache
  5952. ? createComputedGetter(key)
  5953. : createGetterInvoker(userDef);
  5954. sharedPropertyDefinition.set = noop;
  5955. } else {
  5956. sharedPropertyDefinition.get = userDef.get
  5957. ? shouldCache && userDef.cache !== false
  5958. ? createComputedGetter(key)
  5959. : createGetterInvoker(userDef.get)
  5960. : noop;
  5961. sharedPropertyDefinition.set = userDef.set || noop;
  5962. }
  5963. if ( true &&
  5964. sharedPropertyDefinition.set === noop) {
  5965. sharedPropertyDefinition.set = function () {
  5966. warn(
  5967. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5968. this
  5969. );
  5970. };
  5971. }
  5972. Object.defineProperty(target, key, sharedPropertyDefinition);
  5973. }
  5974. function createComputedGetter (key) {
  5975. return function computedGetter () {
  5976. var watcher = this._computedWatchers && this._computedWatchers[key];
  5977. if (watcher) {
  5978. if (watcher.dirty) {
  5979. watcher.evaluate();
  5980. }
  5981. if (Dep.SharedObject.target) {// fixed by xxxxxx
  5982. watcher.depend();
  5983. }
  5984. return watcher.value
  5985. }
  5986. }
  5987. }
  5988. function createGetterInvoker(fn) {
  5989. return function computedGetter () {
  5990. return fn.call(this, this)
  5991. }
  5992. }
  5993. function initMethods (vm, methods) {
  5994. var props = vm.$options.props;
  5995. for (var key in methods) {
  5996. if (true) {
  5997. if (typeof methods[key] !== 'function') {
  5998. warn(
  5999. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6000. "Did you reference the function correctly?",
  6001. vm
  6002. );
  6003. }
  6004. if (props && hasOwn(props, key)) {
  6005. warn(
  6006. ("Method \"" + key + "\" has already been defined as a prop."),
  6007. vm
  6008. );
  6009. }
  6010. if ((key in vm) && isReserved(key)) {
  6011. warn(
  6012. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6013. "Avoid defining component methods that start with _ or $."
  6014. );
  6015. }
  6016. }
  6017. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6018. }
  6019. }
  6020. function initWatch (vm, watch) {
  6021. for (var key in watch) {
  6022. var handler = watch[key];
  6023. if (Array.isArray(handler)) {
  6024. for (var i = 0; i < handler.length; i++) {
  6025. createWatcher(vm, key, handler[i]);
  6026. }
  6027. } else {
  6028. createWatcher(vm, key, handler);
  6029. }
  6030. }
  6031. }
  6032. function createWatcher (
  6033. vm,
  6034. expOrFn,
  6035. handler,
  6036. options
  6037. ) {
  6038. if (isPlainObject(handler)) {
  6039. options = handler;
  6040. handler = handler.handler;
  6041. }
  6042. if (typeof handler === 'string') {
  6043. handler = vm[handler];
  6044. }
  6045. return vm.$watch(expOrFn, handler, options)
  6046. }
  6047. function stateMixin (Vue) {
  6048. // flow somehow has problems with directly declared definition object
  6049. // when using Object.defineProperty, so we have to procedurally build up
  6050. // the object here.
  6051. var dataDef = {};
  6052. dataDef.get = function () { return this._data };
  6053. var propsDef = {};
  6054. propsDef.get = function () { return this._props };
  6055. if (true) {
  6056. dataDef.set = function () {
  6057. warn(
  6058. 'Avoid replacing instance root $data. ' +
  6059. 'Use nested data properties instead.',
  6060. this
  6061. );
  6062. };
  6063. propsDef.set = function () {
  6064. warn("$props is readonly.", this);
  6065. };
  6066. }
  6067. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6068. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6069. Vue.prototype.$set = set;
  6070. Vue.prototype.$delete = del;
  6071. Vue.prototype.$watch = function (
  6072. expOrFn,
  6073. cb,
  6074. options
  6075. ) {
  6076. var vm = this;
  6077. if (isPlainObject(cb)) {
  6078. return createWatcher(vm, expOrFn, cb, options)
  6079. }
  6080. options = options || {};
  6081. options.user = true;
  6082. var watcher = new Watcher(vm, expOrFn, cb, options);
  6083. if (options.immediate) {
  6084. try {
  6085. cb.call(vm, watcher.value);
  6086. } catch (error) {
  6087. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6088. }
  6089. }
  6090. return function unwatchFn () {
  6091. watcher.teardown();
  6092. }
  6093. };
  6094. }
  6095. /* */
  6096. var uid$3 = 0;
  6097. function initMixin (Vue) {
  6098. Vue.prototype._init = function (options) {
  6099. var vm = this;
  6100. // a uid
  6101. vm._uid = uid$3++;
  6102. var startTag, endTag;
  6103. /* istanbul ignore if */
  6104. if ( true && config.performance && mark) {
  6105. startTag = "vue-perf-start:" + (vm._uid);
  6106. endTag = "vue-perf-end:" + (vm._uid);
  6107. mark(startTag);
  6108. }
  6109. // a flag to avoid this being observed
  6110. vm._isVue = true;
  6111. // merge options
  6112. if (options && options._isComponent) {
  6113. // optimize internal component instantiation
  6114. // since dynamic options merging is pretty slow, and none of the
  6115. // internal component options needs special treatment.
  6116. initInternalComponent(vm, options);
  6117. } else {
  6118. vm.$options = mergeOptions(
  6119. resolveConstructorOptions(vm.constructor),
  6120. options || {},
  6121. vm
  6122. );
  6123. }
  6124. /* istanbul ignore else */
  6125. if (true) {
  6126. initProxy(vm);
  6127. } else {}
  6128. // expose real self
  6129. vm._self = vm;
  6130. initLifecycle(vm);
  6131. initEvents(vm);
  6132. initRender(vm);
  6133. callHook(vm, 'beforeCreate');
  6134. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6135. initState(vm);
  6136. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6137. !vm._$fallback && callHook(vm, 'created');
  6138. /* istanbul ignore if */
  6139. if ( true && config.performance && mark) {
  6140. vm._name = formatComponentName(vm, false);
  6141. mark(endTag);
  6142. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6143. }
  6144. if (vm.$options.el) {
  6145. vm.$mount(vm.$options.el);
  6146. }
  6147. };
  6148. }
  6149. function initInternalComponent (vm, options) {
  6150. var opts = vm.$options = Object.create(vm.constructor.options);
  6151. // doing this because it's faster than dynamic enumeration.
  6152. var parentVnode = options._parentVnode;
  6153. opts.parent = options.parent;
  6154. opts._parentVnode = parentVnode;
  6155. var vnodeComponentOptions = parentVnode.componentOptions;
  6156. opts.propsData = vnodeComponentOptions.propsData;
  6157. opts._parentListeners = vnodeComponentOptions.listeners;
  6158. opts._renderChildren = vnodeComponentOptions.children;
  6159. opts._componentTag = vnodeComponentOptions.tag;
  6160. if (options.render) {
  6161. opts.render = options.render;
  6162. opts.staticRenderFns = options.staticRenderFns;
  6163. }
  6164. }
  6165. function resolveConstructorOptions (Ctor) {
  6166. var options = Ctor.options;
  6167. if (Ctor.super) {
  6168. var superOptions = resolveConstructorOptions(Ctor.super);
  6169. var cachedSuperOptions = Ctor.superOptions;
  6170. if (superOptions !== cachedSuperOptions) {
  6171. // super option changed,
  6172. // need to resolve new options.
  6173. Ctor.superOptions = superOptions;
  6174. // check if there are any late-modified/attached options (#4976)
  6175. var modifiedOptions = resolveModifiedOptions(Ctor);
  6176. // update base extend options
  6177. if (modifiedOptions) {
  6178. extend(Ctor.extendOptions, modifiedOptions);
  6179. }
  6180. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6181. if (options.name) {
  6182. options.components[options.name] = Ctor;
  6183. }
  6184. }
  6185. }
  6186. return options
  6187. }
  6188. function resolveModifiedOptions (Ctor) {
  6189. var modified;
  6190. var latest = Ctor.options;
  6191. var sealed = Ctor.sealedOptions;
  6192. for (var key in latest) {
  6193. if (latest[key] !== sealed[key]) {
  6194. if (!modified) { modified = {}; }
  6195. modified[key] = latest[key];
  6196. }
  6197. }
  6198. return modified
  6199. }
  6200. function Vue (options) {
  6201. if ( true &&
  6202. !(this instanceof Vue)
  6203. ) {
  6204. warn('Vue is a constructor and should be called with the `new` keyword');
  6205. }
  6206. this._init(options);
  6207. }
  6208. initMixin(Vue);
  6209. stateMixin(Vue);
  6210. eventsMixin(Vue);
  6211. lifecycleMixin(Vue);
  6212. renderMixin(Vue);
  6213. /* */
  6214. function initUse (Vue) {
  6215. Vue.use = function (plugin) {
  6216. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6217. if (installedPlugins.indexOf(plugin) > -1) {
  6218. return this
  6219. }
  6220. // additional parameters
  6221. var args = toArray(arguments, 1);
  6222. args.unshift(this);
  6223. if (typeof plugin.install === 'function') {
  6224. plugin.install.apply(plugin, args);
  6225. } else if (typeof plugin === 'function') {
  6226. plugin.apply(null, args);
  6227. }
  6228. installedPlugins.push(plugin);
  6229. return this
  6230. };
  6231. }
  6232. /* */
  6233. function initMixin$1 (Vue) {
  6234. Vue.mixin = function (mixin) {
  6235. this.options = mergeOptions(this.options, mixin);
  6236. return this
  6237. };
  6238. }
  6239. /* */
  6240. function initExtend (Vue) {
  6241. /**
  6242. * Each instance constructor, including Vue, has a unique
  6243. * cid. This enables us to create wrapped "child
  6244. * constructors" for prototypal inheritance and cache them.
  6245. */
  6246. Vue.cid = 0;
  6247. var cid = 1;
  6248. /**
  6249. * Class inheritance
  6250. */
  6251. Vue.extend = function (extendOptions) {
  6252. extendOptions = extendOptions || {};
  6253. var Super = this;
  6254. var SuperId = Super.cid;
  6255. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6256. if (cachedCtors[SuperId]) {
  6257. return cachedCtors[SuperId]
  6258. }
  6259. var name = extendOptions.name || Super.options.name;
  6260. if ( true && name) {
  6261. validateComponentName(name);
  6262. }
  6263. var Sub = function VueComponent (options) {
  6264. this._init(options);
  6265. };
  6266. Sub.prototype = Object.create(Super.prototype);
  6267. Sub.prototype.constructor = Sub;
  6268. Sub.cid = cid++;
  6269. Sub.options = mergeOptions(
  6270. Super.options,
  6271. extendOptions
  6272. );
  6273. Sub['super'] = Super;
  6274. // For props and computed properties, we define the proxy getters on
  6275. // the Vue instances at extension time, on the extended prototype. This
  6276. // avoids Object.defineProperty calls for each instance created.
  6277. if (Sub.options.props) {
  6278. initProps$1(Sub);
  6279. }
  6280. if (Sub.options.computed) {
  6281. initComputed$1(Sub);
  6282. }
  6283. // allow further extension/mixin/plugin usage
  6284. Sub.extend = Super.extend;
  6285. Sub.mixin = Super.mixin;
  6286. Sub.use = Super.use;
  6287. // create asset registers, so extended classes
  6288. // can have their private assets too.
  6289. ASSET_TYPES.forEach(function (type) {
  6290. Sub[type] = Super[type];
  6291. });
  6292. // enable recursive self-lookup
  6293. if (name) {
  6294. Sub.options.components[name] = Sub;
  6295. }
  6296. // keep a reference to the super options at extension time.
  6297. // later at instantiation we can check if Super's options have
  6298. // been updated.
  6299. Sub.superOptions = Super.options;
  6300. Sub.extendOptions = extendOptions;
  6301. Sub.sealedOptions = extend({}, Sub.options);
  6302. // cache constructor
  6303. cachedCtors[SuperId] = Sub;
  6304. return Sub
  6305. };
  6306. }
  6307. function initProps$1 (Comp) {
  6308. var props = Comp.options.props;
  6309. for (var key in props) {
  6310. proxy(Comp.prototype, "_props", key);
  6311. }
  6312. }
  6313. function initComputed$1 (Comp) {
  6314. var computed = Comp.options.computed;
  6315. for (var key in computed) {
  6316. defineComputed(Comp.prototype, key, computed[key]);
  6317. }
  6318. }
  6319. /* */
  6320. function initAssetRegisters (Vue) {
  6321. /**
  6322. * Create asset registration methods.
  6323. */
  6324. ASSET_TYPES.forEach(function (type) {
  6325. Vue[type] = function (
  6326. id,
  6327. definition
  6328. ) {
  6329. if (!definition) {
  6330. return this.options[type + 's'][id]
  6331. } else {
  6332. /* istanbul ignore if */
  6333. if ( true && type === 'component') {
  6334. validateComponentName(id);
  6335. }
  6336. if (type === 'component' && isPlainObject(definition)) {
  6337. definition.name = definition.name || id;
  6338. definition = this.options._base.extend(definition);
  6339. }
  6340. if (type === 'directive' && typeof definition === 'function') {
  6341. definition = { bind: definition, update: definition };
  6342. }
  6343. this.options[type + 's'][id] = definition;
  6344. return definition
  6345. }
  6346. };
  6347. });
  6348. }
  6349. /* */
  6350. function getComponentName (opts) {
  6351. return opts && (opts.Ctor.options.name || opts.tag)
  6352. }
  6353. function matches (pattern, name) {
  6354. if (Array.isArray(pattern)) {
  6355. return pattern.indexOf(name) > -1
  6356. } else if (typeof pattern === 'string') {
  6357. return pattern.split(',').indexOf(name) > -1
  6358. } else if (isRegExp(pattern)) {
  6359. return pattern.test(name)
  6360. }
  6361. /* istanbul ignore next */
  6362. return false
  6363. }
  6364. function pruneCache (keepAliveInstance, filter) {
  6365. var cache = keepAliveInstance.cache;
  6366. var keys = keepAliveInstance.keys;
  6367. var _vnode = keepAliveInstance._vnode;
  6368. for (var key in cache) {
  6369. var cachedNode = cache[key];
  6370. if (cachedNode) {
  6371. var name = getComponentName(cachedNode.componentOptions);
  6372. if (name && !filter(name)) {
  6373. pruneCacheEntry(cache, key, keys, _vnode);
  6374. }
  6375. }
  6376. }
  6377. }
  6378. function pruneCacheEntry (
  6379. cache,
  6380. key,
  6381. keys,
  6382. current
  6383. ) {
  6384. var cached$$1 = cache[key];
  6385. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6386. cached$$1.componentInstance.$destroy();
  6387. }
  6388. cache[key] = null;
  6389. remove(keys, key);
  6390. }
  6391. var patternTypes = [String, RegExp, Array];
  6392. var KeepAlive = {
  6393. name: 'keep-alive',
  6394. abstract: true,
  6395. props: {
  6396. include: patternTypes,
  6397. exclude: patternTypes,
  6398. max: [String, Number]
  6399. },
  6400. created: function created () {
  6401. this.cache = Object.create(null);
  6402. this.keys = [];
  6403. },
  6404. destroyed: function destroyed () {
  6405. for (var key in this.cache) {
  6406. pruneCacheEntry(this.cache, key, this.keys);
  6407. }
  6408. },
  6409. mounted: function mounted () {
  6410. var this$1 = this;
  6411. this.$watch('include', function (val) {
  6412. pruneCache(this$1, function (name) { return matches(val, name); });
  6413. });
  6414. this.$watch('exclude', function (val) {
  6415. pruneCache(this$1, function (name) { return !matches(val, name); });
  6416. });
  6417. },
  6418. render: function render () {
  6419. var slot = this.$slots.default;
  6420. var vnode = getFirstComponentChild(slot);
  6421. var componentOptions = vnode && vnode.componentOptions;
  6422. if (componentOptions) {
  6423. // check pattern
  6424. var name = getComponentName(componentOptions);
  6425. var ref = this;
  6426. var include = ref.include;
  6427. var exclude = ref.exclude;
  6428. if (
  6429. // not included
  6430. (include && (!name || !matches(include, name))) ||
  6431. // excluded
  6432. (exclude && name && matches(exclude, name))
  6433. ) {
  6434. return vnode
  6435. }
  6436. var ref$1 = this;
  6437. var cache = ref$1.cache;
  6438. var keys = ref$1.keys;
  6439. var key = vnode.key == null
  6440. // same constructor may get registered as different local components
  6441. // so cid alone is not enough (#3269)
  6442. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6443. : vnode.key;
  6444. if (cache[key]) {
  6445. vnode.componentInstance = cache[key].componentInstance;
  6446. // make current key freshest
  6447. remove(keys, key);
  6448. keys.push(key);
  6449. } else {
  6450. cache[key] = vnode;
  6451. keys.push(key);
  6452. // prune oldest entry
  6453. if (this.max && keys.length > parseInt(this.max)) {
  6454. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6455. }
  6456. }
  6457. vnode.data.keepAlive = true;
  6458. }
  6459. return vnode || (slot && slot[0])
  6460. }
  6461. };
  6462. var builtInComponents = {
  6463. KeepAlive: KeepAlive
  6464. };
  6465. /* */
  6466. function initGlobalAPI (Vue) {
  6467. // config
  6468. var configDef = {};
  6469. configDef.get = function () { return config; };
  6470. if (true) {
  6471. configDef.set = function () {
  6472. warn(
  6473. 'Do not replace the Vue.config object, set individual fields instead.'
  6474. );
  6475. };
  6476. }
  6477. Object.defineProperty(Vue, 'config', configDef);
  6478. // exposed util methods.
  6479. // NOTE: these are not considered part of the public API - avoid relying on
  6480. // them unless you are aware of the risk.
  6481. Vue.util = {
  6482. warn: warn,
  6483. extend: extend,
  6484. mergeOptions: mergeOptions,
  6485. defineReactive: defineReactive$$1
  6486. };
  6487. Vue.set = set;
  6488. Vue.delete = del;
  6489. Vue.nextTick = nextTick;
  6490. // 2.6 explicit observable API
  6491. Vue.observable = function (obj) {
  6492. observe(obj);
  6493. return obj
  6494. };
  6495. Vue.options = Object.create(null);
  6496. ASSET_TYPES.forEach(function (type) {
  6497. Vue.options[type + 's'] = Object.create(null);
  6498. });
  6499. // this is used to identify the "base" constructor to extend all plain-object
  6500. // components with in Weex's multi-instance scenarios.
  6501. Vue.options._base = Vue;
  6502. extend(Vue.options.components, builtInComponents);
  6503. initUse(Vue);
  6504. initMixin$1(Vue);
  6505. initExtend(Vue);
  6506. initAssetRegisters(Vue);
  6507. }
  6508. initGlobalAPI(Vue);
  6509. Object.defineProperty(Vue.prototype, '$isServer', {
  6510. get: isServerRendering
  6511. });
  6512. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6513. get: function get () {
  6514. /* istanbul ignore next */
  6515. return this.$vnode && this.$vnode.ssrContext
  6516. }
  6517. });
  6518. // expose FunctionalRenderContext for ssr runtime helper installation
  6519. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6520. value: FunctionalRenderContext
  6521. });
  6522. Vue.version = '2.6.11';
  6523. /**
  6524. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6525. */
  6526. var ARRAYTYPE = '[object Array]';
  6527. var OBJECTTYPE = '[object Object]';
  6528. // const FUNCTIONTYPE = '[object Function]'
  6529. function diff(current, pre) {
  6530. var result = {};
  6531. syncKeys(current, pre);
  6532. _diff(current, pre, '', result);
  6533. return result
  6534. }
  6535. function syncKeys(current, pre) {
  6536. if (current === pre) { return }
  6537. var rootCurrentType = type(current);
  6538. var rootPreType = type(pre);
  6539. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6540. if(Object.keys(current).length >= Object.keys(pre).length){
  6541. for (var key in pre) {
  6542. var currentValue = current[key];
  6543. if (currentValue === undefined) {
  6544. current[key] = null;
  6545. } else {
  6546. syncKeys(currentValue, pre[key]);
  6547. }
  6548. }
  6549. }
  6550. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6551. if (current.length >= pre.length) {
  6552. pre.forEach(function (item, index) {
  6553. syncKeys(current[index], item);
  6554. });
  6555. }
  6556. }
  6557. }
  6558. function _diff(current, pre, path, result) {
  6559. if (current === pre) { return }
  6560. var rootCurrentType = type(current);
  6561. var rootPreType = type(pre);
  6562. if (rootCurrentType == OBJECTTYPE) {
  6563. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6564. setResult(result, path, current);
  6565. } else {
  6566. var loop = function ( key ) {
  6567. var currentValue = current[key];
  6568. var preValue = pre[key];
  6569. var currentType = type(currentValue);
  6570. var preType = type(preValue);
  6571. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6572. if (currentValue != pre[key]) {
  6573. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6574. }
  6575. } else if (currentType == ARRAYTYPE) {
  6576. if (preType != ARRAYTYPE) {
  6577. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6578. } else {
  6579. if (currentValue.length < preValue.length) {
  6580. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6581. } else {
  6582. currentValue.forEach(function (item, index) {
  6583. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6584. });
  6585. }
  6586. }
  6587. } else if (currentType == OBJECTTYPE) {
  6588. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6589. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6590. } else {
  6591. for (var subKey in currentValue) {
  6592. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6593. }
  6594. }
  6595. }
  6596. };
  6597. for (var key in current) loop( key );
  6598. }
  6599. } else if (rootCurrentType == ARRAYTYPE) {
  6600. if (rootPreType != ARRAYTYPE) {
  6601. setResult(result, path, current);
  6602. } else {
  6603. if (current.length < pre.length) {
  6604. setResult(result, path, current);
  6605. } else {
  6606. current.forEach(function (item, index) {
  6607. _diff(item, pre[index], path + '[' + index + ']', result);
  6608. });
  6609. }
  6610. }
  6611. } else {
  6612. setResult(result, path, current);
  6613. }
  6614. }
  6615. function setResult(result, k, v) {
  6616. // if (type(v) != FUNCTIONTYPE) {
  6617. result[k] = v;
  6618. // }
  6619. }
  6620. function type(obj) {
  6621. return Object.prototype.toString.call(obj)
  6622. }
  6623. /* */
  6624. function flushCallbacks$1(vm) {
  6625. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6626. if (Object({"VUE_APP_NAME":"添利","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6627. var mpInstance = vm.$scope;
  6628. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6629. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6630. }
  6631. var copies = vm.__next_tick_callbacks.slice(0);
  6632. vm.__next_tick_callbacks.length = 0;
  6633. for (var i = 0; i < copies.length; i++) {
  6634. copies[i]();
  6635. }
  6636. }
  6637. }
  6638. function hasRenderWatcher(vm) {
  6639. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6640. }
  6641. function nextTick$1(vm, cb) {
  6642. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6643. //2.nextTick 之前存在 render watcher
  6644. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6645. if(Object({"VUE_APP_NAME":"添利","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6646. var mpInstance = vm.$scope;
  6647. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6648. ']:nextVueTick');
  6649. }
  6650. return nextTick(cb, vm)
  6651. }else{
  6652. if(Object({"VUE_APP_NAME":"添利","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6653. var mpInstance$1 = vm.$scope;
  6654. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6655. ']:nextMPTick');
  6656. }
  6657. }
  6658. var _resolve;
  6659. if (!vm.__next_tick_callbacks) {
  6660. vm.__next_tick_callbacks = [];
  6661. }
  6662. vm.__next_tick_callbacks.push(function () {
  6663. if (cb) {
  6664. try {
  6665. cb.call(vm);
  6666. } catch (e) {
  6667. handleError(e, vm, 'nextTick');
  6668. }
  6669. } else if (_resolve) {
  6670. _resolve(vm);
  6671. }
  6672. });
  6673. // $flow-disable-line
  6674. if (!cb && typeof Promise !== 'undefined') {
  6675. return new Promise(function (resolve) {
  6676. _resolve = resolve;
  6677. })
  6678. }
  6679. }
  6680. /* */
  6681. function cloneWithData(vm) {
  6682. // 确保当前 vm 所有数据被同步
  6683. var ret = Object.create(null);
  6684. var dataKeys = [].concat(
  6685. Object.keys(vm._data || {}),
  6686. Object.keys(vm._computedWatchers || {}));
  6687. dataKeys.reduce(function(ret, key) {
  6688. ret[key] = vm[key];
  6689. return ret
  6690. }, ret);
  6691. // vue-composition-api
  6692. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6693. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6694. if (rawBindings) {
  6695. Object.keys(rawBindings).forEach(function (key) {
  6696. ret[key] = vm[key];
  6697. });
  6698. }
  6699. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6700. Object.assign(ret, vm.$mp.data || {});
  6701. if (
  6702. Array.isArray(vm.$options.behaviors) &&
  6703. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6704. ) { //form-field
  6705. ret['name'] = vm.name;
  6706. ret['value'] = vm.value;
  6707. }
  6708. return JSON.parse(JSON.stringify(ret))
  6709. }
  6710. var patch = function(oldVnode, vnode) {
  6711. var this$1 = this;
  6712. if (vnode === null) { //destroy
  6713. return
  6714. }
  6715. if (this.mpType === 'page' || this.mpType === 'component') {
  6716. var mpInstance = this.$scope;
  6717. var data = Object.create(null);
  6718. try {
  6719. data = cloneWithData(this);
  6720. } catch (err) {
  6721. console.error(err);
  6722. }
  6723. data.__webviewId__ = mpInstance.data.__webviewId__;
  6724. var mpData = Object.create(null);
  6725. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6726. mpData[key] = mpInstance.data[key];
  6727. });
  6728. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6729. if (Object.keys(diffData).length) {
  6730. if (Object({"VUE_APP_NAME":"添利","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6731. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6732. ']差量更新',
  6733. JSON.stringify(diffData));
  6734. }
  6735. this.__next_tick_pending = true;
  6736. mpInstance.setData(diffData, function () {
  6737. this$1.__next_tick_pending = false;
  6738. flushCallbacks$1(this$1);
  6739. });
  6740. } else {
  6741. flushCallbacks$1(this);
  6742. }
  6743. }
  6744. };
  6745. /* */
  6746. function createEmptyRender() {
  6747. }
  6748. function mountComponent$1(
  6749. vm,
  6750. el,
  6751. hydrating
  6752. ) {
  6753. if (!vm.mpType) {//main.js 中的 new Vue
  6754. return vm
  6755. }
  6756. if (vm.mpType === 'app') {
  6757. vm.$options.render = createEmptyRender;
  6758. }
  6759. if (!vm.$options.render) {
  6760. vm.$options.render = createEmptyRender;
  6761. if (true) {
  6762. /* istanbul ignore if */
  6763. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6764. vm.$options.el || el) {
  6765. warn(
  6766. 'You are using the runtime-only build of Vue where the template ' +
  6767. 'compiler is not available. Either pre-compile the templates into ' +
  6768. 'render functions, or use the compiler-included build.',
  6769. vm
  6770. );
  6771. } else {
  6772. warn(
  6773. 'Failed to mount component: template or render function not defined.',
  6774. vm
  6775. );
  6776. }
  6777. }
  6778. }
  6779. !vm._$fallback && callHook(vm, 'beforeMount');
  6780. var updateComponent = function () {
  6781. vm._update(vm._render(), hydrating);
  6782. };
  6783. // we set this to vm._watcher inside the watcher's constructor
  6784. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6785. // component's mounted hook), which relies on vm._watcher being already defined
  6786. new Watcher(vm, updateComponent, noop, {
  6787. before: function before() {
  6788. if (vm._isMounted && !vm._isDestroyed) {
  6789. callHook(vm, 'beforeUpdate');
  6790. }
  6791. }
  6792. }, true /* isRenderWatcher */);
  6793. hydrating = false;
  6794. return vm
  6795. }
  6796. /* */
  6797. function renderClass (
  6798. staticClass,
  6799. dynamicClass
  6800. ) {
  6801. if (isDef(staticClass) || isDef(dynamicClass)) {
  6802. return concat(staticClass, stringifyClass(dynamicClass))
  6803. }
  6804. /* istanbul ignore next */
  6805. return ''
  6806. }
  6807. function concat (a, b) {
  6808. return a ? b ? (a + ' ' + b) : a : (b || '')
  6809. }
  6810. function stringifyClass (value) {
  6811. if (Array.isArray(value)) {
  6812. return stringifyArray(value)
  6813. }
  6814. if (isObject(value)) {
  6815. return stringifyObject(value)
  6816. }
  6817. if (typeof value === 'string') {
  6818. return value
  6819. }
  6820. /* istanbul ignore next */
  6821. return ''
  6822. }
  6823. function stringifyArray (value) {
  6824. var res = '';
  6825. var stringified;
  6826. for (var i = 0, l = value.length; i < l; i++) {
  6827. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6828. if (res) { res += ' '; }
  6829. res += stringified;
  6830. }
  6831. }
  6832. return res
  6833. }
  6834. function stringifyObject (value) {
  6835. var res = '';
  6836. for (var key in value) {
  6837. if (value[key]) {
  6838. if (res) { res += ' '; }
  6839. res += key;
  6840. }
  6841. }
  6842. return res
  6843. }
  6844. /* */
  6845. var parseStyleText = cached(function (cssText) {
  6846. var res = {};
  6847. var listDelimiter = /;(?![^(]*\))/g;
  6848. var propertyDelimiter = /:(.+)/;
  6849. cssText.split(listDelimiter).forEach(function (item) {
  6850. if (item) {
  6851. var tmp = item.split(propertyDelimiter);
  6852. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6853. }
  6854. });
  6855. return res
  6856. });
  6857. // normalize possible array / string values into Object
  6858. function normalizeStyleBinding (bindingStyle) {
  6859. if (Array.isArray(bindingStyle)) {
  6860. return toObject(bindingStyle)
  6861. }
  6862. if (typeof bindingStyle === 'string') {
  6863. return parseStyleText(bindingStyle)
  6864. }
  6865. return bindingStyle
  6866. }
  6867. /* */
  6868. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6869. function getTarget(obj, path) {
  6870. var parts = path.split('.');
  6871. var key = parts[0];
  6872. if (key.indexOf('__$n') === 0) { //number index
  6873. key = parseInt(key.replace('__$n', ''));
  6874. }
  6875. if (parts.length === 1) {
  6876. return obj[key]
  6877. }
  6878. return getTarget(obj[key], parts.slice(1).join('.'))
  6879. }
  6880. function internalMixin(Vue) {
  6881. Vue.config.errorHandler = function(err, vm, info) {
  6882. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6883. console.error(err);
  6884. /* eslint-disable no-undef */
  6885. var app = typeof getApp === 'function' && getApp();
  6886. if (app && app.onError) {
  6887. app.onError(err);
  6888. }
  6889. };
  6890. var oldEmit = Vue.prototype.$emit;
  6891. Vue.prototype.$emit = function(event) {
  6892. if (this.$scope && event) {
  6893. this.$scope['triggerEvent'](event, {
  6894. __args__: toArray(arguments, 1)
  6895. });
  6896. }
  6897. return oldEmit.apply(this, arguments)
  6898. };
  6899. Vue.prototype.$nextTick = function(fn) {
  6900. return nextTick$1(this, fn)
  6901. };
  6902. MP_METHODS.forEach(function (method) {
  6903. Vue.prototype[method] = function(args) {
  6904. if (this.$scope && this.$scope[method]) {
  6905. return this.$scope[method](args)
  6906. }
  6907. // mp-alipay
  6908. if (typeof my === 'undefined') {
  6909. return
  6910. }
  6911. if (method === 'createSelectorQuery') {
  6912. /* eslint-disable no-undef */
  6913. return my.createSelectorQuery(args)
  6914. } else if (method === 'createIntersectionObserver') {
  6915. /* eslint-disable no-undef */
  6916. return my.createIntersectionObserver(args)
  6917. }
  6918. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  6919. };
  6920. });
  6921. Vue.prototype.__init_provide = initProvide;
  6922. Vue.prototype.__init_injections = initInjections;
  6923. Vue.prototype.__call_hook = function(hook, args) {
  6924. var vm = this;
  6925. // #7573 disable dep collection when invoking lifecycle hooks
  6926. pushTarget();
  6927. var handlers = vm.$options[hook];
  6928. var info = hook + " hook";
  6929. var ret;
  6930. if (handlers) {
  6931. for (var i = 0, j = handlers.length; i < j; i++) {
  6932. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6933. }
  6934. }
  6935. if (vm._hasHookEvent) {
  6936. vm.$emit('hook:' + hook, args);
  6937. }
  6938. popTarget();
  6939. return ret
  6940. };
  6941. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6942. if (Array.isArray(modifiers)) {
  6943. if (modifiers.indexOf('trim') !== -1) {
  6944. value = value.trim();
  6945. }
  6946. if (modifiers.indexOf('number') !== -1) {
  6947. value = this._n(value);
  6948. }
  6949. }
  6950. if (!target) {
  6951. target = this;
  6952. }
  6953. target[key] = value;
  6954. };
  6955. Vue.prototype.__set_sync = function(target, key, value) {
  6956. if (!target) {
  6957. target = this;
  6958. }
  6959. target[key] = value;
  6960. };
  6961. Vue.prototype.__get_orig = function(item) {
  6962. if (isPlainObject(item)) {
  6963. return item['$orig'] || item
  6964. }
  6965. return item
  6966. };
  6967. Vue.prototype.__get_value = function(dataPath, target) {
  6968. return getTarget(target || this, dataPath)
  6969. };
  6970. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6971. return renderClass(staticClass, dynamicClass)
  6972. };
  6973. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6974. if (!dynamicStyle && !staticStyle) {
  6975. return ''
  6976. }
  6977. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6978. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6979. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6980. };
  6981. Vue.prototype.__map = function(val, iteratee) {
  6982. //TODO 暂不考虑 string
  6983. var ret, i, l, keys, key;
  6984. if (Array.isArray(val)) {
  6985. ret = new Array(val.length);
  6986. for (i = 0, l = val.length; i < l; i++) {
  6987. ret[i] = iteratee(val[i], i);
  6988. }
  6989. return ret
  6990. } else if (isObject(val)) {
  6991. keys = Object.keys(val);
  6992. ret = Object.create(null);
  6993. for (i = 0, l = keys.length; i < l; i++) {
  6994. key = keys[i];
  6995. ret[key] = iteratee(val[key], key, i);
  6996. }
  6997. return ret
  6998. } else if (typeof val === 'number') {
  6999. ret = new Array(val);
  7000. for (i = 0, l = val; i < l; i++) {
  7001. // 第一个参数暂时仍和小程序一致
  7002. ret[i] = iteratee(i, i);
  7003. }
  7004. return ret
  7005. }
  7006. return []
  7007. };
  7008. }
  7009. /* */
  7010. var LIFECYCLE_HOOKS$1 = [
  7011. //App
  7012. 'onLaunch',
  7013. 'onShow',
  7014. 'onHide',
  7015. 'onUniNViewMessage',
  7016. 'onPageNotFound',
  7017. 'onThemeChange',
  7018. 'onError',
  7019. 'onUnhandledRejection',
  7020. //Page
  7021. 'onInit',
  7022. 'onLoad',
  7023. // 'onShow',
  7024. 'onReady',
  7025. // 'onHide',
  7026. 'onUnload',
  7027. 'onPullDownRefresh',
  7028. 'onReachBottom',
  7029. 'onTabItemTap',
  7030. 'onAddToFavorites',
  7031. 'onShareTimeline',
  7032. 'onShareAppMessage',
  7033. 'onResize',
  7034. 'onPageScroll',
  7035. 'onNavigationBarButtonTap',
  7036. 'onBackPress',
  7037. 'onNavigationBarSearchInputChanged',
  7038. 'onNavigationBarSearchInputConfirmed',
  7039. 'onNavigationBarSearchInputClicked',
  7040. //Component
  7041. // 'onReady', // 兼容旧版本,应该移除该事件
  7042. 'onPageShow',
  7043. 'onPageHide',
  7044. 'onPageResize'
  7045. ];
  7046. function lifecycleMixin$1(Vue) {
  7047. //fixed vue-class-component
  7048. var oldExtend = Vue.extend;
  7049. Vue.extend = function(extendOptions) {
  7050. extendOptions = extendOptions || {};
  7051. var methods = extendOptions.methods;
  7052. if (methods) {
  7053. Object.keys(methods).forEach(function (methodName) {
  7054. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7055. extendOptions[methodName] = methods[methodName];
  7056. delete methods[methodName];
  7057. }
  7058. });
  7059. }
  7060. return oldExtend.call(this, extendOptions)
  7061. };
  7062. var strategies = Vue.config.optionMergeStrategies;
  7063. var mergeHook = strategies.created;
  7064. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7065. strategies[hook] = mergeHook;
  7066. });
  7067. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7068. }
  7069. /* */
  7070. // install platform patch function
  7071. Vue.prototype.__patch__ = patch;
  7072. // public mount method
  7073. Vue.prototype.$mount = function(
  7074. el ,
  7075. hydrating
  7076. ) {
  7077. return mountComponent$1(this, el, hydrating)
  7078. };
  7079. lifecycleMixin$1(Vue);
  7080. internalMixin(Vue);
  7081. /* */
  7082. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7083. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  7084. /***/ }),
  7085. /* 3 */
  7086. /*!***********************************!*\
  7087. !*** (webpack)/buildin/global.js ***!
  7088. \***********************************/
  7089. /*! no static exports found */
  7090. /***/ (function(module, exports) {
  7091. var g;
  7092. // This works in non-strict mode
  7093. g = (function() {
  7094. return this;
  7095. })();
  7096. try {
  7097. // This works if eval is allowed (see CSP)
  7098. g = g || new Function("return this")();
  7099. } catch (e) {
  7100. // This works if the window reference is available
  7101. if (typeof window === "object") g = window;
  7102. }
  7103. // g can still be undefined, but nothing to do about it...
  7104. // We return undefined, instead of nothing here, so it's
  7105. // easier to handle this case. if(!global) { ...}
  7106. module.exports = g;
  7107. /***/ }),
  7108. /* 4 */
  7109. /*!*********************************!*\
  7110. !*** D:/六牛项目/school/pages.json ***!
  7111. \*********************************/
  7112. /*! no static exports found */
  7113. /***/ (function(module, exports) {
  7114. /***/ }),
  7115. /* 5 */
  7116. /*!****************************************!*\
  7117. !*** D:/六牛项目/school/uview-ui/index.js ***!
  7118. \****************************************/
  7119. /*! no static exports found */
  7120. /***/ (function(module, exports, __webpack_require__) {
  7121. "use strict";
  7122. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  7123. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 6));
  7124. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 7));
  7125. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 11));
  7126. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 12));
  7127. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 16));
  7128. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 17));
  7129. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 18));
  7130. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 19));
  7131. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 20));
  7132. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 21));
  7133. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 22));
  7134. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 9));
  7135. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 8));
  7136. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 23));
  7137. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 10));
  7138. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 24));
  7139. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 25));
  7140. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 26));
  7141. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 27));
  7142. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 28));
  7143. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 29);
  7144. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 30));
  7145. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 31));
  7146. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 32));
  7147. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 33));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  7148. // 引入关于是否mixin集成小程序分享的配置
  7149. // import wxshare from './libs/mixin/mpShare.js'
  7150. // 全局挂载引入http相关请求拦截插件
  7151. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  7152. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  7153. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  7154. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  7155. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  7156. // let vuexStore = {};
  7157. // try {
  7158. // vuexStore = require("@/store/$u.mixin.js");
  7159. // } catch (e) {
  7160. // //TODO handle the exception
  7161. // }
  7162. // post类型对象参数转为get类型url参数
  7163. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  7164. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  7165. post: _request.default.post,
  7166. put: _request.default.put,
  7167. 'delete': _request.default.delete,
  7168. hexToRgb: _colorGradient.default.hexToRgb,
  7169. rgbToHex: _colorGradient.default.rgbToHex,
  7170. test: _test.default,
  7171. random: _random.default,
  7172. deepClone: _deepClone.default,
  7173. deepMerge: _deepMerge.default,
  7174. getParent: _getParent.default,
  7175. $parent: _$parent.default,
  7176. addUnit: _addUnit.default,
  7177. trim: _trim.default,
  7178. type: ['primary', 'success', 'error', 'warning', 'info'],
  7179. http: _request.default,
  7180. toast: _toast.default,
  7181. config: _config.default, // uView配置信息相关,比如版本号
  7182. zIndex: _zIndex.default,
  7183. debounce: _debounce.default,
  7184. throttle: _throttle.default };
  7185. // $u挂载到uni对象上
  7186. uni.$u = $u;
  7187. var install = function install(Vue) {
  7188. Vue.mixin(_mixin.default);
  7189. if (Vue.prototype.openShare) {
  7190. Vue.mixin(mpShare);
  7191. }
  7192. // Vue.mixin(vuexStore);
  7193. // 时间格式化,同时两个名称,date和timeFormat
  7194. Vue.filter('timeFormat', function (timestamp, format) {
  7195. return (0, _timeFormat.default)(timestamp, format);
  7196. });
  7197. Vue.filter('date', function (timestamp, format) {
  7198. return (0, _timeFormat.default)(timestamp, format);
  7199. });
  7200. // 将多久以前的方法,注入到全局过滤器
  7201. Vue.filter('timeFrom', function (timestamp, format) {
  7202. return (0, _timeFrom.default)(timestamp, format);
  7203. });
  7204. Vue.prototype.$u = $u;
  7205. };var _default =
  7206. {
  7207. install: install };exports.default = _default;
  7208. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7209. /***/ }),
  7210. /* 6 */
  7211. /*!***************************************************!*\
  7212. !*** D:/六牛项目/school/uview-ui/libs/mixin/mixin.js ***!
  7213. \***************************************************/
  7214. /*! no static exports found */
  7215. /***/ (function(module, exports, __webpack_require__) {
  7216. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  7217. data: function data() {
  7218. return {};
  7219. },
  7220. onLoad: function onLoad() {
  7221. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  7222. this.$u.getRect = this.$uGetRect;
  7223. },
  7224. methods: {
  7225. // 查询节点信息
  7226. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  7227. // 解决办法为在组件根部再套一个没有任何作用的view元素
  7228. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  7229. return new Promise(function (resolve) {
  7230. uni.createSelectorQuery().
  7231. in(_this)[all ? 'selectAll' : 'select'](selector).
  7232. boundingClientRect(function (rect) {
  7233. if (all && Array.isArray(rect) && rect.length) {
  7234. resolve(rect);
  7235. }
  7236. if (!all && rect) {
  7237. resolve(rect);
  7238. }
  7239. }).
  7240. exec();
  7241. });
  7242. },
  7243. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  7244. // 避免在created中去定义parent变量
  7245. if (!this.parent) this.parent = false;
  7246. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  7247. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  7248. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  7249. this.parent = this.$u.$parent.call(this, parentName);
  7250. if (this.parent) {
  7251. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  7252. Object.keys(this.parentData).map(function (key) {
  7253. _this2.parentData[key] = _this2.parent[key];
  7254. });
  7255. }
  7256. },
  7257. // 阻止事件冒泡
  7258. preventEvent: function preventEvent(e) {
  7259. e && e.stopPropagation && e.stopPropagation();
  7260. } },
  7261. onReachBottom: function onReachBottom() {
  7262. uni.$emit('uOnReachBottom');
  7263. },
  7264. beforeDestroy: function beforeDestroy() {var _this3 = this;
  7265. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  7266. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  7267. if (this.parent && uni.$u.test.array(this.parent.children)) {
  7268. // 组件销毁时,移除父组件中的children数组中对应的实例
  7269. var childrenList = this.parent.children;
  7270. childrenList.map(function (child, index) {
  7271. // 如果相等,则移除
  7272. if (child === _this3) {
  7273. childrenList.splice(index, 1);
  7274. }
  7275. });
  7276. }
  7277. } };
  7278. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7279. /***/ }),
  7280. /* 7 */
  7281. /*!*****************************************************!*\
  7282. !*** D:/六牛项目/school/uview-ui/libs/request/index.js ***!
  7283. \*****************************************************/
  7284. /*! no static exports found */
  7285. /***/ (function(module, exports, __webpack_require__) {
  7286. "use strict";
  7287. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 8));
  7288. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 10));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  7289. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  7290. // 设置全局默认配置
  7291. value: function setConfig(customConfig) {
  7292. // 深度合并对象,否则会造成对象深层属性丢失
  7293. this.config = (0, _deepMerge.default)(this.config, customConfig);
  7294. }
  7295. // 主要请求部分
  7296. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7297. // 检查请求拦截
  7298. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  7299. var tmpConfig = {};
  7300. var interceptorRequest = this.interceptor.request(options);
  7301. if (interceptorRequest === false) {
  7302. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  7303. return new Promise(function () {});
  7304. }
  7305. this.options = interceptorRequest;
  7306. }
  7307. options.dataType = options.dataType || this.config.dataType;
  7308. options.responseType = options.responseType || this.config.responseType;
  7309. options.url = options.url || '';
  7310. options.params = options.params || {};
  7311. options.header = Object.assign({}, this.config.header, options.header);
  7312. options.method = options.method || this.config.method;
  7313. return new Promise(function (resolve, reject) {
  7314. options.complete = function (response) {
  7315. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  7316. uni.hideLoading();
  7317. // 清除定时器,如果请求回来了,就无需loading
  7318. clearTimeout(_this.config.timer);
  7319. _this.config.timer = null;
  7320. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  7321. if (_this.config.originalData) {
  7322. // 判断是否存在拦截器
  7323. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  7324. var resInterceptors = _this.interceptor.response(response);
  7325. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  7326. if (resInterceptors !== false) {
  7327. resolve(resInterceptors);
  7328. } else {
  7329. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  7330. reject(response);
  7331. }
  7332. } else {
  7333. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  7334. resolve(response);
  7335. }
  7336. } else {
  7337. if (response.statusCode == 200) {
  7338. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  7339. var _resInterceptors = _this.interceptor.response(response.data);
  7340. if (_resInterceptors !== false) {
  7341. resolve(_resInterceptors);
  7342. } else {
  7343. reject(response.data);
  7344. }
  7345. } else {
  7346. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  7347. resolve(response.data);
  7348. }
  7349. } else {
  7350. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  7351. // if(response.errMsg) {
  7352. // uni.showModal({
  7353. // title: response.errMsg
  7354. // });
  7355. // }
  7356. reject(response);
  7357. }
  7358. }
  7359. };
  7360. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  7361. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  7362. options.url : '/' + options.url);
  7363. // 是否显示loading
  7364. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  7365. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  7366. if (_this.config.showLoading && !_this.config.timer) {
  7367. _this.config.timer = setTimeout(function () {
  7368. uni.showLoading({
  7369. title: _this.config.loadingText,
  7370. mask: _this.config.loadingMask });
  7371. _this.config.timer = null;
  7372. }, _this.config.loadingTime);
  7373. }
  7374. uni.request(options);
  7375. });
  7376. // .catch(res => {
  7377. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  7378. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  7379. // return new Promise(()=>{});
  7380. // })
  7381. } }]);
  7382. function Request() {var _this2 = this;_classCallCheck(this, Request);
  7383. this.config = {
  7384. baseUrl: '', // 请求的根域名
  7385. // 默认的请求头
  7386. header: {},
  7387. method: 'POST',
  7388. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  7389. dataType: 'json',
  7390. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  7391. responseType: 'text',
  7392. showLoading: true, // 是否显示请求中的loading
  7393. loadingText: '请求中...',
  7394. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  7395. timer: null, // 定时器
  7396. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  7397. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  7398. };
  7399. // 拦截器
  7400. this.interceptor = {
  7401. // 请求前的拦截
  7402. request: null,
  7403. // 请求后的拦截
  7404. response: null };
  7405. // get请求
  7406. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7407. return _this2.request({
  7408. method: 'GET',
  7409. url: url,
  7410. header: header,
  7411. data: data });
  7412. };
  7413. // post请求
  7414. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7415. return _this2.request({
  7416. url: url,
  7417. method: 'POST',
  7418. header: header,
  7419. data: data });
  7420. };
  7421. // put请求,不支持支付宝小程序(HX2.6.15)
  7422. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7423. return _this2.request({
  7424. url: url,
  7425. method: 'PUT',
  7426. header: header,
  7427. data: data });
  7428. };
  7429. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  7430. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7431. return _this2.request({
  7432. url: url,
  7433. method: 'DELETE',
  7434. header: header,
  7435. data: data });
  7436. };
  7437. }return Request;}();var _default =
  7438. new Request();exports.default = _default;
  7439. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7440. /***/ }),
  7441. /* 8 */
  7442. /*!**********************************************************!*\
  7443. !*** D:/六牛项目/school/uview-ui/libs/function/deepMerge.js ***!
  7444. \**********************************************************/
  7445. /*! no static exports found */
  7446. /***/ (function(module, exports, __webpack_require__) {
  7447. "use strict";
  7448. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 9));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  7449. // JS对象深度合并
  7450. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7451. target = (0, _deepClone.default)(target);
  7452. if (typeof target !== 'object' || typeof source !== 'object') return false;
  7453. for (var prop in source) {
  7454. if (!source.hasOwnProperty(prop)) continue;
  7455. if (prop in target) {
  7456. if (typeof target[prop] !== 'object') {
  7457. target[prop] = source[prop];
  7458. } else {
  7459. if (typeof source[prop] !== 'object') {
  7460. target[prop] = source[prop];
  7461. } else {
  7462. if (target[prop].concat && source[prop].concat) {
  7463. target[prop] = target[prop].concat(source[prop]);
  7464. } else {
  7465. target[prop] = deepMerge(target[prop], source[prop]);
  7466. }
  7467. }
  7468. }
  7469. } else {
  7470. target[prop] = source[prop];
  7471. }
  7472. }
  7473. return target;
  7474. }var _default =
  7475. deepMerge;exports.default = _default;
  7476. /***/ }),
  7477. /* 9 */
  7478. /*!**********************************************************!*\
  7479. !*** D:/六牛项目/school/uview-ui/libs/function/deepClone.js ***!
  7480. \**********************************************************/
  7481. /*! no static exports found */
  7482. /***/ (function(module, exports, __webpack_require__) {
  7483. "use strict";
  7484. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  7485. function isArray(arr) {
  7486. return Object.prototype.toString.call(arr) === '[object Array]';
  7487. }
  7488. // 深度克隆
  7489. function deepClone(obj) {
  7490. // 对常见的“非”值,直接返回原来值
  7491. if ([null, undefined, NaN, false].includes(obj)) return obj;
  7492. if (typeof obj !== "object" && typeof obj !== 'function') {
  7493. //原始类型直接返回
  7494. return obj;
  7495. }
  7496. var o = isArray(obj) ? [] : {};
  7497. for (var i in obj) {
  7498. if (obj.hasOwnProperty(i)) {
  7499. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  7500. }
  7501. }
  7502. return o;
  7503. }var _default =
  7504. deepClone;exports.default = _default;
  7505. /***/ }),
  7506. /* 10 */
  7507. /*!*****************************************************!*\
  7508. !*** D:/六牛项目/school/uview-ui/libs/function/test.js ***!
  7509. \*****************************************************/
  7510. /*! no static exports found */
  7511. /***/ (function(module, exports, __webpack_require__) {
  7512. "use strict";
  7513. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  7514. * 验证电子邮箱格式
  7515. */
  7516. function email(value) {
  7517. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  7518. }
  7519. /**
  7520. * 验证手机格式
  7521. */
  7522. function mobile(value) {
  7523. return /^1[3-9]\d{9}$/.test(value);
  7524. }
  7525. /**
  7526. * 验证URL格式
  7527. */
  7528. function url(value) {
  7529. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  7530. }
  7531. /**
  7532. * 验证日期格式
  7533. */
  7534. function date(value) {
  7535. return !/Invalid|NaN/.test(new Date(value).toString());
  7536. }
  7537. /**
  7538. * 验证ISO类型的日期格式
  7539. */
  7540. function dateISO(value) {
  7541. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  7542. }
  7543. /**
  7544. * 验证十进制数字
  7545. */
  7546. function number(value) {
  7547. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  7548. }
  7549. /**
  7550. * 验证整数
  7551. */
  7552. function digits(value) {
  7553. return /^\d+$/.test(value);
  7554. }
  7555. /**
  7556. * 验证身份证号码
  7557. */
  7558. function idCard(value) {
  7559. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  7560. value);
  7561. }
  7562. /**
  7563. * 是否车牌号
  7564. */
  7565. function carNo(value) {
  7566. // 新能源车牌
  7567. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  7568. // 旧车牌
  7569. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  7570. if (value.length === 7) {
  7571. return creg.test(value);
  7572. } else if (value.length === 8) {
  7573. return xreg.test(value);
  7574. } else {
  7575. return false;
  7576. }
  7577. }
  7578. /**
  7579. * 金额,只允许2位小数
  7580. */
  7581. function amount(value) {
  7582. //金额,只允许保留两位小数
  7583. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  7584. }
  7585. /**
  7586. * 中文
  7587. */
  7588. function chinese(value) {
  7589. var reg = /^[\u4e00-\u9fa5]+$/gi;
  7590. return reg.test(value);
  7591. }
  7592. /**
  7593. * 只能输入字母
  7594. */
  7595. function letter(value) {
  7596. return /^[a-zA-Z]*$/.test(value);
  7597. }
  7598. /**
  7599. * 只能是字母或者数字
  7600. */
  7601. function enOrNum(value) {
  7602. //英文或者数字
  7603. var reg = /^[0-9a-zA-Z]*$/g;
  7604. return reg.test(value);
  7605. }
  7606. /**
  7607. * 验证是否包含某个值
  7608. */
  7609. function contains(value, param) {
  7610. return value.indexOf(param) >= 0;
  7611. }
  7612. /**
  7613. * 验证一个值范围[min, max]
  7614. */
  7615. function range(value, param) {
  7616. return value >= param[0] && value <= param[1];
  7617. }
  7618. /**
  7619. * 验证一个长度范围[min, max]
  7620. */
  7621. function rangeLength(value, param) {
  7622. return value.length >= param[0] && value.length <= param[1];
  7623. }
  7624. /**
  7625. * 是否固定电话
  7626. */
  7627. function landline(value) {
  7628. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  7629. return reg.test(value);
  7630. }
  7631. /**
  7632. * 判断是否为空
  7633. */
  7634. function empty(value) {
  7635. switch (typeof value) {
  7636. case 'undefined':
  7637. return true;
  7638. case 'string':
  7639. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  7640. break;
  7641. case 'boolean':
  7642. if (!value) return true;
  7643. break;
  7644. case 'number':
  7645. if (0 === value || isNaN(value)) return true;
  7646. break;
  7647. case 'object':
  7648. if (null === value || value.length === 0) return true;
  7649. for (var i in value) {
  7650. return false;
  7651. }
  7652. return true;}
  7653. return false;
  7654. }
  7655. /**
  7656. * 是否json字符串
  7657. */
  7658. function jsonString(value) {
  7659. if (typeof value == 'string') {
  7660. try {
  7661. var obj = JSON.parse(value);
  7662. if (typeof obj == 'object' && obj) {
  7663. return true;
  7664. } else {
  7665. return false;
  7666. }
  7667. } catch (e) {
  7668. return false;
  7669. }
  7670. }
  7671. return false;
  7672. }
  7673. /**
  7674. * 是否数组
  7675. */
  7676. function array(value) {
  7677. if (typeof Array.isArray === "function") {
  7678. return Array.isArray(value);
  7679. } else {
  7680. return Object.prototype.toString.call(value) === "[object Array]";
  7681. }
  7682. }
  7683. /**
  7684. * 是否对象
  7685. */
  7686. function object(value) {
  7687. return Object.prototype.toString.call(value) === '[object Object]';
  7688. }
  7689. /**
  7690. * 是否短信验证码
  7691. */
  7692. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  7693. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  7694. }var _default =
  7695. {
  7696. email: email,
  7697. mobile: mobile,
  7698. url: url,
  7699. date: date,
  7700. dateISO: dateISO,
  7701. number: number,
  7702. digits: digits,
  7703. idCard: idCard,
  7704. carNo: carNo,
  7705. amount: amount,
  7706. chinese: chinese,
  7707. letter: letter,
  7708. enOrNum: enOrNum,
  7709. contains: contains,
  7710. range: range,
  7711. rangeLength: rangeLength,
  7712. empty: empty,
  7713. isEmpty: empty,
  7714. jsonString: jsonString,
  7715. landline: landline,
  7716. object: object,
  7717. array: array,
  7718. code: code };exports.default = _default;
  7719. /***/ }),
  7720. /* 11 */
  7721. /*!************************************************************!*\
  7722. !*** D:/六牛项目/school/uview-ui/libs/function/queryParams.js ***!
  7723. \************************************************************/
  7724. /*! no static exports found */
  7725. /***/ (function(module, exports, __webpack_require__) {
  7726. "use strict";
  7727. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  7728. * 对象转url参数
  7729. * @param {*} data,对象
  7730. * @param {*} isPrefix,是否自动加上"?"
  7731. */
  7732. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  7733. var prefix = isPrefix ? '?' : '';
  7734. var _result = [];
  7735. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  7736. key) {
  7737. var value = data[key];
  7738. // 去掉为空的参数
  7739. if (['', undefined, null].indexOf(value) >= 0) {
  7740. return "continue";
  7741. }
  7742. // 如果值为数组,另行处理
  7743. if (value.constructor === Array) {
  7744. // e.g. {ids: [1, 2, 3]}
  7745. switch (arrayFormat) {
  7746. case 'indices':
  7747. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  7748. for (var i = 0; i < value.length; i++) {
  7749. _result.push(key + '[' + i + ']=' + value[i]);
  7750. }
  7751. break;
  7752. case 'brackets':
  7753. // 结果: ids[]=1&ids[]=2&ids[]=3
  7754. value.forEach(function (_value) {
  7755. _result.push(key + '[]=' + _value);
  7756. });
  7757. break;
  7758. case 'repeat':
  7759. // 结果: ids=1&ids=2&ids=3
  7760. value.forEach(function (_value) {
  7761. _result.push(key + '=' + _value);
  7762. });
  7763. break;
  7764. case 'comma':
  7765. // 结果: ids=1,2,3
  7766. var commaStr = "";
  7767. value.forEach(function (_value) {
  7768. commaStr += (commaStr ? "," : "") + _value;
  7769. });
  7770. _result.push(key + '=' + commaStr);
  7771. break;
  7772. default:
  7773. value.forEach(function (_value) {
  7774. _result.push(key + '[]=' + _value);
  7775. });}
  7776. } else {
  7777. _result.push(key + '=' + value);
  7778. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  7779. }
  7780. return _result.length ? prefix + _result.join('&') : '';
  7781. }var _default =
  7782. queryParams;exports.default = _default;
  7783. /***/ }),
  7784. /* 12 */
  7785. /*!******************************************************!*\
  7786. !*** D:/六牛项目/school/uview-ui/libs/function/route.js ***!
  7787. \******************************************************/
  7788. /*! no static exports found */
  7789. /***/ (function(module, exports, __webpack_require__) {
  7790. "use strict";
  7791. /* 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 */ 13));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);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  7792. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  7793. * 并且带有路由拦截功能
  7794. */var
  7795. Router = /*#__PURE__*/function () {
  7796. function Router() {_classCallCheck(this, Router);
  7797. // 原始属性定义
  7798. this.config = {
  7799. type: 'navigateTo',
  7800. url: '',
  7801. delta: 1, // navigateBack页面后退时,回退的层数
  7802. params: {}, // 传递的参数
  7803. animationType: 'pop-in', // 窗口动画,只在APP有效
  7804. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  7805. intercept: false // 是否需要拦截
  7806. };
  7807. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  7808. // 这里在构造函数中进行this绑定
  7809. this.route = this.route.bind(this);
  7810. }
  7811. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  7812. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  7813. return url[0] === '/' ? url : "/".concat(url);
  7814. }
  7815. // 整合路由参数
  7816. }, { key: "mixinParam", value: function mixinParam(url, params) {
  7817. url = url && this.addRootPath(url);
  7818. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  7819. // 如果有url中有get参数,转换后无需带上"?"
  7820. var query = '';
  7821. if (/.*\/.*\?.*=.*/.test(url)) {
  7822. // object对象转为get类型的参数
  7823. query = uni.$u.queryParams(params, false);
  7824. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  7825. return url += "&" + query;
  7826. } else {
  7827. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  7828. query = uni.$u.queryParams(params);
  7829. return url += query;
  7830. }
  7831. }
  7832. // 对外的方法名称
  7833. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  7834. // 合并用户的配置和内部的默认配置
  7835. mergeConfig = {};
  7836. if (typeof options === 'string') {
  7837. // 如果options为字符串,则为route(url, params)的形式
  7838. mergeConfig.url = this.mixinParam(options, params);
  7839. mergeConfig.type = 'navigateTo';
  7840. } else {
  7841. mergeConfig = uni.$u.deepClone(options, this.config);
  7842. // 否则正常使用mergeConfig中的url和params进行拼接
  7843. mergeConfig.url = this.mixinParam(options.url, options.params);
  7844. }
  7845. if (params.intercept) {
  7846. this.config.intercept = params.intercept;
  7847. }
  7848. // params参数也带给拦截器
  7849. mergeConfig.params = params;
  7850. // 合并内外部参数
  7851. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  7852. // 判断用户是否定义了拦截器
  7853. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  7854. new Promise(function (resolve, reject) {
  7855. uni.$u.routeIntercept(mergeConfig, resolve);
  7856. }));case 10:isNext = _context.sent;
  7857. // 如果isNext为true,则执行路由跳转
  7858. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  7859. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  7860. // 执行路由跳转
  7861. }, { key: "openPage", value: function openPage(config) {
  7862. // 解构参数
  7863. var
  7864. url =
  7865. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  7866. if (config.type == 'navigateTo' || config.type == 'to') {
  7867. uni.navigateTo({
  7868. url: url,
  7869. animationType: animationType,
  7870. animationDuration: animationDuration });
  7871. }
  7872. if (config.type == 'redirectTo' || config.type == 'redirect') {
  7873. uni.redirectTo({
  7874. url: url });
  7875. }
  7876. if (config.type == 'switchTab' || config.type == 'tab') {
  7877. uni.switchTab({
  7878. url: url });
  7879. }
  7880. if (config.type == 'reLaunch' || config.type == 'launch') {
  7881. uni.reLaunch({
  7882. url: url });
  7883. }
  7884. if (config.type == 'navigateBack' || config.type == 'back') {
  7885. uni.navigateBack({
  7886. delta: delta });
  7887. }
  7888. } }]);return Router;}();var _default =
  7889. new Router().route;exports.default = _default;
  7890. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7891. /***/ }),
  7892. /* 13 */
  7893. /*!**********************************************************!*\
  7894. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  7895. \**********************************************************/
  7896. /*! no static exports found */
  7897. /***/ (function(module, exports, __webpack_require__) {
  7898. module.exports = __webpack_require__(/*! regenerator-runtime */ 14);
  7899. /***/ }),
  7900. /* 14 */
  7901. /*!************************************************************!*\
  7902. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  7903. \************************************************************/
  7904. /*! no static exports found */
  7905. /***/ (function(module, exports, __webpack_require__) {
  7906. /**
  7907. * Copyright (c) 2014-present, Facebook, Inc.
  7908. *
  7909. * This source code is licensed under the MIT license found in the
  7910. * LICENSE file in the root directory of this source tree.
  7911. */
  7912. // This method of obtaining a reference to the global object needs to be
  7913. // kept identical to the way it is obtained in runtime.js
  7914. var g = (function() {
  7915. return this || (typeof self === "object" && self);
  7916. })() || Function("return this")();
  7917. // Use `getOwnPropertyNames` because not all browsers support calling
  7918. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  7919. var hadRuntime = g.regeneratorRuntime &&
  7920. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  7921. // Save the old regeneratorRuntime in case it needs to be restored later.
  7922. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  7923. // Force reevalutation of runtime.js.
  7924. g.regeneratorRuntime = undefined;
  7925. module.exports = __webpack_require__(/*! ./runtime */ 15);
  7926. if (hadRuntime) {
  7927. // Restore the original runtime.
  7928. g.regeneratorRuntime = oldRuntime;
  7929. } else {
  7930. // Remove the global property added by runtime.js.
  7931. try {
  7932. delete g.regeneratorRuntime;
  7933. } catch(e) {
  7934. g.regeneratorRuntime = undefined;
  7935. }
  7936. }
  7937. /***/ }),
  7938. /* 15 */
  7939. /*!*****************************************************!*\
  7940. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  7941. \*****************************************************/
  7942. /*! no static exports found */
  7943. /***/ (function(module, exports) {
  7944. /**
  7945. * Copyright (c) 2014-present, Facebook, Inc.
  7946. *
  7947. * This source code is licensed under the MIT license found in the
  7948. * LICENSE file in the root directory of this source tree.
  7949. */
  7950. !(function(global) {
  7951. "use strict";
  7952. var Op = Object.prototype;
  7953. var hasOwn = Op.hasOwnProperty;
  7954. var undefined; // More compressible than void 0.
  7955. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  7956. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  7957. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  7958. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  7959. var inModule = typeof module === "object";
  7960. var runtime = global.regeneratorRuntime;
  7961. if (runtime) {
  7962. if (inModule) {
  7963. // If regeneratorRuntime is defined globally and we're in a module,
  7964. // make the exports object identical to regeneratorRuntime.
  7965. module.exports = runtime;
  7966. }
  7967. // Don't bother evaluating the rest of this file if the runtime was
  7968. // already defined globally.
  7969. return;
  7970. }
  7971. // Define the runtime globally (as expected by generated code) as either
  7972. // module.exports (if we're in a module) or a new, empty object.
  7973. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  7974. function wrap(innerFn, outerFn, self, tryLocsList) {
  7975. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  7976. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  7977. var generator = Object.create(protoGenerator.prototype);
  7978. var context = new Context(tryLocsList || []);
  7979. // The ._invoke method unifies the implementations of the .next,
  7980. // .throw, and .return methods.
  7981. generator._invoke = makeInvokeMethod(innerFn, self, context);
  7982. return generator;
  7983. }
  7984. runtime.wrap = wrap;
  7985. // Try/catch helper to minimize deoptimizations. Returns a completion
  7986. // record like context.tryEntries[i].completion. This interface could
  7987. // have been (and was previously) designed to take a closure to be
  7988. // invoked without arguments, but in all the cases we care about we
  7989. // already have an existing method we want to call, so there's no need
  7990. // to create a new function object. We can even get away with assuming
  7991. // the method takes exactly one argument, since that happens to be true
  7992. // in every case, so we don't have to touch the arguments object. The
  7993. // only additional allocation required is the completion record, which
  7994. // has a stable shape and so hopefully should be cheap to allocate.
  7995. function tryCatch(fn, obj, arg) {
  7996. try {
  7997. return { type: "normal", arg: fn.call(obj, arg) };
  7998. } catch (err) {
  7999. return { type: "throw", arg: err };
  8000. }
  8001. }
  8002. var GenStateSuspendedStart = "suspendedStart";
  8003. var GenStateSuspendedYield = "suspendedYield";
  8004. var GenStateExecuting = "executing";
  8005. var GenStateCompleted = "completed";
  8006. // Returning this object from the innerFn has the same effect as
  8007. // breaking out of the dispatch switch statement.
  8008. var ContinueSentinel = {};
  8009. // Dummy constructor functions that we use as the .constructor and
  8010. // .constructor.prototype properties for functions that return Generator
  8011. // objects. For full spec compliance, you may wish to configure your
  8012. // minifier not to mangle the names of these two functions.
  8013. function Generator() {}
  8014. function GeneratorFunction() {}
  8015. function GeneratorFunctionPrototype() {}
  8016. // This is a polyfill for %IteratorPrototype% for environments that
  8017. // don't natively support it.
  8018. var IteratorPrototype = {};
  8019. IteratorPrototype[iteratorSymbol] = function () {
  8020. return this;
  8021. };
  8022. var getProto = Object.getPrototypeOf;
  8023. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8024. if (NativeIteratorPrototype &&
  8025. NativeIteratorPrototype !== Op &&
  8026. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  8027. // This environment has a native %IteratorPrototype%; use it instead
  8028. // of the polyfill.
  8029. IteratorPrototype = NativeIteratorPrototype;
  8030. }
  8031. var Gp = GeneratorFunctionPrototype.prototype =
  8032. Generator.prototype = Object.create(IteratorPrototype);
  8033. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  8034. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  8035. GeneratorFunctionPrototype[toStringTagSymbol] =
  8036. GeneratorFunction.displayName = "GeneratorFunction";
  8037. // Helper for defining the .next, .throw, and .return methods of the
  8038. // Iterator interface in terms of a single ._invoke method.
  8039. function defineIteratorMethods(prototype) {
  8040. ["next", "throw", "return"].forEach(function(method) {
  8041. prototype[method] = function(arg) {
  8042. return this._invoke(method, arg);
  8043. };
  8044. });
  8045. }
  8046. runtime.isGeneratorFunction = function(genFun) {
  8047. var ctor = typeof genFun === "function" && genFun.constructor;
  8048. return ctor
  8049. ? ctor === GeneratorFunction ||
  8050. // For the native GeneratorFunction constructor, the best we can
  8051. // do is to check its .name property.
  8052. (ctor.displayName || ctor.name) === "GeneratorFunction"
  8053. : false;
  8054. };
  8055. runtime.mark = function(genFun) {
  8056. if (Object.setPrototypeOf) {
  8057. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  8058. } else {
  8059. genFun.__proto__ = GeneratorFunctionPrototype;
  8060. if (!(toStringTagSymbol in genFun)) {
  8061. genFun[toStringTagSymbol] = "GeneratorFunction";
  8062. }
  8063. }
  8064. genFun.prototype = Object.create(Gp);
  8065. return genFun;
  8066. };
  8067. // Within the body of any async function, `await x` is transformed to
  8068. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  8069. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  8070. // meant to be awaited.
  8071. runtime.awrap = function(arg) {
  8072. return { __await: arg };
  8073. };
  8074. function AsyncIterator(generator) {
  8075. function invoke(method, arg, resolve, reject) {
  8076. var record = tryCatch(generator[method], generator, arg);
  8077. if (record.type === "throw") {
  8078. reject(record.arg);
  8079. } else {
  8080. var result = record.arg;
  8081. var value = result.value;
  8082. if (value &&
  8083. typeof value === "object" &&
  8084. hasOwn.call(value, "__await")) {
  8085. return Promise.resolve(value.__await).then(function(value) {
  8086. invoke("next", value, resolve, reject);
  8087. }, function(err) {
  8088. invoke("throw", err, resolve, reject);
  8089. });
  8090. }
  8091. return Promise.resolve(value).then(function(unwrapped) {
  8092. // When a yielded Promise is resolved, its final value becomes
  8093. // the .value of the Promise<{value,done}> result for the
  8094. // current iteration.
  8095. result.value = unwrapped;
  8096. resolve(result);
  8097. }, function(error) {
  8098. // If a rejected Promise was yielded, throw the rejection back
  8099. // into the async generator function so it can be handled there.
  8100. return invoke("throw", error, resolve, reject);
  8101. });
  8102. }
  8103. }
  8104. var previousPromise;
  8105. function enqueue(method, arg) {
  8106. function callInvokeWithMethodAndArg() {
  8107. return new Promise(function(resolve, reject) {
  8108. invoke(method, arg, resolve, reject);
  8109. });
  8110. }
  8111. return previousPromise =
  8112. // If enqueue has been called before, then we want to wait until
  8113. // all previous Promises have been resolved before calling invoke,
  8114. // so that results are always delivered in the correct order. If
  8115. // enqueue has not been called before, then it is important to
  8116. // call invoke immediately, without waiting on a callback to fire,
  8117. // so that the async generator function has the opportunity to do
  8118. // any necessary setup in a predictable way. This predictability
  8119. // is why the Promise constructor synchronously invokes its
  8120. // executor callback, and why async functions synchronously
  8121. // execute code before the first await. Since we implement simple
  8122. // async functions in terms of async generators, it is especially
  8123. // important to get this right, even though it requires care.
  8124. previousPromise ? previousPromise.then(
  8125. callInvokeWithMethodAndArg,
  8126. // Avoid propagating failures to Promises returned by later
  8127. // invocations of the iterator.
  8128. callInvokeWithMethodAndArg
  8129. ) : callInvokeWithMethodAndArg();
  8130. }
  8131. // Define the unified helper method that is used to implement .next,
  8132. // .throw, and .return (see defineIteratorMethods).
  8133. this._invoke = enqueue;
  8134. }
  8135. defineIteratorMethods(AsyncIterator.prototype);
  8136. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  8137. return this;
  8138. };
  8139. runtime.AsyncIterator = AsyncIterator;
  8140. // Note that simple async functions are implemented on top of
  8141. // AsyncIterator objects; they just return a Promise for the value of
  8142. // the final result produced by the iterator.
  8143. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  8144. var iter = new AsyncIterator(
  8145. wrap(innerFn, outerFn, self, tryLocsList)
  8146. );
  8147. return runtime.isGeneratorFunction(outerFn)
  8148. ? iter // If outerFn is a generator, return the full iterator.
  8149. : iter.next().then(function(result) {
  8150. return result.done ? result.value : iter.next();
  8151. });
  8152. };
  8153. function makeInvokeMethod(innerFn, self, context) {
  8154. var state = GenStateSuspendedStart;
  8155. return function invoke(method, arg) {
  8156. if (state === GenStateExecuting) {
  8157. throw new Error("Generator is already running");
  8158. }
  8159. if (state === GenStateCompleted) {
  8160. if (method === "throw") {
  8161. throw arg;
  8162. }
  8163. // Be forgiving, per 25.3.3.3.3 of the spec:
  8164. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  8165. return doneResult();
  8166. }
  8167. context.method = method;
  8168. context.arg = arg;
  8169. while (true) {
  8170. var delegate = context.delegate;
  8171. if (delegate) {
  8172. var delegateResult = maybeInvokeDelegate(delegate, context);
  8173. if (delegateResult) {
  8174. if (delegateResult === ContinueSentinel) continue;
  8175. return delegateResult;
  8176. }
  8177. }
  8178. if (context.method === "next") {
  8179. // Setting context._sent for legacy support of Babel's
  8180. // function.sent implementation.
  8181. context.sent = context._sent = context.arg;
  8182. } else if (context.method === "throw") {
  8183. if (state === GenStateSuspendedStart) {
  8184. state = GenStateCompleted;
  8185. throw context.arg;
  8186. }
  8187. context.dispatchException(context.arg);
  8188. } else if (context.method === "return") {
  8189. context.abrupt("return", context.arg);
  8190. }
  8191. state = GenStateExecuting;
  8192. var record = tryCatch(innerFn, self, context);
  8193. if (record.type === "normal") {
  8194. // If an exception is thrown from innerFn, we leave state ===
  8195. // GenStateExecuting and loop back for another invocation.
  8196. state = context.done
  8197. ? GenStateCompleted
  8198. : GenStateSuspendedYield;
  8199. if (record.arg === ContinueSentinel) {
  8200. continue;
  8201. }
  8202. return {
  8203. value: record.arg,
  8204. done: context.done
  8205. };
  8206. } else if (record.type === "throw") {
  8207. state = GenStateCompleted;
  8208. // Dispatch the exception by looping back around to the
  8209. // context.dispatchException(context.arg) call above.
  8210. context.method = "throw";
  8211. context.arg = record.arg;
  8212. }
  8213. }
  8214. };
  8215. }
  8216. // Call delegate.iterator[context.method](context.arg) and handle the
  8217. // result, either by returning a { value, done } result from the
  8218. // delegate iterator, or by modifying context.method and context.arg,
  8219. // setting context.delegate to null, and returning the ContinueSentinel.
  8220. function maybeInvokeDelegate(delegate, context) {
  8221. var method = delegate.iterator[context.method];
  8222. if (method === undefined) {
  8223. // A .throw or .return when the delegate iterator has no .throw
  8224. // method always terminates the yield* loop.
  8225. context.delegate = null;
  8226. if (context.method === "throw") {
  8227. if (delegate.iterator.return) {
  8228. // If the delegate iterator has a return method, give it a
  8229. // chance to clean up.
  8230. context.method = "return";
  8231. context.arg = undefined;
  8232. maybeInvokeDelegate(delegate, context);
  8233. if (context.method === "throw") {
  8234. // If maybeInvokeDelegate(context) changed context.method from
  8235. // "return" to "throw", let that override the TypeError below.
  8236. return ContinueSentinel;
  8237. }
  8238. }
  8239. context.method = "throw";
  8240. context.arg = new TypeError(
  8241. "The iterator does not provide a 'throw' method");
  8242. }
  8243. return ContinueSentinel;
  8244. }
  8245. var record = tryCatch(method, delegate.iterator, context.arg);
  8246. if (record.type === "throw") {
  8247. context.method = "throw";
  8248. context.arg = record.arg;
  8249. context.delegate = null;
  8250. return ContinueSentinel;
  8251. }
  8252. var info = record.arg;
  8253. if (! info) {
  8254. context.method = "throw";
  8255. context.arg = new TypeError("iterator result is not an object");
  8256. context.delegate = null;
  8257. return ContinueSentinel;
  8258. }
  8259. if (info.done) {
  8260. // Assign the result of the finished delegate to the temporary
  8261. // variable specified by delegate.resultName (see delegateYield).
  8262. context[delegate.resultName] = info.value;
  8263. // Resume execution at the desired location (see delegateYield).
  8264. context.next = delegate.nextLoc;
  8265. // If context.method was "throw" but the delegate handled the
  8266. // exception, let the outer generator proceed normally. If
  8267. // context.method was "next", forget context.arg since it has been
  8268. // "consumed" by the delegate iterator. If context.method was
  8269. // "return", allow the original .return call to continue in the
  8270. // outer generator.
  8271. if (context.method !== "return") {
  8272. context.method = "next";
  8273. context.arg = undefined;
  8274. }
  8275. } else {
  8276. // Re-yield the result returned by the delegate method.
  8277. return info;
  8278. }
  8279. // The delegate iterator is finished, so forget it and continue with
  8280. // the outer generator.
  8281. context.delegate = null;
  8282. return ContinueSentinel;
  8283. }
  8284. // Define Generator.prototype.{next,throw,return} in terms of the
  8285. // unified ._invoke helper method.
  8286. defineIteratorMethods(Gp);
  8287. Gp[toStringTagSymbol] = "Generator";
  8288. // A Generator should always return itself as the iterator object when the
  8289. // @@iterator function is called on it. Some browsers' implementations of the
  8290. // iterator prototype chain incorrectly implement this, causing the Generator
  8291. // object to not be returned from this call. This ensures that doesn't happen.
  8292. // See https://github.com/facebook/regenerator/issues/274 for more details.
  8293. Gp[iteratorSymbol] = function() {
  8294. return this;
  8295. };
  8296. Gp.toString = function() {
  8297. return "[object Generator]";
  8298. };
  8299. function pushTryEntry(locs) {
  8300. var entry = { tryLoc: locs[0] };
  8301. if (1 in locs) {
  8302. entry.catchLoc = locs[1];
  8303. }
  8304. if (2 in locs) {
  8305. entry.finallyLoc = locs[2];
  8306. entry.afterLoc = locs[3];
  8307. }
  8308. this.tryEntries.push(entry);
  8309. }
  8310. function resetTryEntry(entry) {
  8311. var record = entry.completion || {};
  8312. record.type = "normal";
  8313. delete record.arg;
  8314. entry.completion = record;
  8315. }
  8316. function Context(tryLocsList) {
  8317. // The root entry object (effectively a try statement without a catch
  8318. // or a finally block) gives us a place to store values thrown from
  8319. // locations where there is no enclosing try statement.
  8320. this.tryEntries = [{ tryLoc: "root" }];
  8321. tryLocsList.forEach(pushTryEntry, this);
  8322. this.reset(true);
  8323. }
  8324. runtime.keys = function(object) {
  8325. var keys = [];
  8326. for (var key in object) {
  8327. keys.push(key);
  8328. }
  8329. keys.reverse();
  8330. // Rather than returning an object with a next method, we keep
  8331. // things simple and return the next function itself.
  8332. return function next() {
  8333. while (keys.length) {
  8334. var key = keys.pop();
  8335. if (key in object) {
  8336. next.value = key;
  8337. next.done = false;
  8338. return next;
  8339. }
  8340. }
  8341. // To avoid creating an additional object, we just hang the .value
  8342. // and .done properties off the next function object itself. This
  8343. // also ensures that the minifier will not anonymize the function.
  8344. next.done = true;
  8345. return next;
  8346. };
  8347. };
  8348. function values(iterable) {
  8349. if (iterable) {
  8350. var iteratorMethod = iterable[iteratorSymbol];
  8351. if (iteratorMethod) {
  8352. return iteratorMethod.call(iterable);
  8353. }
  8354. if (typeof iterable.next === "function") {
  8355. return iterable;
  8356. }
  8357. if (!isNaN(iterable.length)) {
  8358. var i = -1, next = function next() {
  8359. while (++i < iterable.length) {
  8360. if (hasOwn.call(iterable, i)) {
  8361. next.value = iterable[i];
  8362. next.done = false;
  8363. return next;
  8364. }
  8365. }
  8366. next.value = undefined;
  8367. next.done = true;
  8368. return next;
  8369. };
  8370. return next.next = next;
  8371. }
  8372. }
  8373. // Return an iterator with no values.
  8374. return { next: doneResult };
  8375. }
  8376. runtime.values = values;
  8377. function doneResult() {
  8378. return { value: undefined, done: true };
  8379. }
  8380. Context.prototype = {
  8381. constructor: Context,
  8382. reset: function(skipTempReset) {
  8383. this.prev = 0;
  8384. this.next = 0;
  8385. // Resetting context._sent for legacy support of Babel's
  8386. // function.sent implementation.
  8387. this.sent = this._sent = undefined;
  8388. this.done = false;
  8389. this.delegate = null;
  8390. this.method = "next";
  8391. this.arg = undefined;
  8392. this.tryEntries.forEach(resetTryEntry);
  8393. if (!skipTempReset) {
  8394. for (var name in this) {
  8395. // Not sure about the optimal order of these conditions:
  8396. if (name.charAt(0) === "t" &&
  8397. hasOwn.call(this, name) &&
  8398. !isNaN(+name.slice(1))) {
  8399. this[name] = undefined;
  8400. }
  8401. }
  8402. }
  8403. },
  8404. stop: function() {
  8405. this.done = true;
  8406. var rootEntry = this.tryEntries[0];
  8407. var rootRecord = rootEntry.completion;
  8408. if (rootRecord.type === "throw") {
  8409. throw rootRecord.arg;
  8410. }
  8411. return this.rval;
  8412. },
  8413. dispatchException: function(exception) {
  8414. if (this.done) {
  8415. throw exception;
  8416. }
  8417. var context = this;
  8418. function handle(loc, caught) {
  8419. record.type = "throw";
  8420. record.arg = exception;
  8421. context.next = loc;
  8422. if (caught) {
  8423. // If the dispatched exception was caught by a catch block,
  8424. // then let that catch block handle the exception normally.
  8425. context.method = "next";
  8426. context.arg = undefined;
  8427. }
  8428. return !! caught;
  8429. }
  8430. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8431. var entry = this.tryEntries[i];
  8432. var record = entry.completion;
  8433. if (entry.tryLoc === "root") {
  8434. // Exception thrown outside of any try block that could handle
  8435. // it, so set the completion value of the entire function to
  8436. // throw the exception.
  8437. return handle("end");
  8438. }
  8439. if (entry.tryLoc <= this.prev) {
  8440. var hasCatch = hasOwn.call(entry, "catchLoc");
  8441. var hasFinally = hasOwn.call(entry, "finallyLoc");
  8442. if (hasCatch && hasFinally) {
  8443. if (this.prev < entry.catchLoc) {
  8444. return handle(entry.catchLoc, true);
  8445. } else if (this.prev < entry.finallyLoc) {
  8446. return handle(entry.finallyLoc);
  8447. }
  8448. } else if (hasCatch) {
  8449. if (this.prev < entry.catchLoc) {
  8450. return handle(entry.catchLoc, true);
  8451. }
  8452. } else if (hasFinally) {
  8453. if (this.prev < entry.finallyLoc) {
  8454. return handle(entry.finallyLoc);
  8455. }
  8456. } else {
  8457. throw new Error("try statement without catch or finally");
  8458. }
  8459. }
  8460. }
  8461. },
  8462. abrupt: function(type, arg) {
  8463. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8464. var entry = this.tryEntries[i];
  8465. if (entry.tryLoc <= this.prev &&
  8466. hasOwn.call(entry, "finallyLoc") &&
  8467. this.prev < entry.finallyLoc) {
  8468. var finallyEntry = entry;
  8469. break;
  8470. }
  8471. }
  8472. if (finallyEntry &&
  8473. (type === "break" ||
  8474. type === "continue") &&
  8475. finallyEntry.tryLoc <= arg &&
  8476. arg <= finallyEntry.finallyLoc) {
  8477. // Ignore the finally entry if control is not jumping to a
  8478. // location outside the try/catch block.
  8479. finallyEntry = null;
  8480. }
  8481. var record = finallyEntry ? finallyEntry.completion : {};
  8482. record.type = type;
  8483. record.arg = arg;
  8484. if (finallyEntry) {
  8485. this.method = "next";
  8486. this.next = finallyEntry.finallyLoc;
  8487. return ContinueSentinel;
  8488. }
  8489. return this.complete(record);
  8490. },
  8491. complete: function(record, afterLoc) {
  8492. if (record.type === "throw") {
  8493. throw record.arg;
  8494. }
  8495. if (record.type === "break" ||
  8496. record.type === "continue") {
  8497. this.next = record.arg;
  8498. } else if (record.type === "return") {
  8499. this.rval = this.arg = record.arg;
  8500. this.method = "return";
  8501. this.next = "end";
  8502. } else if (record.type === "normal" && afterLoc) {
  8503. this.next = afterLoc;
  8504. }
  8505. return ContinueSentinel;
  8506. },
  8507. finish: function(finallyLoc) {
  8508. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8509. var entry = this.tryEntries[i];
  8510. if (entry.finallyLoc === finallyLoc) {
  8511. this.complete(entry.completion, entry.afterLoc);
  8512. resetTryEntry(entry);
  8513. return ContinueSentinel;
  8514. }
  8515. }
  8516. },
  8517. "catch": function(tryLoc) {
  8518. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8519. var entry = this.tryEntries[i];
  8520. if (entry.tryLoc === tryLoc) {
  8521. var record = entry.completion;
  8522. if (record.type === "throw") {
  8523. var thrown = record.arg;
  8524. resetTryEntry(entry);
  8525. }
  8526. return thrown;
  8527. }
  8528. }
  8529. // The context.catch method must only be called with a location
  8530. // argument that corresponds to a known catch block.
  8531. throw new Error("illegal catch attempt");
  8532. },
  8533. delegateYield: function(iterable, resultName, nextLoc) {
  8534. this.delegate = {
  8535. iterator: values(iterable),
  8536. resultName: resultName,
  8537. nextLoc: nextLoc
  8538. };
  8539. if (this.method === "next") {
  8540. // Deliberately forget the last sent value so that we don't
  8541. // accidentally pass it on to the delegate.
  8542. this.arg = undefined;
  8543. }
  8544. return ContinueSentinel;
  8545. }
  8546. };
  8547. })(
  8548. // In sloppy mode, unbound `this` refers to the global object, fallback to
  8549. // Function constructor if we're in global strict mode. That is sadly a form
  8550. // of indirect eval which violates Content Security Policy.
  8551. (function() {
  8552. return this || (typeof self === "object" && self);
  8553. })() || Function("return this")()
  8554. );
  8555. /***/ }),
  8556. /* 16 */
  8557. /*!***********************************************************!*\
  8558. !*** D:/六牛项目/school/uview-ui/libs/function/timeFormat.js ***!
  8559. \***********************************************************/
  8560. /*! no static exports found */
  8561. /***/ (function(module, exports, __webpack_require__) {
  8562. "use strict";
  8563. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  8564. // 所以这里做一个兼容polyfill的兼容处理
  8565. if (!String.prototype.padStart) {
  8566. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  8567. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  8568. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  8569. 'fillString must be String');
  8570. var str = this;
  8571. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  8572. if (str.length >= maxLength) return String(str);
  8573. var fillLength = maxLength - str.length,
  8574. times = Math.ceil(fillLength / fillString.length);
  8575. while (times >>= 1) {
  8576. fillString += fillString;
  8577. if (times === 1) {
  8578. fillString += fillString;
  8579. }
  8580. }
  8581. return fillString.slice(0, fillLength) + str;
  8582. };
  8583. }
  8584. // 其他更多是格式化有如下:
  8585. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  8586. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  8587. // 如果为null,则格式化当前时间
  8588. if (!dateTime) dateTime = Number(new Date());
  8589. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  8590. if (dateTime.toString().length == 10) dateTime *= 1000;
  8591. var date = new Date(dateTime);
  8592. var ret;
  8593. var opt = {
  8594. "y+": date.getFullYear().toString(), // 年
  8595. "m+": (date.getMonth() + 1).toString(), // 月
  8596. "d+": date.getDate().toString(), // 日
  8597. "h+": date.getHours().toString(), // 时
  8598. "M+": date.getMinutes().toString(), // 分
  8599. "s+": date.getSeconds().toString() // 秒
  8600. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  8601. };
  8602. for (var k in opt) {
  8603. ret = new RegExp("(" + k + ")").exec(fmt);
  8604. if (ret) {
  8605. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  8606. };
  8607. };
  8608. return fmt;
  8609. }var _default =
  8610. timeFormat;exports.default = _default;
  8611. /***/ }),
  8612. /* 17 */
  8613. /*!*********************************************************!*\
  8614. !*** D:/六牛项目/school/uview-ui/libs/function/timeFrom.js ***!
  8615. \*********************************************************/
  8616. /*! no static exports found */
  8617. /***/ (function(module, exports, __webpack_require__) {
  8618. "use strict";
  8619. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8620. /**
  8621. * 时间戳转为多久之前
  8622. * @param String timestamp 时间戳
  8623. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  8624. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  8625. */
  8626. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  8627. // 如果为null,则格式化当前时间
  8628. if (!dateTime) dateTime = Number(new Date());
  8629. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  8630. if (dateTime.toString().length == 10) dateTime *= 1000;
  8631. var timestamp = +new Date(Number(dateTime));
  8632. var timer = (Number(new Date()) - timestamp) / 1000;
  8633. // 如果小于5分钟,则返回"刚刚",其他以此类推
  8634. var tips = '';
  8635. switch (true) {
  8636. case timer < 300:
  8637. tips = '刚刚';
  8638. break;
  8639. case timer >= 300 && timer < 3600:
  8640. tips = parseInt(timer / 60) + '分钟前';
  8641. break;
  8642. case timer >= 3600 && timer < 86400:
  8643. tips = parseInt(timer / 3600) + '小时前';
  8644. break;
  8645. case timer >= 86400 && timer < 2592000:
  8646. tips = parseInt(timer / 86400) + '天前';
  8647. break;
  8648. default:
  8649. // 如果format为false,则无论什么时间戳,都显示xx之前
  8650. if (format === false) {
  8651. if (timer >= 2592000 && timer < 365 * 86400) {
  8652. tips = parseInt(timer / (86400 * 30)) + '个月前';
  8653. } else {
  8654. tips = parseInt(timer / (86400 * 365)) + '年前';
  8655. }
  8656. } else {
  8657. tips = (0, _timeFormat.default)(timestamp, format);
  8658. }}
  8659. return tips;
  8660. }var _default =
  8661. timeFrom;exports.default = _default;
  8662. /***/ }),
  8663. /* 18 */
  8664. /*!**************************************************************!*\
  8665. !*** D:/六牛项目/school/uview-ui/libs/function/colorGradient.js ***!
  8666. \**************************************************************/
  8667. /*! no static exports found */
  8668. /***/ (function(module, exports, __webpack_require__) {
  8669. "use strict";
  8670. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8671. * 求两个颜色之间的渐变值
  8672. * @param {string} startColor 开始的颜色
  8673. * @param {string} endColor 结束的颜色
  8674. * @param {number} step 颜色等分的份额
  8675. * */
  8676. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  8677. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  8678. var startR = startRGB[0];
  8679. var startG = startRGB[1];
  8680. var startB = startRGB[2];
  8681. var endRGB = hexToRgb(endColor, false);
  8682. var endR = endRGB[0];
  8683. var endG = endRGB[1];
  8684. var endB = endRGB[2];
  8685. var sR = (endR - startR) / step; //总差值
  8686. var sG = (endG - startG) / step;
  8687. var sB = (endB - startB) / step;
  8688. var colorArr = [];
  8689. for (var i = 0; i < step; i++) {
  8690. //计算每一步的hex值
  8691. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  8692. i + startB) + ')');
  8693. colorArr.push(hex);
  8694. }
  8695. return colorArr;
  8696. }
  8697. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  8698. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  8699. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  8700. sColor = sColor.toLowerCase();
  8701. if (sColor && reg.test(sColor)) {
  8702. if (sColor.length === 4) {
  8703. var sColorNew = "#";
  8704. for (var i = 1; i < 4; i += 1) {
  8705. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  8706. }
  8707. sColor = sColorNew;
  8708. }
  8709. //处理六位的颜色值
  8710. var sColorChange = [];
  8711. for (var _i = 1; _i < 7; _i += 2) {
  8712. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  8713. }
  8714. if (!str) {
  8715. return sColorChange;
  8716. } else {
  8717. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  8718. }
  8719. } else if (/^(rgb|RGB)/.test(sColor)) {
  8720. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  8721. return arr.map(function (val) {return Number(val);});
  8722. } else {
  8723. return sColor;
  8724. }
  8725. };
  8726. // 将rgb表示方式转换为hex表示方式
  8727. function rgbToHex(rgb) {
  8728. var _this = rgb;
  8729. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  8730. if (/^(rgb|RGB)/.test(_this)) {
  8731. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  8732. var strHex = "#";
  8733. for (var i = 0; i < aColor.length; i++) {
  8734. var hex = Number(aColor[i]).toString(16);
  8735. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  8736. if (hex === "0") {
  8737. hex += hex;
  8738. }
  8739. strHex += hex;
  8740. }
  8741. if (strHex.length !== 7) {
  8742. strHex = _this;
  8743. }
  8744. return strHex;
  8745. } else if (reg.test(_this)) {
  8746. var aNum = _this.replace(/#/, "").split("");
  8747. if (aNum.length === 6) {
  8748. return _this;
  8749. } else if (aNum.length === 3) {
  8750. var numHex = "#";
  8751. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  8752. numHex += aNum[_i2] + aNum[_i2];
  8753. }
  8754. return numHex;
  8755. }
  8756. } else {
  8757. return _this;
  8758. }
  8759. }
  8760. /**
  8761. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  8762. * sHex为传入的十六进制的色值
  8763. * alpha为rgba的透明度
  8764. */
  8765. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  8766. color = rgbToHex(color);
  8767. // 十六进制颜色值的正则表达式
  8768. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  8769. /* 16进制颜色转为RGB格式 */
  8770. var sColor = color.toLowerCase();
  8771. if (sColor && reg.test(sColor)) {
  8772. if (sColor.length === 4) {
  8773. var sColorNew = '#';
  8774. for (var i = 1; i < 4; i += 1) {
  8775. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  8776. }
  8777. sColor = sColorNew;
  8778. }
  8779. // 处理六位的颜色值
  8780. var sColorChange = [];
  8781. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  8782. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  8783. }
  8784. // return sColorChange.join(',')
  8785. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  8786. } else
  8787. {
  8788. return sColor;
  8789. }
  8790. }var _default =
  8791. {
  8792. colorGradient: colorGradient,
  8793. hexToRgb: hexToRgb,
  8794. rgbToHex: rgbToHex,
  8795. colorToRgba: colorToRgba };exports.default = _default;
  8796. /***/ }),
  8797. /* 19 */
  8798. /*!*****************************************************!*\
  8799. !*** D:/六牛项目/school/uview-ui/libs/function/guid.js ***!
  8800. \*****************************************************/
  8801. /*! no static exports found */
  8802. /***/ (function(module, exports, __webpack_require__) {
  8803. "use strict";
  8804. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8805. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  8806. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  8807. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  8808. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  8809. * v-for的时候,推荐使用后端返回的id而不是循环的index
  8810. * @param {Number} len uuid的长度
  8811. * @param {Boolean} firstU 将返回的首字母置为"u"
  8812. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  8813. */
  8814. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  8815. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  8816. var uuid = [];
  8817. radix = radix || chars.length;
  8818. if (len) {
  8819. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  8820. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  8821. } else {
  8822. var r;
  8823. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  8824. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  8825. uuid[14] = '4';
  8826. for (var _i = 0; _i < 36; _i++) {
  8827. if (!uuid[_i]) {
  8828. r = 0 | Math.random() * 16;
  8829. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  8830. }
  8831. }
  8832. }
  8833. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  8834. if (firstU) {
  8835. uuid.shift();
  8836. return 'u' + uuid.join('');
  8837. } else {
  8838. return uuid.join('');
  8839. }
  8840. }var _default =
  8841. guid;exports.default = _default;
  8842. /***/ }),
  8843. /* 20 */
  8844. /*!******************************************************!*\
  8845. !*** D:/六牛项目/school/uview-ui/libs/function/color.js ***!
  8846. \******************************************************/
  8847. /*! no static exports found */
  8848. /***/ (function(module, exports, __webpack_require__) {
  8849. "use strict";
  8850. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  8851. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  8852. var color = {
  8853. primary: "#2979ff",
  8854. primaryDark: "#2b85e4",
  8855. primaryDisabled: "#a0cfff",
  8856. primaryLight: "#ecf5ff",
  8857. bgColor: "#f3f4f6",
  8858. info: "#909399",
  8859. infoDark: "#82848a",
  8860. infoDisabled: "#c8c9cc",
  8861. infoLight: "#f4f4f5",
  8862. warning: "#ff9900",
  8863. warningDark: "#f29100",
  8864. warningDisabled: "#fcbd71",
  8865. warningLight: "#fdf6ec",
  8866. error: "#fa3534",
  8867. errorDark: "#dd6161",
  8868. errorDisabled: "#fab6b6",
  8869. errorLight: "#fef0f0",
  8870. success: "#19be6b",
  8871. successDark: "#18b566",
  8872. successDisabled: "#71d5a1",
  8873. successLight: "#dbf1e1",
  8874. mainColor: "#303133",
  8875. contentColor: "#606266",
  8876. tipsColor: "#909399",
  8877. lightColor: "#c0c4cc",
  8878. borderColor: "#e4e7ed" };var _default =
  8879. color;exports.default = _default;
  8880. /***/ }),
  8881. /* 21 */
  8882. /*!**********************************************************!*\
  8883. !*** D:/六牛项目/school/uview-ui/libs/function/type2icon.js ***!
  8884. \**********************************************************/
  8885. /*! no static exports found */
  8886. /***/ (function(module, exports, __webpack_require__) {
  8887. "use strict";
  8888. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8889. * 根据主题type值,获取对应的图标
  8890. * @param String type 主题名称,primary|info|error|warning|success
  8891. * @param String fill 是否使用fill填充实体的图标
  8892. */
  8893. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  8894. // 如果非预置值,默认为success
  8895. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  8896. var iconName = '';
  8897. // 目前(2019-12-12),info和primary使用同一个图标
  8898. switch (type) {
  8899. case 'primary':
  8900. iconName = 'info-circle';
  8901. break;
  8902. case 'info':
  8903. iconName = 'info-circle';
  8904. break;
  8905. case 'error':
  8906. iconName = 'close-circle';
  8907. break;
  8908. case 'warning':
  8909. iconName = 'error-circle';
  8910. break;
  8911. case 'success':
  8912. iconName = 'checkmark-circle';
  8913. break;
  8914. default:
  8915. iconName = 'checkmark-circle';}
  8916. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  8917. if (fill) iconName += '-fill';
  8918. return iconName;
  8919. }var _default =
  8920. type2icon;exports.default = _default;
  8921. /***/ }),
  8922. /* 22 */
  8923. /*!************************************************************!*\
  8924. !*** D:/六牛项目/school/uview-ui/libs/function/randomArray.js ***!
  8925. \************************************************************/
  8926. /*! no static exports found */
  8927. /***/ (function(module, exports, __webpack_require__) {
  8928. "use strict";
  8929. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  8930. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  8931. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  8932. return array.sort(function () {return Math.random() - 0.5;});
  8933. }var _default =
  8934. randomArray;exports.default = _default;
  8935. /***/ }),
  8936. /* 23 */
  8937. /*!********************************************************!*\
  8938. !*** D:/六牛项目/school/uview-ui/libs/function/addUnit.js ***!
  8939. \********************************************************/
  8940. /*! no static exports found */
  8941. /***/ (function(module, exports, __webpack_require__) {
  8942. "use strict";
  8943. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 10));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8944. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  8945. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  8946. value = String(value);
  8947. // 用uView内置验证规则中的number判断是否为数值
  8948. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  8949. }
  8950. /***/ }),
  8951. /* 24 */
  8952. /*!*******************************************************!*\
  8953. !*** D:/六牛项目/school/uview-ui/libs/function/random.js ***!
  8954. \*******************************************************/
  8955. /*! no static exports found */
  8956. /***/ (function(module, exports, __webpack_require__) {
  8957. "use strict";
  8958. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  8959. if (min >= 0 && max > 0 && max >= min) {
  8960. var gab = max - min + 1;
  8961. return Math.floor(Math.random() * gab + min);
  8962. } else {
  8963. return 0;
  8964. }
  8965. }var _default =
  8966. random;exports.default = _default;
  8967. /***/ }),
  8968. /* 25 */
  8969. /*!*****************************************************!*\
  8970. !*** D:/六牛项目/school/uview-ui/libs/function/trim.js ***!
  8971. \*****************************************************/
  8972. /*! no static exports found */
  8973. /***/ (function(module, exports, __webpack_require__) {
  8974. "use strict";
  8975. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  8976. if (pos == 'both') {
  8977. return str.replace(/^\s+|\s+$/g, "");
  8978. } else if (pos == "left") {
  8979. return str.replace(/^\s*/, '');
  8980. } else if (pos == 'right') {
  8981. return str.replace(/(\s*$)/g, "");
  8982. } else if (pos == 'all') {
  8983. return str.replace(/\s+/g, "");
  8984. } else {
  8985. return str;
  8986. }
  8987. }var _default =
  8988. trim;exports.default = _default;
  8989. /***/ }),
  8990. /* 26 */
  8991. /*!******************************************************!*\
  8992. !*** D:/六牛项目/school/uview-ui/libs/function/toast.js ***!
  8993. \******************************************************/
  8994. /*! no static exports found */
  8995. /***/ (function(module, exports, __webpack_require__) {
  8996. "use strict";
  8997. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  8998. uni.showToast({
  8999. title: title,
  9000. icon: 'none',
  9001. duration: duration });
  9002. }var _default =
  9003. toast;exports.default = _default;
  9004. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9005. /***/ }),
  9006. /* 27 */
  9007. /*!**********************************************************!*\
  9008. !*** D:/六牛项目/school/uview-ui/libs/function/getParent.js ***!
  9009. \**********************************************************/
  9010. /*! no static exports found */
  9011. /***/ (function(module, exports, __webpack_require__) {
  9012. "use strict";
  9013. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9014. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9015. function getParent(name, keys) {
  9016. var parent = this.$parent;
  9017. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9018. while (parent) {
  9019. // 父组件
  9020. if (parent.$options.name !== name) {
  9021. // 如果组件的name不相等,继续上一级寻找
  9022. parent = parent.$parent;
  9023. } else {var _ret = function () {
  9024. var data = {};
  9025. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  9026. if (Array.isArray(keys)) {
  9027. keys.map(function (val) {
  9028. data[val] = parent[val] ? parent[val] : '';
  9029. });
  9030. } else {
  9031. // 历遍传过来的对象参数
  9032. for (var i in keys) {
  9033. // 如果子组件有此值则用,无此值则用父组件的值
  9034. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  9035. if (Array.isArray(keys[i])) {
  9036. if (keys[i].length) {
  9037. data[i] = keys[i];
  9038. } else {
  9039. data[i] = parent[i];
  9040. }
  9041. } else if (keys[i].constructor === Object) {
  9042. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  9043. if (Object.keys(keys[i]).length) {
  9044. data[i] = keys[i];
  9045. } else {
  9046. data[i] = parent[i];
  9047. }
  9048. } else {
  9049. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  9050. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  9051. }
  9052. }
  9053. }
  9054. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  9055. }
  9056. }
  9057. return {};
  9058. }
  9059. /***/ }),
  9060. /* 28 */
  9061. /*!********************************************************!*\
  9062. !*** D:/六牛项目/school/uview-ui/libs/function/$parent.js ***!
  9063. \********************************************************/
  9064. /*! no static exports found */
  9065. /***/ (function(module, exports, __webpack_require__) {
  9066. "use strict";
  9067. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9068. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9069. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  9070. // 值(默认为undefined),就是查找最顶层的$parent
  9071. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  9072. var parent = this.$parent;
  9073. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9074. while (parent) {
  9075. // 父组件
  9076. if (parent.$options && parent.$options.name !== name) {
  9077. // 如果组件的name不相等,继续上一级寻找
  9078. parent = parent.$parent;
  9079. } else {
  9080. return parent;
  9081. }
  9082. }
  9083. return false;
  9084. }
  9085. /***/ }),
  9086. /* 29 */
  9087. /*!****************************************************!*\
  9088. !*** D:/六牛项目/school/uview-ui/libs/function/sys.js ***!
  9089. \****************************************************/
  9090. /*! no static exports found */
  9091. /***/ (function(module, exports, __webpack_require__) {
  9092. "use strict";
  9093. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  9094. return uni.getSystemInfoSync().platform;
  9095. };
  9096. function sys() {
  9097. return uni.getSystemInfoSync();
  9098. }
  9099. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9100. /***/ }),
  9101. /* 30 */
  9102. /*!*********************************************************!*\
  9103. !*** D:/六牛项目/school/uview-ui/libs/function/debounce.js ***!
  9104. \*********************************************************/
  9105. /*! no static exports found */
  9106. /***/ (function(module, exports, __webpack_require__) {
  9107. "use strict";
  9108. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  9109. /**
  9110. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  9111. *
  9112. * @param {Function} func 要执行的回调函数
  9113. * @param {Number} wait 延时的时间
  9114. * @param {Boolean} immediate 是否立即执行
  9115. * @return null
  9116. */
  9117. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9118. // 清除定时器
  9119. if (timeout !== null) clearTimeout(timeout);
  9120. // 立即执行,此类情况一般用不到
  9121. if (immediate) {
  9122. var callNow = !timeout;
  9123. timeout = setTimeout(function () {
  9124. timeout = null;
  9125. }, wait);
  9126. if (callNow) typeof func === 'function' && func();
  9127. } else {
  9128. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  9129. timeout = setTimeout(function () {
  9130. typeof func === 'function' && func();
  9131. }, wait);
  9132. }
  9133. }var _default =
  9134. debounce;exports.default = _default;
  9135. /***/ }),
  9136. /* 31 */
  9137. /*!*********************************************************!*\
  9138. !*** D:/六牛项目/school/uview-ui/libs/function/throttle.js ***!
  9139. \*********************************************************/
  9140. /*! no static exports found */
  9141. /***/ (function(module, exports, __webpack_require__) {
  9142. "use strict";
  9143. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  9144. /**
  9145. * 节流原理:在一定时间内,只能触发一次
  9146. *
  9147. * @param {Function} func 要执行的回调函数
  9148. * @param {Number} wait 延时的时间
  9149. * @param {Boolean} immediate 是否立即执行
  9150. * @return null
  9151. */
  9152. function throttle(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9153. if (immediate) {
  9154. if (!flag) {
  9155. flag = true;
  9156. // 如果是立即执行,则在wait毫秒内开始时执行
  9157. typeof func === 'function' && func();
  9158. timer = setTimeout(function () {
  9159. flag = false;
  9160. }, wait);
  9161. }
  9162. } else {
  9163. if (!flag) {
  9164. flag = true;
  9165. // 如果是非立即执行,则在wait毫秒内的结束处执行
  9166. timer = setTimeout(function () {
  9167. flag = false;
  9168. typeof func === 'function' && func();
  9169. }, wait);
  9170. }
  9171. }
  9172. };var _default =
  9173. throttle;exports.default = _default;
  9174. /***/ }),
  9175. /* 32 */
  9176. /*!*****************************************************!*\
  9177. !*** D:/六牛项目/school/uview-ui/libs/config/config.js ***!
  9178. \*****************************************************/
  9179. /*! no static exports found */
  9180. /***/ (function(module, exports, __webpack_require__) {
  9181. "use strict";
  9182. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-03-17
  9183. var version = '1.8.4';var _default =
  9184. {
  9185. v: version,
  9186. version: version,
  9187. // 主题名称
  9188. type: [
  9189. 'primary',
  9190. 'success',
  9191. 'info',
  9192. 'error',
  9193. 'warning'] };exports.default = _default;
  9194. /***/ }),
  9195. /* 33 */
  9196. /*!*****************************************************!*\
  9197. !*** D:/六牛项目/school/uview-ui/libs/config/zIndex.js ***!
  9198. \*****************************************************/
  9199. /*! no static exports found */
  9200. /***/ (function(module, exports, __webpack_require__) {
  9201. "use strict";
  9202. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  9203. /**
  9204. * actionsheet: 999
  9205. * modal: 999
  9206. * navigate: 998
  9207. * tabbar: 998
  9208. * toast: 999
  9209. */var _default =
  9210. {
  9211. toast: 10090,
  9212. noNetwork: 10080,
  9213. // popup包含popup,actionsheet,keyboard,picker的值
  9214. popup: 10075,
  9215. mask: 10070,
  9216. navbar: 980,
  9217. topTips: 975,
  9218. sticky: 970,
  9219. indexListSticky: 965 };exports.default = _default;
  9220. /***/ }),
  9221. /* 34 */
  9222. /*!*************************************!*\
  9223. !*** D:/六牛项目/school/store/index.js ***!
  9224. \*************************************/
  9225. /*! no static exports found */
  9226. /***/ (function(module, exports, __webpack_require__) {
  9227. "use strict";
  9228. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  9229. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 35));
  9230. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 36));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9231. _vue.default.use(_vuex.default);
  9232. var store = new _vuex.default.Store({
  9233. state: {
  9234. baseURL: 'http://www.babido.cn',
  9235. // baseURL: 'https://zhibo.liuniu946.com', //请求地址配置
  9236. urlFile: '/index', //项目部署所在文件夹
  9237. hasLogin: false, //是否登录
  9238. userInfo: {}, //登录信息
  9239. loginInterceptor: false, //是否打开强制登录
  9240. orderInfo: {}, //订单信息
  9241. token: '' },
  9242. mutations: {
  9243. // 登录
  9244. login: function login(state) {
  9245. state.hasLogin = true;
  9246. },
  9247. // 退出登录
  9248. logout: function logout(state) {
  9249. state.hasLogin = false;
  9250. state.userInfo = {};
  9251. uni.removeStorage({
  9252. key: 'userInfo' });
  9253. // uni.removeStorage({
  9254. // key: 'mystore'
  9255. // })
  9256. },
  9257. // 保存用户信息
  9258. setUserInfo: function setUserInfo(state, provider) {
  9259. state.userInfo = provider;
  9260. uni.setStorageSync('userInfo', provider);
  9261. // if(provider.store_info){
  9262. console.log(provider.store_info && !(uni.getStorageSync('mystore') || false));
  9263. // uni.showModal({
  9264. // title: '打印',
  9265. // // content: !(uni.getStorageSync('mystore')||false)+'box:'+JSON.stringify(provider)
  9266. // content: (uni.getStorageSync('mystore'))
  9267. // });
  9268. if (provider.store_info && !(uni.getStorageSync('mystore') || false)) {
  9269. uni.setStorageSync('mystore', provider.store_info.id);
  9270. } else
  9271. {
  9272. var value = uni.getStorageSync('mystore');
  9273. console.log('---mystore-8-8-', value);
  9274. }
  9275. } },
  9276. modules: {
  9277. user: _user.default },
  9278. actions: {} });var _default =
  9279. store;exports.default = _default;
  9280. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9281. /***/ }),
  9282. /* 35 */
  9283. /*!********************************************!*\
  9284. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  9285. \********************************************/
  9286. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  9287. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9288. "use strict";
  9289. __webpack_require__.r(__webpack_exports__);
  9290. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  9291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  9292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  9293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  9294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  9295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  9296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  9297. /*!
  9298. * vuex v3.4.0
  9299. * (c) 2020 Evan You
  9300. * @license MIT
  9301. */
  9302. function applyMixin (Vue) {
  9303. var version = Number(Vue.version.split('.')[0]);
  9304. if (version >= 2) {
  9305. Vue.mixin({ beforeCreate: vuexInit });
  9306. } else {
  9307. // override init and inject vuex init procedure
  9308. // for 1.x backwards compatibility.
  9309. var _init = Vue.prototype._init;
  9310. Vue.prototype._init = function (options) {
  9311. if ( options === void 0 ) options = {};
  9312. options.init = options.init
  9313. ? [vuexInit].concat(options.init)
  9314. : vuexInit;
  9315. _init.call(this, options);
  9316. };
  9317. }
  9318. /**
  9319. * Vuex init hook, injected into each instances init hooks list.
  9320. */
  9321. function vuexInit () {
  9322. var options = this.$options;
  9323. // store injection
  9324. if (options.store) {
  9325. this.$store = typeof options.store === 'function'
  9326. ? options.store()
  9327. : options.store;
  9328. } else if (options.parent && options.parent.$store) {
  9329. this.$store = options.parent.$store;
  9330. }
  9331. }
  9332. }
  9333. var target = typeof window !== 'undefined'
  9334. ? window
  9335. : typeof global !== 'undefined'
  9336. ? global
  9337. : {};
  9338. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  9339. function devtoolPlugin (store) {
  9340. if (!devtoolHook) { return }
  9341. store._devtoolHook = devtoolHook;
  9342. devtoolHook.emit('vuex:init', store);
  9343. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  9344. store.replaceState(targetState);
  9345. });
  9346. store.subscribe(function (mutation, state) {
  9347. devtoolHook.emit('vuex:mutation', mutation, state);
  9348. }, { prepend: true });
  9349. store.subscribeAction(function (action, state) {
  9350. devtoolHook.emit('vuex:action', action, state);
  9351. }, { prepend: true });
  9352. }
  9353. /**
  9354. * Get the first item that pass the test
  9355. * by second argument function
  9356. *
  9357. * @param {Array} list
  9358. * @param {Function} f
  9359. * @return {*}
  9360. */
  9361. /**
  9362. * forEach for object
  9363. */
  9364. function forEachValue (obj, fn) {
  9365. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  9366. }
  9367. function isObject (obj) {
  9368. return obj !== null && typeof obj === 'object'
  9369. }
  9370. function isPromise (val) {
  9371. return val && typeof val.then === 'function'
  9372. }
  9373. function assert (condition, msg) {
  9374. if (!condition) { throw new Error(("[vuex] " + msg)) }
  9375. }
  9376. function partial (fn, arg) {
  9377. return function () {
  9378. return fn(arg)
  9379. }
  9380. }
  9381. // Base data struct for store's module, package with some attribute and method
  9382. var Module = function Module (rawModule, runtime) {
  9383. this.runtime = runtime;
  9384. // Store some children item
  9385. this._children = Object.create(null);
  9386. // Store the origin module object which passed by programmer
  9387. this._rawModule = rawModule;
  9388. var rawState = rawModule.state;
  9389. // Store the origin module's state
  9390. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  9391. };
  9392. var prototypeAccessors = { namespaced: { configurable: true } };
  9393. prototypeAccessors.namespaced.get = function () {
  9394. return !!this._rawModule.namespaced
  9395. };
  9396. Module.prototype.addChild = function addChild (key, module) {
  9397. this._children[key] = module;
  9398. };
  9399. Module.prototype.removeChild = function removeChild (key) {
  9400. delete this._children[key];
  9401. };
  9402. Module.prototype.getChild = function getChild (key) {
  9403. return this._children[key]
  9404. };
  9405. Module.prototype.hasChild = function hasChild (key) {
  9406. return key in this._children
  9407. };
  9408. Module.prototype.update = function update (rawModule) {
  9409. this._rawModule.namespaced = rawModule.namespaced;
  9410. if (rawModule.actions) {
  9411. this._rawModule.actions = rawModule.actions;
  9412. }
  9413. if (rawModule.mutations) {
  9414. this._rawModule.mutations = rawModule.mutations;
  9415. }
  9416. if (rawModule.getters) {
  9417. this._rawModule.getters = rawModule.getters;
  9418. }
  9419. };
  9420. Module.prototype.forEachChild = function forEachChild (fn) {
  9421. forEachValue(this._children, fn);
  9422. };
  9423. Module.prototype.forEachGetter = function forEachGetter (fn) {
  9424. if (this._rawModule.getters) {
  9425. forEachValue(this._rawModule.getters, fn);
  9426. }
  9427. };
  9428. Module.prototype.forEachAction = function forEachAction (fn) {
  9429. if (this._rawModule.actions) {
  9430. forEachValue(this._rawModule.actions, fn);
  9431. }
  9432. };
  9433. Module.prototype.forEachMutation = function forEachMutation (fn) {
  9434. if (this._rawModule.mutations) {
  9435. forEachValue(this._rawModule.mutations, fn);
  9436. }
  9437. };
  9438. Object.defineProperties( Module.prototype, prototypeAccessors );
  9439. var ModuleCollection = function ModuleCollection (rawRootModule) {
  9440. // register root module (Vuex.Store options)
  9441. this.register([], rawRootModule, false);
  9442. };
  9443. ModuleCollection.prototype.get = function get (path) {
  9444. return path.reduce(function (module, key) {
  9445. return module.getChild(key)
  9446. }, this.root)
  9447. };
  9448. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  9449. var module = this.root;
  9450. return path.reduce(function (namespace, key) {
  9451. module = module.getChild(key);
  9452. return namespace + (module.namespaced ? key + '/' : '')
  9453. }, '')
  9454. };
  9455. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  9456. update([], this.root, rawRootModule);
  9457. };
  9458. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  9459. var this$1 = this;
  9460. if ( runtime === void 0 ) runtime = true;
  9461. if ((true)) {
  9462. assertRawModule(path, rawModule);
  9463. }
  9464. var newModule = new Module(rawModule, runtime);
  9465. if (path.length === 0) {
  9466. this.root = newModule;
  9467. } else {
  9468. var parent = this.get(path.slice(0, -1));
  9469. parent.addChild(path[path.length - 1], newModule);
  9470. }
  9471. // register nested modules
  9472. if (rawModule.modules) {
  9473. forEachValue(rawModule.modules, function (rawChildModule, key) {
  9474. this$1.register(path.concat(key), rawChildModule, runtime);
  9475. });
  9476. }
  9477. };
  9478. ModuleCollection.prototype.unregister = function unregister (path) {
  9479. var parent = this.get(path.slice(0, -1));
  9480. var key = path[path.length - 1];
  9481. if (!parent.getChild(key).runtime) { return }
  9482. parent.removeChild(key);
  9483. };
  9484. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  9485. var parent = this.get(path.slice(0, -1));
  9486. var key = path[path.length - 1];
  9487. return parent.hasChild(key)
  9488. };
  9489. function update (path, targetModule, newModule) {
  9490. if ((true)) {
  9491. assertRawModule(path, newModule);
  9492. }
  9493. // update target module
  9494. targetModule.update(newModule);
  9495. // update nested modules
  9496. if (newModule.modules) {
  9497. for (var key in newModule.modules) {
  9498. if (!targetModule.getChild(key)) {
  9499. if ((true)) {
  9500. console.warn(
  9501. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  9502. 'manual reload is needed'
  9503. );
  9504. }
  9505. return
  9506. }
  9507. update(
  9508. path.concat(key),
  9509. targetModule.getChild(key),
  9510. newModule.modules[key]
  9511. );
  9512. }
  9513. }
  9514. }
  9515. var functionAssert = {
  9516. assert: function (value) { return typeof value === 'function'; },
  9517. expected: 'function'
  9518. };
  9519. var objectAssert = {
  9520. assert: function (value) { return typeof value === 'function' ||
  9521. (typeof value === 'object' && typeof value.handler === 'function'); },
  9522. expected: 'function or object with "handler" function'
  9523. };
  9524. var assertTypes = {
  9525. getters: functionAssert,
  9526. mutations: functionAssert,
  9527. actions: objectAssert
  9528. };
  9529. function assertRawModule (path, rawModule) {
  9530. Object.keys(assertTypes).forEach(function (key) {
  9531. if (!rawModule[key]) { return }
  9532. var assertOptions = assertTypes[key];
  9533. forEachValue(rawModule[key], function (value, type) {
  9534. assert(
  9535. assertOptions.assert(value),
  9536. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  9537. );
  9538. });
  9539. });
  9540. }
  9541. function makeAssertionMessage (path, key, type, value, expected) {
  9542. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  9543. if (path.length > 0) {
  9544. buf += " in module \"" + (path.join('.')) + "\"";
  9545. }
  9546. buf += " is " + (JSON.stringify(value)) + ".";
  9547. return buf
  9548. }
  9549. var Vue; // bind on install
  9550. var Store = function Store (options) {
  9551. var this$1 = this;
  9552. if ( options === void 0 ) options = {};
  9553. // Auto install if it is not done yet and `window` has `Vue`.
  9554. // To allow users to avoid auto-installation in some cases,
  9555. // this code should be placed here. See #731
  9556. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  9557. install(window.Vue);
  9558. }
  9559. if ((true)) {
  9560. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  9561. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  9562. assert(this instanceof Store, "store must be called with the new operator.");
  9563. }
  9564. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  9565. var strict = options.strict; if ( strict === void 0 ) strict = false;
  9566. // store internal state
  9567. this._committing = false;
  9568. this._actions = Object.create(null);
  9569. this._actionSubscribers = [];
  9570. this._mutations = Object.create(null);
  9571. this._wrappedGetters = Object.create(null);
  9572. this._modules = new ModuleCollection(options);
  9573. this._modulesNamespaceMap = Object.create(null);
  9574. this._subscribers = [];
  9575. this._watcherVM = new Vue();
  9576. this._makeLocalGettersCache = Object.create(null);
  9577. // bind commit and dispatch to self
  9578. var store = this;
  9579. var ref = this;
  9580. var dispatch = ref.dispatch;
  9581. var commit = ref.commit;
  9582. this.dispatch = function boundDispatch (type, payload) {
  9583. return dispatch.call(store, type, payload)
  9584. };
  9585. this.commit = function boundCommit (type, payload, options) {
  9586. return commit.call(store, type, payload, options)
  9587. };
  9588. // strict mode
  9589. this.strict = strict;
  9590. var state = this._modules.root.state;
  9591. // init root module.
  9592. // this also recursively registers all sub-modules
  9593. // and collects all module getters inside this._wrappedGetters
  9594. installModule(this, state, [], this._modules.root);
  9595. // initialize the store vm, which is responsible for the reactivity
  9596. // (also registers _wrappedGetters as computed properties)
  9597. resetStoreVM(this, state);
  9598. // apply plugins
  9599. plugins.forEach(function (plugin) { return plugin(this$1); });
  9600. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  9601. if (useDevtools) {
  9602. devtoolPlugin(this);
  9603. }
  9604. };
  9605. var prototypeAccessors$1 = { state: { configurable: true } };
  9606. prototypeAccessors$1.state.get = function () {
  9607. return this._vm._data.$$state
  9608. };
  9609. prototypeAccessors$1.state.set = function (v) {
  9610. if ((true)) {
  9611. assert(false, "use store.replaceState() to explicit replace store state.");
  9612. }
  9613. };
  9614. Store.prototype.commit = function commit (_type, _payload, _options) {
  9615. var this$1 = this;
  9616. // check object-style commit
  9617. var ref = unifyObjectStyle(_type, _payload, _options);
  9618. var type = ref.type;
  9619. var payload = ref.payload;
  9620. var options = ref.options;
  9621. var mutation = { type: type, payload: payload };
  9622. var entry = this._mutations[type];
  9623. if (!entry) {
  9624. if ((true)) {
  9625. console.error(("[vuex] unknown mutation type: " + type));
  9626. }
  9627. return
  9628. }
  9629. this._withCommit(function () {
  9630. entry.forEach(function commitIterator (handler) {
  9631. handler(payload);
  9632. });
  9633. });
  9634. this._subscribers
  9635. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9636. .forEach(function (sub) { return sub(mutation, this$1.state); });
  9637. if (
  9638. ( true) &&
  9639. options && options.silent
  9640. ) {
  9641. console.warn(
  9642. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  9643. 'Use the filter functionality in the vue-devtools'
  9644. );
  9645. }
  9646. };
  9647. Store.prototype.dispatch = function dispatch (_type, _payload) {
  9648. var this$1 = this;
  9649. // check object-style dispatch
  9650. var ref = unifyObjectStyle(_type, _payload);
  9651. var type = ref.type;
  9652. var payload = ref.payload;
  9653. var action = { type: type, payload: payload };
  9654. var entry = this._actions[type];
  9655. if (!entry) {
  9656. if ((true)) {
  9657. console.error(("[vuex] unknown action type: " + type));
  9658. }
  9659. return
  9660. }
  9661. try {
  9662. this._actionSubscribers
  9663. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  9664. .filter(function (sub) { return sub.before; })
  9665. .forEach(function (sub) { return sub.before(action, this$1.state); });
  9666. } catch (e) {
  9667. if ((true)) {
  9668. console.warn("[vuex] error in before action subscribers: ");
  9669. console.error(e);
  9670. }
  9671. }
  9672. var result = entry.length > 1
  9673. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  9674. : entry[0](payload);
  9675. return new Promise(function (resolve, reject) {
  9676. result.then(function (res) {
  9677. try {
  9678. this$1._actionSubscribers
  9679. .filter(function (sub) { return sub.after; })
  9680. .forEach(function (sub) { return sub.after(action, this$1.state); });
  9681. } catch (e) {
  9682. if ((true)) {
  9683. console.warn("[vuex] error in after action subscribers: ");
  9684. console.error(e);
  9685. }
  9686. }
  9687. resolve(res);
  9688. }, function (error) {
  9689. try {
  9690. this$1._actionSubscribers
  9691. .filter(function (sub) { return sub.error; })
  9692. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  9693. } catch (e) {
  9694. if ((true)) {
  9695. console.warn("[vuex] error in error action subscribers: ");
  9696. console.error(e);
  9697. }
  9698. }
  9699. reject(error);
  9700. });
  9701. })
  9702. };
  9703. Store.prototype.subscribe = function subscribe (fn, options) {
  9704. return genericSubscribe(fn, this._subscribers, options)
  9705. };
  9706. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  9707. var subs = typeof fn === 'function' ? { before: fn } : fn;
  9708. return genericSubscribe(subs, this._actionSubscribers, options)
  9709. };
  9710. Store.prototype.watch = function watch (getter, cb, options) {
  9711. var this$1 = this;
  9712. if ((true)) {
  9713. assert(typeof getter === 'function', "store.watch only accepts a function.");
  9714. }
  9715. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  9716. };
  9717. Store.prototype.replaceState = function replaceState (state) {
  9718. var this$1 = this;
  9719. this._withCommit(function () {
  9720. this$1._vm._data.$$state = state;
  9721. });
  9722. };
  9723. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  9724. if ( options === void 0 ) options = {};
  9725. if (typeof path === 'string') { path = [path]; }
  9726. if ((true)) {
  9727. assert(Array.isArray(path), "module path must be a string or an Array.");
  9728. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  9729. }
  9730. this._modules.register(path, rawModule);
  9731. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  9732. // reset store to update getters...
  9733. resetStoreVM(this, this.state);
  9734. };
  9735. Store.prototype.unregisterModule = function unregisterModule (path) {
  9736. var this$1 = this;
  9737. if (typeof path === 'string') { path = [path]; }
  9738. if ((true)) {
  9739. assert(Array.isArray(path), "module path must be a string or an Array.");
  9740. }
  9741. this._modules.unregister(path);
  9742. this._withCommit(function () {
  9743. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  9744. Vue.delete(parentState, path[path.length - 1]);
  9745. });
  9746. resetStore(this);
  9747. };
  9748. Store.prototype.hasModule = function hasModule (path) {
  9749. if (typeof path === 'string') { path = [path]; }
  9750. if ((true)) {
  9751. assert(Array.isArray(path), "module path must be a string or an Array.");
  9752. }
  9753. return this._modules.isRegistered(path)
  9754. };
  9755. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  9756. this._modules.update(newOptions);
  9757. resetStore(this, true);
  9758. };
  9759. Store.prototype._withCommit = function _withCommit (fn) {
  9760. var committing = this._committing;
  9761. this._committing = true;
  9762. fn();
  9763. this._committing = committing;
  9764. };
  9765. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  9766. function genericSubscribe (fn, subs, options) {
  9767. if (subs.indexOf(fn) < 0) {
  9768. options && options.prepend
  9769. ? subs.unshift(fn)
  9770. : subs.push(fn);
  9771. }
  9772. return function () {
  9773. var i = subs.indexOf(fn);
  9774. if (i > -1) {
  9775. subs.splice(i, 1);
  9776. }
  9777. }
  9778. }
  9779. function resetStore (store, hot) {
  9780. store._actions = Object.create(null);
  9781. store._mutations = Object.create(null);
  9782. store._wrappedGetters = Object.create(null);
  9783. store._modulesNamespaceMap = Object.create(null);
  9784. var state = store.state;
  9785. // init all modules
  9786. installModule(store, state, [], store._modules.root, true);
  9787. // reset vm
  9788. resetStoreVM(store, state, hot);
  9789. }
  9790. function resetStoreVM (store, state, hot) {
  9791. var oldVm = store._vm;
  9792. // bind store public getters
  9793. store.getters = {};
  9794. // reset local getters cache
  9795. store._makeLocalGettersCache = Object.create(null);
  9796. var wrappedGetters = store._wrappedGetters;
  9797. var computed = {};
  9798. forEachValue(wrappedGetters, function (fn, key) {
  9799. // use computed to leverage its lazy-caching mechanism
  9800. // direct inline function use will lead to closure preserving oldVm.
  9801. // using partial to return function with only arguments preserved in closure environment.
  9802. computed[key] = partial(fn, store);
  9803. Object.defineProperty(store.getters, key, {
  9804. get: function () { return store._vm[key]; },
  9805. enumerable: true // for local getters
  9806. });
  9807. });
  9808. // use a Vue instance to store the state tree
  9809. // suppress warnings just in case the user has added
  9810. // some funky global mixins
  9811. var silent = Vue.config.silent;
  9812. Vue.config.silent = true;
  9813. store._vm = new Vue({
  9814. data: {
  9815. $$state: state
  9816. },
  9817. computed: computed
  9818. });
  9819. Vue.config.silent = silent;
  9820. // enable strict mode for new vm
  9821. if (store.strict) {
  9822. enableStrictMode(store);
  9823. }
  9824. if (oldVm) {
  9825. if (hot) {
  9826. // dispatch changes in all subscribed watchers
  9827. // to force getter re-evaluation for hot reloading.
  9828. store._withCommit(function () {
  9829. oldVm._data.$$state = null;
  9830. });
  9831. }
  9832. Vue.nextTick(function () { return oldVm.$destroy(); });
  9833. }
  9834. }
  9835. function installModule (store, rootState, path, module, hot) {
  9836. var isRoot = !path.length;
  9837. var namespace = store._modules.getNamespace(path);
  9838. // register in namespace map
  9839. if (module.namespaced) {
  9840. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  9841. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  9842. }
  9843. store._modulesNamespaceMap[namespace] = module;
  9844. }
  9845. // set state
  9846. if (!isRoot && !hot) {
  9847. var parentState = getNestedState(rootState, path.slice(0, -1));
  9848. var moduleName = path[path.length - 1];
  9849. store._withCommit(function () {
  9850. if ((true)) {
  9851. if (moduleName in parentState) {
  9852. console.warn(
  9853. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  9854. );
  9855. }
  9856. }
  9857. Vue.set(parentState, moduleName, module.state);
  9858. });
  9859. }
  9860. var local = module.context = makeLocalContext(store, namespace, path);
  9861. module.forEachMutation(function (mutation, key) {
  9862. var namespacedType = namespace + key;
  9863. registerMutation(store, namespacedType, mutation, local);
  9864. });
  9865. module.forEachAction(function (action, key) {
  9866. var type = action.root ? key : namespace + key;
  9867. var handler = action.handler || action;
  9868. registerAction(store, type, handler, local);
  9869. });
  9870. module.forEachGetter(function (getter, key) {
  9871. var namespacedType = namespace + key;
  9872. registerGetter(store, namespacedType, getter, local);
  9873. });
  9874. module.forEachChild(function (child, key) {
  9875. installModule(store, rootState, path.concat(key), child, hot);
  9876. });
  9877. }
  9878. /**
  9879. * make localized dispatch, commit, getters and state
  9880. * if there is no namespace, just use root ones
  9881. */
  9882. function makeLocalContext (store, namespace, path) {
  9883. var noNamespace = namespace === '';
  9884. var local = {
  9885. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  9886. var args = unifyObjectStyle(_type, _payload, _options);
  9887. var payload = args.payload;
  9888. var options = args.options;
  9889. var type = args.type;
  9890. if (!options || !options.root) {
  9891. type = namespace + type;
  9892. if (( true) && !store._actions[type]) {
  9893. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  9894. return
  9895. }
  9896. }
  9897. return store.dispatch(type, payload)
  9898. },
  9899. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  9900. var args = unifyObjectStyle(_type, _payload, _options);
  9901. var payload = args.payload;
  9902. var options = args.options;
  9903. var type = args.type;
  9904. if (!options || !options.root) {
  9905. type = namespace + type;
  9906. if (( true) && !store._mutations[type]) {
  9907. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  9908. return
  9909. }
  9910. }
  9911. store.commit(type, payload, options);
  9912. }
  9913. };
  9914. // getters and state object must be gotten lazily
  9915. // because they will be changed by vm update
  9916. Object.defineProperties(local, {
  9917. getters: {
  9918. get: noNamespace
  9919. ? function () { return store.getters; }
  9920. : function () { return makeLocalGetters(store, namespace); }
  9921. },
  9922. state: {
  9923. get: function () { return getNestedState(store.state, path); }
  9924. }
  9925. });
  9926. return local
  9927. }
  9928. function makeLocalGetters (store, namespace) {
  9929. if (!store._makeLocalGettersCache[namespace]) {
  9930. var gettersProxy = {};
  9931. var splitPos = namespace.length;
  9932. Object.keys(store.getters).forEach(function (type) {
  9933. // skip if the target getter is not match this namespace
  9934. if (type.slice(0, splitPos) !== namespace) { return }
  9935. // extract local getter type
  9936. var localType = type.slice(splitPos);
  9937. // Add a port to the getters proxy.
  9938. // Define as getter property because
  9939. // we do not want to evaluate the getters in this time.
  9940. Object.defineProperty(gettersProxy, localType, {
  9941. get: function () { return store.getters[type]; },
  9942. enumerable: true
  9943. });
  9944. });
  9945. store._makeLocalGettersCache[namespace] = gettersProxy;
  9946. }
  9947. return store._makeLocalGettersCache[namespace]
  9948. }
  9949. function registerMutation (store, type, handler, local) {
  9950. var entry = store._mutations[type] || (store._mutations[type] = []);
  9951. entry.push(function wrappedMutationHandler (payload) {
  9952. handler.call(store, local.state, payload);
  9953. });
  9954. }
  9955. function registerAction (store, type, handler, local) {
  9956. var entry = store._actions[type] || (store._actions[type] = []);
  9957. entry.push(function wrappedActionHandler (payload) {
  9958. var res = handler.call(store, {
  9959. dispatch: local.dispatch,
  9960. commit: local.commit,
  9961. getters: local.getters,
  9962. state: local.state,
  9963. rootGetters: store.getters,
  9964. rootState: store.state
  9965. }, payload);
  9966. if (!isPromise(res)) {
  9967. res = Promise.resolve(res);
  9968. }
  9969. if (store._devtoolHook) {
  9970. return res.catch(function (err) {
  9971. store._devtoolHook.emit('vuex:error', err);
  9972. throw err
  9973. })
  9974. } else {
  9975. return res
  9976. }
  9977. });
  9978. }
  9979. function registerGetter (store, type, rawGetter, local) {
  9980. if (store._wrappedGetters[type]) {
  9981. if ((true)) {
  9982. console.error(("[vuex] duplicate getter key: " + type));
  9983. }
  9984. return
  9985. }
  9986. store._wrappedGetters[type] = function wrappedGetter (store) {
  9987. return rawGetter(
  9988. local.state, // local state
  9989. local.getters, // local getters
  9990. store.state, // root state
  9991. store.getters // root getters
  9992. )
  9993. };
  9994. }
  9995. function enableStrictMode (store) {
  9996. store._vm.$watch(function () { return this._data.$$state }, function () {
  9997. if ((true)) {
  9998. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  9999. }
  10000. }, { deep: true, sync: true });
  10001. }
  10002. function getNestedState (state, path) {
  10003. return path.reduce(function (state, key) { return state[key]; }, state)
  10004. }
  10005. function unifyObjectStyle (type, payload, options) {
  10006. if (isObject(type) && type.type) {
  10007. options = payload;
  10008. payload = type;
  10009. type = type.type;
  10010. }
  10011. if ((true)) {
  10012. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10013. }
  10014. return { type: type, payload: payload, options: options }
  10015. }
  10016. function install (_Vue) {
  10017. if (Vue && _Vue === Vue) {
  10018. if ((true)) {
  10019. console.error(
  10020. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10021. );
  10022. }
  10023. return
  10024. }
  10025. Vue = _Vue;
  10026. applyMixin(Vue);
  10027. }
  10028. /**
  10029. * Reduce the code which written in Vue.js for getting the state.
  10030. * @param {String} [namespace] - Module's namespace
  10031. * @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.
  10032. * @param {Object}
  10033. */
  10034. var mapState = normalizeNamespace(function (namespace, states) {
  10035. var res = {};
  10036. if (( true) && !isValidMap(states)) {
  10037. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  10038. }
  10039. normalizeMap(states).forEach(function (ref) {
  10040. var key = ref.key;
  10041. var val = ref.val;
  10042. res[key] = function mappedState () {
  10043. var state = this.$store.state;
  10044. var getters = this.$store.getters;
  10045. if (namespace) {
  10046. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  10047. if (!module) {
  10048. return
  10049. }
  10050. state = module.context.state;
  10051. getters = module.context.getters;
  10052. }
  10053. return typeof val === 'function'
  10054. ? val.call(this, state, getters)
  10055. : state[val]
  10056. };
  10057. // mark vuex getter for devtools
  10058. res[key].vuex = true;
  10059. });
  10060. return res
  10061. });
  10062. /**
  10063. * Reduce the code which written in Vue.js for committing the mutation
  10064. * @param {String} [namespace] - Module's namespace
  10065. * @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.
  10066. * @return {Object}
  10067. */
  10068. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  10069. var res = {};
  10070. if (( true) && !isValidMap(mutations)) {
  10071. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  10072. }
  10073. normalizeMap(mutations).forEach(function (ref) {
  10074. var key = ref.key;
  10075. var val = ref.val;
  10076. res[key] = function mappedMutation () {
  10077. var args = [], len = arguments.length;
  10078. while ( len-- ) args[ len ] = arguments[ len ];
  10079. // Get the commit method from store
  10080. var commit = this.$store.commit;
  10081. if (namespace) {
  10082. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10083. if (!module) {
  10084. return
  10085. }
  10086. commit = module.context.commit;
  10087. }
  10088. return typeof val === 'function'
  10089. ? val.apply(this, [commit].concat(args))
  10090. : commit.apply(this.$store, [val].concat(args))
  10091. };
  10092. });
  10093. return res
  10094. });
  10095. /**
  10096. * Reduce the code which written in Vue.js for getting the getters
  10097. * @param {String} [namespace] - Module's namespace
  10098. * @param {Object|Array} getters
  10099. * @return {Object}
  10100. */
  10101. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10102. var res = {};
  10103. if (( true) && !isValidMap(getters)) {
  10104. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10105. }
  10106. normalizeMap(getters).forEach(function (ref) {
  10107. var key = ref.key;
  10108. var val = ref.val;
  10109. // The namespace has been mutated by normalizeNamespace
  10110. val = namespace + val;
  10111. res[key] = function mappedGetter () {
  10112. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10113. return
  10114. }
  10115. if (( true) && !(val in this.$store.getters)) {
  10116. console.error(("[vuex] unknown getter: " + val));
  10117. return
  10118. }
  10119. return this.$store.getters[val]
  10120. };
  10121. // mark vuex getter for devtools
  10122. res[key].vuex = true;
  10123. });
  10124. return res
  10125. });
  10126. /**
  10127. * Reduce the code which written in Vue.js for dispatch the action
  10128. * @param {String} [namespace] - Module's namespace
  10129. * @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.
  10130. * @return {Object}
  10131. */
  10132. var mapActions = normalizeNamespace(function (namespace, actions) {
  10133. var res = {};
  10134. if (( true) && !isValidMap(actions)) {
  10135. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10136. }
  10137. normalizeMap(actions).forEach(function (ref) {
  10138. var key = ref.key;
  10139. var val = ref.val;
  10140. res[key] = function mappedAction () {
  10141. var args = [], len = arguments.length;
  10142. while ( len-- ) args[ len ] = arguments[ len ];
  10143. // get dispatch function from store
  10144. var dispatch = this.$store.dispatch;
  10145. if (namespace) {
  10146. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  10147. if (!module) {
  10148. return
  10149. }
  10150. dispatch = module.context.dispatch;
  10151. }
  10152. return typeof val === 'function'
  10153. ? val.apply(this, [dispatch].concat(args))
  10154. : dispatch.apply(this.$store, [val].concat(args))
  10155. };
  10156. });
  10157. return res
  10158. });
  10159. /**
  10160. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  10161. * @param {String} namespace
  10162. * @return {Object}
  10163. */
  10164. var createNamespacedHelpers = function (namespace) { return ({
  10165. mapState: mapState.bind(null, namespace),
  10166. mapGetters: mapGetters.bind(null, namespace),
  10167. mapMutations: mapMutations.bind(null, namespace),
  10168. mapActions: mapActions.bind(null, namespace)
  10169. }); };
  10170. /**
  10171. * Normalize the map
  10172. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  10173. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  10174. * @param {Array|Object} map
  10175. * @return {Object}
  10176. */
  10177. function normalizeMap (map) {
  10178. if (!isValidMap(map)) {
  10179. return []
  10180. }
  10181. return Array.isArray(map)
  10182. ? map.map(function (key) { return ({ key: key, val: key }); })
  10183. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  10184. }
  10185. /**
  10186. * Validate whether given map is valid or not
  10187. * @param {*} map
  10188. * @return {Boolean}
  10189. */
  10190. function isValidMap (map) {
  10191. return Array.isArray(map) || isObject(map)
  10192. }
  10193. /**
  10194. * 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.
  10195. * @param {Function} fn
  10196. * @return {Function}
  10197. */
  10198. function normalizeNamespace (fn) {
  10199. return function (namespace, map) {
  10200. if (typeof namespace !== 'string') {
  10201. map = namespace;
  10202. namespace = '';
  10203. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  10204. namespace += '/';
  10205. }
  10206. return fn(namespace, map)
  10207. }
  10208. }
  10209. /**
  10210. * Search a special module from store by namespace. if module not exist, print error message.
  10211. * @param {Object} store
  10212. * @param {String} helper
  10213. * @param {String} namespace
  10214. * @return {Object}
  10215. */
  10216. function getModuleByNamespace (store, helper, namespace) {
  10217. var module = store._modulesNamespaceMap[namespace];
  10218. if (( true) && !module) {
  10219. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  10220. }
  10221. return module
  10222. }
  10223. var index = {
  10224. Store: Store,
  10225. install: install,
  10226. version: '3.4.0',
  10227. mapState: mapState,
  10228. mapMutations: mapMutations,
  10229. mapGetters: mapGetters,
  10230. mapActions: mapActions,
  10231. createNamespacedHelpers: createNamespacedHelpers
  10232. };
  10233. /* harmony default export */ __webpack_exports__["default"] = (index);
  10234. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  10235. /***/ }),
  10236. /* 36 */
  10237. /*!******************************************!*\
  10238. !*** D:/六牛项目/school/store/model/user.js ***!
  10239. \******************************************/
  10240. /*! no static exports found */
  10241. /***/ (function(module, exports, __webpack_require__) {
  10242. "use strict";
  10243. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var state = {
  10244. userInfo: {}, //用户信息
  10245. orderInfo: {
  10246. complete_count: 0, //完成
  10247. received_count: 0, //待收货
  10248. unshipped_count: 0, //待发货
  10249. order_count: 0, //订单总数
  10250. unpaid_count: 0 //待付款
  10251. }, //订单信息
  10252. hasLogin: false //是否登录
  10253. };
  10254. var mutations = {
  10255. // 登录
  10256. login: function login(state) {
  10257. state.hasLogin = true;
  10258. },
  10259. // 退出登录
  10260. logout: function logout(state, provider) {
  10261. state.hasLogin = false;
  10262. // 清空基础信息
  10263. state.userInfo = {};
  10264. state.orderInfo = {
  10265. complete_count: 0, //完成
  10266. received_count: 0, //待收货
  10267. unshipped_count: 0, //待发货
  10268. order_count: 0, //订单总数
  10269. unpaid_count: 0 //待付款
  10270. };
  10271. // 清除缓存用户信息
  10272. uni.removeStorage({
  10273. key: 'userInfo' });
  10274. // 清除缓存token
  10275. uni.removeStorage({
  10276. key: 'token' });
  10277. },
  10278. // 保存用户信息
  10279. setUserInfo: function setUserInfo(state, provider) {
  10280. state.userInfo = provider;
  10281. uni.setStorage({ //缓存用户登陆状态
  10282. key: 'userInfo',
  10283. data: provider });
  10284. },
  10285. // 保存订单信息
  10286. setOrderInfo: function setOrderInfo(state, provider) {
  10287. state.orderInfo = provider;
  10288. } };
  10289. var getters = {};var _default =
  10290. {
  10291. namespaced: true,
  10292. state: state,
  10293. mutations: mutations,
  10294. getters: getters };exports.default = _default;
  10295. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10296. /***/ }),
  10297. /* 37 */,
  10298. /* 38 */,
  10299. /* 39 */,
  10300. /* 40 */,
  10301. /* 41 */,
  10302. /* 42 */
  10303. /*!**********************************************************************************************************!*\
  10304. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  10305. \**********************************************************************************************************/
  10306. /*! exports provided: default */
  10307. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10308. "use strict";
  10309. __webpack_require__.r(__webpack_exports__);
  10310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  10311. /* globals __VUE_SSR_CONTEXT__ */
  10312. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  10313. // This module is a runtime utility for cleaner component module output and will
  10314. // be included in the final webpack user bundle.
  10315. function normalizeComponent (
  10316. scriptExports,
  10317. render,
  10318. staticRenderFns,
  10319. functionalTemplate,
  10320. injectStyles,
  10321. scopeId,
  10322. moduleIdentifier, /* server only */
  10323. shadowMode, /* vue-cli only */
  10324. components, // fixed by xxxxxx auto components
  10325. renderjs // fixed by xxxxxx renderjs
  10326. ) {
  10327. // Vue.extend constructor export interop
  10328. var options = typeof scriptExports === 'function'
  10329. ? scriptExports.options
  10330. : scriptExports
  10331. // fixed by xxxxxx auto components
  10332. if (components) {
  10333. if (!options.components) {
  10334. options.components = {}
  10335. }
  10336. var hasOwn = Object.prototype.hasOwnProperty
  10337. for (var name in components) {
  10338. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  10339. options.components[name] = components[name]
  10340. }
  10341. }
  10342. }
  10343. // fixed by xxxxxx renderjs
  10344. if (renderjs) {
  10345. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  10346. this[renderjs.__module] = this
  10347. });
  10348. (options.mixins || (options.mixins = [])).push(renderjs)
  10349. }
  10350. // render functions
  10351. if (render) {
  10352. options.render = render
  10353. options.staticRenderFns = staticRenderFns
  10354. options._compiled = true
  10355. }
  10356. // functional template
  10357. if (functionalTemplate) {
  10358. options.functional = true
  10359. }
  10360. // scopedId
  10361. if (scopeId) {
  10362. options._scopeId = 'data-v-' + scopeId
  10363. }
  10364. var hook
  10365. if (moduleIdentifier) { // server build
  10366. hook = function (context) {
  10367. // 2.3 injection
  10368. context =
  10369. context || // cached call
  10370. (this.$vnode && this.$vnode.ssrContext) || // stateful
  10371. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  10372. // 2.2 with runInNewContext: true
  10373. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  10374. context = __VUE_SSR_CONTEXT__
  10375. }
  10376. // inject component styles
  10377. if (injectStyles) {
  10378. injectStyles.call(this, context)
  10379. }
  10380. // register component module identifier for async chunk inferrence
  10381. if (context && context._registeredComponents) {
  10382. context._registeredComponents.add(moduleIdentifier)
  10383. }
  10384. }
  10385. // used by ssr in case component is cached and beforeCreate
  10386. // never gets called
  10387. options._ssrRegister = hook
  10388. } else if (injectStyles) {
  10389. hook = shadowMode
  10390. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  10391. : injectStyles
  10392. }
  10393. if (hook) {
  10394. if (options.functional) {
  10395. // for template-only hot-reload because in that case the render fn doesn't
  10396. // go through the normalizer
  10397. options._injectStyles = hook
  10398. // register for functioal component in vue file
  10399. var originalRender = options.render
  10400. options.render = function renderWithStyleInjection (h, context) {
  10401. hook.call(context)
  10402. return originalRender(h, context)
  10403. }
  10404. } else {
  10405. // inject component registration as beforeCreate hook
  10406. var existing = options.beforeCreate
  10407. options.beforeCreate = existing
  10408. ? [].concat(existing, hook)
  10409. : [hook]
  10410. }
  10411. }
  10412. return {
  10413. exports: scriptExports,
  10414. options: options
  10415. }
  10416. }
  10417. /***/ }),
  10418. /* 43 */,
  10419. /* 44 */,
  10420. /* 45 */,
  10421. /* 46 */,
  10422. /* 47 */,
  10423. /* 48 */,
  10424. /* 49 */
  10425. /*!***********************************!*\
  10426. !*** D:/六牛项目/school/api/index.js ***!
  10427. \***********************************/
  10428. /*! no static exports found */
  10429. /***/ (function(module, exports, __webpack_require__) {
  10430. "use strict";
  10431. Object.defineProperty(exports, "__esModule", { value: true });exports.banner = banner;exports.category = category;exports.details = details;var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 50));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10432. //获取首页信息
  10433. function banner(data) {
  10434. return (0, _request.default)({
  10435. url: '/api/index',
  10436. method: 'get',
  10437. data: data });
  10438. }
  10439. // 获取文章列表
  10440. function category(data, cid) {
  10441. return (0, _request.default)({
  10442. url: '/api/article/list/' + cid,
  10443. method: 'get',
  10444. data: data });
  10445. }
  10446. // 获取文章详情
  10447. function details(data, id) {
  10448. return (0, _request.default)({
  10449. url: '/api/article/details/' + id,
  10450. method: 'get',
  10451. data: data });
  10452. }
  10453. /***/ }),
  10454. /* 50 */
  10455. /*!***************************************!*\
  10456. !*** D:/六牛项目/school/utils/request.js ***!
  10457. \***************************************/
  10458. /*! no static exports found */
  10459. /***/ (function(module, exports, __webpack_require__) {
  10460. "use strict";
  10461. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = exports.upFilse = void 0;var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 51));
  10462. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 34));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10463. // 请求完成后拦截
  10464. _newRequest.default.interceptors.response(
  10465. function (response) {
  10466. try {
  10467. var res = response.data;
  10468. // 解析字符串为数字
  10469. if (res.status !== 200) {
  10470. console.log(res.status);
  10471. if (res.status == 410000) {
  10472. // 调用退出登录方法清空用户信息
  10473. _store.default.commit('user/logout');
  10474. // 判断是否开启强制登录
  10475. uni.showModal({
  10476. title: "登陆",
  10477. content: '您未登录!是否马上登录?',
  10478. success: function success(e) {
  10479. // 判断是否点击确认按钮
  10480. if (e.confirm) {
  10481. // 保存当前页面地址
  10482. saveUrl();
  10483. // 跳转页面
  10484. interceptor();
  10485. }
  10486. } });
  10487. } else {
  10488. if (res.msg != '系统出现异常') {
  10489. uni.showToast({
  10490. title: res.msg,
  10491. duration: 1500,
  10492. mask: false,
  10493. icon: 'none' });
  10494. }
  10495. }
  10496. return Promise.reject(res);
  10497. } else {
  10498. return res;
  10499. }
  10500. } catch (e) {
  10501. console.log(e);
  10502. }
  10503. },
  10504. function (error) {
  10505. uni.showToast({
  10506. title: "加载错误请重试",
  10507. duration: 1500,
  10508. mask: false,
  10509. icon: 'none' });
  10510. return Promise.reject(error);
  10511. });
  10512. // 请求前拦截器
  10513. _newRequest.default.interceptors.request(
  10514. function (config) {
  10515. var token = uni.getStorageSync('token') || '';
  10516. // console.log(config);
  10517. if (!config.header) {
  10518. config.header = {
  10519. "Authori-zation": 'Bearer ' + token };
  10520. } else {
  10521. // 添加key请求头
  10522. config.header["Authori-zation"] = 'Bearer ' + token;
  10523. }
  10524. return config;
  10525. },
  10526. function (error) {
  10527. // 错误处理
  10528. console.log(error);
  10529. return Promise.reject(error);
  10530. });
  10531. var upFilse = _newRequest.default.upFilse;exports.upFilse = upFilse;var _default =
  10532. _newRequest.default.open;exports.default = _default;
  10533. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10534. /***/ }),
  10535. /* 51 */
  10536. /*!******************************************!*\
  10537. !*** D:/六牛项目/school/utils/newRequest.js ***!
  10538. \******************************************/
  10539. /*! no static exports found */
  10540. /***/ (function(module, exports, __webpack_require__) {
  10541. "use strict";
  10542. /* 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 */ 13));var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 34));
  10543. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 50));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);});};}
  10544. var service = {
  10545. baseURL: _store.default.state.baseURL, // 请求头
  10546. header: {
  10547. 'Content-Type': "application/x-www-form-urlencoded" },
  10548. // 请求拦截器
  10549. interceptors: {
  10550. // 安装请求前拦截
  10551. request: function request(success, iserror) {
  10552. service.request.success = success;
  10553. service.request.error = iserror;
  10554. },
  10555. // 安装请求完成后拦截
  10556. response: function response(success, iserror) {
  10557. service.response.success = success;
  10558. service.response.error = iserror;
  10559. } },
  10560. // 请求前拦截
  10561. request: {
  10562. // 回调成功执行方法
  10563. success: function success(e) {
  10564. return e;
  10565. },
  10566. // 回调失败
  10567. error: function error(e) {
  10568. return e;
  10569. } },
  10570. // 请求完成后拦截
  10571. response: {
  10572. // 回调成功执行方法
  10573. success: function success(e) {
  10574. return e;
  10575. },
  10576. // 回调失败
  10577. error: function error(e) {
  10578. return e;
  10579. } },
  10580. // 开始请求
  10581. 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 (
  10582. new Promise(function (resolve, reject) {
  10583. var requestData = ''; //保存处理完成后请求数据
  10584. var url = ''; //保存链接地址
  10585. //console.log(data);
  10586. // 请求前数据处理
  10587. requestData = service.request.success(data);
  10588. url = service.baseURL + requestData.url;
  10589. // 数据复制用于请求
  10590. uni.request({
  10591. url: url,
  10592. method: requestData.method || 'GET',
  10593. data: requestData.data,
  10594. header: data.header || service.header,
  10595. success: function success(res) {
  10596. if (res.statusCode == 200) {
  10597. try {
  10598. resolve(service.response.success(res));
  10599. } catch (e) {
  10600. service.response.error(e);
  10601. }
  10602. }
  10603. },
  10604. // 请求失败数据处理
  10605. fail: function fail(err) {
  10606. service.response.error(err);
  10607. } });
  10608. }));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;}(),
  10609. // 上传文件
  10610. 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 (
  10611. new Promise(function (resolve, reject) {
  10612. var requestData = ''; //保存处理完成后请求数据
  10613. var url = ''; //保存请求地址
  10614. try {
  10615. // 请求前数据处理
  10616. requestData = service.request.success(data);
  10617. } catch (e) {
  10618. // 请求报错拦截
  10619. service.request.error(e);
  10620. }
  10621. url = service.baseURL + requestData.url;
  10622. var config = {
  10623. // 上传图片的API
  10624. upload_img_url: url };
  10625. var Uploader = {
  10626. // 选择图片
  10627. choose: function choose(num) {
  10628. return new Promise(function (resolve, reject) {
  10629. uni.chooseImage({
  10630. count: num,
  10631. success: function success(res) {
  10632. console.log(res);
  10633. // 缓存文件路径
  10634. resolve(res.tempFilePaths);
  10635. },
  10636. fail: function fail(err) {
  10637. console.log(err);
  10638. reject(err);
  10639. } });
  10640. });
  10641. },
  10642. // 上传图片
  10643. upload_one: function upload_one(path) {
  10644. return new Promise(function (resolve, reject) {
  10645. uni.showLoading({
  10646. title: '上传中' });
  10647. console.log(path);
  10648. uni.uploadFile({
  10649. url: config.upload_img_url, //仅为示例,非真实的接口地址
  10650. filePath: path,
  10651. name: 'file',
  10652. header: {
  10653. "Authori-zation": 'Bearer ' + uni.getStorageSync('token') },
  10654. success: function success(uploadFileRes) {
  10655. if ("string" === typeof uploadFileRes.data) {
  10656. resolve(JSON.parse(uploadFileRes.data).data);
  10657. } else {
  10658. resolve(uploadFileRes.data.data);
  10659. }
  10660. },
  10661. complete: function complete() {
  10662. uni.hideLoading();
  10663. } });
  10664. });
  10665. },
  10666. // 上传多个图片
  10667. upload: function upload(path_arr) {var _this = this;
  10668. var num = path_arr.length;
  10669. 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:
  10670. img_urls = [];
  10671. i = 0;case 2:if (!(i < num)) {_context2.next = 10;break;}_context2.next = 5;return (
  10672. _this.upload_one(path_arr[i]));case 5:img_url = _context2.sent;
  10673. img_urls.push(img_url);case 7:i++;_context2.next = 2;break;case 10:
  10674. ;
  10675. resolve(img_urls);case 12:case "end":return _context2.stop();}}}, _callee2);}));return function (_x3, _x4) {return _ref.apply(this, arguments);};}());
  10676. },
  10677. // 触发上传图片事件
  10678. choose_and_upload: function choose_and_upload(num) {var _this2 = this;
  10679. 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 (
  10680. _this2.choose(num));case 2:path_arr = _context3.sent;
  10681. console.log(path_arr);
  10682. // 上传图片
  10683. _context3.next = 6;return _this2.upload(path_arr).then(function (e) {
  10684. resolve(e);
  10685. }).catch(function (e) {
  10686. reject(e);
  10687. });case 6:case "end":return _context3.stop();}}}, _callee3);}));return function (_x5, _x6) {return _ref2.apply(this, arguments);};}());
  10688. } };
  10689. Uploader.choose_and_upload(1).then(function (e) {
  10690. resolve(e);
  10691. }).catch(function (e) {
  10692. console.log(e);
  10693. });
  10694. }));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 =
  10695. service;exports.default = _default;
  10696. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10697. /***/ })
  10698. ]]);
  10699. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map