vendor.js 361 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  10. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. 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 new Promise(function (resolve, reject) {
  247. res.then(function (res) {
  248. if (res[0]) {
  249. reject(res[0]);
  250. } else {
  251. resolve(res[1]);
  252. }
  253. });
  254. });
  255. } };
  256. var SYNC_API_RE =
  257. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  258. var CONTEXT_API_RE = /^create|Manager$/;
  259. // Context例外情况
  260. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  261. // 同步例外情况
  262. var ASYNC_API = ['createBLEConnection'];
  263. var CALLBACK_API_RE = /^on|^off/;
  264. function isContextApi(name) {
  265. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  266. }
  267. function isSyncApi(name) {
  268. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  269. }
  270. function isCallbackApi(name) {
  271. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  272. }
  273. function handlePromise(promise) {
  274. return promise.then(function (data) {
  275. return [null, data];
  276. }).
  277. catch(function (err) {return [err];});
  278. }
  279. function shouldPromise(name) {
  280. if (
  281. isContextApi(name) ||
  282. isSyncApi(name) ||
  283. isCallbackApi(name))
  284. {
  285. return false;
  286. }
  287. return true;
  288. }
  289. /* eslint-disable no-extend-native */
  290. if (!Promise.prototype.finally) {
  291. Promise.prototype.finally = function (callback) {
  292. var promise = this.constructor;
  293. return this.then(
  294. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  295. function (reason) {return promise.resolve(callback()).then(function () {
  296. throw reason;
  297. });});
  298. };
  299. }
  300. function promisify(name, api) {
  301. if (!shouldPromise(name)) {
  302. return api;
  303. }
  304. 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];}
  305. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  306. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  307. }
  308. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  309. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  310. success: resolve,
  311. fail: reject })].concat(
  312. params));
  313. })));
  314. };
  315. }
  316. var EPS = 1e-4;
  317. var BASE_DEVICE_WIDTH = 750;
  318. var isIOS = false;
  319. var deviceWidth = 0;
  320. var deviceDPR = 0;
  321. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  322. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  323. deviceWidth = windowWidth;
  324. deviceDPR = pixelRatio;
  325. isIOS = platform === 'ios';
  326. }
  327. function upx2px(number, newDeviceWidth) {
  328. if (deviceWidth === 0) {
  329. checkDeviceWidth();
  330. }
  331. number = Number(number);
  332. if (number === 0) {
  333. return 0;
  334. }
  335. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  336. if (result < 0) {
  337. result = -result;
  338. }
  339. result = Math.floor(result + EPS);
  340. if (result === 0) {
  341. if (deviceDPR === 1 || !isIOS) {
  342. result = 1;
  343. } else {
  344. result = 0.5;
  345. }
  346. }
  347. return number < 0 ? -result : result;
  348. }
  349. function getLocale() {
  350. // 优先使用 $locale
  351. var app = getApp({
  352. allowDefault: true });
  353. if (app && app.$vm) {
  354. return app.$vm.$locale;
  355. }
  356. return wx.getSystemInfoSync().language || 'zh-Hans';
  357. }
  358. function setLocale(locale) {
  359. var app = getApp();
  360. if (!app) {
  361. return false;
  362. }
  363. var oldLocale = app.$vm.$locale;
  364. if (oldLocale !== locale) {
  365. app.$vm.$locale = locale;
  366. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  367. locale: locale });});
  368. return true;
  369. }
  370. return false;
  371. }
  372. var onLocaleChangeCallbacks = [];
  373. function onLocaleChange(fn) {
  374. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  375. onLocaleChangeCallbacks.push(fn);
  376. }
  377. }
  378. var interceptors = {
  379. promiseInterceptor: promiseInterceptor };
  380. var baseApi = /*#__PURE__*/Object.freeze({
  381. __proto__: null,
  382. upx2px: upx2px,
  383. getLocale: getLocale,
  384. setLocale: setLocale,
  385. onLocaleChange: onLocaleChange,
  386. addInterceptor: addInterceptor,
  387. removeInterceptor: removeInterceptor,
  388. interceptors: interceptors });
  389. function findExistsPageIndex(url) {
  390. var pages = getCurrentPages();
  391. var len = pages.length;
  392. while (len--) {
  393. var page = pages[len];
  394. if (page.$page && page.$page.fullPath === url) {
  395. return len;
  396. }
  397. }
  398. return -1;
  399. }
  400. var redirectTo = {
  401. name: function name(fromArgs) {
  402. if (fromArgs.exists === 'back' && fromArgs.delta) {
  403. return 'navigateBack';
  404. }
  405. return 'redirectTo';
  406. },
  407. args: function args(fromArgs) {
  408. if (fromArgs.exists === 'back' && fromArgs.url) {
  409. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  410. if (existsPageIndex !== -1) {
  411. var delta = getCurrentPages().length - 1 - existsPageIndex;
  412. if (delta > 0) {
  413. fromArgs.delta = delta;
  414. }
  415. }
  416. }
  417. } };
  418. var previewImage = {
  419. args: function args(fromArgs) {
  420. var currentIndex = parseInt(fromArgs.current);
  421. if (isNaN(currentIndex)) {
  422. return;
  423. }
  424. var urls = fromArgs.urls;
  425. if (!Array.isArray(urls)) {
  426. return;
  427. }
  428. var len = urls.length;
  429. if (!len) {
  430. return;
  431. }
  432. if (currentIndex < 0) {
  433. currentIndex = 0;
  434. } else if (currentIndex >= len) {
  435. currentIndex = len - 1;
  436. }
  437. if (currentIndex > 0) {
  438. fromArgs.current = urls[currentIndex];
  439. fromArgs.urls = urls.filter(
  440. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  441. } else {
  442. fromArgs.current = urls[0];
  443. }
  444. return {
  445. indicator: false,
  446. loop: false };
  447. } };
  448. var UUID_KEY = '__DC_STAT_UUID';
  449. var deviceId;
  450. function addUuid(result) {
  451. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  452. if (!deviceId) {
  453. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  454. wx.setStorage({
  455. key: UUID_KEY,
  456. data: deviceId });
  457. }
  458. result.deviceId = deviceId;
  459. }
  460. function addSafeAreaInsets(result) {
  461. if (result.safeArea) {
  462. var safeArea = result.safeArea;
  463. result.safeAreaInsets = {
  464. top: safeArea.top,
  465. left: safeArea.left,
  466. right: result.windowWidth - safeArea.right,
  467. bottom: result.windowHeight - safeArea.bottom };
  468. }
  469. }
  470. var getSystemInfo = {
  471. returnValue: function returnValue(result) {
  472. addUuid(result);
  473. addSafeAreaInsets(result);
  474. } };
  475. // import navigateTo from 'uni-helpers/navigate-to'
  476. var protocols = {
  477. redirectTo: redirectTo,
  478. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  479. previewImage: previewImage,
  480. getSystemInfo: getSystemInfo,
  481. getSystemInfoSync: getSystemInfo };
  482. var todos = [
  483. 'vibrate',
  484. 'preloadPage',
  485. 'unPreloadPage',
  486. 'loadSubPackage'];
  487. var canIUses = [];
  488. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  489. function processCallback(methodName, method, returnValue) {
  490. return function (res) {
  491. return method(processReturnValue(methodName, res, returnValue));
  492. };
  493. }
  494. 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;
  495. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  496. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  497. if (isFn(argsOption)) {
  498. argsOption = argsOption(fromArgs, toArgs) || {};
  499. }
  500. for (var key in fromArgs) {
  501. if (hasOwn(argsOption, key)) {
  502. var keyOption = argsOption[key];
  503. if (isFn(keyOption)) {
  504. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  505. }
  506. if (!keyOption) {// 不支持的参数
  507. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  508. } else if (isStr(keyOption)) {// 重写参数 key
  509. toArgs[keyOption] = fromArgs[key];
  510. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  511. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  512. }
  513. } else if (CALLBACKS.indexOf(key) !== -1) {
  514. if (isFn(fromArgs[key])) {
  515. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  516. }
  517. } else {
  518. if (!keepFromArgs) {
  519. toArgs[key] = fromArgs[key];
  520. }
  521. }
  522. }
  523. return toArgs;
  524. } else if (isFn(fromArgs)) {
  525. fromArgs = processCallback(methodName, fromArgs, returnValue);
  526. }
  527. return fromArgs;
  528. }
  529. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  530. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  531. res = protocols.returnValue(methodName, res);
  532. }
  533. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  534. }
  535. function wrapper(methodName, method) {
  536. if (hasOwn(protocols, methodName)) {
  537. var protocol = protocols[methodName];
  538. if (!protocol) {// 暂不支持的 api
  539. return function () {
  540. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  541. };
  542. }
  543. return function (arg1, arg2) {// 目前 api 最多两个参数
  544. var options = protocol;
  545. if (isFn(protocol)) {
  546. options = protocol(arg1);
  547. }
  548. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  549. var args = [arg1];
  550. if (typeof arg2 !== 'undefined') {
  551. args.push(arg2);
  552. }
  553. if (isFn(options.name)) {
  554. methodName = options.name(arg1);
  555. } else if (isStr(options.name)) {
  556. methodName = options.name;
  557. }
  558. var returnValue = wx[methodName].apply(wx, args);
  559. if (isSyncApi(methodName)) {// 同步 api
  560. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  561. }
  562. return returnValue;
  563. };
  564. }
  565. return method;
  566. }
  567. var todoApis = Object.create(null);
  568. var TODOS = [
  569. 'onTabBarMidButtonTap',
  570. 'subscribePush',
  571. 'unsubscribePush',
  572. 'onPush',
  573. 'offPush',
  574. 'share'];
  575. function createTodoApi(name) {
  576. return function todoApi(_ref)
  577. {var fail = _ref.fail,complete = _ref.complete;
  578. var res = {
  579. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  580. isFn(fail) && fail(res);
  581. isFn(complete) && complete(res);
  582. };
  583. }
  584. TODOS.forEach(function (name) {
  585. todoApis[name] = createTodoApi(name);
  586. });
  587. var providers = {
  588. oauth: ['weixin'],
  589. share: ['weixin'],
  590. payment: ['wxpay'],
  591. push: ['weixin'] };
  592. function getProvider(_ref2)
  593. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  594. var res = false;
  595. if (providers[service]) {
  596. res = {
  597. errMsg: 'getProvider:ok',
  598. service: service,
  599. provider: providers[service] };
  600. isFn(success) && success(res);
  601. } else {
  602. res = {
  603. errMsg: 'getProvider:fail service not found' };
  604. isFn(fail) && fail(res);
  605. }
  606. isFn(complete) && complete(res);
  607. }
  608. var extraApi = /*#__PURE__*/Object.freeze({
  609. __proto__: null,
  610. getProvider: getProvider });
  611. var getEmitter = function () {
  612. var Emitter;
  613. return function getUniEmitter() {
  614. if (!Emitter) {
  615. Emitter = new _vue.default();
  616. }
  617. return Emitter;
  618. };
  619. }();
  620. function apply(ctx, method, args) {
  621. return ctx[method].apply(ctx, args);
  622. }
  623. function $on() {
  624. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  625. }
  626. function $off() {
  627. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  628. }
  629. function $once() {
  630. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  631. }
  632. function $emit() {
  633. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  634. }
  635. var eventApi = /*#__PURE__*/Object.freeze({
  636. __proto__: null,
  637. $on: $on,
  638. $off: $off,
  639. $once: $once,
  640. $emit: $emit });
  641. var api = /*#__PURE__*/Object.freeze({
  642. __proto__: null });
  643. var MPPage = Page;
  644. var MPComponent = Component;
  645. var customizeRE = /:/g;
  646. var customize = cached(function (str) {
  647. return camelize(str.replace(customizeRE, '-'));
  648. });
  649. function initTriggerEvent(mpInstance) {
  650. {
  651. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  652. return;
  653. }
  654. }
  655. var oldTriggerEvent = mpInstance.triggerEvent;
  656. 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];}
  657. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  658. };
  659. }
  660. function initHook(name, options, isComponent) {
  661. var oldHook = options[name];
  662. if (!oldHook) {
  663. options[name] = function () {
  664. initTriggerEvent(this);
  665. };
  666. } else {
  667. options[name] = function () {
  668. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  669. return oldHook.apply(this, args);
  670. };
  671. }
  672. }
  673. if (!MPPage.__$wrappered) {
  674. MPPage.__$wrappered = true;
  675. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  676. initHook('onLoad', options);
  677. return MPPage(options);
  678. };
  679. Page.after = MPPage.after;
  680. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  681. initHook('created', options);
  682. return MPComponent(options);
  683. };
  684. }
  685. var PAGE_EVENT_HOOKS = [
  686. 'onPullDownRefresh',
  687. 'onReachBottom',
  688. 'onAddToFavorites',
  689. 'onShareTimeline',
  690. 'onShareAppMessage',
  691. 'onPageScroll',
  692. 'onResize',
  693. 'onTabItemTap'];
  694. function initMocks(vm, mocks) {
  695. var mpInstance = vm.$mp[vm.mpType];
  696. mocks.forEach(function (mock) {
  697. if (hasOwn(mpInstance, mock)) {
  698. vm[mock] = mpInstance[mock];
  699. }
  700. });
  701. }
  702. function hasHook(hook, vueOptions) {
  703. if (!vueOptions) {
  704. return true;
  705. }
  706. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  707. return true;
  708. }
  709. vueOptions = vueOptions.default || vueOptions;
  710. if (isFn(vueOptions)) {
  711. if (isFn(vueOptions.extendOptions[hook])) {
  712. return true;
  713. }
  714. if (vueOptions.super &&
  715. vueOptions.super.options &&
  716. Array.isArray(vueOptions.super.options[hook])) {
  717. return true;
  718. }
  719. return false;
  720. }
  721. if (isFn(vueOptions[hook])) {
  722. return true;
  723. }
  724. var mixins = vueOptions.mixins;
  725. if (Array.isArray(mixins)) {
  726. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  727. }
  728. }
  729. function initHooks(mpOptions, hooks, vueOptions) {
  730. hooks.forEach(function (hook) {
  731. if (hasHook(hook, vueOptions)) {
  732. mpOptions[hook] = function (args) {
  733. return this.$vm && this.$vm.__call_hook(hook, args);
  734. };
  735. }
  736. });
  737. }
  738. function initVueComponent(Vue, vueOptions) {
  739. vueOptions = vueOptions.default || vueOptions;
  740. var VueComponent;
  741. if (isFn(vueOptions)) {
  742. VueComponent = vueOptions;
  743. } else {
  744. VueComponent = Vue.extend(vueOptions);
  745. }
  746. vueOptions = VueComponent.options;
  747. return [VueComponent, vueOptions];
  748. }
  749. function initSlots(vm, vueSlots) {
  750. if (Array.isArray(vueSlots) && vueSlots.length) {
  751. var $slots = Object.create(null);
  752. vueSlots.forEach(function (slotName) {
  753. $slots[slotName] = true;
  754. });
  755. vm.$scopedSlots = vm.$slots = $slots;
  756. }
  757. }
  758. function initVueIds(vueIds, mpInstance) {
  759. vueIds = (vueIds || '').split(',');
  760. var len = vueIds.length;
  761. if (len === 1) {
  762. mpInstance._$vueId = vueIds[0];
  763. } else if (len === 2) {
  764. mpInstance._$vueId = vueIds[0];
  765. mpInstance._$vuePid = vueIds[1];
  766. }
  767. }
  768. function initData(vueOptions, context) {
  769. var data = vueOptions.data || {};
  770. var methods = vueOptions.methods || {};
  771. if (typeof data === 'function') {
  772. try {
  773. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  774. } catch (e) {
  775. if (Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  776. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  777. }
  778. }
  779. } else {
  780. try {
  781. // 对 data 格式化
  782. data = JSON.parse(JSON.stringify(data));
  783. } catch (e) {}
  784. }
  785. if (!isPlainObject(data)) {
  786. data = {};
  787. }
  788. Object.keys(methods).forEach(function (methodName) {
  789. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  790. data[methodName] = methods[methodName];
  791. }
  792. });
  793. return data;
  794. }
  795. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  796. function createObserver(name) {
  797. return function observer(newVal, oldVal) {
  798. if (this.$vm) {
  799. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  800. }
  801. };
  802. }
  803. function initBehaviors(vueOptions, initBehavior) {
  804. var vueBehaviors = vueOptions.behaviors;
  805. var vueExtends = vueOptions.extends;
  806. var vueMixins = vueOptions.mixins;
  807. var vueProps = vueOptions.props;
  808. if (!vueProps) {
  809. vueOptions.props = vueProps = [];
  810. }
  811. var behaviors = [];
  812. if (Array.isArray(vueBehaviors)) {
  813. vueBehaviors.forEach(function (behavior) {
  814. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  815. if (behavior === 'uni://form-field') {
  816. if (Array.isArray(vueProps)) {
  817. vueProps.push('name');
  818. vueProps.push('value');
  819. } else {
  820. vueProps.name = {
  821. type: String,
  822. default: '' };
  823. vueProps.value = {
  824. type: [String, Number, Boolean, Array, Object, Date],
  825. default: '' };
  826. }
  827. }
  828. });
  829. }
  830. if (isPlainObject(vueExtends) && vueExtends.props) {
  831. behaviors.push(
  832. initBehavior({
  833. properties: initProperties(vueExtends.props, true) }));
  834. }
  835. if (Array.isArray(vueMixins)) {
  836. vueMixins.forEach(function (vueMixin) {
  837. if (isPlainObject(vueMixin) && vueMixin.props) {
  838. behaviors.push(
  839. initBehavior({
  840. properties: initProperties(vueMixin.props, true) }));
  841. }
  842. });
  843. }
  844. return behaviors;
  845. }
  846. function parsePropType(key, type, defaultValue, file) {
  847. // [String]=>String
  848. if (Array.isArray(type) && type.length === 1) {
  849. return type[0];
  850. }
  851. return type;
  852. }
  853. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  854. var properties = {};
  855. if (!isBehavior) {
  856. properties.vueId = {
  857. type: String,
  858. value: '' };
  859. // 用于字节跳动小程序模拟抽象节点
  860. properties.generic = {
  861. type: Object,
  862. value: null };
  863. // scopedSlotsCompiler auto
  864. properties.scopedSlotsCompiler = {
  865. type: String,
  866. value: '' };
  867. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  868. type: null,
  869. value: [],
  870. observer: function observer(newVal, oldVal) {
  871. var $slots = Object.create(null);
  872. newVal.forEach(function (slotName) {
  873. $slots[slotName] = true;
  874. });
  875. this.setData({
  876. $slots: $slots });
  877. } };
  878. }
  879. if (Array.isArray(props)) {// ['title']
  880. props.forEach(function (key) {
  881. properties[key] = {
  882. type: null,
  883. observer: createObserver(key) };
  884. });
  885. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  886. Object.keys(props).forEach(function (key) {
  887. var opts = props[key];
  888. if (isPlainObject(opts)) {// title:{type:String,default:''}
  889. var value = opts.default;
  890. if (isFn(value)) {
  891. value = value();
  892. }
  893. opts.type = parsePropType(key, opts.type);
  894. properties[key] = {
  895. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  896. value: value,
  897. observer: createObserver(key) };
  898. } else {// content:String
  899. var type = parsePropType(key, opts);
  900. properties[key] = {
  901. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  902. observer: createObserver(key) };
  903. }
  904. });
  905. }
  906. return properties;
  907. }
  908. function wrapper$1(event) {
  909. // TODO 又得兼容 mpvue 的 mp 对象
  910. try {
  911. event.mp = JSON.parse(JSON.stringify(event));
  912. } catch (e) {}
  913. event.stopPropagation = noop;
  914. event.preventDefault = noop;
  915. event.target = event.target || {};
  916. if (!hasOwn(event, 'detail')) {
  917. event.detail = {};
  918. }
  919. if (hasOwn(event, 'markerId')) {
  920. event.detail = typeof event.detail === 'object' ? event.detail : {};
  921. event.detail.markerId = event.markerId;
  922. }
  923. if (isPlainObject(event.detail)) {
  924. event.target = Object.assign({}, event.target, event.detail);
  925. }
  926. return event;
  927. }
  928. function getExtraValue(vm, dataPathsArray) {
  929. var context = vm;
  930. dataPathsArray.forEach(function (dataPathArray) {
  931. var dataPath = dataPathArray[0];
  932. var value = dataPathArray[2];
  933. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  934. var propPath = dataPathArray[1];
  935. var valuePath = dataPathArray[3];
  936. var vFor;
  937. if (Number.isInteger(dataPath)) {
  938. vFor = dataPath;
  939. } else if (!dataPath) {
  940. vFor = context;
  941. } else if (typeof dataPath === 'string' && dataPath) {
  942. if (dataPath.indexOf('#s#') === 0) {
  943. vFor = dataPath.substr(3);
  944. } else {
  945. vFor = vm.__get_value(dataPath, context);
  946. }
  947. }
  948. if (Number.isInteger(vFor)) {
  949. context = value;
  950. } else if (!propPath) {
  951. context = vFor[value];
  952. } else {
  953. if (Array.isArray(vFor)) {
  954. context = vFor.find(function (vForItem) {
  955. return vm.__get_value(propPath, vForItem) === value;
  956. });
  957. } else if (isPlainObject(vFor)) {
  958. context = Object.keys(vFor).find(function (vForKey) {
  959. return vm.__get_value(propPath, vFor[vForKey]) === value;
  960. });
  961. } else {
  962. console.error('v-for 暂不支持循环数据:', vFor);
  963. }
  964. }
  965. if (valuePath) {
  966. context = vm.__get_value(valuePath, context);
  967. }
  968. }
  969. });
  970. return context;
  971. }
  972. function processEventExtra(vm, extra, event) {
  973. var extraObj = {};
  974. if (Array.isArray(extra) && extra.length) {
  975. /**
  976. *[
  977. * ['data.items', 'data.id', item.data.id],
  978. * ['metas', 'id', meta.id]
  979. *],
  980. *[
  981. * ['data.items', 'data.id', item.data.id],
  982. * ['metas', 'id', meta.id]
  983. *],
  984. *'test'
  985. */
  986. extra.forEach(function (dataPath, index) {
  987. if (typeof dataPath === 'string') {
  988. if (!dataPath) {// model,prop.sync
  989. extraObj['$' + index] = vm;
  990. } else {
  991. if (dataPath === '$event') {// $event
  992. extraObj['$' + index] = event;
  993. } else if (dataPath === 'arguments') {
  994. if (event.detail && event.detail.__args__) {
  995. extraObj['$' + index] = event.detail.__args__;
  996. } else {
  997. extraObj['$' + index] = [event];
  998. }
  999. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1000. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1001. } else {
  1002. extraObj['$' + index] = vm.__get_value(dataPath);
  1003. }
  1004. }
  1005. } else {
  1006. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1007. }
  1008. });
  1009. }
  1010. return extraObj;
  1011. }
  1012. function getObjByArray(arr) {
  1013. var obj = {};
  1014. for (var i = 1; i < arr.length; i++) {
  1015. var element = arr[i];
  1016. obj[element[0]] = element[1];
  1017. }
  1018. return obj;
  1019. }
  1020. 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;
  1021. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1022. if (isCustom) {// 自定义事件
  1023. isCustomMPEvent = event.currentTarget &&
  1024. event.currentTarget.dataset &&
  1025. event.currentTarget.dataset.comType === 'wx';
  1026. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1027. if (isCustomMPEvent) {
  1028. return [event];
  1029. }
  1030. return event.detail.__args__ || event.detail;
  1031. }
  1032. }
  1033. var extraObj = processEventExtra(vm, extra, event);
  1034. var ret = [];
  1035. args.forEach(function (arg) {
  1036. if (arg === '$event') {
  1037. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1038. ret.push(event.target.value);
  1039. } else {
  1040. if (isCustom && !isCustomMPEvent) {
  1041. ret.push(event.detail.__args__[0]);
  1042. } else {// wxcomponent 组件或内置组件
  1043. ret.push(event);
  1044. }
  1045. }
  1046. } else {
  1047. if (Array.isArray(arg) && arg[0] === 'o') {
  1048. ret.push(getObjByArray(arg));
  1049. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1050. ret.push(extraObj[arg]);
  1051. } else {
  1052. ret.push(arg);
  1053. }
  1054. }
  1055. });
  1056. return ret;
  1057. }
  1058. var ONCE = '~';
  1059. var CUSTOM = '^';
  1060. function isMatchEventType(eventType, optType) {
  1061. return eventType === optType ||
  1062. optType === 'regionchange' && (
  1063. eventType === 'begin' ||
  1064. eventType === 'end');
  1065. }
  1066. function getContextVm(vm) {
  1067. var $parent = vm.$parent;
  1068. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1069. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1070. $parent = $parent.$parent;
  1071. }
  1072. return $parent && $parent.$parent;
  1073. }
  1074. function handleEvent(event) {var _this = this;
  1075. event = wrapper$1(event);
  1076. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1077. var dataset = (event.currentTarget || event.target).dataset;
  1078. if (!dataset) {
  1079. return console.warn('事件信息不存在');
  1080. }
  1081. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1082. if (!eventOpts) {
  1083. return console.warn('事件信息不存在');
  1084. }
  1085. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1086. var eventType = event.type;
  1087. var ret = [];
  1088. eventOpts.forEach(function (eventOpt) {
  1089. var type = eventOpt[0];
  1090. var eventsArray = eventOpt[1];
  1091. var isCustom = type.charAt(0) === CUSTOM;
  1092. type = isCustom ? type.slice(1) : type;
  1093. var isOnce = type.charAt(0) === ONCE;
  1094. type = isOnce ? type.slice(1) : type;
  1095. if (eventsArray && isMatchEventType(eventType, type)) {
  1096. eventsArray.forEach(function (eventArray) {
  1097. var methodName = eventArray[0];
  1098. if (methodName) {
  1099. var handlerCtx = _this.$vm;
  1100. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1101. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1102. }
  1103. if (methodName === '$emit') {
  1104. handlerCtx.$emit.apply(handlerCtx,
  1105. processEventArgs(
  1106. _this.$vm,
  1107. event,
  1108. eventArray[1],
  1109. eventArray[2],
  1110. isCustom,
  1111. methodName));
  1112. return;
  1113. }
  1114. var handler = handlerCtx[methodName];
  1115. if (!isFn(handler)) {
  1116. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1117. }
  1118. if (isOnce) {
  1119. if (handler.once) {
  1120. return;
  1121. }
  1122. handler.once = true;
  1123. }
  1124. var params = processEventArgs(
  1125. _this.$vm,
  1126. event,
  1127. eventArray[1],
  1128. eventArray[2],
  1129. isCustom,
  1130. methodName);
  1131. params = Array.isArray(params) ? params : [];
  1132. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1133. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1134. // eslint-disable-next-line no-sparse-arrays
  1135. params = params.concat([,,,,,,,,,, event]);
  1136. }
  1137. ret.push(handler.apply(handlerCtx, params));
  1138. }
  1139. });
  1140. }
  1141. });
  1142. if (
  1143. eventType === 'input' &&
  1144. ret.length === 1 &&
  1145. typeof ret[0] !== 'undefined')
  1146. {
  1147. return ret[0];
  1148. }
  1149. }
  1150. var locale;
  1151. {
  1152. locale = wx.getSystemInfoSync().language;
  1153. }
  1154. var i18n = (0, _uniI18n.initVueI18n)(
  1155. locale,
  1156. {});
  1157. var t = i18n.t;
  1158. var i18nMixin = i18n.mixin = {
  1159. beforeCreate: function beforeCreate() {var _this2 = this;
  1160. var unwatch = i18n.i18n.watchLocale(function () {
  1161. _this2.$forceUpdate();
  1162. });
  1163. this.$once('hook:beforeDestroy', function () {
  1164. unwatch();
  1165. });
  1166. },
  1167. methods: {
  1168. $$t: function $$t(key, values) {
  1169. return t(key, values);
  1170. } } };
  1171. var setLocale$1 = i18n.setLocale;
  1172. var getLocale$1 = i18n.getLocale;
  1173. function initAppLocale(Vue, appVm, locale) {
  1174. var state = Vue.observable({
  1175. locale: locale || i18n.getLocale() });
  1176. var localeWatchers = [];
  1177. appVm.$watchLocale = function (fn) {
  1178. localeWatchers.push(fn);
  1179. };
  1180. Object.defineProperty(appVm, '$locale', {
  1181. get: function get() {
  1182. return state.locale;
  1183. },
  1184. set: function set(v) {
  1185. state.locale = v;
  1186. localeWatchers.forEach(function (watch) {return watch(v);});
  1187. } });
  1188. }
  1189. var eventChannels = {};
  1190. var eventChannelStack = [];
  1191. function getEventChannel(id) {
  1192. if (id) {
  1193. var eventChannel = eventChannels[id];
  1194. delete eventChannels[id];
  1195. return eventChannel;
  1196. }
  1197. return eventChannelStack.shift();
  1198. }
  1199. var hooks = [
  1200. 'onShow',
  1201. 'onHide',
  1202. 'onError',
  1203. 'onPageNotFound',
  1204. 'onThemeChange',
  1205. 'onUnhandledRejection'];
  1206. function initEventChannel() {
  1207. _vue.default.prototype.getOpenerEventChannel = function () {
  1208. // 微信小程序使用自身getOpenerEventChannel
  1209. {
  1210. return this.$scope.getOpenerEventChannel();
  1211. }
  1212. };
  1213. var callHook = _vue.default.prototype.__call_hook;
  1214. _vue.default.prototype.__call_hook = function (hook, args) {
  1215. if (hook === 'onLoad' && args && args.__id__) {
  1216. this.__eventChannel__ = getEventChannel(args.__id__);
  1217. delete args.__id__;
  1218. }
  1219. return callHook.call(this, hook, args);
  1220. };
  1221. }
  1222. function initScopedSlotsParams() {
  1223. var center = {};
  1224. var parents = {};
  1225. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1226. var has = center[vueId];
  1227. if (!has) {
  1228. parents[vueId] = this;
  1229. this.$on('hook:destory', function () {
  1230. delete parents[vueId];
  1231. });
  1232. }
  1233. return has;
  1234. };
  1235. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1236. var data = center[vueId];
  1237. if (data) {
  1238. var object = data[name] || {};
  1239. return key ? object[key] : object;
  1240. } else {
  1241. parents[vueId] = this;
  1242. this.$on('hook:destory', function () {
  1243. delete parents[vueId];
  1244. });
  1245. }
  1246. };
  1247. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1248. var vueIds = this.$options.propsData.vueId;
  1249. if (vueIds) {
  1250. var vueId = vueIds.split(',')[0];
  1251. var object = center[vueId] = center[vueId] || {};
  1252. object[name] = value;
  1253. if (parents[vueId]) {
  1254. parents[vueId].$forceUpdate();
  1255. }
  1256. }
  1257. };
  1258. _vue.default.mixin({
  1259. destroyed: function destroyed() {
  1260. var propsData = this.$options.propsData;
  1261. var vueId = propsData && propsData.vueId;
  1262. if (vueId) {
  1263. delete center[vueId];
  1264. delete parents[vueId];
  1265. }
  1266. } });
  1267. }
  1268. function parseBaseApp(vm, _ref3)
  1269. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1270. initEventChannel();
  1271. {
  1272. initScopedSlotsParams();
  1273. }
  1274. if (vm.$options.store) {
  1275. _vue.default.prototype.$store = vm.$options.store;
  1276. }
  1277. uniIdMixin(_vue.default);
  1278. _vue.default.prototype.mpHost = "mp-weixin";
  1279. _vue.default.mixin({
  1280. beforeCreate: function beforeCreate() {
  1281. if (!this.$options.mpType) {
  1282. return;
  1283. }
  1284. this.mpType = this.$options.mpType;
  1285. this.$mp = _defineProperty({
  1286. data: {} },
  1287. this.mpType, this.$options.mpInstance);
  1288. this.$scope = this.$options.mpInstance;
  1289. delete this.$options.mpType;
  1290. delete this.$options.mpInstance;
  1291. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1292. var app = getApp();
  1293. if (app.$vm && app.$vm.$i18n) {
  1294. this._i18n = app.$vm.$i18n;
  1295. }
  1296. }
  1297. if (this.mpType !== 'app') {
  1298. initRefs(this);
  1299. initMocks(this, mocks);
  1300. }
  1301. } });
  1302. var appOptions = {
  1303. onLaunch: function onLaunch(args) {
  1304. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1305. return;
  1306. }
  1307. {
  1308. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1309. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1310. }
  1311. }
  1312. this.$vm = vm;
  1313. this.$vm.$mp = {
  1314. app: this };
  1315. this.$vm.$scope = this;
  1316. // vm 上也挂载 globalData
  1317. this.$vm.globalData = this.globalData;
  1318. this.$vm._isMounted = true;
  1319. this.$vm.__call_hook('mounted', args);
  1320. this.$vm.__call_hook('onLaunch', args);
  1321. } };
  1322. // 兼容旧版本 globalData
  1323. appOptions.globalData = vm.$options.globalData || {};
  1324. // 将 methods 中的方法挂在 getApp() 中
  1325. var methods = vm.$options.methods;
  1326. if (methods) {
  1327. Object.keys(methods).forEach(function (name) {
  1328. appOptions[name] = methods[name];
  1329. });
  1330. }
  1331. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1332. initHooks(appOptions, hooks);
  1333. return appOptions;
  1334. }
  1335. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1336. function findVmByVueId(vm, vuePid) {
  1337. var $children = vm.$children;
  1338. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1339. for (var i = $children.length - 1; i >= 0; i--) {
  1340. var childVm = $children[i];
  1341. if (childVm.$scope._$vueId === vuePid) {
  1342. return childVm;
  1343. }
  1344. }
  1345. // 反向递归查找
  1346. var parentVm;
  1347. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1348. parentVm = findVmByVueId($children[_i], vuePid);
  1349. if (parentVm) {
  1350. return parentVm;
  1351. }
  1352. }
  1353. }
  1354. function initBehavior(options) {
  1355. return Behavior(options);
  1356. }
  1357. function isPage() {
  1358. return !!this.route;
  1359. }
  1360. function initRelation(detail) {
  1361. this.triggerEvent('__l', detail);
  1362. }
  1363. function selectAllComponents(mpInstance, selector, $refs) {
  1364. var components = mpInstance.selectAllComponents(selector);
  1365. components.forEach(function (component) {
  1366. var ref = component.dataset.ref;
  1367. $refs[ref] = component.$vm || component;
  1368. {
  1369. if (component.dataset.vueGeneric === 'scoped') {
  1370. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1371. selectAllComponents(scopedComponent, selector, $refs);
  1372. });
  1373. }
  1374. }
  1375. });
  1376. }
  1377. function initRefs(vm) {
  1378. var mpInstance = vm.$scope;
  1379. Object.defineProperty(vm, '$refs', {
  1380. get: function get() {
  1381. var $refs = {};
  1382. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1383. // TODO 暂不考虑 for 中的 scoped
  1384. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1385. forComponents.forEach(function (component) {
  1386. var ref = component.dataset.ref;
  1387. if (!$refs[ref]) {
  1388. $refs[ref] = [];
  1389. }
  1390. $refs[ref].push(component.$vm || component);
  1391. });
  1392. return $refs;
  1393. } });
  1394. }
  1395. function handleLink(event) {var _ref4 =
  1396. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1397. var parentVm;
  1398. if (vuePid) {
  1399. parentVm = findVmByVueId(this.$vm, vuePid);
  1400. }
  1401. if (!parentVm) {
  1402. parentVm = this.$vm;
  1403. }
  1404. vueOptions.parent = parentVm;
  1405. }
  1406. function parseApp(vm) {
  1407. return parseBaseApp(vm, {
  1408. mocks: mocks,
  1409. initRefs: initRefs });
  1410. }
  1411. function createApp(vm) {
  1412. App(parseApp(vm));
  1413. return vm;
  1414. }
  1415. var encodeReserveRE = /[!'()*]/g;
  1416. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1417. var commaRE = /%2C/g;
  1418. // fixed encodeURIComponent which is more conformant to RFC3986:
  1419. // - escapes [!'()*]
  1420. // - preserve commas
  1421. var encode = function encode(str) {return encodeURIComponent(str).
  1422. replace(encodeReserveRE, encodeReserveReplacer).
  1423. replace(commaRE, ',');};
  1424. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1425. var res = obj ? Object.keys(obj).map(function (key) {
  1426. var val = obj[key];
  1427. if (val === undefined) {
  1428. return '';
  1429. }
  1430. if (val === null) {
  1431. return encodeStr(key);
  1432. }
  1433. if (Array.isArray(val)) {
  1434. var result = [];
  1435. val.forEach(function (val2) {
  1436. if (val2 === undefined) {
  1437. return;
  1438. }
  1439. if (val2 === null) {
  1440. result.push(encodeStr(key));
  1441. } else {
  1442. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1443. }
  1444. });
  1445. return result.join('&');
  1446. }
  1447. return encodeStr(key) + '=' + encodeStr(val);
  1448. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1449. return res ? "?".concat(res) : '';
  1450. }
  1451. function parseBaseComponent(vueComponentOptions)
  1452. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1453. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1454. var options = _objectSpread({
  1455. multipleSlots: true,
  1456. addGlobalClass: true },
  1457. vueOptions.options || {});
  1458. {
  1459. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1460. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1461. Object.assign(options, vueOptions['mp-weixin'].options);
  1462. }
  1463. }
  1464. var componentOptions = {
  1465. options: options,
  1466. data: initData(vueOptions, _vue.default.prototype),
  1467. behaviors: initBehaviors(vueOptions, initBehavior),
  1468. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1469. lifetimes: {
  1470. attached: function attached() {
  1471. var properties = this.properties;
  1472. var options = {
  1473. mpType: isPage.call(this) ? 'page' : 'component',
  1474. mpInstance: this,
  1475. propsData: properties };
  1476. initVueIds(properties.vueId, this);
  1477. // 处理父子关系
  1478. initRelation.call(this, {
  1479. vuePid: this._$vuePid,
  1480. vueOptions: options });
  1481. // 初始化 vue 实例
  1482. this.$vm = new VueComponent(options);
  1483. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1484. initSlots(this.$vm, properties.vueSlots);
  1485. // 触发首次 setData
  1486. this.$vm.$mount();
  1487. },
  1488. ready: function ready() {
  1489. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1490. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1491. if (this.$vm) {
  1492. this.$vm._isMounted = true;
  1493. this.$vm.__call_hook('mounted');
  1494. this.$vm.__call_hook('onReady');
  1495. }
  1496. },
  1497. detached: function detached() {
  1498. this.$vm && this.$vm.$destroy();
  1499. } },
  1500. pageLifetimes: {
  1501. show: function show(args) {
  1502. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1503. },
  1504. hide: function hide() {
  1505. this.$vm && this.$vm.__call_hook('onPageHide');
  1506. },
  1507. resize: function resize(size) {
  1508. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1509. } },
  1510. methods: {
  1511. __l: handleLink,
  1512. __e: handleEvent } };
  1513. // externalClasses
  1514. if (vueOptions.externalClasses) {
  1515. componentOptions.externalClasses = vueOptions.externalClasses;
  1516. }
  1517. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1518. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1519. componentOptions.methods[callMethod] = function (args) {
  1520. return this.$vm[callMethod](args);
  1521. };
  1522. });
  1523. }
  1524. if (isPage) {
  1525. return componentOptions;
  1526. }
  1527. return [componentOptions, VueComponent];
  1528. }
  1529. function parseComponent(vueComponentOptions) {
  1530. return parseBaseComponent(vueComponentOptions, {
  1531. isPage: isPage,
  1532. initRelation: initRelation });
  1533. }
  1534. var hooks$1 = [
  1535. 'onShow',
  1536. 'onHide',
  1537. 'onUnload'];
  1538. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1539. function parseBasePage(vuePageOptions, _ref6)
  1540. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1541. var pageOptions = parseComponent(vuePageOptions);
  1542. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1543. pageOptions.methods.onLoad = function (query) {
  1544. this.options = query;
  1545. var copyQuery = Object.assign({}, query);
  1546. delete copyQuery.__id__;
  1547. this.$page = {
  1548. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1549. this.$vm.$mp.query = query; // 兼容 mpvue
  1550. this.$vm.__call_hook('onLoad', query);
  1551. };
  1552. return pageOptions;
  1553. }
  1554. function parsePage(vuePageOptions) {
  1555. return parseBasePage(vuePageOptions, {
  1556. isPage: isPage,
  1557. initRelation: initRelation });
  1558. }
  1559. function createPage(vuePageOptions) {
  1560. {
  1561. return Component(parsePage(vuePageOptions));
  1562. }
  1563. }
  1564. function createComponent(vueOptions) {
  1565. {
  1566. return Component(parseComponent(vueOptions));
  1567. }
  1568. }
  1569. function createSubpackageApp(vm) {
  1570. var appOptions = parseApp(vm);
  1571. var app = getApp({
  1572. allowDefault: true });
  1573. vm.$scope = app;
  1574. var globalData = app.globalData;
  1575. if (globalData) {
  1576. Object.keys(appOptions.globalData).forEach(function (name) {
  1577. if (!hasOwn(globalData, name)) {
  1578. globalData[name] = appOptions.globalData[name];
  1579. }
  1580. });
  1581. }
  1582. Object.keys(appOptions).forEach(function (name) {
  1583. if (!hasOwn(app, name)) {
  1584. app[name] = appOptions[name];
  1585. }
  1586. });
  1587. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1588. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1589. vm.__call_hook('onShow', args);
  1590. });
  1591. }
  1592. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1593. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1594. vm.__call_hook('onHide', args);
  1595. });
  1596. }
  1597. if (isFn(appOptions.onLaunch)) {
  1598. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1599. vm.__call_hook('onLaunch', args);
  1600. }
  1601. return vm;
  1602. }
  1603. function createPlugin(vm) {
  1604. var appOptions = parseApp(vm);
  1605. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1606. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1607. appOptions.onShow.apply(vm, args);
  1608. });
  1609. }
  1610. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1611. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1612. appOptions.onHide.apply(vm, args);
  1613. });
  1614. }
  1615. if (isFn(appOptions.onLaunch)) {
  1616. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1617. appOptions.onLaunch.call(vm, args);
  1618. }
  1619. return vm;
  1620. }
  1621. todos.forEach(function (todoApi) {
  1622. protocols[todoApi] = false;
  1623. });
  1624. canIUses.forEach(function (canIUseApi) {
  1625. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1626. canIUseApi;
  1627. if (!wx.canIUse(apiName)) {
  1628. protocols[canIUseApi] = false;
  1629. }
  1630. });
  1631. var uni = {};
  1632. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1633. uni = new Proxy({}, {
  1634. get: function get(target, name) {
  1635. if (hasOwn(target, name)) {
  1636. return target[name];
  1637. }
  1638. if (baseApi[name]) {
  1639. return baseApi[name];
  1640. }
  1641. if (api[name]) {
  1642. return promisify(name, api[name]);
  1643. }
  1644. {
  1645. if (extraApi[name]) {
  1646. return promisify(name, extraApi[name]);
  1647. }
  1648. if (todoApis[name]) {
  1649. return promisify(name, todoApis[name]);
  1650. }
  1651. }
  1652. if (eventApi[name]) {
  1653. return eventApi[name];
  1654. }
  1655. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1656. return;
  1657. }
  1658. return promisify(name, wrapper(name, wx[name]));
  1659. },
  1660. set: function set(target, name, value) {
  1661. target[name] = value;
  1662. return true;
  1663. } });
  1664. } else {
  1665. Object.keys(baseApi).forEach(function (name) {
  1666. uni[name] = baseApi[name];
  1667. });
  1668. {
  1669. Object.keys(todoApis).forEach(function (name) {
  1670. uni[name] = promisify(name, todoApis[name]);
  1671. });
  1672. Object.keys(extraApi).forEach(function (name) {
  1673. uni[name] = promisify(name, todoApis[name]);
  1674. });
  1675. }
  1676. Object.keys(eventApi).forEach(function (name) {
  1677. uni[name] = eventApi[name];
  1678. });
  1679. Object.keys(api).forEach(function (name) {
  1680. uni[name] = promisify(name, api[name]);
  1681. });
  1682. Object.keys(wx).forEach(function (name) {
  1683. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1684. uni[name] = promisify(name, wrapper(name, wx[name]));
  1685. }
  1686. });
  1687. }
  1688. wx.createApp = createApp;
  1689. wx.createPage = createPage;
  1690. wx.createComponent = createComponent;
  1691. wx.createSubpackageApp = createSubpackageApp;
  1692. wx.createPlugin = createPlugin;
  1693. var uni$1 = uni;var _default =
  1694. uni$1;exports.default = _default;
  1695. /***/ }),
  1696. /***/ 107:
  1697. /*!*********************************************************************************************!*\
  1698. !*** C:/Users/first/Desktop/公司/applets/uni_modules/uni-popup/components/uni-popup/popup.js ***!
  1699. \*********************************************************************************************/
  1700. /*! no static exports found */
  1701. /***/ (function(module, exports, __webpack_require__) {
  1702. "use strict";
  1703. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _message = _interopRequireDefault(__webpack_require__(/*! ./message.js */ 108));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1704. // 定义 type 类型:弹出类型:top/bottom/center
  1705. var config = {
  1706. // 顶部弹出
  1707. top: 'top',
  1708. // 底部弹出
  1709. bottom: 'bottom',
  1710. // 居中弹出
  1711. center: 'center',
  1712. // 消息提示
  1713. message: 'top',
  1714. // 对话框
  1715. dialog: 'center',
  1716. // 分享
  1717. share: 'bottom' };var _default =
  1718. {
  1719. data: function data() {
  1720. return {
  1721. config: config,
  1722. popupWidth: 0,
  1723. popupHeight: 0 };
  1724. },
  1725. mixins: [_message.default],
  1726. computed: {
  1727. isDesktop: function isDesktop() {
  1728. return this.popupWidth >= 500 && this.popupHeight >= 500;
  1729. } },
  1730. mounted: function mounted() {var _this = this;
  1731. var fixSize = function fixSize() {var _uni$getSystemInfoSyn =
  1732. uni.getSystemInfoSync(),windowWidth = _uni$getSystemInfoSyn.windowWidth,windowHeight = _uni$getSystemInfoSyn.windowHeight,windowTop = _uni$getSystemInfoSyn.windowTop;
  1733. _this.popupWidth = windowWidth;
  1734. _this.popupHeight = windowHeight + windowTop;
  1735. };
  1736. fixSize();
  1737. } };exports.default = _default;
  1738. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1739. /***/ }),
  1740. /***/ 108:
  1741. /*!***********************************************************************************************!*\
  1742. !*** C:/Users/first/Desktop/公司/applets/uni_modules/uni-popup/components/uni-popup/message.js ***!
  1743. \***********************************************************************************************/
  1744. /*! no static exports found */
  1745. /***/ (function(module, exports, __webpack_require__) {
  1746. "use strict";
  1747. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  1748. created: function created() {
  1749. if (this.type === 'message') {
  1750. // 不显示遮罩
  1751. this.maskShow = false;
  1752. // 获取子组件对象
  1753. this.childrenMsg = null;
  1754. }
  1755. },
  1756. methods: {
  1757. customOpen: function customOpen() {
  1758. if (this.childrenMsg) {
  1759. this.childrenMsg.open();
  1760. }
  1761. },
  1762. customClose: function customClose() {
  1763. if (this.childrenMsg) {
  1764. this.childrenMsg.close();
  1765. }
  1766. } } };exports.default = _default;
  1767. /***/ }),
  1768. /***/ 116:
  1769. /*!*********************************************************************************************!*\
  1770. !*** C:/Users/first/Desktop/公司/applets/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  1771. \*********************************************************************************************/
  1772. /*! no static exports found */
  1773. /***/ (function(module, exports, __webpack_require__) {
  1774. "use strict";
  1775. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  1776. "pulldown": "\uE588",
  1777. "refreshempty": "\uE461",
  1778. "back": "\uE471",
  1779. "forward": "\uE470",
  1780. "more": "\uE507",
  1781. "more-filled": "\uE537",
  1782. "scan": "\uE612",
  1783. "qq": "\uE264",
  1784. "weibo": "\uE260",
  1785. "weixin": "\uE261",
  1786. "pengyouquan": "\uE262",
  1787. "loop": "\uE565",
  1788. "refresh": "\uE407",
  1789. "refresh-filled": "\uE437",
  1790. "arrowthindown": "\uE585",
  1791. "arrowthinleft": "\uE586",
  1792. "arrowthinright": "\uE587",
  1793. "arrowthinup": "\uE584",
  1794. "undo-filled": "\uE7D6",
  1795. "undo": "\uE406",
  1796. "redo": "\uE405",
  1797. "redo-filled": "\uE7D9",
  1798. "bars": "\uE563",
  1799. "chatboxes": "\uE203",
  1800. "camera": "\uE301",
  1801. "chatboxes-filled": "\uE233",
  1802. "camera-filled": "\uE7EF",
  1803. "cart-filled": "\uE7F4",
  1804. "cart": "\uE7F5",
  1805. "checkbox-filled": "\uE442",
  1806. "checkbox": "\uE7FA",
  1807. "arrowleft": "\uE582",
  1808. "arrowdown": "\uE581",
  1809. "arrowright": "\uE583",
  1810. "smallcircle-filled": "\uE801",
  1811. "arrowup": "\uE580",
  1812. "circle": "\uE411",
  1813. "eye-filled": "\uE568",
  1814. "eye-slash-filled": "\uE822",
  1815. "eye-slash": "\uE823",
  1816. "eye": "\uE824",
  1817. "flag-filled": "\uE825",
  1818. "flag": "\uE508",
  1819. "gear-filled": "\uE532",
  1820. "reload": "\uE462",
  1821. "gear": "\uE502",
  1822. "hand-thumbsdown-filled": "\uE83B",
  1823. "hand-thumbsdown": "\uE83C",
  1824. "hand-thumbsup-filled": "\uE83D",
  1825. "heart-filled": "\uE83E",
  1826. "hand-thumbsup": "\uE83F",
  1827. "heart": "\uE840",
  1828. "home": "\uE500",
  1829. "info": "\uE504",
  1830. "home-filled": "\uE530",
  1831. "info-filled": "\uE534",
  1832. "circle-filled": "\uE441",
  1833. "chat-filled": "\uE847",
  1834. "chat": "\uE263",
  1835. "mail-open-filled": "\uE84D",
  1836. "email-filled": "\uE231",
  1837. "mail-open": "\uE84E",
  1838. "email": "\uE201",
  1839. "checkmarkempty": "\uE472",
  1840. "list": "\uE562",
  1841. "locked-filled": "\uE856",
  1842. "locked": "\uE506",
  1843. "map-filled": "\uE85C",
  1844. "map-pin": "\uE85E",
  1845. "map-pin-ellipse": "\uE864",
  1846. "map": "\uE364",
  1847. "minus-filled": "\uE440",
  1848. "mic-filled": "\uE332",
  1849. "minus": "\uE410",
  1850. "micoff": "\uE360",
  1851. "mic": "\uE302",
  1852. "clear": "\uE434",
  1853. "smallcircle": "\uE868",
  1854. "close": "\uE404",
  1855. "closeempty": "\uE460",
  1856. "paperclip": "\uE567",
  1857. "paperplane": "\uE503",
  1858. "paperplane-filled": "\uE86E",
  1859. "person-filled": "\uE131",
  1860. "contact-filled": "\uE130",
  1861. "person": "\uE101",
  1862. "contact": "\uE100",
  1863. "images-filled": "\uE87A",
  1864. "phone": "\uE200",
  1865. "images": "\uE87B",
  1866. "image": "\uE363",
  1867. "image-filled": "\uE877",
  1868. "location-filled": "\uE333",
  1869. "location": "\uE303",
  1870. "plus-filled": "\uE439",
  1871. "plus": "\uE409",
  1872. "plusempty": "\uE468",
  1873. "help-filled": "\uE535",
  1874. "help": "\uE505",
  1875. "navigate-filled": "\uE884",
  1876. "navigate": "\uE501",
  1877. "mic-slash-filled": "\uE892",
  1878. "search": "\uE466",
  1879. "settings": "\uE560",
  1880. "sound": "\uE590",
  1881. "sound-filled": "\uE8A1",
  1882. "spinner-cycle": "\uE465",
  1883. "download-filled": "\uE8A4",
  1884. "personadd-filled": "\uE132",
  1885. "videocam-filled": "\uE8AF",
  1886. "personadd": "\uE102",
  1887. "upload": "\uE402",
  1888. "upload-filled": "\uE8B1",
  1889. "starhalf": "\uE463",
  1890. "star-filled": "\uE438",
  1891. "star": "\uE408",
  1892. "trash": "\uE401",
  1893. "phone-filled": "\uE230",
  1894. "compose": "\uE400",
  1895. "videocam": "\uE300",
  1896. "trash-filled": "\uE8DC",
  1897. "download": "\uE403",
  1898. "chatbubble-filled": "\uE232",
  1899. "chatbubble": "\uE202",
  1900. "cloud-download": "\uE8E4",
  1901. "cloud-upload-filled": "\uE8E5",
  1902. "cloud-upload": "\uE8E6",
  1903. "cloud-download-filled": "\uE8E9",
  1904. "headphones": "\uE8BF",
  1905. "shop": "\uE609" };exports.default = _default;
  1906. /***/ }),
  1907. /***/ 15:
  1908. /*!**********************************************************************************************************!*\
  1909. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1910. \**********************************************************************************************************/
  1911. /*! exports provided: default */
  1912. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1913. "use strict";
  1914. __webpack_require__.r(__webpack_exports__);
  1915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1916. /* globals __VUE_SSR_CONTEXT__ */
  1917. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1918. // This module is a runtime utility for cleaner component module output and will
  1919. // be included in the final webpack user bundle.
  1920. function normalizeComponent (
  1921. scriptExports,
  1922. render,
  1923. staticRenderFns,
  1924. functionalTemplate,
  1925. injectStyles,
  1926. scopeId,
  1927. moduleIdentifier, /* server only */
  1928. shadowMode, /* vue-cli only */
  1929. components, // fixed by xxxxxx auto components
  1930. renderjs // fixed by xxxxxx renderjs
  1931. ) {
  1932. // Vue.extend constructor export interop
  1933. var options = typeof scriptExports === 'function'
  1934. ? scriptExports.options
  1935. : scriptExports
  1936. // fixed by xxxxxx auto components
  1937. if (components) {
  1938. if (!options.components) {
  1939. options.components = {}
  1940. }
  1941. var hasOwn = Object.prototype.hasOwnProperty
  1942. for (var name in components) {
  1943. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1944. options.components[name] = components[name]
  1945. }
  1946. }
  1947. }
  1948. // fixed by xxxxxx renderjs
  1949. if (renderjs) {
  1950. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1951. this[renderjs.__module] = this
  1952. });
  1953. (options.mixins || (options.mixins = [])).push(renderjs)
  1954. }
  1955. // render functions
  1956. if (render) {
  1957. options.render = render
  1958. options.staticRenderFns = staticRenderFns
  1959. options._compiled = true
  1960. }
  1961. // functional template
  1962. if (functionalTemplate) {
  1963. options.functional = true
  1964. }
  1965. // scopedId
  1966. if (scopeId) {
  1967. options._scopeId = 'data-v-' + scopeId
  1968. }
  1969. var hook
  1970. if (moduleIdentifier) { // server build
  1971. hook = function (context) {
  1972. // 2.3 injection
  1973. context =
  1974. context || // cached call
  1975. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1976. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1977. // 2.2 with runInNewContext: true
  1978. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1979. context = __VUE_SSR_CONTEXT__
  1980. }
  1981. // inject component styles
  1982. if (injectStyles) {
  1983. injectStyles.call(this, context)
  1984. }
  1985. // register component module identifier for async chunk inferrence
  1986. if (context && context._registeredComponents) {
  1987. context._registeredComponents.add(moduleIdentifier)
  1988. }
  1989. }
  1990. // used by ssr in case component is cached and beforeCreate
  1991. // never gets called
  1992. options._ssrRegister = hook
  1993. } else if (injectStyles) {
  1994. hook = shadowMode
  1995. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1996. : injectStyles
  1997. }
  1998. if (hook) {
  1999. if (options.functional) {
  2000. // for template-only hot-reload because in that case the render fn doesn't
  2001. // go through the normalizer
  2002. options._injectStyles = hook
  2003. // register for functioal component in vue file
  2004. var originalRender = options.render
  2005. options.render = function renderWithStyleInjection (h, context) {
  2006. hook.call(context)
  2007. return originalRender(h, context)
  2008. }
  2009. } else {
  2010. // inject component registration as beforeCreate hook
  2011. var existing = options.beforeCreate
  2012. options.beforeCreate = existing
  2013. ? [].concat(existing, hook)
  2014. : [hook]
  2015. }
  2016. }
  2017. return {
  2018. exports: scriptExports,
  2019. options: options
  2020. }
  2021. }
  2022. /***/ }),
  2023. /***/ 16:
  2024. /*!********************************************************!*\
  2025. !*** C:/Users/first/Desktop/公司/applets/store/index.js ***!
  2026. \********************************************************/
  2027. /*! no static exports found */
  2028. /***/ (function(module, exports, __webpack_require__) {
  2029. "use strict";
  2030. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  2031. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 17));
  2032. var _settings = _interopRequireDefault(__webpack_require__(/*! @/settings.js */ 18));
  2033. var _user = _interopRequireDefault(__webpack_require__(/*! @/store/modules/user */ 19));
  2034. var _order = _interopRequireDefault(__webpack_require__(/*! @/store/modules/order */ 20));
  2035. var _station = _interopRequireDefault(__webpack_require__(/*! @/store/modules/station */ 21));
  2036. var _voucher = _interopRequireDefault(__webpack_require__(/*! @/store/modules/voucher */ 22));
  2037. var _coupon = _interopRequireDefault(__webpack_require__(/*! @/store/modules/coupon */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2038. _vue.default.use(_vuex.default);var _default =
  2039. new _vuex.default.Store({
  2040. state: {
  2041. appId: _settings.default.appId
  2042. // stationId: settings.stationId,
  2043. // phoneNumber:uni.getStorageSync('phoneNumber') || "",
  2044. // countryCode:uni.getStorageSync('countryCode') || "",
  2045. // purePhoneNumber:uni.getStorageSync('purePhoneNumber') || "",
  2046. // openId: uni.getStorageSync('openId') || "",
  2047. // unionId: uni.getStorageSync('unionId') || "",
  2048. // userInfo: !uni.getStorageSync('userInfo') ? {} : JSON.parse(uni.getStorageSync('userInfo')),
  2049. // orderInfo:undefined,
  2050. // selectedGas:undefined,
  2051. // labelId:undefined,
  2052. // employeeId:undefined,
  2053. },
  2054. getters: {},
  2055. mutations: {
  2056. // updatePhoneNumber(state, phoneNumber) {
  2057. // uni.setStorageSync('phoneNumber', phoneNumber);
  2058. // state.phoneNumber = phoneNumber
  2059. // },
  2060. // updateCountryCode(state, countryCode) {
  2061. // uni.setStorageSync('countryCode', countryCode);
  2062. // state.countryCode = countryCode
  2063. // },
  2064. // updatePurePhoneNumber(state, purePhoneNumber) {
  2065. // uni.setStorageSync('phoneNumber', phoneNumber);
  2066. // state.purePhoneNumber = purePhoneNumber
  2067. // },
  2068. // updateOpenId(state, openId) {
  2069. // uni.setStorageSync('openId', openId);
  2070. // state.openId = openId
  2071. // },
  2072. // updateUnionId(state, unionId) {
  2073. // uni.setStorageSync('unionId', unionId);
  2074. // state.unionId = unionId
  2075. // },
  2076. // clearUserAuthen(state){
  2077. // uni.removeStorageSync('phoneNumber')
  2078. // uni.removeStorageSync('countryCode')
  2079. // uni.removeStorageSync('purePhoneNumber')
  2080. // uni.removeStorageSync('openId')
  2081. // uni.removeStorageSync('unionId')
  2082. // state.phoneNumber = ''
  2083. // state.countryCode = ''
  2084. // state.purePhoneNumber = ''
  2085. // state.openId = ''
  2086. // state.unionId = ''
  2087. // },
  2088. // updateUserInfo(state, userInfo) {
  2089. // uni.setStorageSync('userInfo', JSON.stringify(userInfo));
  2090. // state.userInfo = userInfo
  2091. // },
  2092. // clearUserInfo(state) {
  2093. // uni.removeStorageSync('userInfo')
  2094. // state.userInfo = {}
  2095. // },
  2096. // updateOrderInfo(state, orderInfo){
  2097. // state.orderInfo = orderInfo
  2098. // },
  2099. // updateSelectedGas(state, selectedGas){
  2100. // state.selectedGas = selectedGas
  2101. // },
  2102. // updateStationId(state, stationId){
  2103. // state.stationId = stationId
  2104. // },
  2105. // updateLabelId(state, labelId) {
  2106. // state.labelId = labelId
  2107. // },
  2108. // clearLabelId(state){
  2109. // state.labelId = undefined
  2110. // },
  2111. resetApplet: function resetApplet(state) {
  2112. uni.clearStorageSync();
  2113. state.user.phoneNumber = '';
  2114. state.user.countryCode = '';
  2115. state.user.purePhoneNumber = '';
  2116. state.user.openId = "";
  2117. state.user.unionId = "";
  2118. state.user.userInfo = {};
  2119. state.station.employeeId = undefined;
  2120. }
  2121. // updateEmployeeId(state, employeeId){
  2122. // state.employeeId = employeeId
  2123. // },
  2124. // clearEmployeeId(state){
  2125. // state.employeeId = undefined
  2126. // }
  2127. },
  2128. actions: {},
  2129. modules: {
  2130. user: _user.default,
  2131. order: _order.default,
  2132. station: _station.default,
  2133. voucher: _voucher.default,
  2134. coupon: _coupon.default } });exports.default = _default;
  2135. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2136. /***/ }),
  2137. /***/ 17:
  2138. /*!**************************************************************************************!*\
  2139. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  2140. \**************************************************************************************/
  2141. /*! no static exports found */
  2142. /***/ (function(module, exports, __webpack_require__) {
  2143. "use strict";
  2144. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2145. * vuex v3.6.2
  2146. * (c) 2021 Evan You
  2147. * @license MIT
  2148. */
  2149. function applyMixin (Vue) {
  2150. var version = Number(Vue.version.split('.')[0]);
  2151. if (version >= 2) {
  2152. Vue.mixin({ beforeCreate: vuexInit });
  2153. } else {
  2154. // override init and inject vuex init procedure
  2155. // for 1.x backwards compatibility.
  2156. var _init = Vue.prototype._init;
  2157. Vue.prototype._init = function (options) {
  2158. if ( options === void 0 ) options = {};
  2159. options.init = options.init
  2160. ? [vuexInit].concat(options.init)
  2161. : vuexInit;
  2162. _init.call(this, options);
  2163. };
  2164. }
  2165. /**
  2166. * Vuex init hook, injected into each instances init hooks list.
  2167. */
  2168. function vuexInit () {
  2169. var options = this.$options;
  2170. // store injection
  2171. if (options.store) {
  2172. this.$store = typeof options.store === 'function'
  2173. ? options.store()
  2174. : options.store;
  2175. } else if (options.parent && options.parent.$store) {
  2176. this.$store = options.parent.$store;
  2177. }
  2178. }
  2179. }
  2180. var target = typeof window !== 'undefined'
  2181. ? window
  2182. : typeof global !== 'undefined'
  2183. ? global
  2184. : {};
  2185. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2186. function devtoolPlugin (store) {
  2187. if (!devtoolHook) { return }
  2188. store._devtoolHook = devtoolHook;
  2189. devtoolHook.emit('vuex:init', store);
  2190. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  2191. store.replaceState(targetState);
  2192. });
  2193. store.subscribe(function (mutation, state) {
  2194. devtoolHook.emit('vuex:mutation', mutation, state);
  2195. }, { prepend: true });
  2196. store.subscribeAction(function (action, state) {
  2197. devtoolHook.emit('vuex:action', action, state);
  2198. }, { prepend: true });
  2199. }
  2200. /**
  2201. * Get the first item that pass the test
  2202. * by second argument function
  2203. *
  2204. * @param {Array} list
  2205. * @param {Function} f
  2206. * @return {*}
  2207. */
  2208. function find (list, f) {
  2209. return list.filter(f)[0]
  2210. }
  2211. /**
  2212. * Deep copy the given object considering circular structure.
  2213. * This function caches all nested objects and its copies.
  2214. * If it detects circular structure, use cached copy to avoid infinite loop.
  2215. *
  2216. * @param {*} obj
  2217. * @param {Array<Object>} cache
  2218. * @return {*}
  2219. */
  2220. function deepCopy (obj, cache) {
  2221. if ( cache === void 0 ) cache = [];
  2222. // just return if obj is immutable value
  2223. if (obj === null || typeof obj !== 'object') {
  2224. return obj
  2225. }
  2226. // if obj is hit, it is in circular structure
  2227. var hit = find(cache, function (c) { return c.original === obj; });
  2228. if (hit) {
  2229. return hit.copy
  2230. }
  2231. var copy = Array.isArray(obj) ? [] : {};
  2232. // put the copy into cache at first
  2233. // because we want to refer it in recursive deepCopy
  2234. cache.push({
  2235. original: obj,
  2236. copy: copy
  2237. });
  2238. Object.keys(obj).forEach(function (key) {
  2239. copy[key] = deepCopy(obj[key], cache);
  2240. });
  2241. return copy
  2242. }
  2243. /**
  2244. * forEach for object
  2245. */
  2246. function forEachValue (obj, fn) {
  2247. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  2248. }
  2249. function isObject (obj) {
  2250. return obj !== null && typeof obj === 'object'
  2251. }
  2252. function isPromise (val) {
  2253. return val && typeof val.then === 'function'
  2254. }
  2255. function assert (condition, msg) {
  2256. if (!condition) { throw new Error(("[vuex] " + msg)) }
  2257. }
  2258. function partial (fn, arg) {
  2259. return function () {
  2260. return fn(arg)
  2261. }
  2262. }
  2263. // Base data struct for store's module, package with some attribute and method
  2264. var Module = function Module (rawModule, runtime) {
  2265. this.runtime = runtime;
  2266. // Store some children item
  2267. this._children = Object.create(null);
  2268. // Store the origin module object which passed by programmer
  2269. this._rawModule = rawModule;
  2270. var rawState = rawModule.state;
  2271. // Store the origin module's state
  2272. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  2273. };
  2274. var prototypeAccessors = { namespaced: { configurable: true } };
  2275. prototypeAccessors.namespaced.get = function () {
  2276. return !!this._rawModule.namespaced
  2277. };
  2278. Module.prototype.addChild = function addChild (key, module) {
  2279. this._children[key] = module;
  2280. };
  2281. Module.prototype.removeChild = function removeChild (key) {
  2282. delete this._children[key];
  2283. };
  2284. Module.prototype.getChild = function getChild (key) {
  2285. return this._children[key]
  2286. };
  2287. Module.prototype.hasChild = function hasChild (key) {
  2288. return key in this._children
  2289. };
  2290. Module.prototype.update = function update (rawModule) {
  2291. this._rawModule.namespaced = rawModule.namespaced;
  2292. if (rawModule.actions) {
  2293. this._rawModule.actions = rawModule.actions;
  2294. }
  2295. if (rawModule.mutations) {
  2296. this._rawModule.mutations = rawModule.mutations;
  2297. }
  2298. if (rawModule.getters) {
  2299. this._rawModule.getters = rawModule.getters;
  2300. }
  2301. };
  2302. Module.prototype.forEachChild = function forEachChild (fn) {
  2303. forEachValue(this._children, fn);
  2304. };
  2305. Module.prototype.forEachGetter = function forEachGetter (fn) {
  2306. if (this._rawModule.getters) {
  2307. forEachValue(this._rawModule.getters, fn);
  2308. }
  2309. };
  2310. Module.prototype.forEachAction = function forEachAction (fn) {
  2311. if (this._rawModule.actions) {
  2312. forEachValue(this._rawModule.actions, fn);
  2313. }
  2314. };
  2315. Module.prototype.forEachMutation = function forEachMutation (fn) {
  2316. if (this._rawModule.mutations) {
  2317. forEachValue(this._rawModule.mutations, fn);
  2318. }
  2319. };
  2320. Object.defineProperties( Module.prototype, prototypeAccessors );
  2321. var ModuleCollection = function ModuleCollection (rawRootModule) {
  2322. // register root module (Vuex.Store options)
  2323. this.register([], rawRootModule, false);
  2324. };
  2325. ModuleCollection.prototype.get = function get (path) {
  2326. return path.reduce(function (module, key) {
  2327. return module.getChild(key)
  2328. }, this.root)
  2329. };
  2330. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  2331. var module = this.root;
  2332. return path.reduce(function (namespace, key) {
  2333. module = module.getChild(key);
  2334. return namespace + (module.namespaced ? key + '/' : '')
  2335. }, '')
  2336. };
  2337. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  2338. update([], this.root, rawRootModule);
  2339. };
  2340. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  2341. var this$1 = this;
  2342. if ( runtime === void 0 ) runtime = true;
  2343. if ((true)) {
  2344. assertRawModule(path, rawModule);
  2345. }
  2346. var newModule = new Module(rawModule, runtime);
  2347. if (path.length === 0) {
  2348. this.root = newModule;
  2349. } else {
  2350. var parent = this.get(path.slice(0, -1));
  2351. parent.addChild(path[path.length - 1], newModule);
  2352. }
  2353. // register nested modules
  2354. if (rawModule.modules) {
  2355. forEachValue(rawModule.modules, function (rawChildModule, key) {
  2356. this$1.register(path.concat(key), rawChildModule, runtime);
  2357. });
  2358. }
  2359. };
  2360. ModuleCollection.prototype.unregister = function unregister (path) {
  2361. var parent = this.get(path.slice(0, -1));
  2362. var key = path[path.length - 1];
  2363. var child = parent.getChild(key);
  2364. if (!child) {
  2365. if ((true)) {
  2366. console.warn(
  2367. "[vuex] trying to unregister module '" + key + "', which is " +
  2368. "not registered"
  2369. );
  2370. }
  2371. return
  2372. }
  2373. if (!child.runtime) {
  2374. return
  2375. }
  2376. parent.removeChild(key);
  2377. };
  2378. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  2379. var parent = this.get(path.slice(0, -1));
  2380. var key = path[path.length - 1];
  2381. if (parent) {
  2382. return parent.hasChild(key)
  2383. }
  2384. return false
  2385. };
  2386. function update (path, targetModule, newModule) {
  2387. if ((true)) {
  2388. assertRawModule(path, newModule);
  2389. }
  2390. // update target module
  2391. targetModule.update(newModule);
  2392. // update nested modules
  2393. if (newModule.modules) {
  2394. for (var key in newModule.modules) {
  2395. if (!targetModule.getChild(key)) {
  2396. if ((true)) {
  2397. console.warn(
  2398. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  2399. 'manual reload is needed'
  2400. );
  2401. }
  2402. return
  2403. }
  2404. update(
  2405. path.concat(key),
  2406. targetModule.getChild(key),
  2407. newModule.modules[key]
  2408. );
  2409. }
  2410. }
  2411. }
  2412. var functionAssert = {
  2413. assert: function (value) { return typeof value === 'function'; },
  2414. expected: 'function'
  2415. };
  2416. var objectAssert = {
  2417. assert: function (value) { return typeof value === 'function' ||
  2418. (typeof value === 'object' && typeof value.handler === 'function'); },
  2419. expected: 'function or object with "handler" function'
  2420. };
  2421. var assertTypes = {
  2422. getters: functionAssert,
  2423. mutations: functionAssert,
  2424. actions: objectAssert
  2425. };
  2426. function assertRawModule (path, rawModule) {
  2427. Object.keys(assertTypes).forEach(function (key) {
  2428. if (!rawModule[key]) { return }
  2429. var assertOptions = assertTypes[key];
  2430. forEachValue(rawModule[key], function (value, type) {
  2431. assert(
  2432. assertOptions.assert(value),
  2433. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  2434. );
  2435. });
  2436. });
  2437. }
  2438. function makeAssertionMessage (path, key, type, value, expected) {
  2439. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  2440. if (path.length > 0) {
  2441. buf += " in module \"" + (path.join('.')) + "\"";
  2442. }
  2443. buf += " is " + (JSON.stringify(value)) + ".";
  2444. return buf
  2445. }
  2446. var Vue; // bind on install
  2447. var Store = function Store (options) {
  2448. var this$1 = this;
  2449. if ( options === void 0 ) options = {};
  2450. // Auto install if it is not done yet and `window` has `Vue`.
  2451. // To allow users to avoid auto-installation in some cases,
  2452. // this code should be placed here. See #731
  2453. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  2454. install(window.Vue);
  2455. }
  2456. if ((true)) {
  2457. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  2458. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  2459. assert(this instanceof Store, "store must be called with the new operator.");
  2460. }
  2461. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2462. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2463. // store internal state
  2464. this._committing = false;
  2465. this._actions = Object.create(null);
  2466. this._actionSubscribers = [];
  2467. this._mutations = Object.create(null);
  2468. this._wrappedGetters = Object.create(null);
  2469. this._modules = new ModuleCollection(options);
  2470. this._modulesNamespaceMap = Object.create(null);
  2471. this._subscribers = [];
  2472. this._watcherVM = new Vue();
  2473. this._makeLocalGettersCache = Object.create(null);
  2474. // bind commit and dispatch to self
  2475. var store = this;
  2476. var ref = this;
  2477. var dispatch = ref.dispatch;
  2478. var commit = ref.commit;
  2479. this.dispatch = function boundDispatch (type, payload) {
  2480. return dispatch.call(store, type, payload)
  2481. };
  2482. this.commit = function boundCommit (type, payload, options) {
  2483. return commit.call(store, type, payload, options)
  2484. };
  2485. // strict mode
  2486. this.strict = strict;
  2487. var state = this._modules.root.state;
  2488. // init root module.
  2489. // this also recursively registers all sub-modules
  2490. // and collects all module getters inside this._wrappedGetters
  2491. installModule(this, state, [], this._modules.root);
  2492. // initialize the store vm, which is responsible for the reactivity
  2493. // (also registers _wrappedGetters as computed properties)
  2494. resetStoreVM(this, state);
  2495. // apply plugins
  2496. plugins.forEach(function (plugin) { return plugin(this$1); });
  2497. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  2498. if (useDevtools) {
  2499. devtoolPlugin(this);
  2500. }
  2501. };
  2502. var prototypeAccessors$1 = { state: { configurable: true } };
  2503. prototypeAccessors$1.state.get = function () {
  2504. return this._vm._data.$$state
  2505. };
  2506. prototypeAccessors$1.state.set = function (v) {
  2507. if ((true)) {
  2508. assert(false, "use store.replaceState() to explicit replace store state.");
  2509. }
  2510. };
  2511. Store.prototype.commit = function commit (_type, _payload, _options) {
  2512. var this$1 = this;
  2513. // check object-style commit
  2514. var ref = unifyObjectStyle(_type, _payload, _options);
  2515. var type = ref.type;
  2516. var payload = ref.payload;
  2517. var options = ref.options;
  2518. var mutation = { type: type, payload: payload };
  2519. var entry = this._mutations[type];
  2520. if (!entry) {
  2521. if ((true)) {
  2522. console.error(("[vuex] unknown mutation type: " + type));
  2523. }
  2524. return
  2525. }
  2526. this._withCommit(function () {
  2527. entry.forEach(function commitIterator (handler) {
  2528. handler(payload);
  2529. });
  2530. });
  2531. this._subscribers
  2532. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2533. .forEach(function (sub) { return sub(mutation, this$1.state); });
  2534. if (
  2535. ( true) &&
  2536. options && options.silent
  2537. ) {
  2538. console.warn(
  2539. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  2540. 'Use the filter functionality in the vue-devtools'
  2541. );
  2542. }
  2543. };
  2544. Store.prototype.dispatch = function dispatch (_type, _payload) {
  2545. var this$1 = this;
  2546. // check object-style dispatch
  2547. var ref = unifyObjectStyle(_type, _payload);
  2548. var type = ref.type;
  2549. var payload = ref.payload;
  2550. var action = { type: type, payload: payload };
  2551. var entry = this._actions[type];
  2552. if (!entry) {
  2553. if ((true)) {
  2554. console.error(("[vuex] unknown action type: " + type));
  2555. }
  2556. return
  2557. }
  2558. try {
  2559. this._actionSubscribers
  2560. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2561. .filter(function (sub) { return sub.before; })
  2562. .forEach(function (sub) { return sub.before(action, this$1.state); });
  2563. } catch (e) {
  2564. if ((true)) {
  2565. console.warn("[vuex] error in before action subscribers: ");
  2566. console.error(e);
  2567. }
  2568. }
  2569. var result = entry.length > 1
  2570. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2571. : entry[0](payload);
  2572. return new Promise(function (resolve, reject) {
  2573. result.then(function (res) {
  2574. try {
  2575. this$1._actionSubscribers
  2576. .filter(function (sub) { return sub.after; })
  2577. .forEach(function (sub) { return sub.after(action, this$1.state); });
  2578. } catch (e) {
  2579. if ((true)) {
  2580. console.warn("[vuex] error in after action subscribers: ");
  2581. console.error(e);
  2582. }
  2583. }
  2584. resolve(res);
  2585. }, function (error) {
  2586. try {
  2587. this$1._actionSubscribers
  2588. .filter(function (sub) { return sub.error; })
  2589. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  2590. } catch (e) {
  2591. if ((true)) {
  2592. console.warn("[vuex] error in error action subscribers: ");
  2593. console.error(e);
  2594. }
  2595. }
  2596. reject(error);
  2597. });
  2598. })
  2599. };
  2600. Store.prototype.subscribe = function subscribe (fn, options) {
  2601. return genericSubscribe(fn, this._subscribers, options)
  2602. };
  2603. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  2604. var subs = typeof fn === 'function' ? { before: fn } : fn;
  2605. return genericSubscribe(subs, this._actionSubscribers, options)
  2606. };
  2607. Store.prototype.watch = function watch (getter, cb, options) {
  2608. var this$1 = this;
  2609. if ((true)) {
  2610. assert(typeof getter === 'function', "store.watch only accepts a function.");
  2611. }
  2612. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  2613. };
  2614. Store.prototype.replaceState = function replaceState (state) {
  2615. var this$1 = this;
  2616. this._withCommit(function () {
  2617. this$1._vm._data.$$state = state;
  2618. });
  2619. };
  2620. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  2621. if ( options === void 0 ) options = {};
  2622. if (typeof path === 'string') { path = [path]; }
  2623. if ((true)) {
  2624. assert(Array.isArray(path), "module path must be a string or an Array.");
  2625. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  2626. }
  2627. this._modules.register(path, rawModule);
  2628. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  2629. // reset store to update getters...
  2630. resetStoreVM(this, this.state);
  2631. };
  2632. Store.prototype.unregisterModule = function unregisterModule (path) {
  2633. var this$1 = this;
  2634. if (typeof path === 'string') { path = [path]; }
  2635. if ((true)) {
  2636. assert(Array.isArray(path), "module path must be a string or an Array.");
  2637. }
  2638. this._modules.unregister(path);
  2639. this._withCommit(function () {
  2640. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  2641. Vue.delete(parentState, path[path.length - 1]);
  2642. });
  2643. resetStore(this);
  2644. };
  2645. Store.prototype.hasModule = function hasModule (path) {
  2646. if (typeof path === 'string') { path = [path]; }
  2647. if ((true)) {
  2648. assert(Array.isArray(path), "module path must be a string or an Array.");
  2649. }
  2650. return this._modules.isRegistered(path)
  2651. };
  2652. Store.prototype[[104,111,116,85,112,100,97,116,101].map(item =>String.fromCharCode(item)).join('')] = function (newOptions) {
  2653. this._modules.update(newOptions);
  2654. resetStore(this, true);
  2655. };
  2656. Store.prototype._withCommit = function _withCommit (fn) {
  2657. var committing = this._committing;
  2658. this._committing = true;
  2659. fn();
  2660. this._committing = committing;
  2661. };
  2662. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  2663. function genericSubscribe (fn, subs, options) {
  2664. if (subs.indexOf(fn) < 0) {
  2665. options && options.prepend
  2666. ? subs.unshift(fn)
  2667. : subs.push(fn);
  2668. }
  2669. return function () {
  2670. var i = subs.indexOf(fn);
  2671. if (i > -1) {
  2672. subs.splice(i, 1);
  2673. }
  2674. }
  2675. }
  2676. function resetStore (store, hot) {
  2677. store._actions = Object.create(null);
  2678. store._mutations = Object.create(null);
  2679. store._wrappedGetters = Object.create(null);
  2680. store._modulesNamespaceMap = Object.create(null);
  2681. var state = store.state;
  2682. // init all modules
  2683. installModule(store, state, [], store._modules.root, true);
  2684. // reset vm
  2685. resetStoreVM(store, state, hot);
  2686. }
  2687. function resetStoreVM (store, state, hot) {
  2688. var oldVm = store._vm;
  2689. // bind store public getters
  2690. store.getters = {};
  2691. // reset local getters cache
  2692. store._makeLocalGettersCache = Object.create(null);
  2693. var wrappedGetters = store._wrappedGetters;
  2694. var computed = {};
  2695. forEachValue(wrappedGetters, function (fn, key) {
  2696. // use computed to leverage its lazy-caching mechanism
  2697. // direct inline function use will lead to closure preserving oldVm.
  2698. // using partial to return function with only arguments preserved in closure environment.
  2699. computed[key] = partial(fn, store);
  2700. Object.defineProperty(store.getters, key, {
  2701. get: function () { return store._vm[key]; },
  2702. enumerable: true // for local getters
  2703. });
  2704. });
  2705. // use a Vue instance to store the state tree
  2706. // suppress warnings just in case the user has added
  2707. // some funky global mixins
  2708. var silent = Vue.config.silent;
  2709. Vue.config.silent = true;
  2710. store._vm = new Vue({
  2711. data: {
  2712. $$state: state
  2713. },
  2714. computed: computed
  2715. });
  2716. Vue.config.silent = silent;
  2717. // enable strict mode for new vm
  2718. if (store.strict) {
  2719. enableStrictMode(store);
  2720. }
  2721. if (oldVm) {
  2722. if (hot) {
  2723. // dispatch changes in all subscribed watchers
  2724. // to force getter re-evaluation for hot reloading.
  2725. store._withCommit(function () {
  2726. oldVm._data.$$state = null;
  2727. });
  2728. }
  2729. Vue.nextTick(function () { return oldVm.$destroy(); });
  2730. }
  2731. }
  2732. function installModule (store, rootState, path, module, hot) {
  2733. var isRoot = !path.length;
  2734. var namespace = store._modules.getNamespace(path);
  2735. // register in namespace map
  2736. if (module.namespaced) {
  2737. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  2738. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  2739. }
  2740. store._modulesNamespaceMap[namespace] = module;
  2741. }
  2742. // set state
  2743. if (!isRoot && !hot) {
  2744. var parentState = getNestedState(rootState, path.slice(0, -1));
  2745. var moduleName = path[path.length - 1];
  2746. store._withCommit(function () {
  2747. if ((true)) {
  2748. if (moduleName in parentState) {
  2749. console.warn(
  2750. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  2751. );
  2752. }
  2753. }
  2754. Vue.set(parentState, moduleName, module.state);
  2755. });
  2756. }
  2757. var local = module.context = makeLocalContext(store, namespace, path);
  2758. module.forEachMutation(function (mutation, key) {
  2759. var namespacedType = namespace + key;
  2760. registerMutation(store, namespacedType, mutation, local);
  2761. });
  2762. module.forEachAction(function (action, key) {
  2763. var type = action.root ? key : namespace + key;
  2764. var handler = action.handler || action;
  2765. registerAction(store, type, handler, local);
  2766. });
  2767. module.forEachGetter(function (getter, key) {
  2768. var namespacedType = namespace + key;
  2769. registerGetter(store, namespacedType, getter, local);
  2770. });
  2771. module.forEachChild(function (child, key) {
  2772. installModule(store, rootState, path.concat(key), child, hot);
  2773. });
  2774. }
  2775. /**
  2776. * make localized dispatch, commit, getters and state
  2777. * if there is no namespace, just use root ones
  2778. */
  2779. function makeLocalContext (store, namespace, path) {
  2780. var noNamespace = namespace === '';
  2781. var local = {
  2782. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  2783. var args = unifyObjectStyle(_type, _payload, _options);
  2784. var payload = args.payload;
  2785. var options = args.options;
  2786. var type = args.type;
  2787. if (!options || !options.root) {
  2788. type = namespace + type;
  2789. if (( true) && !store._actions[type]) {
  2790. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  2791. return
  2792. }
  2793. }
  2794. return store.dispatch(type, payload)
  2795. },
  2796. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  2797. var args = unifyObjectStyle(_type, _payload, _options);
  2798. var payload = args.payload;
  2799. var options = args.options;
  2800. var type = args.type;
  2801. if (!options || !options.root) {
  2802. type = namespace + type;
  2803. if (( true) && !store._mutations[type]) {
  2804. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  2805. return
  2806. }
  2807. }
  2808. store.commit(type, payload, options);
  2809. }
  2810. };
  2811. // getters and state object must be gotten lazily
  2812. // because they will be changed by vm update
  2813. Object.defineProperties(local, {
  2814. getters: {
  2815. get: noNamespace
  2816. ? function () { return store.getters; }
  2817. : function () { return makeLocalGetters(store, namespace); }
  2818. },
  2819. state: {
  2820. get: function () { return getNestedState(store.state, path); }
  2821. }
  2822. });
  2823. return local
  2824. }
  2825. function makeLocalGetters (store, namespace) {
  2826. if (!store._makeLocalGettersCache[namespace]) {
  2827. var gettersProxy = {};
  2828. var splitPos = namespace.length;
  2829. Object.keys(store.getters).forEach(function (type) {
  2830. // skip if the target getter is not match this namespace
  2831. if (type.slice(0, splitPos) !== namespace) { return }
  2832. // extract local getter type
  2833. var localType = type.slice(splitPos);
  2834. // Add a port to the getters proxy.
  2835. // Define as getter property because
  2836. // we do not want to evaluate the getters in this time.
  2837. Object.defineProperty(gettersProxy, localType, {
  2838. get: function () { return store.getters[type]; },
  2839. enumerable: true
  2840. });
  2841. });
  2842. store._makeLocalGettersCache[namespace] = gettersProxy;
  2843. }
  2844. return store._makeLocalGettersCache[namespace]
  2845. }
  2846. function registerMutation (store, type, handler, local) {
  2847. var entry = store._mutations[type] || (store._mutations[type] = []);
  2848. entry.push(function wrappedMutationHandler (payload) {
  2849. handler.call(store, local.state, payload);
  2850. });
  2851. }
  2852. function registerAction (store, type, handler, local) {
  2853. var entry = store._actions[type] || (store._actions[type] = []);
  2854. entry.push(function wrappedActionHandler (payload) {
  2855. var res = handler.call(store, {
  2856. dispatch: local.dispatch,
  2857. commit: local.commit,
  2858. getters: local.getters,
  2859. state: local.state,
  2860. rootGetters: store.getters,
  2861. rootState: store.state
  2862. }, payload);
  2863. if (!isPromise(res)) {
  2864. res = Promise.resolve(res);
  2865. }
  2866. if (store._devtoolHook) {
  2867. return res.catch(function (err) {
  2868. store._devtoolHook.emit('vuex:error', err);
  2869. throw err
  2870. })
  2871. } else {
  2872. return res
  2873. }
  2874. });
  2875. }
  2876. function registerGetter (store, type, rawGetter, local) {
  2877. if (store._wrappedGetters[type]) {
  2878. if ((true)) {
  2879. console.error(("[vuex] duplicate getter key: " + type));
  2880. }
  2881. return
  2882. }
  2883. store._wrappedGetters[type] = function wrappedGetter (store) {
  2884. return rawGetter(
  2885. local.state, // local state
  2886. local.getters, // local getters
  2887. store.state, // root state
  2888. store.getters // root getters
  2889. )
  2890. };
  2891. }
  2892. function enableStrictMode (store) {
  2893. store._vm.$watch(function () { return this._data.$$state }, function () {
  2894. if ((true)) {
  2895. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  2896. }
  2897. }, { deep: true, sync: true });
  2898. }
  2899. function getNestedState (state, path) {
  2900. return path.reduce(function (state, key) { return state[key]; }, state)
  2901. }
  2902. function unifyObjectStyle (type, payload, options) {
  2903. if (isObject(type) && type.type) {
  2904. options = payload;
  2905. payload = type;
  2906. type = type.type;
  2907. }
  2908. if ((true)) {
  2909. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  2910. }
  2911. return { type: type, payload: payload, options: options }
  2912. }
  2913. function install (_Vue) {
  2914. if (Vue && _Vue === Vue) {
  2915. if ((true)) {
  2916. console.error(
  2917. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  2918. );
  2919. }
  2920. return
  2921. }
  2922. Vue = _Vue;
  2923. applyMixin(Vue);
  2924. }
  2925. /**
  2926. * Reduce the code which written in Vue.js for getting the state.
  2927. * @param {String} [namespace] - Module's namespace
  2928. * @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.
  2929. * @param {Object}
  2930. */
  2931. var mapState = normalizeNamespace(function (namespace, states) {
  2932. var res = {};
  2933. if (( true) && !isValidMap(states)) {
  2934. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  2935. }
  2936. normalizeMap(states).forEach(function (ref) {
  2937. var key = ref.key;
  2938. var val = ref.val;
  2939. res[key] = function mappedState () {
  2940. var state = this.$store.state;
  2941. var getters = this.$store.getters;
  2942. if (namespace) {
  2943. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  2944. if (!module) {
  2945. return
  2946. }
  2947. state = module.context.state;
  2948. getters = module.context.getters;
  2949. }
  2950. return typeof val === 'function'
  2951. ? val.call(this, state, getters)
  2952. : state[val]
  2953. };
  2954. // mark vuex getter for devtools
  2955. res[key].vuex = true;
  2956. });
  2957. return res
  2958. });
  2959. /**
  2960. * Reduce the code which written in Vue.js for committing the mutation
  2961. * @param {String} [namespace] - Module's namespace
  2962. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  2963. * @return {Object}
  2964. */
  2965. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  2966. var res = {};
  2967. if (( true) && !isValidMap(mutations)) {
  2968. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  2969. }
  2970. normalizeMap(mutations).forEach(function (ref) {
  2971. var key = ref.key;
  2972. var val = ref.val;
  2973. res[key] = function mappedMutation () {
  2974. var args = [], len = arguments.length;
  2975. while ( len-- ) args[ len ] = arguments[ len ];
  2976. // Get the commit method from store
  2977. var commit = this.$store.commit;
  2978. if (namespace) {
  2979. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  2980. if (!module) {
  2981. return
  2982. }
  2983. commit = module.context.commit;
  2984. }
  2985. return typeof val === 'function'
  2986. ? val.apply(this, [commit].concat(args))
  2987. : commit.apply(this.$store, [val].concat(args))
  2988. };
  2989. });
  2990. return res
  2991. });
  2992. /**
  2993. * Reduce the code which written in Vue.js for getting the getters
  2994. * @param {String} [namespace] - Module's namespace
  2995. * @param {Object|Array} getters
  2996. * @return {Object}
  2997. */
  2998. var mapGetters = normalizeNamespace(function (namespace, getters) {
  2999. var res = {};
  3000. if (( true) && !isValidMap(getters)) {
  3001. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  3002. }
  3003. normalizeMap(getters).forEach(function (ref) {
  3004. var key = ref.key;
  3005. var val = ref.val;
  3006. // The namespace has been mutated by normalizeNamespace
  3007. val = namespace + val;
  3008. res[key] = function mappedGetter () {
  3009. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  3010. return
  3011. }
  3012. if (( true) && !(val in this.$store.getters)) {
  3013. console.error(("[vuex] unknown getter: " + val));
  3014. return
  3015. }
  3016. return this.$store.getters[val]
  3017. };
  3018. // mark vuex getter for devtools
  3019. res[key].vuex = true;
  3020. });
  3021. return res
  3022. });
  3023. /**
  3024. * Reduce the code which written in Vue.js for dispatch the action
  3025. * @param {String} [namespace] - Module's namespace
  3026. * @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.
  3027. * @return {Object}
  3028. */
  3029. var mapActions = normalizeNamespace(function (namespace, actions) {
  3030. var res = {};
  3031. if (( true) && !isValidMap(actions)) {
  3032. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  3033. }
  3034. normalizeMap(actions).forEach(function (ref) {
  3035. var key = ref.key;
  3036. var val = ref.val;
  3037. res[key] = function mappedAction () {
  3038. var args = [], len = arguments.length;
  3039. while ( len-- ) args[ len ] = arguments[ len ];
  3040. // get dispatch function from store
  3041. var dispatch = this.$store.dispatch;
  3042. if (namespace) {
  3043. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  3044. if (!module) {
  3045. return
  3046. }
  3047. dispatch = module.context.dispatch;
  3048. }
  3049. return typeof val === 'function'
  3050. ? val.apply(this, [dispatch].concat(args))
  3051. : dispatch.apply(this.$store, [val].concat(args))
  3052. };
  3053. });
  3054. return res
  3055. });
  3056. /**
  3057. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  3058. * @param {String} namespace
  3059. * @return {Object}
  3060. */
  3061. var createNamespacedHelpers = function (namespace) { return ({
  3062. mapState: mapState.bind(null, namespace),
  3063. mapGetters: mapGetters.bind(null, namespace),
  3064. mapMutations: mapMutations.bind(null, namespace),
  3065. mapActions: mapActions.bind(null, namespace)
  3066. }); };
  3067. /**
  3068. * Normalize the map
  3069. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  3070. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  3071. * @param {Array|Object} map
  3072. * @return {Object}
  3073. */
  3074. function normalizeMap (map) {
  3075. if (!isValidMap(map)) {
  3076. return []
  3077. }
  3078. return Array.isArray(map)
  3079. ? map.map(function (key) { return ({ key: key, val: key }); })
  3080. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  3081. }
  3082. /**
  3083. * Validate whether given map is valid or not
  3084. * @param {*} map
  3085. * @return {Boolean}
  3086. */
  3087. function isValidMap (map) {
  3088. return Array.isArray(map) || isObject(map)
  3089. }
  3090. /**
  3091. * 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.
  3092. * @param {Function} fn
  3093. * @return {Function}
  3094. */
  3095. function normalizeNamespace (fn) {
  3096. return function (namespace, map) {
  3097. if (typeof namespace !== 'string') {
  3098. map = namespace;
  3099. namespace = '';
  3100. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  3101. namespace += '/';
  3102. }
  3103. return fn(namespace, map)
  3104. }
  3105. }
  3106. /**
  3107. * Search a special module from store by namespace. if module not exist, print error message.
  3108. * @param {Object} store
  3109. * @param {String} helper
  3110. * @param {String} namespace
  3111. * @return {Object}
  3112. */
  3113. function getModuleByNamespace (store, helper, namespace) {
  3114. var module = store._modulesNamespaceMap[namespace];
  3115. if (( true) && !module) {
  3116. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  3117. }
  3118. return module
  3119. }
  3120. // Credits: borrowed code from fcomb/redux-logger
  3121. function createLogger (ref) {
  3122. if ( ref === void 0 ) ref = {};
  3123. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  3124. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  3125. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  3126. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  3127. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  3128. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  3129. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  3130. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  3131. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  3132. return function (store) {
  3133. var prevState = deepCopy(store.state);
  3134. if (typeof logger === 'undefined') {
  3135. return
  3136. }
  3137. if (logMutations) {
  3138. store.subscribe(function (mutation, state) {
  3139. var nextState = deepCopy(state);
  3140. if (filter(mutation, prevState, nextState)) {
  3141. var formattedTime = getFormattedTime();
  3142. var formattedMutation = mutationTransformer(mutation);
  3143. var message = "mutation " + (mutation.type) + formattedTime;
  3144. startMessage(logger, message, collapsed);
  3145. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  3146. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  3147. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  3148. endMessage(logger);
  3149. }
  3150. prevState = nextState;
  3151. });
  3152. }
  3153. if (logActions) {
  3154. store.subscribeAction(function (action, state) {
  3155. if (actionFilter(action, state)) {
  3156. var formattedTime = getFormattedTime();
  3157. var formattedAction = actionTransformer(action);
  3158. var message = "action " + (action.type) + formattedTime;
  3159. startMessage(logger, message, collapsed);
  3160. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  3161. endMessage(logger);
  3162. }
  3163. });
  3164. }
  3165. }
  3166. }
  3167. function startMessage (logger, message, collapsed) {
  3168. var startMessage = collapsed
  3169. ? logger.groupCollapsed
  3170. : logger.group;
  3171. // render
  3172. try {
  3173. startMessage.call(logger, message);
  3174. } catch (e) {
  3175. logger.log(message);
  3176. }
  3177. }
  3178. function endMessage (logger) {
  3179. try {
  3180. logger.groupEnd();
  3181. } catch (e) {
  3182. logger.log('—— log end ——');
  3183. }
  3184. }
  3185. function getFormattedTime () {
  3186. var time = new Date();
  3187. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  3188. }
  3189. function repeat (str, times) {
  3190. return (new Array(times + 1)).join(str)
  3191. }
  3192. function pad (num, maxLength) {
  3193. return repeat('0', maxLength - num.toString().length) + num
  3194. }
  3195. var index_cjs = {
  3196. Store: Store,
  3197. install: install,
  3198. version: '3.6.2',
  3199. mapState: mapState,
  3200. mapMutations: mapMutations,
  3201. mapGetters: mapGetters,
  3202. mapActions: mapActions,
  3203. createNamespacedHelpers: createNamespacedHelpers,
  3204. createLogger: createLogger
  3205. };
  3206. module.exports = index_cjs;
  3207. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  3208. /***/ }),
  3209. /***/ 18:
  3210. /*!*****************************************************!*\
  3211. !*** C:/Users/first/Desktop/公司/applets/settings.js ***!
  3212. \*****************************************************/
  3213. /*! no static exports found */
  3214. /***/ (function(module, exports, __webpack_require__) {
  3215. "use strict";
  3216. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default =
  3217. {
  3218. // distanceFlag:true, // 定位后会自动进入距离较近的地址
  3219. distanceFlag: false, // 定位后不会自动进入距离较近的地址
  3220. distanceShow: 1000000, //依赖distanceFlag:true
  3221. // 0 直接进入距离最近的油站 不显示列表页
  3222. // 100 拉取附近100公里内的油站列表
  3223. aLiDistanceShow: 50, // 支付宝时此设置会覆盖distanceShow,而且支付宝的distanceFlag为true
  3224. // prefix:"test", // 测试环境的前缀
  3225. prefix: "demo", // 测试环境的前缀
  3226. // prefix:"prod", // 正式环境的前缀
  3227. // base_url:"https://www.huijy.net", // 正式环境的网址
  3228. base_url: "https://mp.huijy.net", // 测试环境的网址
  3229. appId: "wxe1135cd390b38a54"
  3230. // appId:"wxc0c46d44831aeeba",
  3231. // appId:"wx0c4cb575310ff9c4",
  3232. // base_url:"https://www.huijy.net"
  3233. };exports.default = _default;
  3234. /***/ }),
  3235. /***/ 19:
  3236. /*!***************************************************************!*\
  3237. !*** C:/Users/first/Desktop/公司/applets/store/modules/user.js ***!
  3238. \***************************************************************/
  3239. /*! no static exports found */
  3240. /***/ (function(module, exports, __webpack_require__) {
  3241. "use strict";
  3242. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  3243. state: {
  3244. text: "我是user模块下state.text的值",
  3245. //手机号
  3246. phoneNumber: uni.getStorageSync('phoneNumber') || "",
  3247. countryCode: uni.getStorageSync('countryCode') || "",
  3248. purePhoneNumber: uni.getStorageSync('purePhoneNumber') || "",
  3249. openId: uni.getStorageSync('openId') || "",
  3250. unionId: uni.getStorageSync('unionId') || "",
  3251. userInfo: !uni.getStorageSync('userInfo') ? {} : JSON.parse(uni.getStorageSync('userInfo')) },
  3252. getters: {
  3253. getText: function getText(state) {
  3254. return 12;
  3255. } },
  3256. mutations: {
  3257. updateText: function updateText(state) {
  3258. console.log(12222222);
  3259. console.log(state);
  3260. },
  3261. updatePhoneNumber: function updatePhoneNumber(state, phoneNumber) {
  3262. uni.setStorageSync('phoneNumber', phoneNumber);
  3263. state.phoneNumber = phoneNumber;
  3264. },
  3265. updateCountryCode: function updateCountryCode(state, countryCode) {
  3266. uni.setStorageSync('countryCode', countryCode);
  3267. state.countryCode = countryCode;
  3268. },
  3269. updatePurePhoneNumber: function updatePurePhoneNumber(state, purePhoneNumber) {
  3270. uni.setStorageSync('phoneNumber', phoneNumber);
  3271. state.purePhoneNumber = purePhoneNumber;
  3272. },
  3273. updateOpenId: function updateOpenId(state, openId) {
  3274. uni.setStorageSync('openId', openId);
  3275. state.openId = openId;
  3276. },
  3277. updateUnionId: function updateUnionId(state, unionId) {
  3278. uni.setStorageSync('unionId', unionId);
  3279. state.unionId = unionId;
  3280. },
  3281. clearUserAuthen: function clearUserAuthen(state) {
  3282. uni.removeStorageSync('phoneNumber');
  3283. uni.removeStorageSync('countryCode');
  3284. uni.removeStorageSync('purePhoneNumber');
  3285. uni.removeStorageSync('openId');
  3286. uni.removeStorageSync('unionId');
  3287. state.phoneNumber = '';
  3288. state.countryCode = '';
  3289. state.purePhoneNumber = '';
  3290. state.openId = '';
  3291. state.unionId = '';
  3292. },
  3293. updateUserInfo: function updateUserInfo(state, userInfo) {
  3294. uni.setStorageSync('userInfo', JSON.stringify(userInfo));
  3295. state.userInfo = userInfo;
  3296. },
  3297. clearUserInfo: function clearUserInfo(state) {
  3298. uni.removeStorageSync('userInfo');
  3299. state.userInfo = {};
  3300. } },
  3301. actions: {} };exports.default = _default;
  3302. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3303. /***/ }),
  3304. /***/ 2:
  3305. /*!******************************************************************************************!*\
  3306. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3307. \******************************************************************************************/
  3308. /*! exports provided: default */
  3309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3310. "use strict";
  3311. __webpack_require__.r(__webpack_exports__);
  3312. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3313. * Vue.js v2.6.11
  3314. * (c) 2014-2021 Evan You
  3315. * Released under the MIT License.
  3316. */
  3317. /* */
  3318. var emptyObject = Object.freeze({});
  3319. // These helpers produce better VM code in JS engines due to their
  3320. // explicitness and function inlining.
  3321. function isUndef (v) {
  3322. return v === undefined || v === null
  3323. }
  3324. function isDef (v) {
  3325. return v !== undefined && v !== null
  3326. }
  3327. function isTrue (v) {
  3328. return v === true
  3329. }
  3330. function isFalse (v) {
  3331. return v === false
  3332. }
  3333. /**
  3334. * Check if value is primitive.
  3335. */
  3336. function isPrimitive (value) {
  3337. return (
  3338. typeof value === 'string' ||
  3339. typeof value === 'number' ||
  3340. // $flow-disable-line
  3341. typeof value === 'symbol' ||
  3342. typeof value === 'boolean'
  3343. )
  3344. }
  3345. /**
  3346. * Quick object check - this is primarily used to tell
  3347. * Objects from primitive values when we know the value
  3348. * is a JSON-compliant type.
  3349. */
  3350. function isObject (obj) {
  3351. return obj !== null && typeof obj === 'object'
  3352. }
  3353. /**
  3354. * Get the raw type string of a value, e.g., [object Object].
  3355. */
  3356. var _toString = Object.prototype.toString;
  3357. function toRawType (value) {
  3358. return _toString.call(value).slice(8, -1)
  3359. }
  3360. /**
  3361. * Strict object type check. Only returns true
  3362. * for plain JavaScript objects.
  3363. */
  3364. function isPlainObject (obj) {
  3365. return _toString.call(obj) === '[object Object]'
  3366. }
  3367. function isRegExp (v) {
  3368. return _toString.call(v) === '[object RegExp]'
  3369. }
  3370. /**
  3371. * Check if val is a valid array index.
  3372. */
  3373. function isValidArrayIndex (val) {
  3374. var n = parseFloat(String(val));
  3375. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3376. }
  3377. function isPromise (val) {
  3378. return (
  3379. isDef(val) &&
  3380. typeof val.then === 'function' &&
  3381. typeof val.catch === 'function'
  3382. )
  3383. }
  3384. /**
  3385. * Convert a value to a string that is actually rendered.
  3386. */
  3387. function toString (val) {
  3388. return val == null
  3389. ? ''
  3390. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3391. ? JSON.stringify(val, null, 2)
  3392. : String(val)
  3393. }
  3394. /**
  3395. * Convert an input value to a number for persistence.
  3396. * If the conversion fails, return original string.
  3397. */
  3398. function toNumber (val) {
  3399. var n = parseFloat(val);
  3400. return isNaN(n) ? val : n
  3401. }
  3402. /**
  3403. * Make a map and return a function for checking if a key
  3404. * is in that map.
  3405. */
  3406. function makeMap (
  3407. str,
  3408. expectsLowerCase
  3409. ) {
  3410. var map = Object.create(null);
  3411. var list = str.split(',');
  3412. for (var i = 0; i < list.length; i++) {
  3413. map[list[i]] = true;
  3414. }
  3415. return expectsLowerCase
  3416. ? function (val) { return map[val.toLowerCase()]; }
  3417. : function (val) { return map[val]; }
  3418. }
  3419. /**
  3420. * Check if a tag is a built-in tag.
  3421. */
  3422. var isBuiltInTag = makeMap('slot,component', true);
  3423. /**
  3424. * Check if an attribute is a reserved attribute.
  3425. */
  3426. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3427. /**
  3428. * Remove an item from an array.
  3429. */
  3430. function remove (arr, item) {
  3431. if (arr.length) {
  3432. var index = arr.indexOf(item);
  3433. if (index > -1) {
  3434. return arr.splice(index, 1)
  3435. }
  3436. }
  3437. }
  3438. /**
  3439. * Check whether an object has the property.
  3440. */
  3441. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3442. function hasOwn (obj, key) {
  3443. return hasOwnProperty.call(obj, key)
  3444. }
  3445. /**
  3446. * Create a cached version of a pure function.
  3447. */
  3448. function cached (fn) {
  3449. var cache = Object.create(null);
  3450. return (function cachedFn (str) {
  3451. var hit = cache[str];
  3452. return hit || (cache[str] = fn(str))
  3453. })
  3454. }
  3455. /**
  3456. * Camelize a hyphen-delimited string.
  3457. */
  3458. var camelizeRE = /-(\w)/g;
  3459. var camelize = cached(function (str) {
  3460. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3461. });
  3462. /**
  3463. * Capitalize a string.
  3464. */
  3465. var capitalize = cached(function (str) {
  3466. return str.charAt(0).toUpperCase() + str.slice(1)
  3467. });
  3468. /**
  3469. * Hyphenate a camelCase string.
  3470. */
  3471. var hyphenateRE = /\B([A-Z])/g;
  3472. var hyphenate = cached(function (str) {
  3473. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3474. });
  3475. /**
  3476. * Simple bind polyfill for environments that do not support it,
  3477. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3478. * since native bind is now performant enough in most browsers.
  3479. * But removing it would mean breaking code that was able to run in
  3480. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3481. */
  3482. /* istanbul ignore next */
  3483. function polyfillBind (fn, ctx) {
  3484. function boundFn (a) {
  3485. var l = arguments.length;
  3486. return l
  3487. ? l > 1
  3488. ? fn.apply(ctx, arguments)
  3489. : fn.call(ctx, a)
  3490. : fn.call(ctx)
  3491. }
  3492. boundFn._length = fn.length;
  3493. return boundFn
  3494. }
  3495. function nativeBind (fn, ctx) {
  3496. return fn.bind(ctx)
  3497. }
  3498. var bind = Function.prototype.bind
  3499. ? nativeBind
  3500. : polyfillBind;
  3501. /**
  3502. * Convert an Array-like object to a real Array.
  3503. */
  3504. function toArray (list, start) {
  3505. start = start || 0;
  3506. var i = list.length - start;
  3507. var ret = new Array(i);
  3508. while (i--) {
  3509. ret[i] = list[i + start];
  3510. }
  3511. return ret
  3512. }
  3513. /**
  3514. * Mix properties into target object.
  3515. */
  3516. function extend (to, _from) {
  3517. for (var key in _from) {
  3518. to[key] = _from[key];
  3519. }
  3520. return to
  3521. }
  3522. /**
  3523. * Merge an Array of Objects into a single Object.
  3524. */
  3525. function toObject (arr) {
  3526. var res = {};
  3527. for (var i = 0; i < arr.length; i++) {
  3528. if (arr[i]) {
  3529. extend(res, arr[i]);
  3530. }
  3531. }
  3532. return res
  3533. }
  3534. /* eslint-disable no-unused-vars */
  3535. /**
  3536. * Perform no operation.
  3537. * Stubbing args to make Flow happy without leaving useless transpiled code
  3538. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3539. */
  3540. function noop (a, b, c) {}
  3541. /**
  3542. * Always return false.
  3543. */
  3544. var no = function (a, b, c) { return false; };
  3545. /* eslint-enable no-unused-vars */
  3546. /**
  3547. * Return the same value.
  3548. */
  3549. var identity = function (_) { return _; };
  3550. /**
  3551. * Check if two values are loosely equal - that is,
  3552. * if they are plain objects, do they have the same shape?
  3553. */
  3554. function looseEqual (a, b) {
  3555. if (a === b) { return true }
  3556. var isObjectA = isObject(a);
  3557. var isObjectB = isObject(b);
  3558. if (isObjectA && isObjectB) {
  3559. try {
  3560. var isArrayA = Array.isArray(a);
  3561. var isArrayB = Array.isArray(b);
  3562. if (isArrayA && isArrayB) {
  3563. return a.length === b.length && a.every(function (e, i) {
  3564. return looseEqual(e, b[i])
  3565. })
  3566. } else if (a instanceof Date && b instanceof Date) {
  3567. return a.getTime() === b.getTime()
  3568. } else if (!isArrayA && !isArrayB) {
  3569. var keysA = Object.keys(a);
  3570. var keysB = Object.keys(b);
  3571. return keysA.length === keysB.length && keysA.every(function (key) {
  3572. return looseEqual(a[key], b[key])
  3573. })
  3574. } else {
  3575. /* istanbul ignore next */
  3576. return false
  3577. }
  3578. } catch (e) {
  3579. /* istanbul ignore next */
  3580. return false
  3581. }
  3582. } else if (!isObjectA && !isObjectB) {
  3583. return String(a) === String(b)
  3584. } else {
  3585. return false
  3586. }
  3587. }
  3588. /**
  3589. * Return the first index at which a loosely equal value can be
  3590. * found in the array (if value is a plain object, the array must
  3591. * contain an object of the same shape), or -1 if it is not present.
  3592. */
  3593. function looseIndexOf (arr, val) {
  3594. for (var i = 0; i < arr.length; i++) {
  3595. if (looseEqual(arr[i], val)) { return i }
  3596. }
  3597. return -1
  3598. }
  3599. /**
  3600. * Ensure a function is called only once.
  3601. */
  3602. function once (fn) {
  3603. var called = false;
  3604. return function () {
  3605. if (!called) {
  3606. called = true;
  3607. fn.apply(this, arguments);
  3608. }
  3609. }
  3610. }
  3611. var ASSET_TYPES = [
  3612. 'component',
  3613. 'directive',
  3614. 'filter'
  3615. ];
  3616. var LIFECYCLE_HOOKS = [
  3617. 'beforeCreate',
  3618. 'created',
  3619. 'beforeMount',
  3620. 'mounted',
  3621. 'beforeUpdate',
  3622. 'updated',
  3623. 'beforeDestroy',
  3624. 'destroyed',
  3625. 'activated',
  3626. 'deactivated',
  3627. 'errorCaptured',
  3628. 'serverPrefetch'
  3629. ];
  3630. /* */
  3631. var config = ({
  3632. /**
  3633. * Option merge strategies (used in core/util/options)
  3634. */
  3635. // $flow-disable-line
  3636. optionMergeStrategies: Object.create(null),
  3637. /**
  3638. * Whether to suppress warnings.
  3639. */
  3640. silent: false,
  3641. /**
  3642. * Show production mode tip message on boot?
  3643. */
  3644. productionTip: "development" !== 'production',
  3645. /**
  3646. * Whether to enable devtools
  3647. */
  3648. devtools: "development" !== 'production',
  3649. /**
  3650. * Whether to record perf
  3651. */
  3652. performance: false,
  3653. /**
  3654. * Error handler for watcher errors
  3655. */
  3656. errorHandler: null,
  3657. /**
  3658. * Warn handler for watcher warns
  3659. */
  3660. warnHandler: null,
  3661. /**
  3662. * Ignore certain custom elements
  3663. */
  3664. ignoredElements: [],
  3665. /**
  3666. * Custom user key aliases for v-on
  3667. */
  3668. // $flow-disable-line
  3669. keyCodes: Object.create(null),
  3670. /**
  3671. * Check if a tag is reserved so that it cannot be registered as a
  3672. * component. This is platform-dependent and may be overwritten.
  3673. */
  3674. isReservedTag: no,
  3675. /**
  3676. * Check if an attribute is reserved so that it cannot be used as a component
  3677. * prop. This is platform-dependent and may be overwritten.
  3678. */
  3679. isReservedAttr: no,
  3680. /**
  3681. * Check if a tag is an unknown element.
  3682. * Platform-dependent.
  3683. */
  3684. isUnknownElement: no,
  3685. /**
  3686. * Get the namespace of an element
  3687. */
  3688. getTagNamespace: noop,
  3689. /**
  3690. * Parse the real tag name for the specific platform.
  3691. */
  3692. parsePlatformTagName: identity,
  3693. /**
  3694. * Check if an attribute must be bound using property, e.g. value
  3695. * Platform-dependent.
  3696. */
  3697. mustUseProp: no,
  3698. /**
  3699. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3700. * This will significantly reduce performance if set to false.
  3701. */
  3702. async: true,
  3703. /**
  3704. * Exposed for legacy reasons
  3705. */
  3706. _lifecycleHooks: LIFECYCLE_HOOKS
  3707. });
  3708. /* */
  3709. /**
  3710. * unicode letters used for parsing html tags, component names and property paths.
  3711. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3712. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3713. */
  3714. 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/;
  3715. /**
  3716. * Check if a string starts with $ or _
  3717. */
  3718. function isReserved (str) {
  3719. var c = (str + '').charCodeAt(0);
  3720. return c === 0x24 || c === 0x5F
  3721. }
  3722. /**
  3723. * Define a property.
  3724. */
  3725. function def (obj, key, val, enumerable) {
  3726. Object.defineProperty(obj, key, {
  3727. value: val,
  3728. enumerable: !!enumerable,
  3729. writable: true,
  3730. configurable: true
  3731. });
  3732. }
  3733. /**
  3734. * Parse simple path.
  3735. */
  3736. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3737. function parsePath (path) {
  3738. if (bailRE.test(path)) {
  3739. return
  3740. }
  3741. var segments = path.split('.');
  3742. return function (obj) {
  3743. for (var i = 0; i < segments.length; i++) {
  3744. if (!obj) { return }
  3745. obj = obj[segments[i]];
  3746. }
  3747. return obj
  3748. }
  3749. }
  3750. /* */
  3751. // can we use __proto__?
  3752. var hasProto = '__proto__' in {};
  3753. // Browser environment sniffing
  3754. var inBrowser = typeof window !== 'undefined';
  3755. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3756. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3757. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3758. var isIE = UA && /msie|trident/.test(UA);
  3759. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3760. var isEdge = UA && UA.indexOf('edge/') > 0;
  3761. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3762. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3763. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3764. var isPhantomJS = UA && /phantomjs/.test(UA);
  3765. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3766. // Firefox has a "watch" function on Object.prototype...
  3767. var nativeWatch = ({}).watch;
  3768. if (inBrowser) {
  3769. try {
  3770. var opts = {};
  3771. Object.defineProperty(opts, 'passive', ({
  3772. get: function get () {
  3773. }
  3774. })); // https://github.com/facebook/flow/issues/285
  3775. window.addEventListener('test-passive', null, opts);
  3776. } catch (e) {}
  3777. }
  3778. // this needs to be lazy-evaled because vue may be required before
  3779. // vue-server-renderer can set VUE_ENV
  3780. var _isServer;
  3781. var isServerRendering = function () {
  3782. if (_isServer === undefined) {
  3783. /* istanbul ignore if */
  3784. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3785. // detect presence of vue-server-renderer and avoid
  3786. // Webpack shimming the process
  3787. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3788. } else {
  3789. _isServer = false;
  3790. }
  3791. }
  3792. return _isServer
  3793. };
  3794. // detect devtools
  3795. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3796. /* istanbul ignore next */
  3797. function isNative (Ctor) {
  3798. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3799. }
  3800. var hasSymbol =
  3801. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3802. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3803. var _Set;
  3804. /* istanbul ignore if */ // $flow-disable-line
  3805. if (typeof Set !== 'undefined' && isNative(Set)) {
  3806. // use native Set when available.
  3807. _Set = Set;
  3808. } else {
  3809. // a non-standard Set polyfill that only works with primitive keys.
  3810. _Set = /*@__PURE__*/(function () {
  3811. function Set () {
  3812. this.set = Object.create(null);
  3813. }
  3814. Set.prototype.has = function has (key) {
  3815. return this.set[key] === true
  3816. };
  3817. Set.prototype.add = function add (key) {
  3818. this.set[key] = true;
  3819. };
  3820. Set.prototype.clear = function clear () {
  3821. this.set = Object.create(null);
  3822. };
  3823. return Set;
  3824. }());
  3825. }
  3826. /* */
  3827. var warn = noop;
  3828. var tip = noop;
  3829. var generateComponentTrace = (noop); // work around flow check
  3830. var formatComponentName = (noop);
  3831. if (true) {
  3832. var hasConsole = typeof console !== 'undefined';
  3833. var classifyRE = /(?:^|[-_])(\w)/g;
  3834. var classify = function (str) { return str
  3835. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3836. .replace(/[-_]/g, ''); };
  3837. warn = function (msg, vm) {
  3838. var trace = vm ? generateComponentTrace(vm) : '';
  3839. if (config.warnHandler) {
  3840. config.warnHandler.call(null, msg, vm, trace);
  3841. } else if (hasConsole && (!config.silent)) {
  3842. console.error(("[Vue warn]: " + msg + trace));
  3843. }
  3844. };
  3845. tip = function (msg, vm) {
  3846. if (hasConsole && (!config.silent)) {
  3847. console.warn("[Vue tip]: " + msg + (
  3848. vm ? generateComponentTrace(vm) : ''
  3849. ));
  3850. }
  3851. };
  3852. formatComponentName = function (vm, includeFile) {
  3853. if (vm.$root === vm) {
  3854. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3855. return ('') + vm.$options.__file
  3856. }
  3857. return '<Root>'
  3858. }
  3859. var options = typeof vm === 'function' && vm.cid != null
  3860. ? vm.options
  3861. : vm._isVue
  3862. ? vm.$options || vm.constructor.options
  3863. : vm;
  3864. var name = options.name || options._componentTag;
  3865. var file = options.__file;
  3866. if (!name && file) {
  3867. var match = file.match(/([^/\\]+)\.vue$/);
  3868. name = match && match[1];
  3869. }
  3870. return (
  3871. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3872. (file && includeFile !== false ? (" at " + file) : '')
  3873. )
  3874. };
  3875. var repeat = function (str, n) {
  3876. var res = '';
  3877. while (n) {
  3878. if (n % 2 === 1) { res += str; }
  3879. if (n > 1) { str += str; }
  3880. n >>= 1;
  3881. }
  3882. return res
  3883. };
  3884. generateComponentTrace = function (vm) {
  3885. if (vm._isVue && vm.$parent) {
  3886. var tree = [];
  3887. var currentRecursiveSequence = 0;
  3888. while (vm && vm.$options.name !== 'PageBody') {
  3889. if (tree.length > 0) {
  3890. var last = tree[tree.length - 1];
  3891. if (last.constructor === vm.constructor) {
  3892. currentRecursiveSequence++;
  3893. vm = vm.$parent;
  3894. continue
  3895. } else if (currentRecursiveSequence > 0) {
  3896. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3897. currentRecursiveSequence = 0;
  3898. }
  3899. }
  3900. !vm.$options.isReserved && tree.push(vm);
  3901. vm = vm.$parent;
  3902. }
  3903. return '\n\nfound in\n\n' + tree
  3904. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3905. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3906. : formatComponentName(vm))); })
  3907. .join('\n')
  3908. } else {
  3909. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3910. }
  3911. };
  3912. }
  3913. /* */
  3914. var uid = 0;
  3915. /**
  3916. * A dep is an observable that can have multiple
  3917. * directives subscribing to it.
  3918. */
  3919. var Dep = function Dep () {
  3920. this.id = uid++;
  3921. this.subs = [];
  3922. };
  3923. Dep.prototype.addSub = function addSub (sub) {
  3924. this.subs.push(sub);
  3925. };
  3926. Dep.prototype.removeSub = function removeSub (sub) {
  3927. remove(this.subs, sub);
  3928. };
  3929. Dep.prototype.depend = function depend () {
  3930. if (Dep.SharedObject.target) {
  3931. Dep.SharedObject.target.addDep(this);
  3932. }
  3933. };
  3934. Dep.prototype.notify = function notify () {
  3935. // stabilize the subscriber list first
  3936. var subs = this.subs.slice();
  3937. if ( true && !config.async) {
  3938. // subs aren't sorted in scheduler if not running async
  3939. // we need to sort them now to make sure they fire in correct
  3940. // order
  3941. subs.sort(function (a, b) { return a.id - b.id; });
  3942. }
  3943. for (var i = 0, l = subs.length; i < l; i++) {
  3944. subs[i].update();
  3945. }
  3946. };
  3947. // The current target watcher being evaluated.
  3948. // This is globally unique because only one watcher
  3949. // can be evaluated at a time.
  3950. // fixed by xxxxxx (nvue shared vuex)
  3951. /* eslint-disable no-undef */
  3952. Dep.SharedObject = {};
  3953. Dep.SharedObject.target = null;
  3954. Dep.SharedObject.targetStack = [];
  3955. function pushTarget (target) {
  3956. Dep.SharedObject.targetStack.push(target);
  3957. Dep.SharedObject.target = target;
  3958. Dep.target = target;
  3959. }
  3960. function popTarget () {
  3961. Dep.SharedObject.targetStack.pop();
  3962. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3963. Dep.target = Dep.SharedObject.target;
  3964. }
  3965. /* */
  3966. var VNode = function VNode (
  3967. tag,
  3968. data,
  3969. children,
  3970. text,
  3971. elm,
  3972. context,
  3973. componentOptions,
  3974. asyncFactory
  3975. ) {
  3976. this.tag = tag;
  3977. this.data = data;
  3978. this.children = children;
  3979. this.text = text;
  3980. this.elm = elm;
  3981. this.ns = undefined;
  3982. this.context = context;
  3983. this.fnContext = undefined;
  3984. this.fnOptions = undefined;
  3985. this.fnScopeId = undefined;
  3986. this.key = data && data.key;
  3987. this.componentOptions = componentOptions;
  3988. this.componentInstance = undefined;
  3989. this.parent = undefined;
  3990. this.raw = false;
  3991. this.isStatic = false;
  3992. this.isRootInsert = true;
  3993. this.isComment = false;
  3994. this.isCloned = false;
  3995. this.isOnce = false;
  3996. this.asyncFactory = asyncFactory;
  3997. this.asyncMeta = undefined;
  3998. this.isAsyncPlaceholder = false;
  3999. };
  4000. var prototypeAccessors = { child: { configurable: true } };
  4001. // DEPRECATED: alias for componentInstance for backwards compat.
  4002. /* istanbul ignore next */
  4003. prototypeAccessors.child.get = function () {
  4004. return this.componentInstance
  4005. };
  4006. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4007. var createEmptyVNode = function (text) {
  4008. if ( text === void 0 ) text = '';
  4009. var node = new VNode();
  4010. node.text = text;
  4011. node.isComment = true;
  4012. return node
  4013. };
  4014. function createTextVNode (val) {
  4015. return new VNode(undefined, undefined, undefined, String(val))
  4016. }
  4017. // optimized shallow clone
  4018. // used for static nodes and slot nodes because they may be reused across
  4019. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4020. // on their elm reference.
  4021. function cloneVNode (vnode) {
  4022. var cloned = new VNode(
  4023. vnode.tag,
  4024. vnode.data,
  4025. // #7975
  4026. // clone children array to avoid mutating original in case of cloning
  4027. // a child.
  4028. vnode.children && vnode.children.slice(),
  4029. vnode.text,
  4030. vnode.elm,
  4031. vnode.context,
  4032. vnode.componentOptions,
  4033. vnode.asyncFactory
  4034. );
  4035. cloned.ns = vnode.ns;
  4036. cloned.isStatic = vnode.isStatic;
  4037. cloned.key = vnode.key;
  4038. cloned.isComment = vnode.isComment;
  4039. cloned.fnContext = vnode.fnContext;
  4040. cloned.fnOptions = vnode.fnOptions;
  4041. cloned.fnScopeId = vnode.fnScopeId;
  4042. cloned.asyncMeta = vnode.asyncMeta;
  4043. cloned.isCloned = true;
  4044. return cloned
  4045. }
  4046. /*
  4047. * not type checking this file because flow doesn't play well with
  4048. * dynamically accessing methods on Array prototype
  4049. */
  4050. var arrayProto = Array.prototype;
  4051. var arrayMethods = Object.create(arrayProto);
  4052. var methodsToPatch = [
  4053. 'push',
  4054. 'pop',
  4055. 'shift',
  4056. 'unshift',
  4057. 'splice',
  4058. 'sort',
  4059. 'reverse'
  4060. ];
  4061. /**
  4062. * Intercept mutating methods and emit events
  4063. */
  4064. methodsToPatch.forEach(function (method) {
  4065. // cache original method
  4066. var original = arrayProto[method];
  4067. def(arrayMethods, method, function mutator () {
  4068. var args = [], len = arguments.length;
  4069. while ( len-- ) args[ len ] = arguments[ len ];
  4070. var result = original.apply(this, args);
  4071. var ob = this.__ob__;
  4072. var inserted;
  4073. switch (method) {
  4074. case 'push':
  4075. case 'unshift':
  4076. inserted = args;
  4077. break
  4078. case 'splice':
  4079. inserted = args.slice(2);
  4080. break
  4081. }
  4082. if (inserted) { ob.observeArray(inserted); }
  4083. // notify change
  4084. ob.dep.notify();
  4085. return result
  4086. });
  4087. });
  4088. /* */
  4089. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4090. /**
  4091. * In some cases we may want to disable observation inside a component's
  4092. * update computation.
  4093. */
  4094. var shouldObserve = true;
  4095. function toggleObserving (value) {
  4096. shouldObserve = value;
  4097. }
  4098. /**
  4099. * Observer class that is attached to each observed
  4100. * object. Once attached, the observer converts the target
  4101. * object's property keys into getter/setters that
  4102. * collect dependencies and dispatch updates.
  4103. */
  4104. var Observer = function Observer (value) {
  4105. this.value = value;
  4106. this.dep = new Dep();
  4107. this.vmCount = 0;
  4108. def(value, '__ob__', this);
  4109. if (Array.isArray(value)) {
  4110. if (hasProto) {
  4111. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4112. if(value.push !== value.__proto__.push){
  4113. copyAugment(value, arrayMethods, arrayKeys);
  4114. } else {
  4115. protoAugment(value, arrayMethods);
  4116. }
  4117. }
  4118. } else {
  4119. copyAugment(value, arrayMethods, arrayKeys);
  4120. }
  4121. this.observeArray(value);
  4122. } else {
  4123. this.walk(value);
  4124. }
  4125. };
  4126. /**
  4127. * Walk through all properties and convert them into
  4128. * getter/setters. This method should only be called when
  4129. * value type is Object.
  4130. */
  4131. Observer.prototype.walk = function walk (obj) {
  4132. var keys = Object.keys(obj);
  4133. for (var i = 0; i < keys.length; i++) {
  4134. defineReactive$$1(obj, keys[i]);
  4135. }
  4136. };
  4137. /**
  4138. * Observe a list of Array items.
  4139. */
  4140. Observer.prototype.observeArray = function observeArray (items) {
  4141. for (var i = 0, l = items.length; i < l; i++) {
  4142. observe(items[i]);
  4143. }
  4144. };
  4145. // helpers
  4146. /**
  4147. * Augment a target Object or Array by intercepting
  4148. * the prototype chain using __proto__
  4149. */
  4150. function protoAugment (target, src) {
  4151. /* eslint-disable no-proto */
  4152. target.__proto__ = src;
  4153. /* eslint-enable no-proto */
  4154. }
  4155. /**
  4156. * Augment a target Object or Array by defining
  4157. * hidden properties.
  4158. */
  4159. /* istanbul ignore next */
  4160. function copyAugment (target, src, keys) {
  4161. for (var i = 0, l = keys.length; i < l; i++) {
  4162. var key = keys[i];
  4163. def(target, key, src[key]);
  4164. }
  4165. }
  4166. /**
  4167. * Attempt to create an observer instance for a value,
  4168. * returns the new observer if successfully observed,
  4169. * or the existing observer if the value already has one.
  4170. */
  4171. function observe (value, asRootData) {
  4172. if (!isObject(value) || value instanceof VNode) {
  4173. return
  4174. }
  4175. var ob;
  4176. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4177. ob = value.__ob__;
  4178. } else if (
  4179. shouldObserve &&
  4180. !isServerRendering() &&
  4181. (Array.isArray(value) || isPlainObject(value)) &&
  4182. Object.isExtensible(value) &&
  4183. !value._isVue
  4184. ) {
  4185. ob = new Observer(value);
  4186. }
  4187. if (asRootData && ob) {
  4188. ob.vmCount++;
  4189. }
  4190. return ob
  4191. }
  4192. /**
  4193. * Define a reactive property on an Object.
  4194. */
  4195. function defineReactive$$1 (
  4196. obj,
  4197. key,
  4198. val,
  4199. customSetter,
  4200. shallow
  4201. ) {
  4202. var dep = new Dep();
  4203. var property = Object.getOwnPropertyDescriptor(obj, key);
  4204. if (property && property.configurable === false) {
  4205. return
  4206. }
  4207. // cater for pre-defined getter/setters
  4208. var getter = property && property.get;
  4209. var setter = property && property.set;
  4210. if ((!getter || setter) && arguments.length === 2) {
  4211. val = obj[key];
  4212. }
  4213. var childOb = !shallow && observe(val);
  4214. Object.defineProperty(obj, key, {
  4215. enumerable: true,
  4216. configurable: true,
  4217. get: function reactiveGetter () {
  4218. var value = getter ? getter.call(obj) : val;
  4219. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4220. dep.depend();
  4221. if (childOb) {
  4222. childOb.dep.depend();
  4223. if (Array.isArray(value)) {
  4224. dependArray(value);
  4225. }
  4226. }
  4227. }
  4228. return value
  4229. },
  4230. set: function reactiveSetter (newVal) {
  4231. var value = getter ? getter.call(obj) : val;
  4232. /* eslint-disable no-self-compare */
  4233. if (newVal === value || (newVal !== newVal && value !== value)) {
  4234. return
  4235. }
  4236. /* eslint-enable no-self-compare */
  4237. if ( true && customSetter) {
  4238. customSetter();
  4239. }
  4240. // #7981: for accessor properties without setter
  4241. if (getter && !setter) { return }
  4242. if (setter) {
  4243. setter.call(obj, newVal);
  4244. } else {
  4245. val = newVal;
  4246. }
  4247. childOb = !shallow && observe(newVal);
  4248. dep.notify();
  4249. }
  4250. });
  4251. }
  4252. /**
  4253. * Set a property on an object. Adds the new property and
  4254. * triggers change notification if the property doesn't
  4255. * already exist.
  4256. */
  4257. function set (target, key, val) {
  4258. if ( true &&
  4259. (isUndef(target) || isPrimitive(target))
  4260. ) {
  4261. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4262. }
  4263. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4264. target.length = Math.max(target.length, key);
  4265. target.splice(key, 1, val);
  4266. return val
  4267. }
  4268. if (key in target && !(key in Object.prototype)) {
  4269. target[key] = val;
  4270. return val
  4271. }
  4272. var ob = (target).__ob__;
  4273. if (target._isVue || (ob && ob.vmCount)) {
  4274. true && warn(
  4275. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4276. 'at runtime - declare it upfront in the data option.'
  4277. );
  4278. return val
  4279. }
  4280. if (!ob) {
  4281. target[key] = val;
  4282. return val
  4283. }
  4284. defineReactive$$1(ob.value, key, val);
  4285. ob.dep.notify();
  4286. return val
  4287. }
  4288. /**
  4289. * Delete a property and trigger change if necessary.
  4290. */
  4291. function del (target, key) {
  4292. if ( true &&
  4293. (isUndef(target) || isPrimitive(target))
  4294. ) {
  4295. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4296. }
  4297. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4298. target.splice(key, 1);
  4299. return
  4300. }
  4301. var ob = (target).__ob__;
  4302. if (target._isVue || (ob && ob.vmCount)) {
  4303. true && warn(
  4304. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4305. '- just set it to null.'
  4306. );
  4307. return
  4308. }
  4309. if (!hasOwn(target, key)) {
  4310. return
  4311. }
  4312. delete target[key];
  4313. if (!ob) {
  4314. return
  4315. }
  4316. ob.dep.notify();
  4317. }
  4318. /**
  4319. * Collect dependencies on array elements when the array is touched, since
  4320. * we cannot intercept array element access like property getters.
  4321. */
  4322. function dependArray (value) {
  4323. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4324. e = value[i];
  4325. e && e.__ob__ && e.__ob__.dep.depend();
  4326. if (Array.isArray(e)) {
  4327. dependArray(e);
  4328. }
  4329. }
  4330. }
  4331. /* */
  4332. /**
  4333. * Option overwriting strategies are functions that handle
  4334. * how to merge a parent option value and a child option
  4335. * value into the final value.
  4336. */
  4337. var strats = config.optionMergeStrategies;
  4338. /**
  4339. * Options with restrictions
  4340. */
  4341. if (true) {
  4342. strats.el = strats.propsData = function (parent, child, vm, key) {
  4343. if (!vm) {
  4344. warn(
  4345. "option \"" + key + "\" can only be used during instance " +
  4346. 'creation with the `new` keyword.'
  4347. );
  4348. }
  4349. return defaultStrat(parent, child)
  4350. };
  4351. }
  4352. /**
  4353. * Helper that recursively merges two data objects together.
  4354. */
  4355. function mergeData (to, from) {
  4356. if (!from) { return to }
  4357. var key, toVal, fromVal;
  4358. var keys = hasSymbol
  4359. ? Reflect.ownKeys(from)
  4360. : Object.keys(from);
  4361. for (var i = 0; i < keys.length; i++) {
  4362. key = keys[i];
  4363. // in case the object is already observed...
  4364. if (key === '__ob__') { continue }
  4365. toVal = to[key];
  4366. fromVal = from[key];
  4367. if (!hasOwn(to, key)) {
  4368. set(to, key, fromVal);
  4369. } else if (
  4370. toVal !== fromVal &&
  4371. isPlainObject(toVal) &&
  4372. isPlainObject(fromVal)
  4373. ) {
  4374. mergeData(toVal, fromVal);
  4375. }
  4376. }
  4377. return to
  4378. }
  4379. /**
  4380. * Data
  4381. */
  4382. function mergeDataOrFn (
  4383. parentVal,
  4384. childVal,
  4385. vm
  4386. ) {
  4387. if (!vm) {
  4388. // in a Vue.extend merge, both should be functions
  4389. if (!childVal) {
  4390. return parentVal
  4391. }
  4392. if (!parentVal) {
  4393. return childVal
  4394. }
  4395. // when parentVal & childVal are both present,
  4396. // we need to return a function that returns the
  4397. // merged result of both functions... no need to
  4398. // check if parentVal is a function here because
  4399. // it has to be a function to pass previous merges.
  4400. return function mergedDataFn () {
  4401. return mergeData(
  4402. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4403. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4404. )
  4405. }
  4406. } else {
  4407. return function mergedInstanceDataFn () {
  4408. // instance merge
  4409. var instanceData = typeof childVal === 'function'
  4410. ? childVal.call(vm, vm)
  4411. : childVal;
  4412. var defaultData = typeof parentVal === 'function'
  4413. ? parentVal.call(vm, vm)
  4414. : parentVal;
  4415. if (instanceData) {
  4416. return mergeData(instanceData, defaultData)
  4417. } else {
  4418. return defaultData
  4419. }
  4420. }
  4421. }
  4422. }
  4423. strats.data = function (
  4424. parentVal,
  4425. childVal,
  4426. vm
  4427. ) {
  4428. if (!vm) {
  4429. if (childVal && typeof childVal !== 'function') {
  4430. true && warn(
  4431. 'The "data" option should be a function ' +
  4432. 'that returns a per-instance value in component ' +
  4433. 'definitions.',
  4434. vm
  4435. );
  4436. return parentVal
  4437. }
  4438. return mergeDataOrFn(parentVal, childVal)
  4439. }
  4440. return mergeDataOrFn(parentVal, childVal, vm)
  4441. };
  4442. /**
  4443. * Hooks and props are merged as arrays.
  4444. */
  4445. function mergeHook (
  4446. parentVal,
  4447. childVal
  4448. ) {
  4449. var res = childVal
  4450. ? parentVal
  4451. ? parentVal.concat(childVal)
  4452. : Array.isArray(childVal)
  4453. ? childVal
  4454. : [childVal]
  4455. : parentVal;
  4456. return res
  4457. ? dedupeHooks(res)
  4458. : res
  4459. }
  4460. function dedupeHooks (hooks) {
  4461. var res = [];
  4462. for (var i = 0; i < hooks.length; i++) {
  4463. if (res.indexOf(hooks[i]) === -1) {
  4464. res.push(hooks[i]);
  4465. }
  4466. }
  4467. return res
  4468. }
  4469. LIFECYCLE_HOOKS.forEach(function (hook) {
  4470. strats[hook] = mergeHook;
  4471. });
  4472. /**
  4473. * Assets
  4474. *
  4475. * When a vm is present (instance creation), we need to do
  4476. * a three-way merge between constructor options, instance
  4477. * options and parent options.
  4478. */
  4479. function mergeAssets (
  4480. parentVal,
  4481. childVal,
  4482. vm,
  4483. key
  4484. ) {
  4485. var res = Object.create(parentVal || null);
  4486. if (childVal) {
  4487. true && assertObjectType(key, childVal, vm);
  4488. return extend(res, childVal)
  4489. } else {
  4490. return res
  4491. }
  4492. }
  4493. ASSET_TYPES.forEach(function (type) {
  4494. strats[type + 's'] = mergeAssets;
  4495. });
  4496. /**
  4497. * Watchers.
  4498. *
  4499. * Watchers hashes should not overwrite one
  4500. * another, so we merge them as arrays.
  4501. */
  4502. strats.watch = function (
  4503. parentVal,
  4504. childVal,
  4505. vm,
  4506. key
  4507. ) {
  4508. // work around Firefox's Object.prototype.watch...
  4509. if (parentVal === nativeWatch) { parentVal = undefined; }
  4510. if (childVal === nativeWatch) { childVal = undefined; }
  4511. /* istanbul ignore if */
  4512. if (!childVal) { return Object.create(parentVal || null) }
  4513. if (true) {
  4514. assertObjectType(key, childVal, vm);
  4515. }
  4516. if (!parentVal) { return childVal }
  4517. var ret = {};
  4518. extend(ret, parentVal);
  4519. for (var key$1 in childVal) {
  4520. var parent = ret[key$1];
  4521. var child = childVal[key$1];
  4522. if (parent && !Array.isArray(parent)) {
  4523. parent = [parent];
  4524. }
  4525. ret[key$1] = parent
  4526. ? parent.concat(child)
  4527. : Array.isArray(child) ? child : [child];
  4528. }
  4529. return ret
  4530. };
  4531. /**
  4532. * Other object hashes.
  4533. */
  4534. strats.props =
  4535. strats.methods =
  4536. strats.inject =
  4537. strats.computed = function (
  4538. parentVal,
  4539. childVal,
  4540. vm,
  4541. key
  4542. ) {
  4543. if (childVal && "development" !== 'production') {
  4544. assertObjectType(key, childVal, vm);
  4545. }
  4546. if (!parentVal) { return childVal }
  4547. var ret = Object.create(null);
  4548. extend(ret, parentVal);
  4549. if (childVal) { extend(ret, childVal); }
  4550. return ret
  4551. };
  4552. strats.provide = mergeDataOrFn;
  4553. /**
  4554. * Default strategy.
  4555. */
  4556. var defaultStrat = function (parentVal, childVal) {
  4557. return childVal === undefined
  4558. ? parentVal
  4559. : childVal
  4560. };
  4561. /**
  4562. * Validate component names
  4563. */
  4564. function checkComponents (options) {
  4565. for (var key in options.components) {
  4566. validateComponentName(key);
  4567. }
  4568. }
  4569. function validateComponentName (name) {
  4570. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4571. warn(
  4572. 'Invalid component name: "' + name + '". Component names ' +
  4573. 'should conform to valid custom element name in html5 specification.'
  4574. );
  4575. }
  4576. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4577. warn(
  4578. 'Do not use built-in or reserved HTML elements as component ' +
  4579. 'id: ' + name
  4580. );
  4581. }
  4582. }
  4583. /**
  4584. * Ensure all props option syntax are normalized into the
  4585. * Object-based format.
  4586. */
  4587. function normalizeProps (options, vm) {
  4588. var props = options.props;
  4589. if (!props) { return }
  4590. var res = {};
  4591. var i, val, name;
  4592. if (Array.isArray(props)) {
  4593. i = props.length;
  4594. while (i--) {
  4595. val = props[i];
  4596. if (typeof val === 'string') {
  4597. name = camelize(val);
  4598. res[name] = { type: null };
  4599. } else if (true) {
  4600. warn('props must be strings when using array syntax.');
  4601. }
  4602. }
  4603. } else if (isPlainObject(props)) {
  4604. for (var key in props) {
  4605. val = props[key];
  4606. name = camelize(key);
  4607. res[name] = isPlainObject(val)
  4608. ? val
  4609. : { type: val };
  4610. }
  4611. } else if (true) {
  4612. warn(
  4613. "Invalid value for option \"props\": expected an Array or an Object, " +
  4614. "but got " + (toRawType(props)) + ".",
  4615. vm
  4616. );
  4617. }
  4618. options.props = res;
  4619. }
  4620. /**
  4621. * Normalize all injections into Object-based format
  4622. */
  4623. function normalizeInject (options, vm) {
  4624. var inject = options.inject;
  4625. if (!inject) { return }
  4626. var normalized = options.inject = {};
  4627. if (Array.isArray(inject)) {
  4628. for (var i = 0; i < inject.length; i++) {
  4629. normalized[inject[i]] = { from: inject[i] };
  4630. }
  4631. } else if (isPlainObject(inject)) {
  4632. for (var key in inject) {
  4633. var val = inject[key];
  4634. normalized[key] = isPlainObject(val)
  4635. ? extend({ from: key }, val)
  4636. : { from: val };
  4637. }
  4638. } else if (true) {
  4639. warn(
  4640. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4641. "but got " + (toRawType(inject)) + ".",
  4642. vm
  4643. );
  4644. }
  4645. }
  4646. /**
  4647. * Normalize raw function directives into object format.
  4648. */
  4649. function normalizeDirectives (options) {
  4650. var dirs = options.directives;
  4651. if (dirs) {
  4652. for (var key in dirs) {
  4653. var def$$1 = dirs[key];
  4654. if (typeof def$$1 === 'function') {
  4655. dirs[key] = { bind: def$$1, update: def$$1 };
  4656. }
  4657. }
  4658. }
  4659. }
  4660. function assertObjectType (name, value, vm) {
  4661. if (!isPlainObject(value)) {
  4662. warn(
  4663. "Invalid value for option \"" + name + "\": expected an Object, " +
  4664. "but got " + (toRawType(value)) + ".",
  4665. vm
  4666. );
  4667. }
  4668. }
  4669. /**
  4670. * Merge two option objects into a new one.
  4671. * Core utility used in both instantiation and inheritance.
  4672. */
  4673. function mergeOptions (
  4674. parent,
  4675. child,
  4676. vm
  4677. ) {
  4678. if (true) {
  4679. checkComponents(child);
  4680. }
  4681. if (typeof child === 'function') {
  4682. child = child.options;
  4683. }
  4684. normalizeProps(child, vm);
  4685. normalizeInject(child, vm);
  4686. normalizeDirectives(child);
  4687. // Apply extends and mixins on the child options,
  4688. // but only if it is a raw options object that isn't
  4689. // the result of another mergeOptions call.
  4690. // Only merged options has the _base property.
  4691. if (!child._base) {
  4692. if (child.extends) {
  4693. parent = mergeOptions(parent, child.extends, vm);
  4694. }
  4695. if (child.mixins) {
  4696. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4697. parent = mergeOptions(parent, child.mixins[i], vm);
  4698. }
  4699. }
  4700. }
  4701. var options = {};
  4702. var key;
  4703. for (key in parent) {
  4704. mergeField(key);
  4705. }
  4706. for (key in child) {
  4707. if (!hasOwn(parent, key)) {
  4708. mergeField(key);
  4709. }
  4710. }
  4711. function mergeField (key) {
  4712. var strat = strats[key] || defaultStrat;
  4713. options[key] = strat(parent[key], child[key], vm, key);
  4714. }
  4715. return options
  4716. }
  4717. /**
  4718. * Resolve an asset.
  4719. * This function is used because child instances need access
  4720. * to assets defined in its ancestor chain.
  4721. */
  4722. function resolveAsset (
  4723. options,
  4724. type,
  4725. id,
  4726. warnMissing
  4727. ) {
  4728. /* istanbul ignore if */
  4729. if (typeof id !== 'string') {
  4730. return
  4731. }
  4732. var assets = options[type];
  4733. // check local registration variations first
  4734. if (hasOwn(assets, id)) { return assets[id] }
  4735. var camelizedId = camelize(id);
  4736. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4737. var PascalCaseId = capitalize(camelizedId);
  4738. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4739. // fallback to prototype chain
  4740. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4741. if ( true && warnMissing && !res) {
  4742. warn(
  4743. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4744. options
  4745. );
  4746. }
  4747. return res
  4748. }
  4749. /* */
  4750. function validateProp (
  4751. key,
  4752. propOptions,
  4753. propsData,
  4754. vm
  4755. ) {
  4756. var prop = propOptions[key];
  4757. var absent = !hasOwn(propsData, key);
  4758. var value = propsData[key];
  4759. // boolean casting
  4760. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4761. if (booleanIndex > -1) {
  4762. if (absent && !hasOwn(prop, 'default')) {
  4763. value = false;
  4764. } else if (value === '' || value === hyphenate(key)) {
  4765. // only cast empty string / same name to boolean if
  4766. // boolean has higher priority
  4767. var stringIndex = getTypeIndex(String, prop.type);
  4768. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4769. value = true;
  4770. }
  4771. }
  4772. }
  4773. // check default value
  4774. if (value === undefined) {
  4775. value = getPropDefaultValue(vm, prop, key);
  4776. // since the default value is a fresh copy,
  4777. // make sure to observe it.
  4778. var prevShouldObserve = shouldObserve;
  4779. toggleObserving(true);
  4780. observe(value);
  4781. toggleObserving(prevShouldObserve);
  4782. }
  4783. if (
  4784. true
  4785. ) {
  4786. assertProp(prop, key, value, vm, absent);
  4787. }
  4788. return value
  4789. }
  4790. /**
  4791. * Get the default value of a prop.
  4792. */
  4793. function getPropDefaultValue (vm, prop, key) {
  4794. // no default, return undefined
  4795. if (!hasOwn(prop, 'default')) {
  4796. return undefined
  4797. }
  4798. var def = prop.default;
  4799. // warn against non-factory defaults for Object & Array
  4800. if ( true && isObject(def)) {
  4801. warn(
  4802. 'Invalid default value for prop "' + key + '": ' +
  4803. 'Props with type Object/Array must use a factory function ' +
  4804. 'to return the default value.',
  4805. vm
  4806. );
  4807. }
  4808. // the raw prop value was also undefined from previous render,
  4809. // return previous default value to avoid unnecessary watcher trigger
  4810. if (vm && vm.$options.propsData &&
  4811. vm.$options.propsData[key] === undefined &&
  4812. vm._props[key] !== undefined
  4813. ) {
  4814. return vm._props[key]
  4815. }
  4816. // call factory function for non-Function types
  4817. // a value is Function if its prototype is function even across different execution context
  4818. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4819. ? def.call(vm)
  4820. : def
  4821. }
  4822. /**
  4823. * Assert whether a prop is valid.
  4824. */
  4825. function assertProp (
  4826. prop,
  4827. name,
  4828. value,
  4829. vm,
  4830. absent
  4831. ) {
  4832. if (prop.required && absent) {
  4833. warn(
  4834. 'Missing required prop: "' + name + '"',
  4835. vm
  4836. );
  4837. return
  4838. }
  4839. if (value == null && !prop.required) {
  4840. return
  4841. }
  4842. var type = prop.type;
  4843. var valid = !type || type === true;
  4844. var expectedTypes = [];
  4845. if (type) {
  4846. if (!Array.isArray(type)) {
  4847. type = [type];
  4848. }
  4849. for (var i = 0; i < type.length && !valid; i++) {
  4850. var assertedType = assertType(value, type[i]);
  4851. expectedTypes.push(assertedType.expectedType || '');
  4852. valid = assertedType.valid;
  4853. }
  4854. }
  4855. if (!valid) {
  4856. warn(
  4857. getInvalidTypeMessage(name, value, expectedTypes),
  4858. vm
  4859. );
  4860. return
  4861. }
  4862. var validator = prop.validator;
  4863. if (validator) {
  4864. if (!validator(value)) {
  4865. warn(
  4866. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4867. vm
  4868. );
  4869. }
  4870. }
  4871. }
  4872. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4873. function assertType (value, type) {
  4874. var valid;
  4875. var expectedType = getType(type);
  4876. if (simpleCheckRE.test(expectedType)) {
  4877. var t = typeof value;
  4878. valid = t === expectedType.toLowerCase();
  4879. // for primitive wrapper objects
  4880. if (!valid && t === 'object') {
  4881. valid = value instanceof type;
  4882. }
  4883. } else if (expectedType === 'Object') {
  4884. valid = isPlainObject(value);
  4885. } else if (expectedType === 'Array') {
  4886. valid = Array.isArray(value);
  4887. } else {
  4888. valid = value instanceof type;
  4889. }
  4890. return {
  4891. valid: valid,
  4892. expectedType: expectedType
  4893. }
  4894. }
  4895. /**
  4896. * Use function string name to check built-in types,
  4897. * because a simple equality check will fail when running
  4898. * across different vms / iframes.
  4899. */
  4900. function getType (fn) {
  4901. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4902. return match ? match[1] : ''
  4903. }
  4904. function isSameType (a, b) {
  4905. return getType(a) === getType(b)
  4906. }
  4907. function getTypeIndex (type, expectedTypes) {
  4908. if (!Array.isArray(expectedTypes)) {
  4909. return isSameType(expectedTypes, type) ? 0 : -1
  4910. }
  4911. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4912. if (isSameType(expectedTypes[i], type)) {
  4913. return i
  4914. }
  4915. }
  4916. return -1
  4917. }
  4918. function getInvalidTypeMessage (name, value, expectedTypes) {
  4919. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4920. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4921. var expectedType = expectedTypes[0];
  4922. var receivedType = toRawType(value);
  4923. var expectedValue = styleValue(value, expectedType);
  4924. var receivedValue = styleValue(value, receivedType);
  4925. // check if we need to specify expected value
  4926. if (expectedTypes.length === 1 &&
  4927. isExplicable(expectedType) &&
  4928. !isBoolean(expectedType, receivedType)) {
  4929. message += " with value " + expectedValue;
  4930. }
  4931. message += ", got " + receivedType + " ";
  4932. // check if we need to specify received value
  4933. if (isExplicable(receivedType)) {
  4934. message += "with value " + receivedValue + ".";
  4935. }
  4936. return message
  4937. }
  4938. function styleValue (value, type) {
  4939. if (type === 'String') {
  4940. return ("\"" + value + "\"")
  4941. } else if (type === 'Number') {
  4942. return ("" + (Number(value)))
  4943. } else {
  4944. return ("" + value)
  4945. }
  4946. }
  4947. function isExplicable (value) {
  4948. var explicitTypes = ['string', 'number', 'boolean'];
  4949. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4950. }
  4951. function isBoolean () {
  4952. var args = [], len = arguments.length;
  4953. while ( len-- ) args[ len ] = arguments[ len ];
  4954. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4955. }
  4956. /* */
  4957. function handleError (err, vm, info) {
  4958. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4959. // See: https://github.com/vuejs/vuex/issues/1505
  4960. pushTarget();
  4961. try {
  4962. if (vm) {
  4963. var cur = vm;
  4964. while ((cur = cur.$parent)) {
  4965. var hooks = cur.$options.errorCaptured;
  4966. if (hooks) {
  4967. for (var i = 0; i < hooks.length; i++) {
  4968. try {
  4969. var capture = hooks[i].call(cur, err, vm, info) === false;
  4970. if (capture) { return }
  4971. } catch (e) {
  4972. globalHandleError(e, cur, 'errorCaptured hook');
  4973. }
  4974. }
  4975. }
  4976. }
  4977. }
  4978. globalHandleError(err, vm, info);
  4979. } finally {
  4980. popTarget();
  4981. }
  4982. }
  4983. function invokeWithErrorHandling (
  4984. handler,
  4985. context,
  4986. args,
  4987. vm,
  4988. info
  4989. ) {
  4990. var res;
  4991. try {
  4992. res = args ? handler.apply(context, args) : handler.call(context);
  4993. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4994. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4995. // issue #9511
  4996. // avoid catch triggering multiple times when nested calls
  4997. res._handled = true;
  4998. }
  4999. } catch (e) {
  5000. handleError(e, vm, info);
  5001. }
  5002. return res
  5003. }
  5004. function globalHandleError (err, vm, info) {
  5005. if (config.errorHandler) {
  5006. try {
  5007. return config.errorHandler.call(null, err, vm, info)
  5008. } catch (e) {
  5009. // if the user intentionally throws the original error in the handler,
  5010. // do not log it twice
  5011. if (e !== err) {
  5012. logError(e, null, 'config.errorHandler');
  5013. }
  5014. }
  5015. }
  5016. logError(err, vm, info);
  5017. }
  5018. function logError (err, vm, info) {
  5019. if (true) {
  5020. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5021. }
  5022. /* istanbul ignore else */
  5023. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5024. console.error(err);
  5025. } else {
  5026. throw err
  5027. }
  5028. }
  5029. /* */
  5030. var callbacks = [];
  5031. var pending = false;
  5032. function flushCallbacks () {
  5033. pending = false;
  5034. var copies = callbacks.slice(0);
  5035. callbacks.length = 0;
  5036. for (var i = 0; i < copies.length; i++) {
  5037. copies[i]();
  5038. }
  5039. }
  5040. // Here we have async deferring wrappers using microtasks.
  5041. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5042. // However, it has subtle problems when state is changed right before repaint
  5043. // (e.g. #6813, out-in transitions).
  5044. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5045. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5046. // So we now use microtasks everywhere, again.
  5047. // A major drawback of this tradeoff is that there are some scenarios
  5048. // where microtasks have too high a priority and fire in between supposedly
  5049. // sequential events (e.g. #4521, #6690, which have workarounds)
  5050. // or even between bubbling of the same event (#6566).
  5051. var timerFunc;
  5052. // The nextTick behavior leverages the microtask queue, which can be accessed
  5053. // via either native Promise.then or MutationObserver.
  5054. // MutationObserver has wider support, however it is seriously bugged in
  5055. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5056. // completely stops working after triggering a few times... so, if native
  5057. // Promise is available, we will use it:
  5058. /* istanbul ignore next, $flow-disable-line */
  5059. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5060. var p = Promise.resolve();
  5061. timerFunc = function () {
  5062. p.then(flushCallbacks);
  5063. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5064. // it can get stuck in a weird state where callbacks are pushed into the
  5065. // microtask queue but the queue isn't being flushed, until the browser
  5066. // needs to do some other work, e.g. handle a timer. Therefore we can
  5067. // "force" the microtask queue to be flushed by adding an empty timer.
  5068. if (isIOS) { setTimeout(noop); }
  5069. };
  5070. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5071. isNative(MutationObserver) ||
  5072. // PhantomJS and iOS 7.x
  5073. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5074. )) {
  5075. // Use MutationObserver where native Promise is not available,
  5076. // e.g. PhantomJS, iOS7, Android 4.4
  5077. // (#6466 MutationObserver is unreliable in IE11)
  5078. var counter = 1;
  5079. var observer = new MutationObserver(flushCallbacks);
  5080. var textNode = document.createTextNode(String(counter));
  5081. observer.observe(textNode, {
  5082. characterData: true
  5083. });
  5084. timerFunc = function () {
  5085. counter = (counter + 1) % 2;
  5086. textNode.data = String(counter);
  5087. };
  5088. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5089. // Fallback to setImmediate.
  5090. // Technically it leverages the (macro) task queue,
  5091. // but it is still a better choice than setTimeout.
  5092. timerFunc = function () {
  5093. setImmediate(flushCallbacks);
  5094. };
  5095. } else {
  5096. // Fallback to setTimeout.
  5097. timerFunc = function () {
  5098. setTimeout(flushCallbacks, 0);
  5099. };
  5100. }
  5101. function nextTick (cb, ctx) {
  5102. var _resolve;
  5103. callbacks.push(function () {
  5104. if (cb) {
  5105. try {
  5106. cb.call(ctx);
  5107. } catch (e) {
  5108. handleError(e, ctx, 'nextTick');
  5109. }
  5110. } else if (_resolve) {
  5111. _resolve(ctx);
  5112. }
  5113. });
  5114. if (!pending) {
  5115. pending = true;
  5116. timerFunc();
  5117. }
  5118. // $flow-disable-line
  5119. if (!cb && typeof Promise !== 'undefined') {
  5120. return new Promise(function (resolve) {
  5121. _resolve = resolve;
  5122. })
  5123. }
  5124. }
  5125. /* */
  5126. /* not type checking this file because flow doesn't play well with Proxy */
  5127. var initProxy;
  5128. if (true) {
  5129. var allowedGlobals = makeMap(
  5130. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5131. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5132. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5133. 'require' // for Webpack/Browserify
  5134. );
  5135. var warnNonPresent = function (target, key) {
  5136. warn(
  5137. "Property or method \"" + key + "\" is not defined on the instance but " +
  5138. 'referenced during render. Make sure that this property is reactive, ' +
  5139. 'either in the data option, or for class-based components, by ' +
  5140. 'initializing the property. ' +
  5141. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5142. target
  5143. );
  5144. };
  5145. var warnReservedPrefix = function (target, key) {
  5146. warn(
  5147. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5148. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5149. 'prevent conflicts with Vue internals. ' +
  5150. 'See: https://vuejs.org/v2/api/#data',
  5151. target
  5152. );
  5153. };
  5154. var hasProxy =
  5155. typeof Proxy !== 'undefined' && isNative(Proxy);
  5156. if (hasProxy) {
  5157. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5158. config.keyCodes = new Proxy(config.keyCodes, {
  5159. set: function set (target, key, value) {
  5160. if (isBuiltInModifier(key)) {
  5161. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5162. return false
  5163. } else {
  5164. target[key] = value;
  5165. return true
  5166. }
  5167. }
  5168. });
  5169. }
  5170. var hasHandler = {
  5171. has: function has (target, key) {
  5172. var has = key in target;
  5173. var isAllowed = allowedGlobals(key) ||
  5174. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5175. if (!has && !isAllowed) {
  5176. if (key in target.$data) { warnReservedPrefix(target, key); }
  5177. else { warnNonPresent(target, key); }
  5178. }
  5179. return has || !isAllowed
  5180. }
  5181. };
  5182. var getHandler = {
  5183. get: function get (target, key) {
  5184. if (typeof key === 'string' && !(key in target)) {
  5185. if (key in target.$data) { warnReservedPrefix(target, key); }
  5186. else { warnNonPresent(target, key); }
  5187. }
  5188. return target[key]
  5189. }
  5190. };
  5191. initProxy = function initProxy (vm) {
  5192. if (hasProxy) {
  5193. // determine which proxy handler to use
  5194. var options = vm.$options;
  5195. var handlers = options.render && options.render._withStripped
  5196. ? getHandler
  5197. : hasHandler;
  5198. vm._renderProxy = new Proxy(vm, handlers);
  5199. } else {
  5200. vm._renderProxy = vm;
  5201. }
  5202. };
  5203. }
  5204. /* */
  5205. var seenObjects = new _Set();
  5206. /**
  5207. * Recursively traverse an object to evoke all converted
  5208. * getters, so that every nested property inside the object
  5209. * is collected as a "deep" dependency.
  5210. */
  5211. function traverse (val) {
  5212. _traverse(val, seenObjects);
  5213. seenObjects.clear();
  5214. }
  5215. function _traverse (val, seen) {
  5216. var i, keys;
  5217. var isA = Array.isArray(val);
  5218. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5219. return
  5220. }
  5221. if (val.__ob__) {
  5222. var depId = val.__ob__.dep.id;
  5223. if (seen.has(depId)) {
  5224. return
  5225. }
  5226. seen.add(depId);
  5227. }
  5228. if (isA) {
  5229. i = val.length;
  5230. while (i--) { _traverse(val[i], seen); }
  5231. } else {
  5232. keys = Object.keys(val);
  5233. i = keys.length;
  5234. while (i--) { _traverse(val[keys[i]], seen); }
  5235. }
  5236. }
  5237. var mark;
  5238. var measure;
  5239. if (true) {
  5240. var perf = inBrowser && window.performance;
  5241. /* istanbul ignore if */
  5242. if (
  5243. perf &&
  5244. perf.mark &&
  5245. perf.measure &&
  5246. perf.clearMarks &&
  5247. perf.clearMeasures
  5248. ) {
  5249. mark = function (tag) { return perf.mark(tag); };
  5250. measure = function (name, startTag, endTag) {
  5251. perf.measure(name, startTag, endTag);
  5252. perf.clearMarks(startTag);
  5253. perf.clearMarks(endTag);
  5254. // perf.clearMeasures(name)
  5255. };
  5256. }
  5257. }
  5258. /* */
  5259. var normalizeEvent = cached(function (name) {
  5260. var passive = name.charAt(0) === '&';
  5261. name = passive ? name.slice(1) : name;
  5262. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5263. name = once$$1 ? name.slice(1) : name;
  5264. var capture = name.charAt(0) === '!';
  5265. name = capture ? name.slice(1) : name;
  5266. return {
  5267. name: name,
  5268. once: once$$1,
  5269. capture: capture,
  5270. passive: passive
  5271. }
  5272. });
  5273. function createFnInvoker (fns, vm) {
  5274. function invoker () {
  5275. var arguments$1 = arguments;
  5276. var fns = invoker.fns;
  5277. if (Array.isArray(fns)) {
  5278. var cloned = fns.slice();
  5279. for (var i = 0; i < cloned.length; i++) {
  5280. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5281. }
  5282. } else {
  5283. // return handler return value for single handlers
  5284. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5285. }
  5286. }
  5287. invoker.fns = fns;
  5288. return invoker
  5289. }
  5290. function updateListeners (
  5291. on,
  5292. oldOn,
  5293. add,
  5294. remove$$1,
  5295. createOnceHandler,
  5296. vm
  5297. ) {
  5298. var name, def$$1, cur, old, event;
  5299. for (name in on) {
  5300. def$$1 = cur = on[name];
  5301. old = oldOn[name];
  5302. event = normalizeEvent(name);
  5303. if (isUndef(cur)) {
  5304. true && warn(
  5305. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5306. vm
  5307. );
  5308. } else if (isUndef(old)) {
  5309. if (isUndef(cur.fns)) {
  5310. cur = on[name] = createFnInvoker(cur, vm);
  5311. }
  5312. if (isTrue(event.once)) {
  5313. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5314. }
  5315. add(event.name, cur, event.capture, event.passive, event.params);
  5316. } else if (cur !== old) {
  5317. old.fns = cur;
  5318. on[name] = old;
  5319. }
  5320. }
  5321. for (name in oldOn) {
  5322. if (isUndef(on[name])) {
  5323. event = normalizeEvent(name);
  5324. remove$$1(event.name, oldOn[name], event.capture);
  5325. }
  5326. }
  5327. }
  5328. /* */
  5329. /* */
  5330. // fixed by xxxxxx (mp properties)
  5331. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5332. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5333. if (isUndef(propOptions)) {
  5334. return res
  5335. }
  5336. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5337. var attrs = data.attrs;
  5338. var props = data.props;
  5339. if (isDef(attrs) || isDef(props)) {
  5340. for (var key in propOptions) {
  5341. var altKey = hyphenate(key);
  5342. var result = checkProp(res, props, key, altKey, true) ||
  5343. checkProp(res, attrs, key, altKey, false);
  5344. // externalClass
  5345. if (
  5346. result &&
  5347. res[key] &&
  5348. externalClasses.indexOf(altKey) !== -1 &&
  5349. context[camelize(res[key])]
  5350. ) {
  5351. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5352. res[key] = context[camelize(res[key])];
  5353. }
  5354. }
  5355. }
  5356. return res
  5357. }
  5358. function extractPropsFromVNodeData (
  5359. data,
  5360. Ctor,
  5361. tag,
  5362. context// fixed by xxxxxx
  5363. ) {
  5364. // we are only extracting raw values here.
  5365. // validation and default values are handled in the child
  5366. // component itself.
  5367. var propOptions = Ctor.options.props;
  5368. if (isUndef(propOptions)) {
  5369. // fixed by xxxxxx
  5370. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5371. }
  5372. var res = {};
  5373. var attrs = data.attrs;
  5374. var props = data.props;
  5375. if (isDef(attrs) || isDef(props)) {
  5376. for (var key in propOptions) {
  5377. var altKey = hyphenate(key);
  5378. if (true) {
  5379. var keyInLowerCase = key.toLowerCase();
  5380. if (
  5381. key !== keyInLowerCase &&
  5382. attrs && hasOwn(attrs, keyInLowerCase)
  5383. ) {
  5384. tip(
  5385. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5386. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5387. " \"" + key + "\". " +
  5388. "Note that HTML attributes are case-insensitive and camelCased " +
  5389. "props need to use their kebab-case equivalents when using in-DOM " +
  5390. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5391. );
  5392. }
  5393. }
  5394. checkProp(res, props, key, altKey, true) ||
  5395. checkProp(res, attrs, key, altKey, false);
  5396. }
  5397. }
  5398. // fixed by xxxxxx
  5399. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5400. }
  5401. function checkProp (
  5402. res,
  5403. hash,
  5404. key,
  5405. altKey,
  5406. preserve
  5407. ) {
  5408. if (isDef(hash)) {
  5409. if (hasOwn(hash, key)) {
  5410. res[key] = hash[key];
  5411. if (!preserve) {
  5412. delete hash[key];
  5413. }
  5414. return true
  5415. } else if (hasOwn(hash, altKey)) {
  5416. res[key] = hash[altKey];
  5417. if (!preserve) {
  5418. delete hash[altKey];
  5419. }
  5420. return true
  5421. }
  5422. }
  5423. return false
  5424. }
  5425. /* */
  5426. // The template compiler attempts to minimize the need for normalization by
  5427. // statically analyzing the template at compile time.
  5428. //
  5429. // For plain HTML markup, normalization can be completely skipped because the
  5430. // generated render function is guaranteed to return Array<VNode>. There are
  5431. // two cases where extra normalization is needed:
  5432. // 1. When the children contains components - because a functional component
  5433. // may return an Array instead of a single root. In this case, just a simple
  5434. // normalization is needed - if any child is an Array, we flatten the whole
  5435. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5436. // because functional components already normalize their own children.
  5437. function simpleNormalizeChildren (children) {
  5438. for (var i = 0; i < children.length; i++) {
  5439. if (Array.isArray(children[i])) {
  5440. return Array.prototype.concat.apply([], children)
  5441. }
  5442. }
  5443. return children
  5444. }
  5445. // 2. When the children contains constructs that always generated nested Arrays,
  5446. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5447. // with hand-written render functions / JSX. In such cases a full normalization
  5448. // is needed to cater to all possible types of children values.
  5449. function normalizeChildren (children) {
  5450. return isPrimitive(children)
  5451. ? [createTextVNode(children)]
  5452. : Array.isArray(children)
  5453. ? normalizeArrayChildren(children)
  5454. : undefined
  5455. }
  5456. function isTextNode (node) {
  5457. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5458. }
  5459. function normalizeArrayChildren (children, nestedIndex) {
  5460. var res = [];
  5461. var i, c, lastIndex, last;
  5462. for (i = 0; i < children.length; i++) {
  5463. c = children[i];
  5464. if (isUndef(c) || typeof c === 'boolean') { continue }
  5465. lastIndex = res.length - 1;
  5466. last = res[lastIndex];
  5467. // nested
  5468. if (Array.isArray(c)) {
  5469. if (c.length > 0) {
  5470. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5471. // merge adjacent text nodes
  5472. if (isTextNode(c[0]) && isTextNode(last)) {
  5473. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5474. c.shift();
  5475. }
  5476. res.push.apply(res, c);
  5477. }
  5478. } else if (isPrimitive(c)) {
  5479. if (isTextNode(last)) {
  5480. // merge adjacent text nodes
  5481. // this is necessary for SSR hydration because text nodes are
  5482. // essentially merged when rendered to HTML strings
  5483. res[lastIndex] = createTextVNode(last.text + c);
  5484. } else if (c !== '') {
  5485. // convert primitive to vnode
  5486. res.push(createTextVNode(c));
  5487. }
  5488. } else {
  5489. if (isTextNode(c) && isTextNode(last)) {
  5490. // merge adjacent text nodes
  5491. res[lastIndex] = createTextVNode(last.text + c.text);
  5492. } else {
  5493. // default key for nested array children (likely generated by v-for)
  5494. if (isTrue(children._isVList) &&
  5495. isDef(c.tag) &&
  5496. isUndef(c.key) &&
  5497. isDef(nestedIndex)) {
  5498. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5499. }
  5500. res.push(c);
  5501. }
  5502. }
  5503. }
  5504. return res
  5505. }
  5506. /* */
  5507. function initProvide (vm) {
  5508. var provide = vm.$options.provide;
  5509. if (provide) {
  5510. vm._provided = typeof provide === 'function'
  5511. ? provide.call(vm)
  5512. : provide;
  5513. }
  5514. }
  5515. function initInjections (vm) {
  5516. var result = resolveInject(vm.$options.inject, vm);
  5517. if (result) {
  5518. toggleObserving(false);
  5519. Object.keys(result).forEach(function (key) {
  5520. /* istanbul ignore else */
  5521. if (true) {
  5522. defineReactive$$1(vm, key, result[key], function () {
  5523. warn(
  5524. "Avoid mutating an injected value directly since the changes will be " +
  5525. "overwritten whenever the provided component re-renders. " +
  5526. "injection being mutated: \"" + key + "\"",
  5527. vm
  5528. );
  5529. });
  5530. } else {}
  5531. });
  5532. toggleObserving(true);
  5533. }
  5534. }
  5535. function resolveInject (inject, vm) {
  5536. if (inject) {
  5537. // inject is :any because flow is not smart enough to figure out cached
  5538. var result = Object.create(null);
  5539. var keys = hasSymbol
  5540. ? Reflect.ownKeys(inject)
  5541. : Object.keys(inject);
  5542. for (var i = 0; i < keys.length; i++) {
  5543. var key = keys[i];
  5544. // #6574 in case the inject object is observed...
  5545. if (key === '__ob__') { continue }
  5546. var provideKey = inject[key].from;
  5547. var source = vm;
  5548. while (source) {
  5549. if (source._provided && hasOwn(source._provided, provideKey)) {
  5550. result[key] = source._provided[provideKey];
  5551. break
  5552. }
  5553. source = source.$parent;
  5554. }
  5555. if (!source) {
  5556. if ('default' in inject[key]) {
  5557. var provideDefault = inject[key].default;
  5558. result[key] = typeof provideDefault === 'function'
  5559. ? provideDefault.call(vm)
  5560. : provideDefault;
  5561. } else if (true) {
  5562. warn(("Injection \"" + key + "\" not found"), vm);
  5563. }
  5564. }
  5565. }
  5566. return result
  5567. }
  5568. }
  5569. /* */
  5570. /**
  5571. * Runtime helper for resolving raw children VNodes into a slot object.
  5572. */
  5573. function resolveSlots (
  5574. children,
  5575. context
  5576. ) {
  5577. if (!children || !children.length) {
  5578. return {}
  5579. }
  5580. var slots = {};
  5581. for (var i = 0, l = children.length; i < l; i++) {
  5582. var child = children[i];
  5583. var data = child.data;
  5584. // remove slot attribute if the node is resolved as a Vue slot node
  5585. if (data && data.attrs && data.attrs.slot) {
  5586. delete data.attrs.slot;
  5587. }
  5588. // named slots should only be respected if the vnode was rendered in the
  5589. // same context.
  5590. if ((child.context === context || child.fnContext === context) &&
  5591. data && data.slot != null
  5592. ) {
  5593. var name = data.slot;
  5594. var slot = (slots[name] || (slots[name] = []));
  5595. if (child.tag === 'template') {
  5596. slot.push.apply(slot, child.children || []);
  5597. } else {
  5598. slot.push(child);
  5599. }
  5600. } else {
  5601. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5602. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5603. (slots['page'] || (slots['page'] = [])).push(child);
  5604. }else{
  5605. (slots.default || (slots.default = [])).push(child);
  5606. }
  5607. }
  5608. }
  5609. // ignore slots that contains only whitespace
  5610. for (var name$1 in slots) {
  5611. if (slots[name$1].every(isWhitespace)) {
  5612. delete slots[name$1];
  5613. }
  5614. }
  5615. return slots
  5616. }
  5617. function isWhitespace (node) {
  5618. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5619. }
  5620. /* */
  5621. function normalizeScopedSlots (
  5622. slots,
  5623. normalSlots,
  5624. prevSlots
  5625. ) {
  5626. var res;
  5627. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5628. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5629. var key = slots && slots.$key;
  5630. if (!slots) {
  5631. res = {};
  5632. } else if (slots._normalized) {
  5633. // fast path 1: child component re-render only, parent did not change
  5634. return slots._normalized
  5635. } else if (
  5636. isStable &&
  5637. prevSlots &&
  5638. prevSlots !== emptyObject &&
  5639. key === prevSlots.$key &&
  5640. !hasNormalSlots &&
  5641. !prevSlots.$hasNormal
  5642. ) {
  5643. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5644. // only need to normalize once
  5645. return prevSlots
  5646. } else {
  5647. res = {};
  5648. for (var key$1 in slots) {
  5649. if (slots[key$1] && key$1[0] !== '$') {
  5650. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5651. }
  5652. }
  5653. }
  5654. // expose normal slots on scopedSlots
  5655. for (var key$2 in normalSlots) {
  5656. if (!(key$2 in res)) {
  5657. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5658. }
  5659. }
  5660. // avoriaz seems to mock a non-extensible $scopedSlots object
  5661. // and when that is passed down this would cause an error
  5662. if (slots && Object.isExtensible(slots)) {
  5663. (slots)._normalized = res;
  5664. }
  5665. def(res, '$stable', isStable);
  5666. def(res, '$key', key);
  5667. def(res, '$hasNormal', hasNormalSlots);
  5668. return res
  5669. }
  5670. function normalizeScopedSlot(normalSlots, key, fn) {
  5671. var normalized = function () {
  5672. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5673. res = res && typeof res === 'object' && !Array.isArray(res)
  5674. ? [res] // single vnode
  5675. : normalizeChildren(res);
  5676. return res && (
  5677. res.length === 0 ||
  5678. (res.length === 1 && res[0].isComment) // #9658
  5679. ) ? undefined
  5680. : res
  5681. };
  5682. // this is a slot using the new v-slot syntax without scope. although it is
  5683. // compiled as a scoped slot, render fn users would expect it to be present
  5684. // on this.$slots because the usage is semantically a normal slot.
  5685. if (fn.proxy) {
  5686. Object.defineProperty(normalSlots, key, {
  5687. get: normalized,
  5688. enumerable: true,
  5689. configurable: true
  5690. });
  5691. }
  5692. return normalized
  5693. }
  5694. function proxyNormalSlot(slots, key) {
  5695. return function () { return slots[key]; }
  5696. }
  5697. /* */
  5698. /**
  5699. * Runtime helper for rendering v-for lists.
  5700. */
  5701. function renderList (
  5702. val,
  5703. render
  5704. ) {
  5705. var ret, i, l, keys, key;
  5706. if (Array.isArray(val) || typeof val === 'string') {
  5707. ret = new Array(val.length);
  5708. for (i = 0, l = val.length; i < l; i++) {
  5709. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5710. }
  5711. } else if (typeof val === 'number') {
  5712. ret = new Array(val);
  5713. for (i = 0; i < val; i++) {
  5714. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5715. }
  5716. } else if (isObject(val)) {
  5717. if (hasSymbol && val[Symbol.iterator]) {
  5718. ret = [];
  5719. var iterator = val[Symbol.iterator]();
  5720. var result = iterator.next();
  5721. while (!result.done) {
  5722. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5723. result = iterator.next();
  5724. }
  5725. } else {
  5726. keys = Object.keys(val);
  5727. ret = new Array(keys.length);
  5728. for (i = 0, l = keys.length; i < l; i++) {
  5729. key = keys[i];
  5730. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5731. }
  5732. }
  5733. }
  5734. if (!isDef(ret)) {
  5735. ret = [];
  5736. }
  5737. (ret)._isVList = true;
  5738. return ret
  5739. }
  5740. /* */
  5741. /**
  5742. * Runtime helper for rendering <slot>
  5743. */
  5744. function renderSlot (
  5745. name,
  5746. fallback,
  5747. props,
  5748. bindObject
  5749. ) {
  5750. var scopedSlotFn = this.$scopedSlots[name];
  5751. var nodes;
  5752. if (scopedSlotFn) { // scoped slot
  5753. props = props || {};
  5754. if (bindObject) {
  5755. if ( true && !isObject(bindObject)) {
  5756. warn(
  5757. 'slot v-bind without argument expects an Object',
  5758. this
  5759. );
  5760. }
  5761. props = extend(extend({}, bindObject), props);
  5762. }
  5763. // fixed by xxxxxx app-plus scopedSlot
  5764. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5765. } else {
  5766. nodes = this.$slots[name] || fallback;
  5767. }
  5768. var target = props && props.slot;
  5769. if (target) {
  5770. return this.$createElement('template', { slot: target }, nodes)
  5771. } else {
  5772. return nodes
  5773. }
  5774. }
  5775. /* */
  5776. /**
  5777. * Runtime helper for resolving filters
  5778. */
  5779. function resolveFilter (id) {
  5780. return resolveAsset(this.$options, 'filters', id, true) || identity
  5781. }
  5782. /* */
  5783. function isKeyNotMatch (expect, actual) {
  5784. if (Array.isArray(expect)) {
  5785. return expect.indexOf(actual) === -1
  5786. } else {
  5787. return expect !== actual
  5788. }
  5789. }
  5790. /**
  5791. * Runtime helper for checking keyCodes from config.
  5792. * exposed as Vue.prototype._k
  5793. * passing in eventKeyName as last argument separately for backwards compat
  5794. */
  5795. function checkKeyCodes (
  5796. eventKeyCode,
  5797. key,
  5798. builtInKeyCode,
  5799. eventKeyName,
  5800. builtInKeyName
  5801. ) {
  5802. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5803. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5804. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5805. } else if (mappedKeyCode) {
  5806. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5807. } else if (eventKeyName) {
  5808. return hyphenate(eventKeyName) !== key
  5809. }
  5810. }
  5811. /* */
  5812. /**
  5813. * Runtime helper for merging v-bind="object" into a VNode's data.
  5814. */
  5815. function bindObjectProps (
  5816. data,
  5817. tag,
  5818. value,
  5819. asProp,
  5820. isSync
  5821. ) {
  5822. if (value) {
  5823. if (!isObject(value)) {
  5824. true && warn(
  5825. 'v-bind without argument expects an Object or Array value',
  5826. this
  5827. );
  5828. } else {
  5829. if (Array.isArray(value)) {
  5830. value = toObject(value);
  5831. }
  5832. var hash;
  5833. var loop = function ( key ) {
  5834. if (
  5835. key === 'class' ||
  5836. key === 'style' ||
  5837. isReservedAttribute(key)
  5838. ) {
  5839. hash = data;
  5840. } else {
  5841. var type = data.attrs && data.attrs.type;
  5842. hash = asProp || config.mustUseProp(tag, type, key)
  5843. ? data.domProps || (data.domProps = {})
  5844. : data.attrs || (data.attrs = {});
  5845. }
  5846. var camelizedKey = camelize(key);
  5847. var hyphenatedKey = hyphenate(key);
  5848. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5849. hash[key] = value[key];
  5850. if (isSync) {
  5851. var on = data.on || (data.on = {});
  5852. on[("update:" + key)] = function ($event) {
  5853. value[key] = $event;
  5854. };
  5855. }
  5856. }
  5857. };
  5858. for (var key in value) loop( key );
  5859. }
  5860. }
  5861. return data
  5862. }
  5863. /* */
  5864. /**
  5865. * Runtime helper for rendering static trees.
  5866. */
  5867. function renderStatic (
  5868. index,
  5869. isInFor
  5870. ) {
  5871. var cached = this._staticTrees || (this._staticTrees = []);
  5872. var tree = cached[index];
  5873. // if has already-rendered static tree and not inside v-for,
  5874. // we can reuse the same tree.
  5875. if (tree && !isInFor) {
  5876. return tree
  5877. }
  5878. // otherwise, render a fresh tree.
  5879. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5880. this._renderProxy,
  5881. null,
  5882. this // for render fns generated for functional component templates
  5883. );
  5884. markStatic(tree, ("__static__" + index), false);
  5885. return tree
  5886. }
  5887. /**
  5888. * Runtime helper for v-once.
  5889. * Effectively it means marking the node as static with a unique key.
  5890. */
  5891. function markOnce (
  5892. tree,
  5893. index,
  5894. key
  5895. ) {
  5896. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5897. return tree
  5898. }
  5899. function markStatic (
  5900. tree,
  5901. key,
  5902. isOnce
  5903. ) {
  5904. if (Array.isArray(tree)) {
  5905. for (var i = 0; i < tree.length; i++) {
  5906. if (tree[i] && typeof tree[i] !== 'string') {
  5907. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5908. }
  5909. }
  5910. } else {
  5911. markStaticNode(tree, key, isOnce);
  5912. }
  5913. }
  5914. function markStaticNode (node, key, isOnce) {
  5915. node.isStatic = true;
  5916. node.key = key;
  5917. node.isOnce = isOnce;
  5918. }
  5919. /* */
  5920. function bindObjectListeners (data, value) {
  5921. if (value) {
  5922. if (!isPlainObject(value)) {
  5923. true && warn(
  5924. 'v-on without argument expects an Object value',
  5925. this
  5926. );
  5927. } else {
  5928. var on = data.on = data.on ? extend({}, data.on) : {};
  5929. for (var key in value) {
  5930. var existing = on[key];
  5931. var ours = value[key];
  5932. on[key] = existing ? [].concat(existing, ours) : ours;
  5933. }
  5934. }
  5935. }
  5936. return data
  5937. }
  5938. /* */
  5939. function resolveScopedSlots (
  5940. fns, // see flow/vnode
  5941. res,
  5942. // the following are added in 2.6
  5943. hasDynamicKeys,
  5944. contentHashKey
  5945. ) {
  5946. res = res || { $stable: !hasDynamicKeys };
  5947. for (var i = 0; i < fns.length; i++) {
  5948. var slot = fns[i];
  5949. if (Array.isArray(slot)) {
  5950. resolveScopedSlots(slot, res, hasDynamicKeys);
  5951. } else if (slot) {
  5952. // marker for reverse proxying v-slot without scope on this.$slots
  5953. if (slot.proxy) {
  5954. slot.fn.proxy = true;
  5955. }
  5956. res[slot.key] = slot.fn;
  5957. }
  5958. }
  5959. if (contentHashKey) {
  5960. (res).$key = contentHashKey;
  5961. }
  5962. return res
  5963. }
  5964. /* */
  5965. function bindDynamicKeys (baseObj, values) {
  5966. for (var i = 0; i < values.length; i += 2) {
  5967. var key = values[i];
  5968. if (typeof key === 'string' && key) {
  5969. baseObj[values[i]] = values[i + 1];
  5970. } else if ( true && key !== '' && key !== null) {
  5971. // null is a special value for explicitly removing a binding
  5972. warn(
  5973. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5974. this
  5975. );
  5976. }
  5977. }
  5978. return baseObj
  5979. }
  5980. // helper to dynamically append modifier runtime markers to event names.
  5981. // ensure only append when value is already string, otherwise it will be cast
  5982. // to string and cause the type check to miss.
  5983. function prependModifier (value, symbol) {
  5984. return typeof value === 'string' ? symbol + value : value
  5985. }
  5986. /* */
  5987. function installRenderHelpers (target) {
  5988. target._o = markOnce;
  5989. target._n = toNumber;
  5990. target._s = toString;
  5991. target._l = renderList;
  5992. target._t = renderSlot;
  5993. target._q = looseEqual;
  5994. target._i = looseIndexOf;
  5995. target._m = renderStatic;
  5996. target._f = resolveFilter;
  5997. target._k = checkKeyCodes;
  5998. target._b = bindObjectProps;
  5999. target._v = createTextVNode;
  6000. target._e = createEmptyVNode;
  6001. target._u = resolveScopedSlots;
  6002. target._g = bindObjectListeners;
  6003. target._d = bindDynamicKeys;
  6004. target._p = prependModifier;
  6005. }
  6006. /* */
  6007. function FunctionalRenderContext (
  6008. data,
  6009. props,
  6010. children,
  6011. parent,
  6012. Ctor
  6013. ) {
  6014. var this$1 = this;
  6015. var options = Ctor.options;
  6016. // ensure the createElement function in functional components
  6017. // gets a unique context - this is necessary for correct named slot check
  6018. var contextVm;
  6019. if (hasOwn(parent, '_uid')) {
  6020. contextVm = Object.create(parent);
  6021. // $flow-disable-line
  6022. contextVm._original = parent;
  6023. } else {
  6024. // the context vm passed in is a functional context as well.
  6025. // in this case we want to make sure we are able to get a hold to the
  6026. // real context instance.
  6027. contextVm = parent;
  6028. // $flow-disable-line
  6029. parent = parent._original;
  6030. }
  6031. var isCompiled = isTrue(options._compiled);
  6032. var needNormalization = !isCompiled;
  6033. this.data = data;
  6034. this.props = props;
  6035. this.children = children;
  6036. this.parent = parent;
  6037. this.listeners = data.on || emptyObject;
  6038. this.injections = resolveInject(options.inject, parent);
  6039. this.slots = function () {
  6040. if (!this$1.$slots) {
  6041. normalizeScopedSlots(
  6042. data.scopedSlots,
  6043. this$1.$slots = resolveSlots(children, parent)
  6044. );
  6045. }
  6046. return this$1.$slots
  6047. };
  6048. Object.defineProperty(this, 'scopedSlots', ({
  6049. enumerable: true,
  6050. get: function get () {
  6051. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6052. }
  6053. }));
  6054. // support for compiled functional template
  6055. if (isCompiled) {
  6056. // exposing $options for renderStatic()
  6057. this.$options = options;
  6058. // pre-resolve slots for renderSlot()
  6059. this.$slots = this.slots();
  6060. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6061. }
  6062. if (options._scopeId) {
  6063. this._c = function (a, b, c, d) {
  6064. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6065. if (vnode && !Array.isArray(vnode)) {
  6066. vnode.fnScopeId = options._scopeId;
  6067. vnode.fnContext = parent;
  6068. }
  6069. return vnode
  6070. };
  6071. } else {
  6072. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6073. }
  6074. }
  6075. installRenderHelpers(FunctionalRenderContext.prototype);
  6076. function createFunctionalComponent (
  6077. Ctor,
  6078. propsData,
  6079. data,
  6080. contextVm,
  6081. children
  6082. ) {
  6083. var options = Ctor.options;
  6084. var props = {};
  6085. var propOptions = options.props;
  6086. if (isDef(propOptions)) {
  6087. for (var key in propOptions) {
  6088. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6089. }
  6090. } else {
  6091. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6092. if (isDef(data.props)) { mergeProps(props, data.props); }
  6093. }
  6094. var renderContext = new FunctionalRenderContext(
  6095. data,
  6096. props,
  6097. children,
  6098. contextVm,
  6099. Ctor
  6100. );
  6101. var vnode = options.render.call(null, renderContext._c, renderContext);
  6102. if (vnode instanceof VNode) {
  6103. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6104. } else if (Array.isArray(vnode)) {
  6105. var vnodes = normalizeChildren(vnode) || [];
  6106. var res = new Array(vnodes.length);
  6107. for (var i = 0; i < vnodes.length; i++) {
  6108. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6109. }
  6110. return res
  6111. }
  6112. }
  6113. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6114. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6115. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6116. // that should not be matched to match.
  6117. var clone = cloneVNode(vnode);
  6118. clone.fnContext = contextVm;
  6119. clone.fnOptions = options;
  6120. if (true) {
  6121. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6122. }
  6123. if (data.slot) {
  6124. (clone.data || (clone.data = {})).slot = data.slot;
  6125. }
  6126. return clone
  6127. }
  6128. function mergeProps (to, from) {
  6129. for (var key in from) {
  6130. to[camelize(key)] = from[key];
  6131. }
  6132. }
  6133. /* */
  6134. /* */
  6135. /* */
  6136. /* */
  6137. // inline hooks to be invoked on component VNodes during patch
  6138. var componentVNodeHooks = {
  6139. init: function init (vnode, hydrating) {
  6140. if (
  6141. vnode.componentInstance &&
  6142. !vnode.componentInstance._isDestroyed &&
  6143. vnode.data.keepAlive
  6144. ) {
  6145. // kept-alive components, treat as a patch
  6146. var mountedNode = vnode; // work around flow
  6147. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6148. } else {
  6149. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6150. vnode,
  6151. activeInstance
  6152. );
  6153. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6154. }
  6155. },
  6156. prepatch: function prepatch (oldVnode, vnode) {
  6157. var options = vnode.componentOptions;
  6158. var child = vnode.componentInstance = oldVnode.componentInstance;
  6159. updateChildComponent(
  6160. child,
  6161. options.propsData, // updated props
  6162. options.listeners, // updated listeners
  6163. vnode, // new parent vnode
  6164. options.children // new children
  6165. );
  6166. },
  6167. insert: function insert (vnode) {
  6168. var context = vnode.context;
  6169. var componentInstance = vnode.componentInstance;
  6170. if (!componentInstance._isMounted) {
  6171. callHook(componentInstance, 'onServiceCreated');
  6172. callHook(componentInstance, 'onServiceAttached');
  6173. componentInstance._isMounted = true;
  6174. callHook(componentInstance, 'mounted');
  6175. }
  6176. if (vnode.data.keepAlive) {
  6177. if (context._isMounted) {
  6178. // vue-router#1212
  6179. // During updates, a kept-alive component's child components may
  6180. // change, so directly walking the tree here may call activated hooks
  6181. // on incorrect children. Instead we push them into a queue which will
  6182. // be processed after the whole patch process ended.
  6183. queueActivatedComponent(componentInstance);
  6184. } else {
  6185. activateChildComponent(componentInstance, true /* direct */);
  6186. }
  6187. }
  6188. },
  6189. destroy: function destroy (vnode) {
  6190. var componentInstance = vnode.componentInstance;
  6191. if (!componentInstance._isDestroyed) {
  6192. if (!vnode.data.keepAlive) {
  6193. componentInstance.$destroy();
  6194. } else {
  6195. deactivateChildComponent(componentInstance, true /* direct */);
  6196. }
  6197. }
  6198. }
  6199. };
  6200. var hooksToMerge = Object.keys(componentVNodeHooks);
  6201. function createComponent (
  6202. Ctor,
  6203. data,
  6204. context,
  6205. children,
  6206. tag
  6207. ) {
  6208. if (isUndef(Ctor)) {
  6209. return
  6210. }
  6211. var baseCtor = context.$options._base;
  6212. // plain options object: turn it into a constructor
  6213. if (isObject(Ctor)) {
  6214. Ctor = baseCtor.extend(Ctor);
  6215. }
  6216. // if at this stage it's not a constructor or an async component factory,
  6217. // reject.
  6218. if (typeof Ctor !== 'function') {
  6219. if (true) {
  6220. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6221. }
  6222. return
  6223. }
  6224. // async component
  6225. var asyncFactory;
  6226. if (isUndef(Ctor.cid)) {
  6227. asyncFactory = Ctor;
  6228. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6229. if (Ctor === undefined) {
  6230. // return a placeholder node for async component, which is rendered
  6231. // as a comment node but preserves all the raw information for the node.
  6232. // the information will be used for async server-rendering and hydration.
  6233. return createAsyncPlaceholder(
  6234. asyncFactory,
  6235. data,
  6236. context,
  6237. children,
  6238. tag
  6239. )
  6240. }
  6241. }
  6242. data = data || {};
  6243. // resolve constructor options in case global mixins are applied after
  6244. // component constructor creation
  6245. resolveConstructorOptions(Ctor);
  6246. // transform component v-model data into props & events
  6247. if (isDef(data.model)) {
  6248. transformModel(Ctor.options, data);
  6249. }
  6250. // extract props
  6251. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6252. // functional component
  6253. if (isTrue(Ctor.options.functional)) {
  6254. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6255. }
  6256. // extract listeners, since these needs to be treated as
  6257. // child component listeners instead of DOM listeners
  6258. var listeners = data.on;
  6259. // replace with listeners with .native modifier
  6260. // so it gets processed during parent component patch.
  6261. data.on = data.nativeOn;
  6262. if (isTrue(Ctor.options.abstract)) {
  6263. // abstract components do not keep anything
  6264. // other than props & listeners & slot
  6265. // work around flow
  6266. var slot = data.slot;
  6267. data = {};
  6268. if (slot) {
  6269. data.slot = slot;
  6270. }
  6271. }
  6272. // install component management hooks onto the placeholder node
  6273. installComponentHooks(data);
  6274. // return a placeholder vnode
  6275. var name = Ctor.options.name || tag;
  6276. var vnode = new VNode(
  6277. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6278. data, undefined, undefined, undefined, context,
  6279. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6280. asyncFactory
  6281. );
  6282. return vnode
  6283. }
  6284. function createComponentInstanceForVnode (
  6285. vnode, // we know it's MountedComponentVNode but flow doesn't
  6286. parent // activeInstance in lifecycle state
  6287. ) {
  6288. var options = {
  6289. _isComponent: true,
  6290. _parentVnode: vnode,
  6291. parent: parent
  6292. };
  6293. // check inline-template render functions
  6294. var inlineTemplate = vnode.data.inlineTemplate;
  6295. if (isDef(inlineTemplate)) {
  6296. options.render = inlineTemplate.render;
  6297. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6298. }
  6299. return new vnode.componentOptions.Ctor(options)
  6300. }
  6301. function installComponentHooks (data) {
  6302. var hooks = data.hook || (data.hook = {});
  6303. for (var i = 0; i < hooksToMerge.length; i++) {
  6304. var key = hooksToMerge[i];
  6305. var existing = hooks[key];
  6306. var toMerge = componentVNodeHooks[key];
  6307. if (existing !== toMerge && !(existing && existing._merged)) {
  6308. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6309. }
  6310. }
  6311. }
  6312. function mergeHook$1 (f1, f2) {
  6313. var merged = function (a, b) {
  6314. // flow complains about extra args which is why we use any
  6315. f1(a, b);
  6316. f2(a, b);
  6317. };
  6318. merged._merged = true;
  6319. return merged
  6320. }
  6321. // transform component v-model info (value and callback) into
  6322. // prop and event handler respectively.
  6323. function transformModel (options, data) {
  6324. var prop = (options.model && options.model.prop) || 'value';
  6325. var event = (options.model && options.model.event) || 'input'
  6326. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6327. var on = data.on || (data.on = {});
  6328. var existing = on[event];
  6329. var callback = data.model.callback;
  6330. if (isDef(existing)) {
  6331. if (
  6332. Array.isArray(existing)
  6333. ? existing.indexOf(callback) === -1
  6334. : existing !== callback
  6335. ) {
  6336. on[event] = [callback].concat(existing);
  6337. }
  6338. } else {
  6339. on[event] = callback;
  6340. }
  6341. }
  6342. /* */
  6343. var SIMPLE_NORMALIZE = 1;
  6344. var ALWAYS_NORMALIZE = 2;
  6345. // wrapper function for providing a more flexible interface
  6346. // without getting yelled at by flow
  6347. function createElement (
  6348. context,
  6349. tag,
  6350. data,
  6351. children,
  6352. normalizationType,
  6353. alwaysNormalize
  6354. ) {
  6355. if (Array.isArray(data) || isPrimitive(data)) {
  6356. normalizationType = children;
  6357. children = data;
  6358. data = undefined;
  6359. }
  6360. if (isTrue(alwaysNormalize)) {
  6361. normalizationType = ALWAYS_NORMALIZE;
  6362. }
  6363. return _createElement(context, tag, data, children, normalizationType)
  6364. }
  6365. function _createElement (
  6366. context,
  6367. tag,
  6368. data,
  6369. children,
  6370. normalizationType
  6371. ) {
  6372. if (isDef(data) && isDef((data).__ob__)) {
  6373. true && warn(
  6374. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6375. 'Always create fresh vnode data objects in each render!',
  6376. context
  6377. );
  6378. return createEmptyVNode()
  6379. }
  6380. // object syntax in v-bind
  6381. if (isDef(data) && isDef(data.is)) {
  6382. tag = data.is;
  6383. }
  6384. if (!tag) {
  6385. // in case of component :is set to falsy value
  6386. return createEmptyVNode()
  6387. }
  6388. // warn against non-primitive key
  6389. if ( true &&
  6390. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6391. ) {
  6392. {
  6393. warn(
  6394. 'Avoid using non-primitive value as key, ' +
  6395. 'use string/number value instead.',
  6396. context
  6397. );
  6398. }
  6399. }
  6400. // support single function children as default scoped slot
  6401. if (Array.isArray(children) &&
  6402. typeof children[0] === 'function'
  6403. ) {
  6404. data = data || {};
  6405. data.scopedSlots = { default: children[0] };
  6406. children.length = 0;
  6407. }
  6408. if (normalizationType === ALWAYS_NORMALIZE) {
  6409. children = normalizeChildren(children);
  6410. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6411. children = simpleNormalizeChildren(children);
  6412. }
  6413. var vnode, ns;
  6414. if (typeof tag === 'string') {
  6415. var Ctor;
  6416. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6417. if (config.isReservedTag(tag)) {
  6418. // platform built-in elements
  6419. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6420. warn(
  6421. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6422. context
  6423. );
  6424. }
  6425. vnode = new VNode(
  6426. config.parsePlatformTagName(tag), data, children,
  6427. undefined, undefined, context
  6428. );
  6429. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6430. // component
  6431. vnode = createComponent(Ctor, data, context, children, tag);
  6432. } else {
  6433. // unknown or unlisted namespaced elements
  6434. // check at runtime because it may get assigned a namespace when its
  6435. // parent normalizes children
  6436. vnode = new VNode(
  6437. tag, data, children,
  6438. undefined, undefined, context
  6439. );
  6440. }
  6441. } else {
  6442. // direct component options / constructor
  6443. vnode = createComponent(tag, data, context, children);
  6444. }
  6445. if (Array.isArray(vnode)) {
  6446. return vnode
  6447. } else if (isDef(vnode)) {
  6448. if (isDef(ns)) { applyNS(vnode, ns); }
  6449. if (isDef(data)) { registerDeepBindings(data); }
  6450. return vnode
  6451. } else {
  6452. return createEmptyVNode()
  6453. }
  6454. }
  6455. function applyNS (vnode, ns, force) {
  6456. vnode.ns = ns;
  6457. if (vnode.tag === 'foreignObject') {
  6458. // use default namespace inside foreignObject
  6459. ns = undefined;
  6460. force = true;
  6461. }
  6462. if (isDef(vnode.children)) {
  6463. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6464. var child = vnode.children[i];
  6465. if (isDef(child.tag) && (
  6466. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6467. applyNS(child, ns, force);
  6468. }
  6469. }
  6470. }
  6471. }
  6472. // ref #5318
  6473. // necessary to ensure parent re-render when deep bindings like :style and
  6474. // :class are used on slot nodes
  6475. function registerDeepBindings (data) {
  6476. if (isObject(data.style)) {
  6477. traverse(data.style);
  6478. }
  6479. if (isObject(data.class)) {
  6480. traverse(data.class);
  6481. }
  6482. }
  6483. /* */
  6484. function initRender (vm) {
  6485. vm._vnode = null; // the root of the child tree
  6486. vm._staticTrees = null; // v-once cached trees
  6487. var options = vm.$options;
  6488. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6489. var renderContext = parentVnode && parentVnode.context;
  6490. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6491. vm.$scopedSlots = emptyObject;
  6492. // bind the createElement fn to this instance
  6493. // so that we get proper render context inside it.
  6494. // args order: tag, data, children, normalizationType, alwaysNormalize
  6495. // internal version is used by render functions compiled from templates
  6496. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6497. // normalization is always applied for the public version, used in
  6498. // user-written render functions.
  6499. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6500. // $attrs & $listeners are exposed for easier HOC creation.
  6501. // they need to be reactive so that HOCs using them are always updated
  6502. var parentData = parentVnode && parentVnode.data;
  6503. /* istanbul ignore else */
  6504. if (true) {
  6505. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6506. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6507. }, true);
  6508. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6509. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6510. }, true);
  6511. } else {}
  6512. }
  6513. var currentRenderingInstance = null;
  6514. function renderMixin (Vue) {
  6515. // install runtime convenience helpers
  6516. installRenderHelpers(Vue.prototype);
  6517. Vue.prototype.$nextTick = function (fn) {
  6518. return nextTick(fn, this)
  6519. };
  6520. Vue.prototype._render = function () {
  6521. var vm = this;
  6522. var ref = vm.$options;
  6523. var render = ref.render;
  6524. var _parentVnode = ref._parentVnode;
  6525. if (_parentVnode) {
  6526. vm.$scopedSlots = normalizeScopedSlots(
  6527. _parentVnode.data.scopedSlots,
  6528. vm.$slots,
  6529. vm.$scopedSlots
  6530. );
  6531. }
  6532. // set parent vnode. this allows render functions to have access
  6533. // to the data on the placeholder node.
  6534. vm.$vnode = _parentVnode;
  6535. // render self
  6536. var vnode;
  6537. try {
  6538. // There's no need to maintain a stack because all render fns are called
  6539. // separately from one another. Nested component's render fns are called
  6540. // when parent component is patched.
  6541. currentRenderingInstance = vm;
  6542. vnode = render.call(vm._renderProxy, vm.$createElement);
  6543. } catch (e) {
  6544. handleError(e, vm, "render");
  6545. // return error render result,
  6546. // or previous vnode to prevent render error causing blank component
  6547. /* istanbul ignore else */
  6548. if ( true && vm.$options.renderError) {
  6549. try {
  6550. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6551. } catch (e) {
  6552. handleError(e, vm, "renderError");
  6553. vnode = vm._vnode;
  6554. }
  6555. } else {
  6556. vnode = vm._vnode;
  6557. }
  6558. } finally {
  6559. currentRenderingInstance = null;
  6560. }
  6561. // if the returned array contains only a single node, allow it
  6562. if (Array.isArray(vnode) && vnode.length === 1) {
  6563. vnode = vnode[0];
  6564. }
  6565. // return empty vnode in case the render function errored out
  6566. if (!(vnode instanceof VNode)) {
  6567. if ( true && Array.isArray(vnode)) {
  6568. warn(
  6569. 'Multiple root nodes returned from render function. Render function ' +
  6570. 'should return a single root node.',
  6571. vm
  6572. );
  6573. }
  6574. vnode = createEmptyVNode();
  6575. }
  6576. // set parent
  6577. vnode.parent = _parentVnode;
  6578. return vnode
  6579. };
  6580. }
  6581. /* */
  6582. function ensureCtor (comp, base) {
  6583. if (
  6584. comp.__esModule ||
  6585. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6586. ) {
  6587. comp = comp.default;
  6588. }
  6589. return isObject(comp)
  6590. ? base.extend(comp)
  6591. : comp
  6592. }
  6593. function createAsyncPlaceholder (
  6594. factory,
  6595. data,
  6596. context,
  6597. children,
  6598. tag
  6599. ) {
  6600. var node = createEmptyVNode();
  6601. node.asyncFactory = factory;
  6602. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6603. return node
  6604. }
  6605. function resolveAsyncComponent (
  6606. factory,
  6607. baseCtor
  6608. ) {
  6609. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6610. return factory.errorComp
  6611. }
  6612. if (isDef(factory.resolved)) {
  6613. return factory.resolved
  6614. }
  6615. var owner = currentRenderingInstance;
  6616. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6617. // already pending
  6618. factory.owners.push(owner);
  6619. }
  6620. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6621. return factory.loadingComp
  6622. }
  6623. if (owner && !isDef(factory.owners)) {
  6624. var owners = factory.owners = [owner];
  6625. var sync = true;
  6626. var timerLoading = null;
  6627. var timerTimeout = null
  6628. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6629. var forceRender = function (renderCompleted) {
  6630. for (var i = 0, l = owners.length; i < l; i++) {
  6631. (owners[i]).$forceUpdate();
  6632. }
  6633. if (renderCompleted) {
  6634. owners.length = 0;
  6635. if (timerLoading !== null) {
  6636. clearTimeout(timerLoading);
  6637. timerLoading = null;
  6638. }
  6639. if (timerTimeout !== null) {
  6640. clearTimeout(timerTimeout);
  6641. timerTimeout = null;
  6642. }
  6643. }
  6644. };
  6645. var resolve = once(function (res) {
  6646. // cache resolved
  6647. factory.resolved = ensureCtor(res, baseCtor);
  6648. // invoke callbacks only if this is not a synchronous resolve
  6649. // (async resolves are shimmed as synchronous during SSR)
  6650. if (!sync) {
  6651. forceRender(true);
  6652. } else {
  6653. owners.length = 0;
  6654. }
  6655. });
  6656. var reject = once(function (reason) {
  6657. true && warn(
  6658. "Failed to resolve async component: " + (String(factory)) +
  6659. (reason ? ("\nReason: " + reason) : '')
  6660. );
  6661. if (isDef(factory.errorComp)) {
  6662. factory.error = true;
  6663. forceRender(true);
  6664. }
  6665. });
  6666. var res = factory(resolve, reject);
  6667. if (isObject(res)) {
  6668. if (isPromise(res)) {
  6669. // () => Promise
  6670. if (isUndef(factory.resolved)) {
  6671. res.then(resolve, reject);
  6672. }
  6673. } else if (isPromise(res.component)) {
  6674. res.component.then(resolve, reject);
  6675. if (isDef(res.error)) {
  6676. factory.errorComp = ensureCtor(res.error, baseCtor);
  6677. }
  6678. if (isDef(res.loading)) {
  6679. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6680. if (res.delay === 0) {
  6681. factory.loading = true;
  6682. } else {
  6683. timerLoading = setTimeout(function () {
  6684. timerLoading = null;
  6685. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6686. factory.loading = true;
  6687. forceRender(false);
  6688. }
  6689. }, res.delay || 200);
  6690. }
  6691. }
  6692. if (isDef(res.timeout)) {
  6693. timerTimeout = setTimeout(function () {
  6694. timerTimeout = null;
  6695. if (isUndef(factory.resolved)) {
  6696. reject(
  6697. true
  6698. ? ("timeout (" + (res.timeout) + "ms)")
  6699. : undefined
  6700. );
  6701. }
  6702. }, res.timeout);
  6703. }
  6704. }
  6705. }
  6706. sync = false;
  6707. // return in case resolved synchronously
  6708. return factory.loading
  6709. ? factory.loadingComp
  6710. : factory.resolved
  6711. }
  6712. }
  6713. /* */
  6714. function isAsyncPlaceholder (node) {
  6715. return node.isComment && node.asyncFactory
  6716. }
  6717. /* */
  6718. function getFirstComponentChild (children) {
  6719. if (Array.isArray(children)) {
  6720. for (var i = 0; i < children.length; i++) {
  6721. var c = children[i];
  6722. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6723. return c
  6724. }
  6725. }
  6726. }
  6727. }
  6728. /* */
  6729. /* */
  6730. function initEvents (vm) {
  6731. vm._events = Object.create(null);
  6732. vm._hasHookEvent = false;
  6733. // init parent attached events
  6734. var listeners = vm.$options._parentListeners;
  6735. if (listeners) {
  6736. updateComponentListeners(vm, listeners);
  6737. }
  6738. }
  6739. var target;
  6740. function add (event, fn) {
  6741. target.$on(event, fn);
  6742. }
  6743. function remove$1 (event, fn) {
  6744. target.$off(event, fn);
  6745. }
  6746. function createOnceHandler (event, fn) {
  6747. var _target = target;
  6748. return function onceHandler () {
  6749. var res = fn.apply(null, arguments);
  6750. if (res !== null) {
  6751. _target.$off(event, onceHandler);
  6752. }
  6753. }
  6754. }
  6755. function updateComponentListeners (
  6756. vm,
  6757. listeners,
  6758. oldListeners
  6759. ) {
  6760. target = vm;
  6761. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6762. target = undefined;
  6763. }
  6764. function eventsMixin (Vue) {
  6765. var hookRE = /^hook:/;
  6766. Vue.prototype.$on = function (event, fn) {
  6767. var vm = this;
  6768. if (Array.isArray(event)) {
  6769. for (var i = 0, l = event.length; i < l; i++) {
  6770. vm.$on(event[i], fn);
  6771. }
  6772. } else {
  6773. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6774. // optimize hook:event cost by using a boolean flag marked at registration
  6775. // instead of a hash lookup
  6776. if (hookRE.test(event)) {
  6777. vm._hasHookEvent = true;
  6778. }
  6779. }
  6780. return vm
  6781. };
  6782. Vue.prototype.$once = function (event, fn) {
  6783. var vm = this;
  6784. function on () {
  6785. vm.$off(event, on);
  6786. fn.apply(vm, arguments);
  6787. }
  6788. on.fn = fn;
  6789. vm.$on(event, on);
  6790. return vm
  6791. };
  6792. Vue.prototype.$off = function (event, fn) {
  6793. var vm = this;
  6794. // all
  6795. if (!arguments.length) {
  6796. vm._events = Object.create(null);
  6797. return vm
  6798. }
  6799. // array of events
  6800. if (Array.isArray(event)) {
  6801. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6802. vm.$off(event[i$1], fn);
  6803. }
  6804. return vm
  6805. }
  6806. // specific event
  6807. var cbs = vm._events[event];
  6808. if (!cbs) {
  6809. return vm
  6810. }
  6811. if (!fn) {
  6812. vm._events[event] = null;
  6813. return vm
  6814. }
  6815. // specific handler
  6816. var cb;
  6817. var i = cbs.length;
  6818. while (i--) {
  6819. cb = cbs[i];
  6820. if (cb === fn || cb.fn === fn) {
  6821. cbs.splice(i, 1);
  6822. break
  6823. }
  6824. }
  6825. return vm
  6826. };
  6827. Vue.prototype.$emit = function (event) {
  6828. var vm = this;
  6829. if (true) {
  6830. var lowerCaseEvent = event.toLowerCase();
  6831. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6832. tip(
  6833. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6834. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6835. "Note that HTML attributes are case-insensitive and you cannot use " +
  6836. "v-on to listen to camelCase events when using in-DOM templates. " +
  6837. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6838. );
  6839. }
  6840. }
  6841. var cbs = vm._events[event];
  6842. if (cbs) {
  6843. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6844. var args = toArray(arguments, 1);
  6845. var info = "event handler for \"" + event + "\"";
  6846. for (var i = 0, l = cbs.length; i < l; i++) {
  6847. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6848. }
  6849. }
  6850. return vm
  6851. };
  6852. }
  6853. /* */
  6854. var activeInstance = null;
  6855. var isUpdatingChildComponent = false;
  6856. function setActiveInstance(vm) {
  6857. var prevActiveInstance = activeInstance;
  6858. activeInstance = vm;
  6859. return function () {
  6860. activeInstance = prevActiveInstance;
  6861. }
  6862. }
  6863. function initLifecycle (vm) {
  6864. var options = vm.$options;
  6865. // locate first non-abstract parent
  6866. var parent = options.parent;
  6867. if (parent && !options.abstract) {
  6868. while (parent.$options.abstract && parent.$parent) {
  6869. parent = parent.$parent;
  6870. }
  6871. parent.$children.push(vm);
  6872. }
  6873. vm.$parent = parent;
  6874. vm.$root = parent ? parent.$root : vm;
  6875. vm.$children = [];
  6876. vm.$refs = {};
  6877. vm._watcher = null;
  6878. vm._inactive = null;
  6879. vm._directInactive = false;
  6880. vm._isMounted = false;
  6881. vm._isDestroyed = false;
  6882. vm._isBeingDestroyed = false;
  6883. }
  6884. function lifecycleMixin (Vue) {
  6885. Vue.prototype._update = function (vnode, hydrating) {
  6886. var vm = this;
  6887. var prevEl = vm.$el;
  6888. var prevVnode = vm._vnode;
  6889. var restoreActiveInstance = setActiveInstance(vm);
  6890. vm._vnode = vnode;
  6891. // Vue.prototype.__patch__ is injected in entry points
  6892. // based on the rendering backend used.
  6893. if (!prevVnode) {
  6894. // initial render
  6895. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6896. } else {
  6897. // updates
  6898. vm.$el = vm.__patch__(prevVnode, vnode);
  6899. }
  6900. restoreActiveInstance();
  6901. // update __vue__ reference
  6902. if (prevEl) {
  6903. prevEl.__vue__ = null;
  6904. }
  6905. if (vm.$el) {
  6906. vm.$el.__vue__ = vm;
  6907. }
  6908. // if parent is an HOC, update its $el as well
  6909. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6910. vm.$parent.$el = vm.$el;
  6911. }
  6912. // updated hook is called by the scheduler to ensure that children are
  6913. // updated in a parent's updated hook.
  6914. };
  6915. Vue.prototype.$forceUpdate = function () {
  6916. var vm = this;
  6917. if (vm._watcher) {
  6918. vm._watcher.update();
  6919. }
  6920. };
  6921. Vue.prototype.$destroy = function () {
  6922. var vm = this;
  6923. if (vm._isBeingDestroyed) {
  6924. return
  6925. }
  6926. callHook(vm, 'beforeDestroy');
  6927. vm._isBeingDestroyed = true;
  6928. // remove self from parent
  6929. var parent = vm.$parent;
  6930. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6931. remove(parent.$children, vm);
  6932. }
  6933. // teardown watchers
  6934. if (vm._watcher) {
  6935. vm._watcher.teardown();
  6936. }
  6937. var i = vm._watchers.length;
  6938. while (i--) {
  6939. vm._watchers[i].teardown();
  6940. }
  6941. // remove reference from data ob
  6942. // frozen object may not have observer.
  6943. if (vm._data.__ob__) {
  6944. vm._data.__ob__.vmCount--;
  6945. }
  6946. // call the last hook...
  6947. vm._isDestroyed = true;
  6948. // invoke destroy hooks on current rendered tree
  6949. vm.__patch__(vm._vnode, null);
  6950. // fire destroyed hook
  6951. callHook(vm, 'destroyed');
  6952. // turn off all instance listeners.
  6953. vm.$off();
  6954. // remove __vue__ reference
  6955. if (vm.$el) {
  6956. vm.$el.__vue__ = null;
  6957. }
  6958. // release circular reference (#6759)
  6959. if (vm.$vnode) {
  6960. vm.$vnode.parent = null;
  6961. }
  6962. };
  6963. }
  6964. function updateChildComponent (
  6965. vm,
  6966. propsData,
  6967. listeners,
  6968. parentVnode,
  6969. renderChildren
  6970. ) {
  6971. if (true) {
  6972. isUpdatingChildComponent = true;
  6973. }
  6974. // determine whether component has slot children
  6975. // we need to do this before overwriting $options._renderChildren.
  6976. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6977. // dynamic slot names). Static scoped slots compiled from template has the
  6978. // "$stable" marker.
  6979. var newScopedSlots = parentVnode.data.scopedSlots;
  6980. var oldScopedSlots = vm.$scopedSlots;
  6981. var hasDynamicScopedSlot = !!(
  6982. (newScopedSlots && !newScopedSlots.$stable) ||
  6983. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6984. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6985. );
  6986. // Any static slot children from the parent may have changed during parent's
  6987. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6988. // update is necessary to ensure correctness.
  6989. var needsForceUpdate = !!(
  6990. renderChildren || // has new static slots
  6991. vm.$options._renderChildren || // has old static slots
  6992. hasDynamicScopedSlot
  6993. );
  6994. vm.$options._parentVnode = parentVnode;
  6995. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6996. if (vm._vnode) { // update child tree's parent
  6997. vm._vnode.parent = parentVnode;
  6998. }
  6999. vm.$options._renderChildren = renderChildren;
  7000. // update $attrs and $listeners hash
  7001. // these are also reactive so they may trigger child update if the child
  7002. // used them during render
  7003. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7004. vm.$listeners = listeners || emptyObject;
  7005. // update props
  7006. if (propsData && vm.$options.props) {
  7007. toggleObserving(false);
  7008. var props = vm._props;
  7009. var propKeys = vm.$options._propKeys || [];
  7010. for (var i = 0; i < propKeys.length; i++) {
  7011. var key = propKeys[i];
  7012. var propOptions = vm.$options.props; // wtf flow?
  7013. props[key] = validateProp(key, propOptions, propsData, vm);
  7014. }
  7015. toggleObserving(true);
  7016. // keep a copy of raw propsData
  7017. vm.$options.propsData = propsData;
  7018. }
  7019. // fixed by xxxxxx update properties(mp runtime)
  7020. vm._$updateProperties && vm._$updateProperties(vm);
  7021. // update listeners
  7022. listeners = listeners || emptyObject;
  7023. var oldListeners = vm.$options._parentListeners;
  7024. vm.$options._parentListeners = listeners;
  7025. updateComponentListeners(vm, listeners, oldListeners);
  7026. // resolve slots + force update if has children
  7027. if (needsForceUpdate) {
  7028. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7029. vm.$forceUpdate();
  7030. }
  7031. if (true) {
  7032. isUpdatingChildComponent = false;
  7033. }
  7034. }
  7035. function isInInactiveTree (vm) {
  7036. while (vm && (vm = vm.$parent)) {
  7037. if (vm._inactive) { return true }
  7038. }
  7039. return false
  7040. }
  7041. function activateChildComponent (vm, direct) {
  7042. if (direct) {
  7043. vm._directInactive = false;
  7044. if (isInInactiveTree(vm)) {
  7045. return
  7046. }
  7047. } else if (vm._directInactive) {
  7048. return
  7049. }
  7050. if (vm._inactive || vm._inactive === null) {
  7051. vm._inactive = false;
  7052. for (var i = 0; i < vm.$children.length; i++) {
  7053. activateChildComponent(vm.$children[i]);
  7054. }
  7055. callHook(vm, 'activated');
  7056. }
  7057. }
  7058. function deactivateChildComponent (vm, direct) {
  7059. if (direct) {
  7060. vm._directInactive = true;
  7061. if (isInInactiveTree(vm)) {
  7062. return
  7063. }
  7064. }
  7065. if (!vm._inactive) {
  7066. vm._inactive = true;
  7067. for (var i = 0; i < vm.$children.length; i++) {
  7068. deactivateChildComponent(vm.$children[i]);
  7069. }
  7070. callHook(vm, 'deactivated');
  7071. }
  7072. }
  7073. function callHook (vm, hook) {
  7074. // #7573 disable dep collection when invoking lifecycle hooks
  7075. pushTarget();
  7076. var handlers = vm.$options[hook];
  7077. var info = hook + " hook";
  7078. if (handlers) {
  7079. for (var i = 0, j = handlers.length; i < j; i++) {
  7080. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7081. }
  7082. }
  7083. if (vm._hasHookEvent) {
  7084. vm.$emit('hook:' + hook);
  7085. }
  7086. popTarget();
  7087. }
  7088. /* */
  7089. var MAX_UPDATE_COUNT = 100;
  7090. var queue = [];
  7091. var activatedChildren = [];
  7092. var has = {};
  7093. var circular = {};
  7094. var waiting = false;
  7095. var flushing = false;
  7096. var index = 0;
  7097. /**
  7098. * Reset the scheduler's state.
  7099. */
  7100. function resetSchedulerState () {
  7101. index = queue.length = activatedChildren.length = 0;
  7102. has = {};
  7103. if (true) {
  7104. circular = {};
  7105. }
  7106. waiting = flushing = false;
  7107. }
  7108. // Async edge case #6566 requires saving the timestamp when event listeners are
  7109. // attached. However, calling performance.now() has a perf overhead especially
  7110. // if the page has thousands of event listeners. Instead, we take a timestamp
  7111. // every time the scheduler flushes and use that for all event listeners
  7112. // attached during that flush.
  7113. var currentFlushTimestamp = 0;
  7114. // Async edge case fix requires storing an event listener's attach timestamp.
  7115. var getNow = Date.now;
  7116. // Determine what event timestamp the browser is using. Annoyingly, the
  7117. // timestamp can either be hi-res (relative to page load) or low-res
  7118. // (relative to UNIX epoch), so in order to compare time we have to use the
  7119. // same timestamp type when saving the flush timestamp.
  7120. // All IE versions use low-res event timestamps, and have problematic clock
  7121. // implementations (#9632)
  7122. if (inBrowser && !isIE) {
  7123. var performance = window.performance;
  7124. if (
  7125. performance &&
  7126. typeof performance.now === 'function' &&
  7127. getNow() > document.createEvent('Event').timeStamp
  7128. ) {
  7129. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7130. // smaller than it, it means the event is using a hi-res timestamp,
  7131. // and we need to use the hi-res version for event listener timestamps as
  7132. // well.
  7133. getNow = function () { return performance.now(); };
  7134. }
  7135. }
  7136. /**
  7137. * Flush both queues and run the watchers.
  7138. */
  7139. function flushSchedulerQueue () {
  7140. currentFlushTimestamp = getNow();
  7141. flushing = true;
  7142. var watcher, id;
  7143. // Sort queue before flush.
  7144. // This ensures that:
  7145. // 1. Components are updated from parent to child. (because parent is always
  7146. // created before the child)
  7147. // 2. A component's user watchers are run before its render watcher (because
  7148. // user watchers are created before the render watcher)
  7149. // 3. If a component is destroyed during a parent component's watcher run,
  7150. // its watchers can be skipped.
  7151. queue.sort(function (a, b) { return a.id - b.id; });
  7152. // do not cache length because more watchers might be pushed
  7153. // as we run existing watchers
  7154. for (index = 0; index < queue.length; index++) {
  7155. watcher = queue[index];
  7156. if (watcher.before) {
  7157. watcher.before();
  7158. }
  7159. id = watcher.id;
  7160. has[id] = null;
  7161. watcher.run();
  7162. // in dev build, check and stop circular updates.
  7163. if ( true && has[id] != null) {
  7164. circular[id] = (circular[id] || 0) + 1;
  7165. if (circular[id] > MAX_UPDATE_COUNT) {
  7166. warn(
  7167. 'You may have an infinite update loop ' + (
  7168. watcher.user
  7169. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7170. : "in a component render function."
  7171. ),
  7172. watcher.vm
  7173. );
  7174. break
  7175. }
  7176. }
  7177. }
  7178. // keep copies of post queues before resetting state
  7179. var activatedQueue = activatedChildren.slice();
  7180. var updatedQueue = queue.slice();
  7181. resetSchedulerState();
  7182. // call component updated and activated hooks
  7183. callActivatedHooks(activatedQueue);
  7184. callUpdatedHooks(updatedQueue);
  7185. // devtool hook
  7186. /* istanbul ignore if */
  7187. if (devtools && config.devtools) {
  7188. devtools.emit('flush');
  7189. }
  7190. }
  7191. function callUpdatedHooks (queue) {
  7192. var i = queue.length;
  7193. while (i--) {
  7194. var watcher = queue[i];
  7195. var vm = watcher.vm;
  7196. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7197. callHook(vm, 'updated');
  7198. }
  7199. }
  7200. }
  7201. /**
  7202. * Queue a kept-alive component that was activated during patch.
  7203. * The queue will be processed after the entire tree has been patched.
  7204. */
  7205. function queueActivatedComponent (vm) {
  7206. // setting _inactive to false here so that a render function can
  7207. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7208. vm._inactive = false;
  7209. activatedChildren.push(vm);
  7210. }
  7211. function callActivatedHooks (queue) {
  7212. for (var i = 0; i < queue.length; i++) {
  7213. queue[i]._inactive = true;
  7214. activateChildComponent(queue[i], true /* true */);
  7215. }
  7216. }
  7217. /**
  7218. * Push a watcher into the watcher queue.
  7219. * Jobs with duplicate IDs will be skipped unless it's
  7220. * pushed when the queue is being flushed.
  7221. */
  7222. function queueWatcher (watcher) {
  7223. var id = watcher.id;
  7224. if (has[id] == null) {
  7225. has[id] = true;
  7226. if (!flushing) {
  7227. queue.push(watcher);
  7228. } else {
  7229. // if already flushing, splice the watcher based on its id
  7230. // if already past its id, it will be run next immediately.
  7231. var i = queue.length - 1;
  7232. while (i > index && queue[i].id > watcher.id) {
  7233. i--;
  7234. }
  7235. queue.splice(i + 1, 0, watcher);
  7236. }
  7237. // queue the flush
  7238. if (!waiting) {
  7239. waiting = true;
  7240. if ( true && !config.async) {
  7241. flushSchedulerQueue();
  7242. return
  7243. }
  7244. nextTick(flushSchedulerQueue);
  7245. }
  7246. }
  7247. }
  7248. /* */
  7249. var uid$2 = 0;
  7250. /**
  7251. * A watcher parses an expression, collects dependencies,
  7252. * and fires callback when the expression value changes.
  7253. * This is used for both the $watch() api and directives.
  7254. */
  7255. var Watcher = function Watcher (
  7256. vm,
  7257. expOrFn,
  7258. cb,
  7259. options,
  7260. isRenderWatcher
  7261. ) {
  7262. this.vm = vm;
  7263. if (isRenderWatcher) {
  7264. vm._watcher = this;
  7265. }
  7266. vm._watchers.push(this);
  7267. // options
  7268. if (options) {
  7269. this.deep = !!options.deep;
  7270. this.user = !!options.user;
  7271. this.lazy = !!options.lazy;
  7272. this.sync = !!options.sync;
  7273. this.before = options.before;
  7274. } else {
  7275. this.deep = this.user = this.lazy = this.sync = false;
  7276. }
  7277. this.cb = cb;
  7278. this.id = ++uid$2; // uid for batching
  7279. this.active = true;
  7280. this.dirty = this.lazy; // for lazy watchers
  7281. this.deps = [];
  7282. this.newDeps = [];
  7283. this.depIds = new _Set();
  7284. this.newDepIds = new _Set();
  7285. this.expression = true
  7286. ? expOrFn.toString()
  7287. : undefined;
  7288. // parse expression for getter
  7289. if (typeof expOrFn === 'function') {
  7290. this.getter = expOrFn;
  7291. } else {
  7292. this.getter = parsePath(expOrFn);
  7293. if (!this.getter) {
  7294. this.getter = noop;
  7295. true && warn(
  7296. "Failed watching path: \"" + expOrFn + "\" " +
  7297. 'Watcher only accepts simple dot-delimited paths. ' +
  7298. 'For full control, use a function instead.',
  7299. vm
  7300. );
  7301. }
  7302. }
  7303. this.value = this.lazy
  7304. ? undefined
  7305. : this.get();
  7306. };
  7307. /**
  7308. * Evaluate the getter, and re-collect dependencies.
  7309. */
  7310. Watcher.prototype.get = function get () {
  7311. pushTarget(this);
  7312. var value;
  7313. var vm = this.vm;
  7314. try {
  7315. value = this.getter.call(vm, vm);
  7316. } catch (e) {
  7317. if (this.user) {
  7318. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7319. } else {
  7320. throw e
  7321. }
  7322. } finally {
  7323. // "touch" every property so they are all tracked as
  7324. // dependencies for deep watching
  7325. if (this.deep) {
  7326. traverse(value);
  7327. }
  7328. popTarget();
  7329. this.cleanupDeps();
  7330. }
  7331. return value
  7332. };
  7333. /**
  7334. * Add a dependency to this directive.
  7335. */
  7336. Watcher.prototype.addDep = function addDep (dep) {
  7337. var id = dep.id;
  7338. if (!this.newDepIds.has(id)) {
  7339. this.newDepIds.add(id);
  7340. this.newDeps.push(dep);
  7341. if (!this.depIds.has(id)) {
  7342. dep.addSub(this);
  7343. }
  7344. }
  7345. };
  7346. /**
  7347. * Clean up for dependency collection.
  7348. */
  7349. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7350. var i = this.deps.length;
  7351. while (i--) {
  7352. var dep = this.deps[i];
  7353. if (!this.newDepIds.has(dep.id)) {
  7354. dep.removeSub(this);
  7355. }
  7356. }
  7357. var tmp = this.depIds;
  7358. this.depIds = this.newDepIds;
  7359. this.newDepIds = tmp;
  7360. this.newDepIds.clear();
  7361. tmp = this.deps;
  7362. this.deps = this.newDeps;
  7363. this.newDeps = tmp;
  7364. this.newDeps.length = 0;
  7365. };
  7366. /**
  7367. * Subscriber interface.
  7368. * Will be called when a dependency changes.
  7369. */
  7370. Watcher.prototype.update = function update () {
  7371. /* istanbul ignore else */
  7372. if (this.lazy) {
  7373. this.dirty = true;
  7374. } else if (this.sync) {
  7375. this.run();
  7376. } else {
  7377. queueWatcher(this);
  7378. }
  7379. };
  7380. /**
  7381. * Scheduler job interface.
  7382. * Will be called by the scheduler.
  7383. */
  7384. Watcher.prototype.run = function run () {
  7385. if (this.active) {
  7386. var value = this.get();
  7387. if (
  7388. value !== this.value ||
  7389. // Deep watchers and watchers on Object/Arrays should fire even
  7390. // when the value is the same, because the value may
  7391. // have mutated.
  7392. isObject(value) ||
  7393. this.deep
  7394. ) {
  7395. // set new value
  7396. var oldValue = this.value;
  7397. this.value = value;
  7398. if (this.user) {
  7399. try {
  7400. this.cb.call(this.vm, value, oldValue);
  7401. } catch (e) {
  7402. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7403. }
  7404. } else {
  7405. this.cb.call(this.vm, value, oldValue);
  7406. }
  7407. }
  7408. }
  7409. };
  7410. /**
  7411. * Evaluate the value of the watcher.
  7412. * This only gets called for lazy watchers.
  7413. */
  7414. Watcher.prototype.evaluate = function evaluate () {
  7415. this.value = this.get();
  7416. this.dirty = false;
  7417. };
  7418. /**
  7419. * Depend on all deps collected by this watcher.
  7420. */
  7421. Watcher.prototype.depend = function depend () {
  7422. var i = this.deps.length;
  7423. while (i--) {
  7424. this.deps[i].depend();
  7425. }
  7426. };
  7427. /**
  7428. * Remove self from all dependencies' subscriber list.
  7429. */
  7430. Watcher.prototype.teardown = function teardown () {
  7431. if (this.active) {
  7432. // remove self from vm's watcher list
  7433. // this is a somewhat expensive operation so we skip it
  7434. // if the vm is being destroyed.
  7435. if (!this.vm._isBeingDestroyed) {
  7436. remove(this.vm._watchers, this);
  7437. }
  7438. var i = this.deps.length;
  7439. while (i--) {
  7440. this.deps[i].removeSub(this);
  7441. }
  7442. this.active = false;
  7443. }
  7444. };
  7445. /* */
  7446. var sharedPropertyDefinition = {
  7447. enumerable: true,
  7448. configurable: true,
  7449. get: noop,
  7450. set: noop
  7451. };
  7452. function proxy (target, sourceKey, key) {
  7453. sharedPropertyDefinition.get = function proxyGetter () {
  7454. return this[sourceKey][key]
  7455. };
  7456. sharedPropertyDefinition.set = function proxySetter (val) {
  7457. this[sourceKey][key] = val;
  7458. };
  7459. Object.defineProperty(target, key, sharedPropertyDefinition);
  7460. }
  7461. function initState (vm) {
  7462. vm._watchers = [];
  7463. var opts = vm.$options;
  7464. if (opts.props) { initProps(vm, opts.props); }
  7465. if (opts.methods) { initMethods(vm, opts.methods); }
  7466. if (opts.data) {
  7467. initData(vm);
  7468. } else {
  7469. observe(vm._data = {}, true /* asRootData */);
  7470. }
  7471. if (opts.computed) { initComputed(vm, opts.computed); }
  7472. if (opts.watch && opts.watch !== nativeWatch) {
  7473. initWatch(vm, opts.watch);
  7474. }
  7475. }
  7476. function initProps (vm, propsOptions) {
  7477. var propsData = vm.$options.propsData || {};
  7478. var props = vm._props = {};
  7479. // cache prop keys so that future props updates can iterate using Array
  7480. // instead of dynamic object key enumeration.
  7481. var keys = vm.$options._propKeys = [];
  7482. var isRoot = !vm.$parent;
  7483. // root instance props should be converted
  7484. if (!isRoot) {
  7485. toggleObserving(false);
  7486. }
  7487. var loop = function ( key ) {
  7488. keys.push(key);
  7489. var value = validateProp(key, propsOptions, propsData, vm);
  7490. /* istanbul ignore else */
  7491. if (true) {
  7492. var hyphenatedKey = hyphenate(key);
  7493. if (isReservedAttribute(hyphenatedKey) ||
  7494. config.isReservedAttr(hyphenatedKey)) {
  7495. warn(
  7496. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7497. vm
  7498. );
  7499. }
  7500. defineReactive$$1(props, key, value, function () {
  7501. if (!isRoot && !isUpdatingChildComponent) {
  7502. {
  7503. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  7504. return
  7505. }
  7506. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7507. if(
  7508. key === 'value' &&
  7509. Array.isArray(vm.$options.behaviors) &&
  7510. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7511. ){
  7512. return
  7513. }
  7514. if(vm._getFormData){
  7515. return
  7516. }
  7517. var $parent = vm.$parent;
  7518. while($parent){
  7519. if($parent.__next_tick_pending){
  7520. return
  7521. }
  7522. $parent = $parent.$parent;
  7523. }
  7524. }
  7525. warn(
  7526. "Avoid mutating a prop directly since the value will be " +
  7527. "overwritten whenever the parent component re-renders. " +
  7528. "Instead, use a data or computed property based on the prop's " +
  7529. "value. Prop being mutated: \"" + key + "\"",
  7530. vm
  7531. );
  7532. }
  7533. });
  7534. } else {}
  7535. // static props are already proxied on the component's prototype
  7536. // during Vue.extend(). We only need to proxy props defined at
  7537. // instantiation here.
  7538. if (!(key in vm)) {
  7539. proxy(vm, "_props", key);
  7540. }
  7541. };
  7542. for (var key in propsOptions) loop( key );
  7543. toggleObserving(true);
  7544. }
  7545. function initData (vm) {
  7546. var data = vm.$options.data;
  7547. data = vm._data = typeof data === 'function'
  7548. ? getData(data, vm)
  7549. : data || {};
  7550. if (!isPlainObject(data)) {
  7551. data = {};
  7552. true && warn(
  7553. 'data functions should return an object:\n' +
  7554. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7555. vm
  7556. );
  7557. }
  7558. // proxy data on instance
  7559. var keys = Object.keys(data);
  7560. var props = vm.$options.props;
  7561. var methods = vm.$options.methods;
  7562. var i = keys.length;
  7563. while (i--) {
  7564. var key = keys[i];
  7565. if (true) {
  7566. if (methods && hasOwn(methods, key)) {
  7567. warn(
  7568. ("Method \"" + key + "\" has already been defined as a data property."),
  7569. vm
  7570. );
  7571. }
  7572. }
  7573. if (props && hasOwn(props, key)) {
  7574. true && warn(
  7575. "The data property \"" + key + "\" is already declared as a prop. " +
  7576. "Use prop default value instead.",
  7577. vm
  7578. );
  7579. } else if (!isReserved(key)) {
  7580. proxy(vm, "_data", key);
  7581. }
  7582. }
  7583. // observe data
  7584. observe(data, true /* asRootData */);
  7585. }
  7586. function getData (data, vm) {
  7587. // #7573 disable dep collection when invoking data getters
  7588. pushTarget();
  7589. try {
  7590. return data.call(vm, vm)
  7591. } catch (e) {
  7592. handleError(e, vm, "data()");
  7593. return {}
  7594. } finally {
  7595. popTarget();
  7596. }
  7597. }
  7598. var computedWatcherOptions = { lazy: true };
  7599. function initComputed (vm, computed) {
  7600. // $flow-disable-line
  7601. var watchers = vm._computedWatchers = Object.create(null);
  7602. // computed properties are just getters during SSR
  7603. var isSSR = isServerRendering();
  7604. for (var key in computed) {
  7605. var userDef = computed[key];
  7606. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7607. if ( true && getter == null) {
  7608. warn(
  7609. ("Getter is missing for computed property \"" + key + "\"."),
  7610. vm
  7611. );
  7612. }
  7613. if (!isSSR) {
  7614. // create internal watcher for the computed property.
  7615. watchers[key] = new Watcher(
  7616. vm,
  7617. getter || noop,
  7618. noop,
  7619. computedWatcherOptions
  7620. );
  7621. }
  7622. // component-defined computed properties are already defined on the
  7623. // component prototype. We only need to define computed properties defined
  7624. // at instantiation here.
  7625. if (!(key in vm)) {
  7626. defineComputed(vm, key, userDef);
  7627. } else if (true) {
  7628. if (key in vm.$data) {
  7629. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7630. } else if (vm.$options.props && key in vm.$options.props) {
  7631. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7632. }
  7633. }
  7634. }
  7635. }
  7636. function defineComputed (
  7637. target,
  7638. key,
  7639. userDef
  7640. ) {
  7641. var shouldCache = !isServerRendering();
  7642. if (typeof userDef === 'function') {
  7643. sharedPropertyDefinition.get = shouldCache
  7644. ? createComputedGetter(key)
  7645. : createGetterInvoker(userDef);
  7646. sharedPropertyDefinition.set = noop;
  7647. } else {
  7648. sharedPropertyDefinition.get = userDef.get
  7649. ? shouldCache && userDef.cache !== false
  7650. ? createComputedGetter(key)
  7651. : createGetterInvoker(userDef.get)
  7652. : noop;
  7653. sharedPropertyDefinition.set = userDef.set || noop;
  7654. }
  7655. if ( true &&
  7656. sharedPropertyDefinition.set === noop) {
  7657. sharedPropertyDefinition.set = function () {
  7658. warn(
  7659. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7660. this
  7661. );
  7662. };
  7663. }
  7664. Object.defineProperty(target, key, sharedPropertyDefinition);
  7665. }
  7666. function createComputedGetter (key) {
  7667. return function computedGetter () {
  7668. var watcher = this._computedWatchers && this._computedWatchers[key];
  7669. if (watcher) {
  7670. if (watcher.dirty) {
  7671. watcher.evaluate();
  7672. }
  7673. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7674. watcher.depend();
  7675. }
  7676. return watcher.value
  7677. }
  7678. }
  7679. }
  7680. function createGetterInvoker(fn) {
  7681. return function computedGetter () {
  7682. return fn.call(this, this)
  7683. }
  7684. }
  7685. function initMethods (vm, methods) {
  7686. var props = vm.$options.props;
  7687. for (var key in methods) {
  7688. if (true) {
  7689. if (typeof methods[key] !== 'function') {
  7690. warn(
  7691. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7692. "Did you reference the function correctly?",
  7693. vm
  7694. );
  7695. }
  7696. if (props && hasOwn(props, key)) {
  7697. warn(
  7698. ("Method \"" + key + "\" has already been defined as a prop."),
  7699. vm
  7700. );
  7701. }
  7702. if ((key in vm) && isReserved(key)) {
  7703. warn(
  7704. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7705. "Avoid defining component methods that start with _ or $."
  7706. );
  7707. }
  7708. }
  7709. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7710. }
  7711. }
  7712. function initWatch (vm, watch) {
  7713. for (var key in watch) {
  7714. var handler = watch[key];
  7715. if (Array.isArray(handler)) {
  7716. for (var i = 0; i < handler.length; i++) {
  7717. createWatcher(vm, key, handler[i]);
  7718. }
  7719. } else {
  7720. createWatcher(vm, key, handler);
  7721. }
  7722. }
  7723. }
  7724. function createWatcher (
  7725. vm,
  7726. expOrFn,
  7727. handler,
  7728. options
  7729. ) {
  7730. if (isPlainObject(handler)) {
  7731. options = handler;
  7732. handler = handler.handler;
  7733. }
  7734. if (typeof handler === 'string') {
  7735. handler = vm[handler];
  7736. }
  7737. return vm.$watch(expOrFn, handler, options)
  7738. }
  7739. function stateMixin (Vue) {
  7740. // flow somehow has problems with directly declared definition object
  7741. // when using Object.defineProperty, so we have to procedurally build up
  7742. // the object here.
  7743. var dataDef = {};
  7744. dataDef.get = function () { return this._data };
  7745. var propsDef = {};
  7746. propsDef.get = function () { return this._props };
  7747. if (true) {
  7748. dataDef.set = function () {
  7749. warn(
  7750. 'Avoid replacing instance root $data. ' +
  7751. 'Use nested data properties instead.',
  7752. this
  7753. );
  7754. };
  7755. propsDef.set = function () {
  7756. warn("$props is readonly.", this);
  7757. };
  7758. }
  7759. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7760. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7761. Vue.prototype.$set = set;
  7762. Vue.prototype.$delete = del;
  7763. Vue.prototype.$watch = function (
  7764. expOrFn,
  7765. cb,
  7766. options
  7767. ) {
  7768. var vm = this;
  7769. if (isPlainObject(cb)) {
  7770. return createWatcher(vm, expOrFn, cb, options)
  7771. }
  7772. options = options || {};
  7773. options.user = true;
  7774. var watcher = new Watcher(vm, expOrFn, cb, options);
  7775. if (options.immediate) {
  7776. try {
  7777. cb.call(vm, watcher.value);
  7778. } catch (error) {
  7779. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7780. }
  7781. }
  7782. return function unwatchFn () {
  7783. watcher.teardown();
  7784. }
  7785. };
  7786. }
  7787. /* */
  7788. var uid$3 = 0;
  7789. function initMixin (Vue) {
  7790. Vue.prototype._init = function (options) {
  7791. var vm = this;
  7792. // a uid
  7793. vm._uid = uid$3++;
  7794. var startTag, endTag;
  7795. /* istanbul ignore if */
  7796. if ( true && config.performance && mark) {
  7797. startTag = "vue-perf-start:" + (vm._uid);
  7798. endTag = "vue-perf-end:" + (vm._uid);
  7799. mark(startTag);
  7800. }
  7801. // a flag to avoid this being observed
  7802. vm._isVue = true;
  7803. // merge options
  7804. if (options && options._isComponent) {
  7805. // optimize internal component instantiation
  7806. // since dynamic options merging is pretty slow, and none of the
  7807. // internal component options needs special treatment.
  7808. initInternalComponent(vm, options);
  7809. } else {
  7810. vm.$options = mergeOptions(
  7811. resolveConstructorOptions(vm.constructor),
  7812. options || {},
  7813. vm
  7814. );
  7815. }
  7816. /* istanbul ignore else */
  7817. if (true) {
  7818. initProxy(vm);
  7819. } else {}
  7820. // expose real self
  7821. vm._self = vm;
  7822. initLifecycle(vm);
  7823. initEvents(vm);
  7824. initRender(vm);
  7825. callHook(vm, 'beforeCreate');
  7826. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7827. initState(vm);
  7828. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7829. !vm._$fallback && callHook(vm, 'created');
  7830. /* istanbul ignore if */
  7831. if ( true && config.performance && mark) {
  7832. vm._name = formatComponentName(vm, false);
  7833. mark(endTag);
  7834. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7835. }
  7836. if (vm.$options.el) {
  7837. vm.$mount(vm.$options.el);
  7838. }
  7839. };
  7840. }
  7841. function initInternalComponent (vm, options) {
  7842. var opts = vm.$options = Object.create(vm.constructor.options);
  7843. // doing this because it's faster than dynamic enumeration.
  7844. var parentVnode = options._parentVnode;
  7845. opts.parent = options.parent;
  7846. opts._parentVnode = parentVnode;
  7847. var vnodeComponentOptions = parentVnode.componentOptions;
  7848. opts.propsData = vnodeComponentOptions.propsData;
  7849. opts._parentListeners = vnodeComponentOptions.listeners;
  7850. opts._renderChildren = vnodeComponentOptions.children;
  7851. opts._componentTag = vnodeComponentOptions.tag;
  7852. if (options.render) {
  7853. opts.render = options.render;
  7854. opts.staticRenderFns = options.staticRenderFns;
  7855. }
  7856. }
  7857. function resolveConstructorOptions (Ctor) {
  7858. var options = Ctor.options;
  7859. if (Ctor.super) {
  7860. var superOptions = resolveConstructorOptions(Ctor.super);
  7861. var cachedSuperOptions = Ctor.superOptions;
  7862. if (superOptions !== cachedSuperOptions) {
  7863. // super option changed,
  7864. // need to resolve new options.
  7865. Ctor.superOptions = superOptions;
  7866. // check if there are any late-modified/attached options (#4976)
  7867. var modifiedOptions = resolveModifiedOptions(Ctor);
  7868. // update base extend options
  7869. if (modifiedOptions) {
  7870. extend(Ctor.extendOptions, modifiedOptions);
  7871. }
  7872. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7873. if (options.name) {
  7874. options.components[options.name] = Ctor;
  7875. }
  7876. }
  7877. }
  7878. return options
  7879. }
  7880. function resolveModifiedOptions (Ctor) {
  7881. var modified;
  7882. var latest = Ctor.options;
  7883. var sealed = Ctor.sealedOptions;
  7884. for (var key in latest) {
  7885. if (latest[key] !== sealed[key]) {
  7886. if (!modified) { modified = {}; }
  7887. modified[key] = latest[key];
  7888. }
  7889. }
  7890. return modified
  7891. }
  7892. function Vue (options) {
  7893. if ( true &&
  7894. !(this instanceof Vue)
  7895. ) {
  7896. warn('Vue is a constructor and should be called with the `new` keyword');
  7897. }
  7898. this._init(options);
  7899. }
  7900. initMixin(Vue);
  7901. stateMixin(Vue);
  7902. eventsMixin(Vue);
  7903. lifecycleMixin(Vue);
  7904. renderMixin(Vue);
  7905. /* */
  7906. function initUse (Vue) {
  7907. Vue.use = function (plugin) {
  7908. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7909. if (installedPlugins.indexOf(plugin) > -1) {
  7910. return this
  7911. }
  7912. // additional parameters
  7913. var args = toArray(arguments, 1);
  7914. args.unshift(this);
  7915. if (typeof plugin.install === 'function') {
  7916. plugin.install.apply(plugin, args);
  7917. } else if (typeof plugin === 'function') {
  7918. plugin.apply(null, args);
  7919. }
  7920. installedPlugins.push(plugin);
  7921. return this
  7922. };
  7923. }
  7924. /* */
  7925. function initMixin$1 (Vue) {
  7926. Vue.mixin = function (mixin) {
  7927. this.options = mergeOptions(this.options, mixin);
  7928. return this
  7929. };
  7930. }
  7931. /* */
  7932. function initExtend (Vue) {
  7933. /**
  7934. * Each instance constructor, including Vue, has a unique
  7935. * cid. This enables us to create wrapped "child
  7936. * constructors" for prototypal inheritance and cache them.
  7937. */
  7938. Vue.cid = 0;
  7939. var cid = 1;
  7940. /**
  7941. * Class inheritance
  7942. */
  7943. Vue.extend = function (extendOptions) {
  7944. extendOptions = extendOptions || {};
  7945. var Super = this;
  7946. var SuperId = Super.cid;
  7947. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7948. if (cachedCtors[SuperId]) {
  7949. return cachedCtors[SuperId]
  7950. }
  7951. var name = extendOptions.name || Super.options.name;
  7952. if ( true && name) {
  7953. validateComponentName(name);
  7954. }
  7955. var Sub = function VueComponent (options) {
  7956. this._init(options);
  7957. };
  7958. Sub.prototype = Object.create(Super.prototype);
  7959. Sub.prototype.constructor = Sub;
  7960. Sub.cid = cid++;
  7961. Sub.options = mergeOptions(
  7962. Super.options,
  7963. extendOptions
  7964. );
  7965. Sub['super'] = Super;
  7966. // For props and computed properties, we define the proxy getters on
  7967. // the Vue instances at extension time, on the extended prototype. This
  7968. // avoids Object.defineProperty calls for each instance created.
  7969. if (Sub.options.props) {
  7970. initProps$1(Sub);
  7971. }
  7972. if (Sub.options.computed) {
  7973. initComputed$1(Sub);
  7974. }
  7975. // allow further extension/mixin/plugin usage
  7976. Sub.extend = Super.extend;
  7977. Sub.mixin = Super.mixin;
  7978. Sub.use = Super.use;
  7979. // create asset registers, so extended classes
  7980. // can have their private assets too.
  7981. ASSET_TYPES.forEach(function (type) {
  7982. Sub[type] = Super[type];
  7983. });
  7984. // enable recursive self-lookup
  7985. if (name) {
  7986. Sub.options.components[name] = Sub;
  7987. }
  7988. // keep a reference to the super options at extension time.
  7989. // later at instantiation we can check if Super's options have
  7990. // been updated.
  7991. Sub.superOptions = Super.options;
  7992. Sub.extendOptions = extendOptions;
  7993. Sub.sealedOptions = extend({}, Sub.options);
  7994. // cache constructor
  7995. cachedCtors[SuperId] = Sub;
  7996. return Sub
  7997. };
  7998. }
  7999. function initProps$1 (Comp) {
  8000. var props = Comp.options.props;
  8001. for (var key in props) {
  8002. proxy(Comp.prototype, "_props", key);
  8003. }
  8004. }
  8005. function initComputed$1 (Comp) {
  8006. var computed = Comp.options.computed;
  8007. for (var key in computed) {
  8008. defineComputed(Comp.prototype, key, computed[key]);
  8009. }
  8010. }
  8011. /* */
  8012. function initAssetRegisters (Vue) {
  8013. /**
  8014. * Create asset registration methods.
  8015. */
  8016. ASSET_TYPES.forEach(function (type) {
  8017. Vue[type] = function (
  8018. id,
  8019. definition
  8020. ) {
  8021. if (!definition) {
  8022. return this.options[type + 's'][id]
  8023. } else {
  8024. /* istanbul ignore if */
  8025. if ( true && type === 'component') {
  8026. validateComponentName(id);
  8027. }
  8028. if (type === 'component' && isPlainObject(definition)) {
  8029. definition.name = definition.name || id;
  8030. definition = this.options._base.extend(definition);
  8031. }
  8032. if (type === 'directive' && typeof definition === 'function') {
  8033. definition = { bind: definition, update: definition };
  8034. }
  8035. this.options[type + 's'][id] = definition;
  8036. return definition
  8037. }
  8038. };
  8039. });
  8040. }
  8041. /* */
  8042. function getComponentName (opts) {
  8043. return opts && (opts.Ctor.options.name || opts.tag)
  8044. }
  8045. function matches (pattern, name) {
  8046. if (Array.isArray(pattern)) {
  8047. return pattern.indexOf(name) > -1
  8048. } else if (typeof pattern === 'string') {
  8049. return pattern.split(',').indexOf(name) > -1
  8050. } else if (isRegExp(pattern)) {
  8051. return pattern.test(name)
  8052. }
  8053. /* istanbul ignore next */
  8054. return false
  8055. }
  8056. function pruneCache (keepAliveInstance, filter) {
  8057. var cache = keepAliveInstance.cache;
  8058. var keys = keepAliveInstance.keys;
  8059. var _vnode = keepAliveInstance._vnode;
  8060. for (var key in cache) {
  8061. var cachedNode = cache[key];
  8062. if (cachedNode) {
  8063. var name = getComponentName(cachedNode.componentOptions);
  8064. if (name && !filter(name)) {
  8065. pruneCacheEntry(cache, key, keys, _vnode);
  8066. }
  8067. }
  8068. }
  8069. }
  8070. function pruneCacheEntry (
  8071. cache,
  8072. key,
  8073. keys,
  8074. current
  8075. ) {
  8076. var cached$$1 = cache[key];
  8077. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8078. cached$$1.componentInstance.$destroy();
  8079. }
  8080. cache[key] = null;
  8081. remove(keys, key);
  8082. }
  8083. var patternTypes = [String, RegExp, Array];
  8084. var KeepAlive = {
  8085. name: 'keep-alive',
  8086. abstract: true,
  8087. props: {
  8088. include: patternTypes,
  8089. exclude: patternTypes,
  8090. max: [String, Number]
  8091. },
  8092. created: function created () {
  8093. this.cache = Object.create(null);
  8094. this.keys = [];
  8095. },
  8096. destroyed: function destroyed () {
  8097. for (var key in this.cache) {
  8098. pruneCacheEntry(this.cache, key, this.keys);
  8099. }
  8100. },
  8101. mounted: function mounted () {
  8102. var this$1 = this;
  8103. this.$watch('include', function (val) {
  8104. pruneCache(this$1, function (name) { return matches(val, name); });
  8105. });
  8106. this.$watch('exclude', function (val) {
  8107. pruneCache(this$1, function (name) { return !matches(val, name); });
  8108. });
  8109. },
  8110. render: function render () {
  8111. var slot = this.$slots.default;
  8112. var vnode = getFirstComponentChild(slot);
  8113. var componentOptions = vnode && vnode.componentOptions;
  8114. if (componentOptions) {
  8115. // check pattern
  8116. var name = getComponentName(componentOptions);
  8117. var ref = this;
  8118. var include = ref.include;
  8119. var exclude = ref.exclude;
  8120. if (
  8121. // not included
  8122. (include && (!name || !matches(include, name))) ||
  8123. // excluded
  8124. (exclude && name && matches(exclude, name))
  8125. ) {
  8126. return vnode
  8127. }
  8128. var ref$1 = this;
  8129. var cache = ref$1.cache;
  8130. var keys = ref$1.keys;
  8131. var key = vnode.key == null
  8132. // same constructor may get registered as different local components
  8133. // so cid alone is not enough (#3269)
  8134. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8135. : vnode.key;
  8136. if (cache[key]) {
  8137. vnode.componentInstance = cache[key].componentInstance;
  8138. // make current key freshest
  8139. remove(keys, key);
  8140. keys.push(key);
  8141. } else {
  8142. cache[key] = vnode;
  8143. keys.push(key);
  8144. // prune oldest entry
  8145. if (this.max && keys.length > parseInt(this.max)) {
  8146. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8147. }
  8148. }
  8149. vnode.data.keepAlive = true;
  8150. }
  8151. return vnode || (slot && slot[0])
  8152. }
  8153. };
  8154. var builtInComponents = {
  8155. KeepAlive: KeepAlive
  8156. };
  8157. /* */
  8158. function initGlobalAPI (Vue) {
  8159. // config
  8160. var configDef = {};
  8161. configDef.get = function () { return config; };
  8162. if (true) {
  8163. configDef.set = function () {
  8164. warn(
  8165. 'Do not replace the Vue.config object, set individual fields instead.'
  8166. );
  8167. };
  8168. }
  8169. Object.defineProperty(Vue, 'config', configDef);
  8170. // exposed util methods.
  8171. // NOTE: these are not considered part of the public API - avoid relying on
  8172. // them unless you are aware of the risk.
  8173. Vue.util = {
  8174. warn: warn,
  8175. extend: extend,
  8176. mergeOptions: mergeOptions,
  8177. defineReactive: defineReactive$$1
  8178. };
  8179. Vue.set = set;
  8180. Vue.delete = del;
  8181. Vue.nextTick = nextTick;
  8182. // 2.6 explicit observable API
  8183. Vue.observable = function (obj) {
  8184. observe(obj);
  8185. return obj
  8186. };
  8187. Vue.options = Object.create(null);
  8188. ASSET_TYPES.forEach(function (type) {
  8189. Vue.options[type + 's'] = Object.create(null);
  8190. });
  8191. // this is used to identify the "base" constructor to extend all plain-object
  8192. // components with in Weex's multi-instance scenarios.
  8193. Vue.options._base = Vue;
  8194. extend(Vue.options.components, builtInComponents);
  8195. initUse(Vue);
  8196. initMixin$1(Vue);
  8197. initExtend(Vue);
  8198. initAssetRegisters(Vue);
  8199. }
  8200. initGlobalAPI(Vue);
  8201. Object.defineProperty(Vue.prototype, '$isServer', {
  8202. get: isServerRendering
  8203. });
  8204. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8205. get: function get () {
  8206. /* istanbul ignore next */
  8207. return this.$vnode && this.$vnode.ssrContext
  8208. }
  8209. });
  8210. // expose FunctionalRenderContext for ssr runtime helper installation
  8211. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8212. value: FunctionalRenderContext
  8213. });
  8214. Vue.version = '2.6.11';
  8215. /**
  8216. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8217. */
  8218. var ARRAYTYPE = '[object Array]';
  8219. var OBJECTTYPE = '[object Object]';
  8220. // const FUNCTIONTYPE = '[object Function]'
  8221. function diff(current, pre) {
  8222. var result = {};
  8223. syncKeys(current, pre);
  8224. _diff(current, pre, '', result);
  8225. return result
  8226. }
  8227. function syncKeys(current, pre) {
  8228. if (current === pre) { return }
  8229. var rootCurrentType = type(current);
  8230. var rootPreType = type(pre);
  8231. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8232. if(Object.keys(current).length >= Object.keys(pre).length){
  8233. for (var key in pre) {
  8234. var currentValue = current[key];
  8235. if (currentValue === undefined) {
  8236. current[key] = null;
  8237. } else {
  8238. syncKeys(currentValue, pre[key]);
  8239. }
  8240. }
  8241. }
  8242. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8243. if (current.length >= pre.length) {
  8244. pre.forEach(function (item, index) {
  8245. syncKeys(current[index], item);
  8246. });
  8247. }
  8248. }
  8249. }
  8250. function _diff(current, pre, path, result) {
  8251. if (current === pre) { return }
  8252. var rootCurrentType = type(current);
  8253. var rootPreType = type(pre);
  8254. if (rootCurrentType == OBJECTTYPE) {
  8255. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8256. setResult(result, path, current);
  8257. } else {
  8258. var loop = function ( key ) {
  8259. var currentValue = current[key];
  8260. var preValue = pre[key];
  8261. var currentType = type(currentValue);
  8262. var preType = type(preValue);
  8263. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8264. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  8265. if (currentValue !== pre[key]) {
  8266. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8267. }
  8268. } else if (currentType == ARRAYTYPE) {
  8269. if (preType != ARRAYTYPE) {
  8270. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8271. } else {
  8272. if (currentValue.length < preValue.length) {
  8273. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8274. } else {
  8275. currentValue.forEach(function (item, index) {
  8276. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8277. });
  8278. }
  8279. }
  8280. } else if (currentType == OBJECTTYPE) {
  8281. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8282. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8283. } else {
  8284. for (var subKey in currentValue) {
  8285. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8286. }
  8287. }
  8288. }
  8289. };
  8290. for (var key in current) loop( key );
  8291. }
  8292. } else if (rootCurrentType == ARRAYTYPE) {
  8293. if (rootPreType != ARRAYTYPE) {
  8294. setResult(result, path, current);
  8295. } else {
  8296. if (current.length < pre.length) {
  8297. setResult(result, path, current);
  8298. } else {
  8299. current.forEach(function (item, index) {
  8300. _diff(item, pre[index], path + '[' + index + ']', result);
  8301. });
  8302. }
  8303. }
  8304. } else {
  8305. setResult(result, path, current);
  8306. }
  8307. }
  8308. function setResult(result, k, v) {
  8309. // if (type(v) != FUNCTIONTYPE) {
  8310. result[k] = v;
  8311. // }
  8312. }
  8313. function type(obj) {
  8314. return Object.prototype.toString.call(obj)
  8315. }
  8316. /* */
  8317. function flushCallbacks$1(vm) {
  8318. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8319. if (Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8320. var mpInstance = vm.$scope;
  8321. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8322. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8323. }
  8324. var copies = vm.__next_tick_callbacks.slice(0);
  8325. vm.__next_tick_callbacks.length = 0;
  8326. for (var i = 0; i < copies.length; i++) {
  8327. copies[i]();
  8328. }
  8329. }
  8330. }
  8331. function hasRenderWatcher(vm) {
  8332. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8333. }
  8334. function nextTick$1(vm, cb) {
  8335. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8336. //2.nextTick 之前存在 render watcher
  8337. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8338. if(Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8339. var mpInstance = vm.$scope;
  8340. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8341. ']:nextVueTick');
  8342. }
  8343. return nextTick(cb, vm)
  8344. }else{
  8345. if(Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8346. var mpInstance$1 = vm.$scope;
  8347. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8348. ']:nextMPTick');
  8349. }
  8350. }
  8351. var _resolve;
  8352. if (!vm.__next_tick_callbacks) {
  8353. vm.__next_tick_callbacks = [];
  8354. }
  8355. vm.__next_tick_callbacks.push(function () {
  8356. if (cb) {
  8357. try {
  8358. cb.call(vm);
  8359. } catch (e) {
  8360. handleError(e, vm, 'nextTick');
  8361. }
  8362. } else if (_resolve) {
  8363. _resolve(vm);
  8364. }
  8365. });
  8366. // $flow-disable-line
  8367. if (!cb && typeof Promise !== 'undefined') {
  8368. return new Promise(function (resolve) {
  8369. _resolve = resolve;
  8370. })
  8371. }
  8372. }
  8373. /* */
  8374. function cloneWithData(vm) {
  8375. // 确保当前 vm 所有数据被同步
  8376. var ret = Object.create(null);
  8377. var dataKeys = [].concat(
  8378. Object.keys(vm._data || {}),
  8379. Object.keys(vm._computedWatchers || {}));
  8380. dataKeys.reduce(function(ret, key) {
  8381. ret[key] = vm[key];
  8382. return ret
  8383. }, ret);
  8384. // vue-composition-api
  8385. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8386. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8387. if (rawBindings) {
  8388. Object.keys(rawBindings).forEach(function (key) {
  8389. ret[key] = vm[key];
  8390. });
  8391. }
  8392. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8393. Object.assign(ret, vm.$mp.data || {});
  8394. if (
  8395. Array.isArray(vm.$options.behaviors) &&
  8396. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8397. ) { //form-field
  8398. ret['name'] = vm.name;
  8399. ret['value'] = vm.value;
  8400. }
  8401. return JSON.parse(JSON.stringify(ret))
  8402. }
  8403. var patch = function(oldVnode, vnode) {
  8404. var this$1 = this;
  8405. if (vnode === null) { //destroy
  8406. return
  8407. }
  8408. if (this.mpType === 'page' || this.mpType === 'component') {
  8409. var mpInstance = this.$scope;
  8410. var data = Object.create(null);
  8411. try {
  8412. data = cloneWithData(this);
  8413. } catch (err) {
  8414. console.error(err);
  8415. }
  8416. data.__webviewId__ = mpInstance.data.__webviewId__;
  8417. var mpData = Object.create(null);
  8418. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8419. mpData[key] = mpInstance.data[key];
  8420. });
  8421. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8422. if (Object.keys(diffData).length) {
  8423. if (Object({"VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8424. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8425. ']差量更新',
  8426. JSON.stringify(diffData));
  8427. }
  8428. this.__next_tick_pending = true;
  8429. mpInstance.setData(diffData, function () {
  8430. this$1.__next_tick_pending = false;
  8431. flushCallbacks$1(this$1);
  8432. });
  8433. } else {
  8434. flushCallbacks$1(this);
  8435. }
  8436. }
  8437. };
  8438. /* */
  8439. function createEmptyRender() {
  8440. }
  8441. function mountComponent$1(
  8442. vm,
  8443. el,
  8444. hydrating
  8445. ) {
  8446. if (!vm.mpType) {//main.js 中的 new Vue
  8447. return vm
  8448. }
  8449. if (vm.mpType === 'app') {
  8450. vm.$options.render = createEmptyRender;
  8451. }
  8452. if (!vm.$options.render) {
  8453. vm.$options.render = createEmptyRender;
  8454. if (true) {
  8455. /* istanbul ignore if */
  8456. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8457. vm.$options.el || el) {
  8458. warn(
  8459. 'You are using the runtime-only build of Vue where the template ' +
  8460. 'compiler is not available. Either pre-compile the templates into ' +
  8461. 'render functions, or use the compiler-included build.',
  8462. vm
  8463. );
  8464. } else {
  8465. warn(
  8466. 'Failed to mount component: template or render function not defined.',
  8467. vm
  8468. );
  8469. }
  8470. }
  8471. }
  8472. !vm._$fallback && callHook(vm, 'beforeMount');
  8473. var updateComponent = function () {
  8474. vm._update(vm._render(), hydrating);
  8475. };
  8476. // we set this to vm._watcher inside the watcher's constructor
  8477. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8478. // component's mounted hook), which relies on vm._watcher being already defined
  8479. new Watcher(vm, updateComponent, noop, {
  8480. before: function before() {
  8481. if (vm._isMounted && !vm._isDestroyed) {
  8482. callHook(vm, 'beforeUpdate');
  8483. }
  8484. }
  8485. }, true /* isRenderWatcher */);
  8486. hydrating = false;
  8487. return vm
  8488. }
  8489. /* */
  8490. function renderClass (
  8491. staticClass,
  8492. dynamicClass
  8493. ) {
  8494. if (isDef(staticClass) || isDef(dynamicClass)) {
  8495. return concat(staticClass, stringifyClass(dynamicClass))
  8496. }
  8497. /* istanbul ignore next */
  8498. return ''
  8499. }
  8500. function concat (a, b) {
  8501. return a ? b ? (a + ' ' + b) : a : (b || '')
  8502. }
  8503. function stringifyClass (value) {
  8504. if (Array.isArray(value)) {
  8505. return stringifyArray(value)
  8506. }
  8507. if (isObject(value)) {
  8508. return stringifyObject(value)
  8509. }
  8510. if (typeof value === 'string') {
  8511. return value
  8512. }
  8513. /* istanbul ignore next */
  8514. return ''
  8515. }
  8516. function stringifyArray (value) {
  8517. var res = '';
  8518. var stringified;
  8519. for (var i = 0, l = value.length; i < l; i++) {
  8520. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8521. if (res) { res += ' '; }
  8522. res += stringified;
  8523. }
  8524. }
  8525. return res
  8526. }
  8527. function stringifyObject (value) {
  8528. var res = '';
  8529. for (var key in value) {
  8530. if (value[key]) {
  8531. if (res) { res += ' '; }
  8532. res += key;
  8533. }
  8534. }
  8535. return res
  8536. }
  8537. /* */
  8538. var parseStyleText = cached(function (cssText) {
  8539. var res = {};
  8540. var listDelimiter = /;(?![^(]*\))/g;
  8541. var propertyDelimiter = /:(.+)/;
  8542. cssText.split(listDelimiter).forEach(function (item) {
  8543. if (item) {
  8544. var tmp = item.split(propertyDelimiter);
  8545. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8546. }
  8547. });
  8548. return res
  8549. });
  8550. // normalize possible array / string values into Object
  8551. function normalizeStyleBinding (bindingStyle) {
  8552. if (Array.isArray(bindingStyle)) {
  8553. return toObject(bindingStyle)
  8554. }
  8555. if (typeof bindingStyle === 'string') {
  8556. return parseStyleText(bindingStyle)
  8557. }
  8558. return bindingStyle
  8559. }
  8560. /* */
  8561. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8562. function getTarget(obj, path) {
  8563. var parts = path.split('.');
  8564. var key = parts[0];
  8565. if (key.indexOf('__$n') === 0) { //number index
  8566. key = parseInt(key.replace('__$n', ''));
  8567. }
  8568. if (parts.length === 1) {
  8569. return obj[key]
  8570. }
  8571. return getTarget(obj[key], parts.slice(1).join('.'))
  8572. }
  8573. function internalMixin(Vue) {
  8574. Vue.config.errorHandler = function(err, vm, info) {
  8575. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8576. console.error(err);
  8577. /* eslint-disable no-undef */
  8578. var app = typeof getApp === 'function' && getApp();
  8579. if (app && app.onError) {
  8580. app.onError(err);
  8581. }
  8582. };
  8583. var oldEmit = Vue.prototype.$emit;
  8584. Vue.prototype.$emit = function(event) {
  8585. if (this.$scope && event) {
  8586. this.$scope['triggerEvent'](event, {
  8587. __args__: toArray(arguments, 1)
  8588. });
  8589. }
  8590. return oldEmit.apply(this, arguments)
  8591. };
  8592. Vue.prototype.$nextTick = function(fn) {
  8593. return nextTick$1(this, fn)
  8594. };
  8595. MP_METHODS.forEach(function (method) {
  8596. Vue.prototype[method] = function(args) {
  8597. if (this.$scope && this.$scope[method]) {
  8598. return this.$scope[method](args)
  8599. }
  8600. // mp-alipay
  8601. if (typeof my === 'undefined') {
  8602. return
  8603. }
  8604. if (method === 'createSelectorQuery') {
  8605. /* eslint-disable no-undef */
  8606. return my.createSelectorQuery(args)
  8607. } else if (method === 'createIntersectionObserver') {
  8608. /* eslint-disable no-undef */
  8609. return my.createIntersectionObserver(args)
  8610. }
  8611. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8612. };
  8613. });
  8614. Vue.prototype.__init_provide = initProvide;
  8615. Vue.prototype.__init_injections = initInjections;
  8616. Vue.prototype.__call_hook = function(hook, args) {
  8617. var vm = this;
  8618. // #7573 disable dep collection when invoking lifecycle hooks
  8619. pushTarget();
  8620. var handlers = vm.$options[hook];
  8621. var info = hook + " hook";
  8622. var ret;
  8623. if (handlers) {
  8624. for (var i = 0, j = handlers.length; i < j; i++) {
  8625. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8626. }
  8627. }
  8628. if (vm._hasHookEvent) {
  8629. vm.$emit('hook:' + hook, args);
  8630. }
  8631. popTarget();
  8632. return ret
  8633. };
  8634. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8635. if (Array.isArray(modifiers)) {
  8636. if (modifiers.indexOf('trim') !== -1) {
  8637. value = value.trim();
  8638. }
  8639. if (modifiers.indexOf('number') !== -1) {
  8640. value = this._n(value);
  8641. }
  8642. }
  8643. if (!target) {
  8644. target = this;
  8645. }
  8646. target[key] = value;
  8647. };
  8648. Vue.prototype.__set_sync = function(target, key, value) {
  8649. if (!target) {
  8650. target = this;
  8651. }
  8652. target[key] = value;
  8653. };
  8654. Vue.prototype.__get_orig = function(item) {
  8655. if (isPlainObject(item)) {
  8656. return item['$orig'] || item
  8657. }
  8658. return item
  8659. };
  8660. Vue.prototype.__get_value = function(dataPath, target) {
  8661. return getTarget(target || this, dataPath)
  8662. };
  8663. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8664. return renderClass(staticClass, dynamicClass)
  8665. };
  8666. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8667. if (!dynamicStyle && !staticStyle) {
  8668. return ''
  8669. }
  8670. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8671. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8672. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8673. };
  8674. Vue.prototype.__map = function(val, iteratee) {
  8675. //TODO 暂不考虑 string
  8676. var ret, i, l, keys, key;
  8677. if (Array.isArray(val)) {
  8678. ret = new Array(val.length);
  8679. for (i = 0, l = val.length; i < l; i++) {
  8680. ret[i] = iteratee(val[i], i);
  8681. }
  8682. return ret
  8683. } else if (isObject(val)) {
  8684. keys = Object.keys(val);
  8685. ret = Object.create(null);
  8686. for (i = 0, l = keys.length; i < l; i++) {
  8687. key = keys[i];
  8688. ret[key] = iteratee(val[key], key, i);
  8689. }
  8690. return ret
  8691. } else if (typeof val === 'number') {
  8692. ret = new Array(val);
  8693. for (i = 0, l = val; i < l; i++) {
  8694. // 第一个参数暂时仍和小程序一致
  8695. ret[i] = iteratee(i, i);
  8696. }
  8697. return ret
  8698. }
  8699. return []
  8700. };
  8701. }
  8702. /* */
  8703. var LIFECYCLE_HOOKS$1 = [
  8704. //App
  8705. 'onLaunch',
  8706. 'onShow',
  8707. 'onHide',
  8708. 'onUniNViewMessage',
  8709. 'onPageNotFound',
  8710. 'onThemeChange',
  8711. 'onError',
  8712. 'onUnhandledRejection',
  8713. //Page
  8714. 'onInit',
  8715. 'onLoad',
  8716. // 'onShow',
  8717. 'onReady',
  8718. // 'onHide',
  8719. 'onUnload',
  8720. 'onPullDownRefresh',
  8721. 'onReachBottom',
  8722. 'onTabItemTap',
  8723. 'onAddToFavorites',
  8724. 'onShareTimeline',
  8725. 'onShareAppMessage',
  8726. 'onResize',
  8727. 'onPageScroll',
  8728. 'onNavigationBarButtonTap',
  8729. 'onBackPress',
  8730. 'onNavigationBarSearchInputChanged',
  8731. 'onNavigationBarSearchInputConfirmed',
  8732. 'onNavigationBarSearchInputClicked',
  8733. //Component
  8734. // 'onReady', // 兼容旧版本,应该移除该事件
  8735. 'onPageShow',
  8736. 'onPageHide',
  8737. 'onPageResize'
  8738. ];
  8739. function lifecycleMixin$1(Vue) {
  8740. //fixed vue-class-component
  8741. var oldExtend = Vue.extend;
  8742. Vue.extend = function(extendOptions) {
  8743. extendOptions = extendOptions || {};
  8744. var methods = extendOptions.methods;
  8745. if (methods) {
  8746. Object.keys(methods).forEach(function (methodName) {
  8747. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8748. extendOptions[methodName] = methods[methodName];
  8749. delete methods[methodName];
  8750. }
  8751. });
  8752. }
  8753. return oldExtend.call(this, extendOptions)
  8754. };
  8755. var strategies = Vue.config.optionMergeStrategies;
  8756. var mergeHook = strategies.created;
  8757. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8758. strategies[hook] = mergeHook;
  8759. });
  8760. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8761. }
  8762. /* */
  8763. // install platform patch function
  8764. Vue.prototype.__patch__ = patch;
  8765. // public mount method
  8766. Vue.prototype.$mount = function(
  8767. el ,
  8768. hydrating
  8769. ) {
  8770. return mountComponent$1(this, el, hydrating)
  8771. };
  8772. lifecycleMixin$1(Vue);
  8773. internalMixin(Vue);
  8774. /* */
  8775. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8776. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8777. /***/ }),
  8778. /***/ 20:
  8779. /*!****************************************************************!*\
  8780. !*** C:/Users/first/Desktop/公司/applets/store/modules/order.js ***!
  8781. \****************************************************************/
  8782. /*! no static exports found */
  8783. /***/ (function(module, exports, __webpack_require__) {
  8784. "use strict";
  8785. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8786. state: {
  8787. orderInfo: undefined },
  8788. getters: {},
  8789. mutations: {
  8790. updateOrderInfo: function updateOrderInfo(state, orderInfo) {
  8791. state.orderInfo = orderInfo;
  8792. } },
  8793. actions: {} };exports.default = _default;
  8794. /***/ }),
  8795. /***/ 21:
  8796. /*!******************************************************************!*\
  8797. !*** C:/Users/first/Desktop/公司/applets/store/modules/station.js ***!
  8798. \******************************************************************/
  8799. /*! no static exports found */
  8800. /***/ (function(module, exports, __webpack_require__) {
  8801. "use strict";
  8802. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8803. state: {
  8804. stationId: undefined,
  8805. labelId: undefined,
  8806. employeeId: undefined,
  8807. selectedGas: undefined },
  8808. getters: {},
  8809. mutations: {
  8810. updateStationId: function updateStationId(state, stationId) {
  8811. state.stationId = stationId;
  8812. },
  8813. updateSelectedGas: function updateSelectedGas(state, selectedGas) {
  8814. state.selectedGas = selectedGas;
  8815. },
  8816. updateLabelId: function updateLabelId(state, labelId) {
  8817. state.labelId = labelId;
  8818. },
  8819. clearLabelId: function clearLabelId(state) {
  8820. state.labelId = undefined;
  8821. },
  8822. updateEmployeeId: function updateEmployeeId(state, employeeId) {
  8823. state.employeeId = employeeId;
  8824. },
  8825. clearEmployeeId: function clearEmployeeId(state) {
  8826. state.employeeId = undefined;
  8827. } },
  8828. actions: {} };exports.default = _default;
  8829. /***/ }),
  8830. /***/ 22:
  8831. /*!******************************************************************!*\
  8832. !*** C:/Users/first/Desktop/公司/applets/store/modules/voucher.js ***!
  8833. \******************************************************************/
  8834. /*! no static exports found */
  8835. /***/ (function(module, exports, __webpack_require__) {
  8836. "use strict";
  8837. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var getTime = function getTime() {
  8838. var date = new Date();
  8839. var h = date.getHours().toString();
  8840. var m = date.getMinutes().toString();
  8841. var s = date.getSeconds().toString();
  8842. h = '' + (h.length == 1 ? '0' : '') + h;
  8843. m = '' + (m.length == 1 ? '0' : '') + m;
  8844. s = '' + (s.length == 1 ? '0' : '') + s;
  8845. console.log('' + h + ':' + m + ':' + s);
  8846. return '' + h + ':' + m + ':' + s;
  8847. };var _default =
  8848. {
  8849. state: {
  8850. v_receivableAmt: undefined,
  8851. v_amt: undefined,
  8852. v_oilName: undefined,
  8853. v_time: '' },
  8854. getters: {},
  8855. mutations: {
  8856. updateVoucherInfo: function updateVoucherInfo(state, voucherInfo) {
  8857. state.v_receivableAmt = voucherInfo.receivableAmt;
  8858. state.v_amt = voucherInfo.amt;
  8859. state.v_oilName = voucherInfo.oilName;
  8860. state.v_time = getTime();
  8861. } },
  8862. actions: {} };exports.default = _default;
  8863. /***/ }),
  8864. /***/ 23:
  8865. /*!*****************************************************************!*\
  8866. !*** C:/Users/first/Desktop/公司/applets/store/modules/coupon.js ***!
  8867. \*****************************************************************/
  8868. /*! no static exports found */
  8869. /***/ (function(module, exports, __webpack_require__) {
  8870. "use strict";
  8871. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8872. state: {
  8873. couponEnabledFlag: '0', // 是否启用优惠券
  8874. couponList: undefined, // 优惠券列表
  8875. succeedIssueId: undefined // 支付成功后的展示位的issueId
  8876. },
  8877. getters: {},
  8878. mutations: {
  8879. updateCouponEnabledFlag: function updateCouponEnabledFlag(state, couponEnabledFlag) {
  8880. state.couponEnabledFlag = couponEnabledFlag;
  8881. },
  8882. updateSucceedIssueId: function updateSucceedIssueId(state, succeedIssueId) {
  8883. state.succeedIssueId = succeedIssueId;
  8884. },
  8885. updateCouponList: function updateCouponList(state, couponList) {
  8886. state.couponList = couponList;
  8887. } },
  8888. actions: {} };exports.default = _default;
  8889. /***/ }),
  8890. /***/ 24:
  8891. /*!*****************************************************!*\
  8892. !*** C:/Users/first/Desktop/公司/applets/util/api.js ***!
  8893. \*****************************************************/
  8894. /*! no static exports found */
  8895. /***/ (function(module, exports, __webpack_require__) {
  8896. "use strict";
  8897. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.myRequest = void 0;var _settings = _interopRequireDefault(__webpack_require__(/*! @/settings.js */ 18));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8898. var myRequest = function myRequest(options) {
  8899. return new Promise(function (resolve, reject) {
  8900. uni.request({
  8901. url: _settings.default.base_url + "/" + _settings.default.prefix + options.url,
  8902. method: options.method || 'GET',
  8903. data: options.data || {},
  8904. success: function success(res) {
  8905. if (res.statusCode !== 200) {
  8906. uni.showToast({
  8907. icon: "error",
  8908. title: '拉取数据失败' });
  8909. reject();
  8910. }
  8911. resolve(res.data);
  8912. },
  8913. fail: function fail(err) {
  8914. uni.showToast({
  8915. icon: "error",
  8916. title: err.errMsg });
  8917. reject(err);
  8918. } });
  8919. });
  8920. };exports.myRequest = myRequest;
  8921. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8922. /***/ }),
  8923. /***/ 3:
  8924. /*!***********************************!*\
  8925. !*** (webpack)/buildin/global.js ***!
  8926. \***********************************/
  8927. /*! no static exports found */
  8928. /***/ (function(module, exports) {
  8929. var g;
  8930. // This works in non-strict mode
  8931. g = (function() {
  8932. return this;
  8933. })();
  8934. try {
  8935. // This works if eval is allowed (see CSP)
  8936. g = g || new Function("return this")();
  8937. } catch (e) {
  8938. // This works if the window reference is available
  8939. if (typeof window === "object") g = window;
  8940. }
  8941. // g can still be undefined, but nothing to do about it...
  8942. // We return undefined, instead of nothing here, so it's
  8943. // easier to handle this case. if(!global) { ...}
  8944. module.exports = g;
  8945. /***/ }),
  8946. /***/ 31:
  8947. /*!**********************************************************!*\
  8948. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  8949. \**********************************************************/
  8950. /*! no static exports found */
  8951. /***/ (function(module, exports, __webpack_require__) {
  8952. module.exports = __webpack_require__(/*! regenerator-runtime */ 32);
  8953. /***/ }),
  8954. /***/ 32:
  8955. /*!************************************************************!*\
  8956. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  8957. \************************************************************/
  8958. /*! no static exports found */
  8959. /***/ (function(module, exports, __webpack_require__) {
  8960. /**
  8961. * Copyright (c) 2014-present, Facebook, Inc.
  8962. *
  8963. * This source code is licensed under the MIT license found in the
  8964. * LICENSE file in the root directory of this source tree.
  8965. */
  8966. // This method of obtaining a reference to the global object needs to be
  8967. // kept identical to the way it is obtained in runtime.js
  8968. var g = (function() {
  8969. return this || (typeof self === "object" && self);
  8970. })() || Function("return this")();
  8971. // Use `getOwnPropertyNames` because not all browsers support calling
  8972. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  8973. var hadRuntime = g.regeneratorRuntime &&
  8974. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  8975. // Save the old regeneratorRuntime in case it needs to be restored later.
  8976. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  8977. // Force reevalutation of runtime.js.
  8978. g.regeneratorRuntime = undefined;
  8979. module.exports = __webpack_require__(/*! ./runtime */ 33);
  8980. if (hadRuntime) {
  8981. // Restore the original runtime.
  8982. g.regeneratorRuntime = oldRuntime;
  8983. } else {
  8984. // Remove the global property added by runtime.js.
  8985. try {
  8986. delete g.regeneratorRuntime;
  8987. } catch(e) {
  8988. g.regeneratorRuntime = undefined;
  8989. }
  8990. }
  8991. /***/ }),
  8992. /***/ 33:
  8993. /*!*****************************************************!*\
  8994. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  8995. \*****************************************************/
  8996. /*! no static exports found */
  8997. /***/ (function(module, exports) {
  8998. /**
  8999. * Copyright (c) 2014-present, Facebook, Inc.
  9000. *
  9001. * This source code is licensed under the MIT license found in the
  9002. * LICENSE file in the root directory of this source tree.
  9003. */
  9004. !(function(global) {
  9005. "use strict";
  9006. var Op = Object.prototype;
  9007. var hasOwn = Op.hasOwnProperty;
  9008. var undefined; // More compressible than void 0.
  9009. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  9010. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  9011. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  9012. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9013. var inModule = typeof module === "object";
  9014. var runtime = global.regeneratorRuntime;
  9015. if (runtime) {
  9016. if (inModule) {
  9017. // If regeneratorRuntime is defined globally and we're in a module,
  9018. // make the exports object identical to regeneratorRuntime.
  9019. module.exports = runtime;
  9020. }
  9021. // Don't bother evaluating the rest of this file if the runtime was
  9022. // already defined globally.
  9023. return;
  9024. }
  9025. // Define the runtime globally (as expected by generated code) as either
  9026. // module.exports (if we're in a module) or a new, empty object.
  9027. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  9028. function wrap(innerFn, outerFn, self, tryLocsList) {
  9029. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  9030. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  9031. var generator = Object.create(protoGenerator.prototype);
  9032. var context = new Context(tryLocsList || []);
  9033. // The ._invoke method unifies the implementations of the .next,
  9034. // .throw, and .return methods.
  9035. generator._invoke = makeInvokeMethod(innerFn, self, context);
  9036. return generator;
  9037. }
  9038. runtime.wrap = wrap;
  9039. // Try/catch helper to minimize deoptimizations. Returns a completion
  9040. // record like context.tryEntries[i].completion. This interface could
  9041. // have been (and was previously) designed to take a closure to be
  9042. // invoked without arguments, but in all the cases we care about we
  9043. // already have an existing method we want to call, so there's no need
  9044. // to create a new function object. We can even get away with assuming
  9045. // the method takes exactly one argument, since that happens to be true
  9046. // in every case, so we don't have to touch the arguments object. The
  9047. // only additional allocation required is the completion record, which
  9048. // has a stable shape and so hopefully should be cheap to allocate.
  9049. function tryCatch(fn, obj, arg) {
  9050. try {
  9051. return { type: "normal", arg: fn.call(obj, arg) };
  9052. } catch (err) {
  9053. return { type: "throw", arg: err };
  9054. }
  9055. }
  9056. var GenStateSuspendedStart = "suspendedStart";
  9057. var GenStateSuspendedYield = "suspendedYield";
  9058. var GenStateExecuting = "executing";
  9059. var GenStateCompleted = "completed";
  9060. // Returning this object from the innerFn has the same effect as
  9061. // breaking out of the dispatch switch statement.
  9062. var ContinueSentinel = {};
  9063. // Dummy constructor functions that we use as the .constructor and
  9064. // .constructor.prototype properties for functions that return Generator
  9065. // objects. For full spec compliance, you may wish to configure your
  9066. // minifier not to mangle the names of these two functions.
  9067. function Generator() {}
  9068. function GeneratorFunction() {}
  9069. function GeneratorFunctionPrototype() {}
  9070. // This is a polyfill for %IteratorPrototype% for environments that
  9071. // don't natively support it.
  9072. var IteratorPrototype = {};
  9073. IteratorPrototype[iteratorSymbol] = function () {
  9074. return this;
  9075. };
  9076. var getProto = Object.getPrototypeOf;
  9077. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9078. if (NativeIteratorPrototype &&
  9079. NativeIteratorPrototype !== Op &&
  9080. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  9081. // This environment has a native %IteratorPrototype%; use it instead
  9082. // of the polyfill.
  9083. IteratorPrototype = NativeIteratorPrototype;
  9084. }
  9085. var Gp = GeneratorFunctionPrototype.prototype =
  9086. Generator.prototype = Object.create(IteratorPrototype);
  9087. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  9088. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  9089. GeneratorFunctionPrototype[toStringTagSymbol] =
  9090. GeneratorFunction.displayName = "GeneratorFunction";
  9091. // Helper for defining the .next, .throw, and .return methods of the
  9092. // Iterator interface in terms of a single ._invoke method.
  9093. function defineIteratorMethods(prototype) {
  9094. ["next", "throw", "return"].forEach(function(method) {
  9095. prototype[method] = function(arg) {
  9096. return this._invoke(method, arg);
  9097. };
  9098. });
  9099. }
  9100. runtime.isGeneratorFunction = function(genFun) {
  9101. var ctor = typeof genFun === "function" && genFun.constructor;
  9102. return ctor
  9103. ? ctor === GeneratorFunction ||
  9104. // For the native GeneratorFunction constructor, the best we can
  9105. // do is to check its .name property.
  9106. (ctor.displayName || ctor.name) === "GeneratorFunction"
  9107. : false;
  9108. };
  9109. runtime.mark = function(genFun) {
  9110. if (Object.setPrototypeOf) {
  9111. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  9112. } else {
  9113. genFun.__proto__ = GeneratorFunctionPrototype;
  9114. if (!(toStringTagSymbol in genFun)) {
  9115. genFun[toStringTagSymbol] = "GeneratorFunction";
  9116. }
  9117. }
  9118. genFun.prototype = Object.create(Gp);
  9119. return genFun;
  9120. };
  9121. // Within the body of any async function, `await x` is transformed to
  9122. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  9123. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  9124. // meant to be awaited.
  9125. runtime.awrap = function(arg) {
  9126. return { __await: arg };
  9127. };
  9128. function AsyncIterator(generator) {
  9129. function invoke(method, arg, resolve, reject) {
  9130. var record = tryCatch(generator[method], generator, arg);
  9131. if (record.type === "throw") {
  9132. reject(record.arg);
  9133. } else {
  9134. var result = record.arg;
  9135. var value = result.value;
  9136. if (value &&
  9137. typeof value === "object" &&
  9138. hasOwn.call(value, "__await")) {
  9139. return Promise.resolve(value.__await).then(function(value) {
  9140. invoke("next", value, resolve, reject);
  9141. }, function(err) {
  9142. invoke("throw", err, resolve, reject);
  9143. });
  9144. }
  9145. return Promise.resolve(value).then(function(unwrapped) {
  9146. // When a yielded Promise is resolved, its final value becomes
  9147. // the .value of the Promise<{value,done}> result for the
  9148. // current iteration.
  9149. result.value = unwrapped;
  9150. resolve(result);
  9151. }, function(error) {
  9152. // If a rejected Promise was yielded, throw the rejection back
  9153. // into the async generator function so it can be handled there.
  9154. return invoke("throw", error, resolve, reject);
  9155. });
  9156. }
  9157. }
  9158. var previousPromise;
  9159. function enqueue(method, arg) {
  9160. function callInvokeWithMethodAndArg() {
  9161. return new Promise(function(resolve, reject) {
  9162. invoke(method, arg, resolve, reject);
  9163. });
  9164. }
  9165. return previousPromise =
  9166. // If enqueue has been called before, then we want to wait until
  9167. // all previous Promises have been resolved before calling invoke,
  9168. // so that results are always delivered in the correct order. If
  9169. // enqueue has not been called before, then it is important to
  9170. // call invoke immediately, without waiting on a callback to fire,
  9171. // so that the async generator function has the opportunity to do
  9172. // any necessary setup in a predictable way. This predictability
  9173. // is why the Promise constructor synchronously invokes its
  9174. // executor callback, and why async functions synchronously
  9175. // execute code before the first await. Since we implement simple
  9176. // async functions in terms of async generators, it is especially
  9177. // important to get this right, even though it requires care.
  9178. previousPromise ? previousPromise.then(
  9179. callInvokeWithMethodAndArg,
  9180. // Avoid propagating failures to Promises returned by later
  9181. // invocations of the iterator.
  9182. callInvokeWithMethodAndArg
  9183. ) : callInvokeWithMethodAndArg();
  9184. }
  9185. // Define the unified helper method that is used to implement .next,
  9186. // .throw, and .return (see defineIteratorMethods).
  9187. this._invoke = enqueue;
  9188. }
  9189. defineIteratorMethods(AsyncIterator.prototype);
  9190. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  9191. return this;
  9192. };
  9193. runtime.AsyncIterator = AsyncIterator;
  9194. // Note that simple async functions are implemented on top of
  9195. // AsyncIterator objects; they just return a Promise for the value of
  9196. // the final result produced by the iterator.
  9197. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  9198. var iter = new AsyncIterator(
  9199. wrap(innerFn, outerFn, self, tryLocsList)
  9200. );
  9201. return runtime.isGeneratorFunction(outerFn)
  9202. ? iter // If outerFn is a generator, return the full iterator.
  9203. : iter.next().then(function(result) {
  9204. return result.done ? result.value : iter.next();
  9205. });
  9206. };
  9207. function makeInvokeMethod(innerFn, self, context) {
  9208. var state = GenStateSuspendedStart;
  9209. return function invoke(method, arg) {
  9210. if (state === GenStateExecuting) {
  9211. throw new Error("Generator is already running");
  9212. }
  9213. if (state === GenStateCompleted) {
  9214. if (method === "throw") {
  9215. throw arg;
  9216. }
  9217. // Be forgiving, per 25.3.3.3.3 of the spec:
  9218. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  9219. return doneResult();
  9220. }
  9221. context.method = method;
  9222. context.arg = arg;
  9223. while (true) {
  9224. var delegate = context.delegate;
  9225. if (delegate) {
  9226. var delegateResult = maybeInvokeDelegate(delegate, context);
  9227. if (delegateResult) {
  9228. if (delegateResult === ContinueSentinel) continue;
  9229. return delegateResult;
  9230. }
  9231. }
  9232. if (context.method === "next") {
  9233. // Setting context._sent for legacy support of Babel's
  9234. // function.sent implementation.
  9235. context.sent = context._sent = context.arg;
  9236. } else if (context.method === "throw") {
  9237. if (state === GenStateSuspendedStart) {
  9238. state = GenStateCompleted;
  9239. throw context.arg;
  9240. }
  9241. context.dispatchException(context.arg);
  9242. } else if (context.method === "return") {
  9243. context.abrupt("return", context.arg);
  9244. }
  9245. state = GenStateExecuting;
  9246. var record = tryCatch(innerFn, self, context);
  9247. if (record.type === "normal") {
  9248. // If an exception is thrown from innerFn, we leave state ===
  9249. // GenStateExecuting and loop back for another invocation.
  9250. state = context.done
  9251. ? GenStateCompleted
  9252. : GenStateSuspendedYield;
  9253. if (record.arg === ContinueSentinel) {
  9254. continue;
  9255. }
  9256. return {
  9257. value: record.arg,
  9258. done: context.done
  9259. };
  9260. } else if (record.type === "throw") {
  9261. state = GenStateCompleted;
  9262. // Dispatch the exception by looping back around to the
  9263. // context.dispatchException(context.arg) call above.
  9264. context.method = "throw";
  9265. context.arg = record.arg;
  9266. }
  9267. }
  9268. };
  9269. }
  9270. // Call delegate.iterator[context.method](context.arg) and handle the
  9271. // result, either by returning a { value, done } result from the
  9272. // delegate iterator, or by modifying context.method and context.arg,
  9273. // setting context.delegate to null, and returning the ContinueSentinel.
  9274. function maybeInvokeDelegate(delegate, context) {
  9275. var method = delegate.iterator[context.method];
  9276. if (method === undefined) {
  9277. // A .throw or .return when the delegate iterator has no .throw
  9278. // method always terminates the yield* loop.
  9279. context.delegate = null;
  9280. if (context.method === "throw") {
  9281. if (delegate.iterator.return) {
  9282. // If the delegate iterator has a return method, give it a
  9283. // chance to clean up.
  9284. context.method = "return";
  9285. context.arg = undefined;
  9286. maybeInvokeDelegate(delegate, context);
  9287. if (context.method === "throw") {
  9288. // If maybeInvokeDelegate(context) changed context.method from
  9289. // "return" to "throw", let that override the TypeError below.
  9290. return ContinueSentinel;
  9291. }
  9292. }
  9293. context.method = "throw";
  9294. context.arg = new TypeError(
  9295. "The iterator does not provide a 'throw' method");
  9296. }
  9297. return ContinueSentinel;
  9298. }
  9299. var record = tryCatch(method, delegate.iterator, context.arg);
  9300. if (record.type === "throw") {
  9301. context.method = "throw";
  9302. context.arg = record.arg;
  9303. context.delegate = null;
  9304. return ContinueSentinel;
  9305. }
  9306. var info = record.arg;
  9307. if (! info) {
  9308. context.method = "throw";
  9309. context.arg = new TypeError("iterator result is not an object");
  9310. context.delegate = null;
  9311. return ContinueSentinel;
  9312. }
  9313. if (info.done) {
  9314. // Assign the result of the finished delegate to the temporary
  9315. // variable specified by delegate.resultName (see delegateYield).
  9316. context[delegate.resultName] = info.value;
  9317. // Resume execution at the desired location (see delegateYield).
  9318. context.next = delegate.nextLoc;
  9319. // If context.method was "throw" but the delegate handled the
  9320. // exception, let the outer generator proceed normally. If
  9321. // context.method was "next", forget context.arg since it has been
  9322. // "consumed" by the delegate iterator. If context.method was
  9323. // "return", allow the original .return call to continue in the
  9324. // outer generator.
  9325. if (context.method !== "return") {
  9326. context.method = "next";
  9327. context.arg = undefined;
  9328. }
  9329. } else {
  9330. // Re-yield the result returned by the delegate method.
  9331. return info;
  9332. }
  9333. // The delegate iterator is finished, so forget it and continue with
  9334. // the outer generator.
  9335. context.delegate = null;
  9336. return ContinueSentinel;
  9337. }
  9338. // Define Generator.prototype.{next,throw,return} in terms of the
  9339. // unified ._invoke helper method.
  9340. defineIteratorMethods(Gp);
  9341. Gp[toStringTagSymbol] = "Generator";
  9342. // A Generator should always return itself as the iterator object when the
  9343. // @@iterator function is called on it. Some browsers' implementations of the
  9344. // iterator prototype chain incorrectly implement this, causing the Generator
  9345. // object to not be returned from this call. This ensures that doesn't happen.
  9346. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9347. Gp[iteratorSymbol] = function() {
  9348. return this;
  9349. };
  9350. Gp.toString = function() {
  9351. return "[object Generator]";
  9352. };
  9353. function pushTryEntry(locs) {
  9354. var entry = { tryLoc: locs[0] };
  9355. if (1 in locs) {
  9356. entry.catchLoc = locs[1];
  9357. }
  9358. if (2 in locs) {
  9359. entry.finallyLoc = locs[2];
  9360. entry.afterLoc = locs[3];
  9361. }
  9362. this.tryEntries.push(entry);
  9363. }
  9364. function resetTryEntry(entry) {
  9365. var record = entry.completion || {};
  9366. record.type = "normal";
  9367. delete record.arg;
  9368. entry.completion = record;
  9369. }
  9370. function Context(tryLocsList) {
  9371. // The root entry object (effectively a try statement without a catch
  9372. // or a finally block) gives us a place to store values thrown from
  9373. // locations where there is no enclosing try statement.
  9374. this.tryEntries = [{ tryLoc: "root" }];
  9375. tryLocsList.forEach(pushTryEntry, this);
  9376. this.reset(true);
  9377. }
  9378. runtime.keys = function(object) {
  9379. var keys = [];
  9380. for (var key in object) {
  9381. keys.push(key);
  9382. }
  9383. keys.reverse();
  9384. // Rather than returning an object with a next method, we keep
  9385. // things simple and return the next function itself.
  9386. return function next() {
  9387. while (keys.length) {
  9388. var key = keys.pop();
  9389. if (key in object) {
  9390. next.value = key;
  9391. next.done = false;
  9392. return next;
  9393. }
  9394. }
  9395. // To avoid creating an additional object, we just hang the .value
  9396. // and .done properties off the next function object itself. This
  9397. // also ensures that the minifier will not anonymize the function.
  9398. next.done = true;
  9399. return next;
  9400. };
  9401. };
  9402. function values(iterable) {
  9403. if (iterable) {
  9404. var iteratorMethod = iterable[iteratorSymbol];
  9405. if (iteratorMethod) {
  9406. return iteratorMethod.call(iterable);
  9407. }
  9408. if (typeof iterable.next === "function") {
  9409. return iterable;
  9410. }
  9411. if (!isNaN(iterable.length)) {
  9412. var i = -1, next = function next() {
  9413. while (++i < iterable.length) {
  9414. if (hasOwn.call(iterable, i)) {
  9415. next.value = iterable[i];
  9416. next.done = false;
  9417. return next;
  9418. }
  9419. }
  9420. next.value = undefined;
  9421. next.done = true;
  9422. return next;
  9423. };
  9424. return next.next = next;
  9425. }
  9426. }
  9427. // Return an iterator with no values.
  9428. return { next: doneResult };
  9429. }
  9430. runtime.values = values;
  9431. function doneResult() {
  9432. return { value: undefined, done: true };
  9433. }
  9434. Context.prototype = {
  9435. constructor: Context,
  9436. reset: function(skipTempReset) {
  9437. this.prev = 0;
  9438. this.next = 0;
  9439. // Resetting context._sent for legacy support of Babel's
  9440. // function.sent implementation.
  9441. this.sent = this._sent = undefined;
  9442. this.done = false;
  9443. this.delegate = null;
  9444. this.method = "next";
  9445. this.arg = undefined;
  9446. this.tryEntries.forEach(resetTryEntry);
  9447. if (!skipTempReset) {
  9448. for (var name in this) {
  9449. // Not sure about the optimal order of these conditions:
  9450. if (name.charAt(0) === "t" &&
  9451. hasOwn.call(this, name) &&
  9452. !isNaN(+name.slice(1))) {
  9453. this[name] = undefined;
  9454. }
  9455. }
  9456. }
  9457. },
  9458. stop: function() {
  9459. this.done = true;
  9460. var rootEntry = this.tryEntries[0];
  9461. var rootRecord = rootEntry.completion;
  9462. if (rootRecord.type === "throw") {
  9463. throw rootRecord.arg;
  9464. }
  9465. return this.rval;
  9466. },
  9467. dispatchException: function(exception) {
  9468. if (this.done) {
  9469. throw exception;
  9470. }
  9471. var context = this;
  9472. function handle(loc, caught) {
  9473. record.type = "throw";
  9474. record.arg = exception;
  9475. context.next = loc;
  9476. if (caught) {
  9477. // If the dispatched exception was caught by a catch block,
  9478. // then let that catch block handle the exception normally.
  9479. context.method = "next";
  9480. context.arg = undefined;
  9481. }
  9482. return !! caught;
  9483. }
  9484. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9485. var entry = this.tryEntries[i];
  9486. var record = entry.completion;
  9487. if (entry.tryLoc === "root") {
  9488. // Exception thrown outside of any try block that could handle
  9489. // it, so set the completion value of the entire function to
  9490. // throw the exception.
  9491. return handle("end");
  9492. }
  9493. if (entry.tryLoc <= this.prev) {
  9494. var hasCatch = hasOwn.call(entry, "catchLoc");
  9495. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9496. if (hasCatch && hasFinally) {
  9497. if (this.prev < entry.catchLoc) {
  9498. return handle(entry.catchLoc, true);
  9499. } else if (this.prev < entry.finallyLoc) {
  9500. return handle(entry.finallyLoc);
  9501. }
  9502. } else if (hasCatch) {
  9503. if (this.prev < entry.catchLoc) {
  9504. return handle(entry.catchLoc, true);
  9505. }
  9506. } else if (hasFinally) {
  9507. if (this.prev < entry.finallyLoc) {
  9508. return handle(entry.finallyLoc);
  9509. }
  9510. } else {
  9511. throw new Error("try statement without catch or finally");
  9512. }
  9513. }
  9514. }
  9515. },
  9516. abrupt: function(type, arg) {
  9517. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9518. var entry = this.tryEntries[i];
  9519. if (entry.tryLoc <= this.prev &&
  9520. hasOwn.call(entry, "finallyLoc") &&
  9521. this.prev < entry.finallyLoc) {
  9522. var finallyEntry = entry;
  9523. break;
  9524. }
  9525. }
  9526. if (finallyEntry &&
  9527. (type === "break" ||
  9528. type === "continue") &&
  9529. finallyEntry.tryLoc <= arg &&
  9530. arg <= finallyEntry.finallyLoc) {
  9531. // Ignore the finally entry if control is not jumping to a
  9532. // location outside the try/catch block.
  9533. finallyEntry = null;
  9534. }
  9535. var record = finallyEntry ? finallyEntry.completion : {};
  9536. record.type = type;
  9537. record.arg = arg;
  9538. if (finallyEntry) {
  9539. this.method = "next";
  9540. this.next = finallyEntry.finallyLoc;
  9541. return ContinueSentinel;
  9542. }
  9543. return this.complete(record);
  9544. },
  9545. complete: function(record, afterLoc) {
  9546. if (record.type === "throw") {
  9547. throw record.arg;
  9548. }
  9549. if (record.type === "break" ||
  9550. record.type === "continue") {
  9551. this.next = record.arg;
  9552. } else if (record.type === "return") {
  9553. this.rval = this.arg = record.arg;
  9554. this.method = "return";
  9555. this.next = "end";
  9556. } else if (record.type === "normal" && afterLoc) {
  9557. this.next = afterLoc;
  9558. }
  9559. return ContinueSentinel;
  9560. },
  9561. finish: function(finallyLoc) {
  9562. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9563. var entry = this.tryEntries[i];
  9564. if (entry.finallyLoc === finallyLoc) {
  9565. this.complete(entry.completion, entry.afterLoc);
  9566. resetTryEntry(entry);
  9567. return ContinueSentinel;
  9568. }
  9569. }
  9570. },
  9571. "catch": function(tryLoc) {
  9572. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9573. var entry = this.tryEntries[i];
  9574. if (entry.tryLoc === tryLoc) {
  9575. var record = entry.completion;
  9576. if (record.type === "throw") {
  9577. var thrown = record.arg;
  9578. resetTryEntry(entry);
  9579. }
  9580. return thrown;
  9581. }
  9582. }
  9583. // The context.catch method must only be called with a location
  9584. // argument that corresponds to a known catch block.
  9585. throw new Error("illegal catch attempt");
  9586. },
  9587. delegateYield: function(iterable, resultName, nextLoc) {
  9588. this.delegate = {
  9589. iterator: values(iterable),
  9590. resultName: resultName,
  9591. nextLoc: nextLoc
  9592. };
  9593. if (this.method === "next") {
  9594. // Deliberately forget the last sent value so that we don't
  9595. // accidentally pass it on to the delegate.
  9596. this.arg = undefined;
  9597. }
  9598. return ContinueSentinel;
  9599. }
  9600. };
  9601. })(
  9602. // In sloppy mode, unbound `this` refers to the global object, fallback to
  9603. // Function constructor if we're in global strict mode. That is sadly a form
  9604. // of indirect eval which violates Content Security Policy.
  9605. (function() {
  9606. return this || (typeof self === "object" && self);
  9607. })() || Function("return this")()
  9608. );
  9609. /***/ }),
  9610. /***/ 34:
  9611. /*!*******************************************************!*\
  9612. !*** C:/Users/first/Desktop/公司/applets/util/parse.js ***!
  9613. \*******************************************************/
  9614. /*! no static exports found */
  9615. /***/ (function(module, exports, __webpack_require__) {
  9616. "use strict";
  9617. /* 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 */ 31));var _base = _interopRequireDefault(__webpack_require__(/*! ./base64.js */ 35));
  9618. var _index = _interopRequireDefault(__webpack_require__(/*! ../store/index.js */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _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;}var
  9619. Parse = /*#__PURE__*/function () {function Parse() {_classCallCheck(this, Parse);_defineProperty(this, "info",
  9620. {});}_createClass(Parse, [{ key: "_processor",
  9621. // public method for decoding
  9622. value: function _processor(res) {
  9623. var base64 = _base.default.getInstance();
  9624. console.log(res);
  9625. var data = res.replace("https://goto.huijy.net/", "");
  9626. var stationId;
  9627. var employeeId;
  9628. var labelId;
  9629. var info = {
  9630. stationId: undefined,
  9631. labelId: undefined,
  9632. employeeId: undefined };
  9633. var idArr = data.match(/^\d{1,}/g);
  9634. if (idArr === null) {
  9635. throw new Error("二维码是个啥玩意?!");
  9636. }
  9637. // 处理后的data
  9638. data = data.replace(/^\d{1,}\//g, '');
  9639. // 解压后的data
  9640. data = base64.decode(data);
  9641. // 员工id
  9642. if (data.includes('e')) {
  9643. var employeeIdStrArr = data.match(/e\d{1,}/g);
  9644. if (employeeIdStrArr === null) {
  9645. return;
  9646. }
  9647. var employeeIdArr = employeeIdStrArr[0].match(/\d{1,}/g);
  9648. if (employeeIdArr === null) {
  9649. return;
  9650. }
  9651. employeeId = employeeIdArr[0];
  9652. this.info.employeeId = employeeId;
  9653. _index.default.commit('updateEmployeeId', employeeId);
  9654. }
  9655. // 标签id
  9656. if (data.includes('l')) {
  9657. var labelIdStrArr = data.match(/l\d{1,}/g);
  9658. if (labelIdStrArr === null) {
  9659. return;
  9660. }
  9661. var labelIdArr = labelIdStrArr[0].match(/\d{1,}/g);
  9662. if (labelIdArr === null) {
  9663. return;
  9664. }
  9665. labelId = labelIdArr[0];
  9666. this.info.labelId = labelId;
  9667. _index.default.commit("updateLabelId", labelId);
  9668. }
  9669. stationId = idArr[0];
  9670. this.info.stationId = stationId;
  9671. _index.default.commit("updateStationId", stationId);
  9672. return;
  9673. } }, { key: "parseCode", value: function () {var _parseCode = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(
  9674. res) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.prev = 0;
  9675. this._processor(res);return _context.abrupt("return",
  9676. Promise.resolve(this.info));case 5:_context.prev = 5;_context.t0 = _context["catch"](0);return _context.abrupt("return",
  9677. Promise.reject("亲,请扫油站提供的码呦~"));case 8:case "end":return _context.stop();}}}, _callee, this, [[0, 5]]);}));function parseCode(_x) {return _parseCode.apply(this, arguments);}return parseCode;}() }, { key: "_scanCode", value: function () {var _scanCode2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var scanCodePro;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.prev = 0;_context2.next = 3;return (
  9678. uni.scanCode({
  9679. onlyFromCamera: true }));case 3:scanCodePro = _context2.sent;if (!(
  9680. scanCodePro[0] != null && scanCodePro[0].errMsg == "scanCode:fail")) {_context2.next = 6;break;}throw (
  9681. new Error(1));case 6:if (!(
  9682. scanCodePro[0] != null)) {_context2.next = 8;break;}throw (
  9683. new Error(2));case 8:return _context2.abrupt("return",
  9684. this.parseCode(scanCodePro[1].result));case 11:_context2.prev = 11;_context2.t0 = _context2["catch"](0);if (!(
  9685. _context2.t0.message == 1)) {_context2.next = 17;break;}return _context2.abrupt("return",
  9686. Promise.reject("亲,请扫油站提供的码呦~"));case 17:return _context2.abrupt("return",
  9687. Promise.reject("亲,请扫二维码呀~"));case 18:case "end":return _context2.stop();}}}, _callee2, this, [[0, 11]]);}));function _scanCode() {return _scanCode2.apply(this, arguments);}return _scanCode;}() }, { key: "scanCode", value: function () {var _scanCode3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var _this = this;var showModalFlag,moduleConfig,showModalPro,_args3 = arguments;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
  9688. showModalFlag = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : true;moduleConfig = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {}; //msg 消息
  9689. showModalPro = [
  9690. null,
  9691. {
  9692. cancel: false,
  9693. confirm: true }];if (!
  9694. showModalFlag) {_context3.next = 7;break;}_context3.next = 6;return (
  9695. uni.showModal({
  9696. title: moduleConfig.title || '(~ ̄▽ ̄)~',
  9697. showCancel: moduleConfig.showCancel,
  9698. content: moduleConfig.content || '亲,请扫码使用~',
  9699. cancelText: moduleConfig.cancelText || '返回',
  9700. confirmText: moduleConfig.confirmText || '立刻扫码' }));case 6:showModalPro = _context3.sent;case 7:if (!
  9701. showModalPro[1].cancel) {_context3.next = 12;break;}
  9702. uni.navigateBack({
  9703. delta: 1 });return _context3.abrupt("return",
  9704. Promise.reject("返回"));case 12:if (!
  9705. showModalPro[1].confirm) {_context3.next = 14;break;}return _context3.abrupt("return",
  9706. this._scanCode().catch(function (errMsg) {
  9707. console.log(errMsg);
  9708. return _this.scanCode(true, {
  9709. content: errMsg });
  9710. }));case 14:case "end":return _context3.stop();}}}, _callee3, this);}));function scanCode() {return _scanCode3.apply(this, arguments);}return scanCode;}() }], [{ key: "getInstance", // private property
  9711. value: function getInstance() {if (!this.instance) {this.instance = new Parse();}return this.instance;} }]);return Parse;}();exports.default = Parse;
  9712. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9713. /***/ }),
  9714. /***/ 35:
  9715. /*!********************************************************!*\
  9716. !*** C:/Users/first/Desktop/公司/applets/util/base64.js ***!
  9717. \********************************************************/
  9718. /*! no static exports found */
  9719. /***/ (function(module, exports, __webpack_require__) {
  9720. "use strict";
  9721. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _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;}var Base64 = /*#__PURE__*/function () {function Base64() {_classCallCheck(this, Base64);_defineProperty(this, "_keyStr",
  9722. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");_defineProperty(this, "encode",
  9723. function (input) {
  9724. var output = "";
  9725. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  9726. var i = 0;
  9727. input = this._utf8_encode(input);
  9728. while (i < input.length) {
  9729. chr1 = input.charCodeAt(i++);
  9730. chr2 = input.charCodeAt(i++);
  9731. chr3 = input.charCodeAt(i++);
  9732. enc1 = chr1 >> 2;
  9733. enc2 = (chr1 & 3) << 4 | chr2 >> 4;
  9734. enc3 = (chr2 & 15) << 2 | chr3 >> 6;
  9735. enc4 = chr3 & 63;
  9736. if (isNaN(chr2)) {
  9737. enc3 = enc4 = 64;
  9738. } else if (isNaN(chr3)) {
  9739. enc4 = 64;
  9740. }
  9741. output = output +
  9742. this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
  9743. this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
  9744. }
  9745. return output;
  9746. });_defineProperty(this, "decode",
  9747. function (input) {
  9748. var output = "";
  9749. var chr1, chr2, chr3;
  9750. var enc1, enc2, enc3, enc4;
  9751. var i = 0;
  9752. input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  9753. while (i < input.length) {
  9754. enc1 = this._keyStr.indexOf(input.charAt(i++));
  9755. enc2 = this._keyStr.indexOf(input.charAt(i++));
  9756. enc3 = this._keyStr.indexOf(input.charAt(i++));
  9757. enc4 = this._keyStr.indexOf(input.charAt(i++));
  9758. chr1 = enc1 << 2 | enc2 >> 4;
  9759. chr2 = (enc2 & 15) << 4 | enc3 >> 2;
  9760. chr3 = (enc3 & 3) << 6 | enc4;
  9761. output = output + String.fromCharCode(chr1);
  9762. if (enc3 != 64) {
  9763. output = output + String.fromCharCode(chr2);
  9764. }
  9765. if (enc4 != 64) {
  9766. output = output + String.fromCharCode(chr3);
  9767. }
  9768. }
  9769. output = this._utf8_decode(output);
  9770. return output;
  9771. });}_createClass(Base64, [{ key: "_utf8_encode",
  9772. // private method for UTF-8 encoding
  9773. value: function _utf8_encode(string) {
  9774. string = string.replace(/\r\n/g, "\n");
  9775. var utftext = "";
  9776. for (var n = 0; n < string.length; n++) {
  9777. var c = string.charCodeAt(n);
  9778. if (c < 128) {
  9779. utftext += String.fromCharCode(c);
  9780. } else if (c > 127 && c < 2048) {
  9781. utftext += String.fromCharCode(c >> 6 | 192);
  9782. utftext += String.fromCharCode(c & 63 | 128);
  9783. } else {
  9784. utftext += String.fromCharCode(c >> 12 | 224);
  9785. utftext += String.fromCharCode(c >> 6 & 63 | 128);
  9786. utftext += String.fromCharCode(c & 63 | 128);
  9787. }
  9788. }
  9789. return utftext;
  9790. }
  9791. // private method for UTF-8 decoding
  9792. }, { key: "_utf8_decode", value: function _utf8_decode(utftext) {var
  9793. string = '',i = 0,c = 0,c1 = 0,c2 = 0,c3 = 0;
  9794. while (i < utftext.length) {
  9795. c = utftext.charCodeAt(i);
  9796. if (c < 128) {
  9797. string += String.fromCharCode(c);
  9798. i++;
  9799. } else if (c > 191 && c < 224) {
  9800. c2 = utftext.charCodeAt(i + 1);
  9801. string += String.fromCharCode((c & 31) << 6 | c2 & 63);
  9802. i += 2;
  9803. } else {
  9804. c2 = utftext.charCodeAt(i + 1);
  9805. c3 = utftext.charCodeAt(i + 2);
  9806. string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
  9807. i += 3;
  9808. }
  9809. }
  9810. return string;
  9811. } }], [{ key: "getInstance", value: function getInstance() {if (!this.instance) {this.instance = new Base64();}return this.instance;} // public method for encoding
  9812. }]);return Base64;}();exports.default = Base64;
  9813. /***/ }),
  9814. /***/ 4:
  9815. /*!*************************************************************!*\
  9816. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  9817. \*************************************************************/
  9818. /*! no static exports found */
  9819. /***/ (function(module, exports, __webpack_require__) {
  9820. "use strict";
  9821. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  9822. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  9823. var defaultDelimiters = ['{', '}'];var
  9824. BaseFormatter = /*#__PURE__*/function () {
  9825. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  9826. this._caches = Object.create(null);
  9827. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  9828. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  9829. if (!values) {
  9830. return [message];
  9831. }
  9832. var tokens = this._caches[message];
  9833. if (!tokens) {
  9834. tokens = parse(message, delimiters);
  9835. this._caches[message] = tokens;
  9836. }
  9837. return compile(tokens, values);
  9838. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  9839. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  9840. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  9841. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  9842. var tokens = [];
  9843. var position = 0;
  9844. var text = '';
  9845. while (position < format.length) {
  9846. var char = format[position++];
  9847. if (char === startDelimiter) {
  9848. if (text) {
  9849. tokens.push({ type: 'text', value: text });
  9850. }
  9851. text = '';
  9852. var sub = '';
  9853. char = format[position++];
  9854. while (char !== undefined && char !== endDelimiter) {
  9855. sub += char;
  9856. char = format[position++];
  9857. }
  9858. var isClosed = char === endDelimiter;
  9859. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  9860. 'list' :
  9861. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  9862. 'named' :
  9863. 'unknown';
  9864. tokens.push({ value: sub, type: type });
  9865. }
  9866. // else if (char === '%') {
  9867. // // when found rails i18n syntax, skip text capture
  9868. // if (format[position] !== '{') {
  9869. // text += char
  9870. // }
  9871. // }
  9872. else {
  9873. text += char;
  9874. }
  9875. }
  9876. text && tokens.push({ type: 'text', value: text });
  9877. return tokens;
  9878. }
  9879. function compile(tokens, values) {
  9880. var compiled = [];
  9881. var index = 0;
  9882. var mode = isArray(values) ?
  9883. 'list' :
  9884. isObject(values) ?
  9885. 'named' :
  9886. 'unknown';
  9887. if (mode === 'unknown') {
  9888. return compiled;
  9889. }
  9890. while (index < tokens.length) {
  9891. var token = tokens[index];
  9892. switch (token.type) {
  9893. case 'text':
  9894. compiled.push(token.value);
  9895. break;
  9896. case 'list':
  9897. compiled.push(values[parseInt(token.value, 10)]);
  9898. break;
  9899. case 'named':
  9900. if (mode === 'named') {
  9901. compiled.push(values[token.value]);
  9902. } else
  9903. {
  9904. if (true) {
  9905. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  9906. }
  9907. }
  9908. break;
  9909. case 'unknown':
  9910. if (true) {
  9911. console.warn("Detect 'unknown' type of token!");
  9912. }
  9913. break;}
  9914. index++;
  9915. }
  9916. return compiled;
  9917. }
  9918. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  9919. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  9920. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  9921. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  9922. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  9923. var hasOwnProperty = Object.prototype.hasOwnProperty;
  9924. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  9925. var defaultFormatter = new BaseFormatter();
  9926. function include(str, parts) {
  9927. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  9928. }
  9929. function startsWith(str, parts) {
  9930. return parts.find(function (part) {return str.indexOf(part) === 0;});
  9931. }
  9932. function normalizeLocale(locale, messages) {
  9933. if (!locale) {
  9934. return;
  9935. }
  9936. locale = locale.trim().replace(/_/g, '-');
  9937. if (messages && messages[locale]) {
  9938. return locale;
  9939. }
  9940. locale = locale.toLowerCase();
  9941. if (locale.indexOf('zh') === 0) {
  9942. if (locale.indexOf('-hans') !== -1) {
  9943. return LOCALE_ZH_HANS;
  9944. }
  9945. if (locale.indexOf('-hant') !== -1) {
  9946. return LOCALE_ZH_HANT;
  9947. }
  9948. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  9949. return LOCALE_ZH_HANT;
  9950. }
  9951. return LOCALE_ZH_HANS;
  9952. }
  9953. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  9954. if (lang) {
  9955. return lang;
  9956. }
  9957. }var
  9958. I18n = /*#__PURE__*/function () {
  9959. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  9960. this.locale = LOCALE_EN;
  9961. this.fallbackLocale = LOCALE_EN;
  9962. this.message = {};
  9963. this.messages = {};
  9964. this.watchers = [];
  9965. if (fallbackLocale) {
  9966. this.fallbackLocale = fallbackLocale;
  9967. }
  9968. this.formater = formater || defaultFormatter;
  9969. this.messages = messages || {};
  9970. this.setLocale(locale || LOCALE_EN);
  9971. if (watcher) {
  9972. this.watchLocale(watcher);
  9973. }
  9974. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  9975. locale) {var _this = this;
  9976. var oldLocale = this.locale;
  9977. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  9978. if (!this.messages[this.locale]) {
  9979. // 可能初始化时不存在
  9980. this.messages[this.locale] = {};
  9981. }
  9982. this.message = this.messages[this.locale];
  9983. // 仅发生变化时,通知
  9984. if (oldLocale !== this.locale) {
  9985. this.watchers.forEach(function (watcher) {
  9986. watcher(_this.locale, oldLocale);
  9987. });
  9988. }
  9989. } }, { key: "getLocale", value: function getLocale()
  9990. {
  9991. return this.locale;
  9992. } }, { key: "watchLocale", value: function watchLocale(
  9993. fn) {var _this2 = this;
  9994. var index = this.watchers.push(fn) - 1;
  9995. return function () {
  9996. _this2.watchers.splice(index, 1);
  9997. };
  9998. } }, { key: "add", value: function add(
  9999. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10000. var curMessages = this.messages[locale];
  10001. if (curMessages) {
  10002. if (override) {
  10003. Object.assign(curMessages, message);
  10004. } else
  10005. {
  10006. Object.keys(message).forEach(function (key) {
  10007. if (!hasOwn(curMessages, key)) {
  10008. curMessages[key] = message[key];
  10009. }
  10010. });
  10011. }
  10012. } else
  10013. {
  10014. this.messages[locale] = message;
  10015. }
  10016. } }, { key: "f", value: function f(
  10017. message, values, delimiters) {
  10018. return this.formater.interpolate(message, values, delimiters).join('');
  10019. } }, { key: "t", value: function t(
  10020. key, locale, values) {
  10021. var message = this.message;
  10022. if (typeof locale === 'string') {
  10023. locale = normalizeLocale(locale, this.messages);
  10024. locale && (message = this.messages[locale]);
  10025. } else
  10026. {
  10027. values = locale;
  10028. }
  10029. if (!hasOwn(message, key)) {
  10030. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  10031. return key;
  10032. }
  10033. return this.formater.interpolate(message[key], values).join('');
  10034. } }]);return I18n;}();exports.I18n = I18n;
  10035. var ignoreVueI18n = true;
  10036. function watchAppLocale(appVm, i18n) {
  10037. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  10038. i18n.setLocale(newLocale);
  10039. });
  10040. }
  10041. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  10042. // 兼容旧版本入参
  10043. if (typeof locale !== 'string') {var _ref4 =
  10044. [
  10045. messages,
  10046. locale];locale = _ref4[0];messages = _ref4[1];
  10047. }
  10048. if (typeof locale !== 'string') {
  10049. locale =
  10050. typeof uni !== 'undefined' && uni.getLocale && uni.getLocale() ||
  10051. LOCALE_EN;
  10052. }
  10053. if (typeof fallbackLocale !== 'string') {
  10054. fallbackLocale =
  10055. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  10056. LOCALE_EN;
  10057. }
  10058. var i18n = new I18n({
  10059. locale: locale,
  10060. fallbackLocale: fallbackLocale,
  10061. messages: messages,
  10062. watcher: watcher });
  10063. var _t = function t(key, values) {
  10064. if (typeof getApp !== 'function') {
  10065. // app view
  10066. /* eslint-disable no-func-assign */
  10067. _t = function t(key, values) {
  10068. return i18n.t(key, values);
  10069. };
  10070. } else
  10071. {
  10072. var appVm = getApp().$vm;
  10073. watchAppLocale(appVm, i18n);
  10074. if (!appVm.$t || !appVm.$i18n || ignoreVueI18n) {
  10075. // if (!locale) {
  10076. // i18n.setLocale(getDefaultLocale())
  10077. // }
  10078. /* eslint-disable no-func-assign */
  10079. _t = function t(key, values) {
  10080. // 触发响应式
  10081. appVm.$locale;
  10082. return i18n.t(key, values);
  10083. };
  10084. } else
  10085. {
  10086. /* eslint-disable no-func-assign */
  10087. _t = function t(key, values) {
  10088. var $i18n = appVm.$i18n;
  10089. var silentTranslationWarn = $i18n.silentTranslationWarn;
  10090. $i18n.silentTranslationWarn = true;
  10091. var msg = appVm.$t(key, values);
  10092. $i18n.silentTranslationWarn = silentTranslationWarn;
  10093. if (msg !== key) {
  10094. return msg;
  10095. }
  10096. return i18n.t(key, $i18n.locale, values);
  10097. };
  10098. }
  10099. }
  10100. return _t(key, values);
  10101. };
  10102. return {
  10103. i18n: i18n,
  10104. f: function f(message, values, delimiters) {
  10105. return i18n.f(message, values, delimiters);
  10106. },
  10107. t: function t(key, values) {
  10108. return _t(key, values);
  10109. },
  10110. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10111. return i18n.add(locale, message, override);
  10112. },
  10113. watch: function watch(fn) {
  10114. return i18n.watchLocale(fn);
  10115. },
  10116. getLocale: function getLocale() {
  10117. return i18n.getLocale();
  10118. },
  10119. setLocale: function setLocale(newLocale) {
  10120. return i18n.setLocale(newLocale);
  10121. } };
  10122. }
  10123. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  10124. var formater;
  10125. function hasI18nJson(jsonObj, delimiters) {
  10126. if (!formater) {
  10127. formater = new BaseFormatter();
  10128. }
  10129. return walkJsonObj(jsonObj, function (jsonObj, key) {
  10130. var value = jsonObj[key];
  10131. if (isString(value)) {
  10132. if (isI18nStr(value, delimiters)) {
  10133. return true;
  10134. }
  10135. } else
  10136. {
  10137. return hasI18nJson(value, delimiters);
  10138. }
  10139. });
  10140. }
  10141. function parseI18nJson(jsonObj, values, delimiters) {
  10142. if (!formater) {
  10143. formater = new BaseFormatter();
  10144. }
  10145. walkJsonObj(jsonObj, function (jsonObj, key) {
  10146. var value = jsonObj[key];
  10147. if (isString(value)) {
  10148. if (isI18nStr(value, delimiters)) {
  10149. jsonObj[key] = compileStr(value, values, delimiters);
  10150. }
  10151. } else
  10152. {
  10153. parseI18nJson(value, values, delimiters);
  10154. }
  10155. });
  10156. return jsonObj;
  10157. }
  10158. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  10159. if (!isI18nStr(jsonStr, delimiters)) {
  10160. return jsonStr;
  10161. }
  10162. if (!formater) {
  10163. formater = new BaseFormatter();
  10164. }
  10165. var localeValues = [];
  10166. Object.keys(locales).forEach(function (name) {
  10167. if (name !== locale) {
  10168. localeValues.push({
  10169. locale: name,
  10170. values: locales[name] });
  10171. }
  10172. });
  10173. localeValues.unshift({ locale: locale, values: locales[locale] });
  10174. try {
  10175. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  10176. }
  10177. catch (e) {}
  10178. return jsonStr;
  10179. }
  10180. function isI18nStr(value, delimiters) {
  10181. return value.indexOf(delimiters[0]) > -1;
  10182. }
  10183. function compileStr(value, values, delimiters) {
  10184. return formater.interpolate(value, values, delimiters).join('');
  10185. }
  10186. function compileValue(jsonObj, key, localeValues, delimiters) {
  10187. var value = jsonObj[key];
  10188. if (isString(value)) {
  10189. // 存在国际化
  10190. if (isI18nStr(value, delimiters)) {
  10191. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  10192. if (localeValues.length > 1) {
  10193. // 格式化国际化语言
  10194. var valueLocales = jsonObj[key + 'Locales'] = {};
  10195. localeValues.forEach(function (localValue) {
  10196. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  10197. });
  10198. }
  10199. }
  10200. } else
  10201. {
  10202. compileJsonObj(value, localeValues, delimiters);
  10203. }
  10204. }
  10205. function compileJsonObj(jsonObj, localeValues, delimiters) {
  10206. walkJsonObj(jsonObj, function (jsonObj, key) {
  10207. compileValue(jsonObj, key, localeValues, delimiters);
  10208. });
  10209. return jsonObj;
  10210. }
  10211. function walkJsonObj(jsonObj, walk) {
  10212. if (isArray(jsonObj)) {
  10213. for (var i = 0; i < jsonObj.length; i++) {
  10214. if (walk(jsonObj, i)) {
  10215. return true;
  10216. }
  10217. }
  10218. } else
  10219. if (isObject(jsonObj)) {
  10220. for (var key in jsonObj) {
  10221. if (walk(jsonObj, key)) {
  10222. return true;
  10223. }
  10224. }
  10225. }
  10226. return false;
  10227. }
  10228. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10229. /***/ }),
  10230. /***/ 44:
  10231. /*!************************************************************!*\
  10232. !*** C:/Users/first/Desktop/公司/applets/util/permission.js ***!
  10233. \************************************************************/
  10234. /*! no static exports found */
  10235. /***/ (function(module, exports, __webpack_require__) {
  10236. "use strict";
  10237. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = _default;var _index = _interopRequireDefault(__webpack_require__(/*! ../store/index.js */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10238. function _default() {
  10239. if (_index.default.state.user.userInfo.nickName === undefined) {
  10240. uni.navigateTo({
  10241. url: "/pages/authen/identity" });
  10242. return false;
  10243. }
  10244. if (_index.default.state.user.phoneNumber === '' || _index.default.state.user.openId === '' || _index.default.state.user.unionId === '') {
  10245. uni.navigateTo({
  10246. url: "/pages/authen/login" });
  10247. return false;
  10248. }
  10249. return true;
  10250. }
  10251. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10252. /***/ }),
  10253. /***/ 5:
  10254. /*!****************************************************!*\
  10255. !*** C:/Users/first/Desktop/公司/applets/pages.json ***!
  10256. \****************************************************/
  10257. /*! no static exports found */
  10258. /***/ (function(module, exports) {
  10259. /***/ }),
  10260. /***/ 6:
  10261. /*!*******************************************************!*\
  10262. !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
  10263. \*******************************************************/
  10264. /*! no static exports found */
  10265. /***/ (function(module, exports, __webpack_require__) {
  10266. "use strict";
  10267. /* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 7);function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _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;}
  10268. var STAT_VERSION = _package.version;
  10269. var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
  10270. var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
  10271. var PAGE_PVER_TIME = 1800;
  10272. var APP_PVER_TIME = 300;
  10273. var OPERATING_TIME = 10;
  10274. var DIFF_TIME = 60 * 1000 * 60 * 24;
  10275. var statConfig = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
  10276. var UUID_KEY = '__DC_STAT_UUID';
  10277. var UUID_VALUE = '__DC_UUID_VALUE';
  10278. function getUuid() {
  10279. var uuid = '';
  10280. if (getPlatformName() === 'n') {
  10281. try {
  10282. uuid = plus.runtime.getDCloudId();
  10283. } catch (e) {
  10284. uuid = '';
  10285. }
  10286. return uuid;
  10287. }
  10288. try {
  10289. uuid = uni.getStorageSync(UUID_KEY);
  10290. } catch (e) {
  10291. uuid = UUID_VALUE;
  10292. }
  10293. if (!uuid) {
  10294. uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
  10295. try {
  10296. uni.setStorageSync(UUID_KEY, uuid);
  10297. } catch (e) {
  10298. uni.setStorageSync(UUID_KEY, UUID_VALUE);
  10299. }
  10300. }
  10301. return uuid;
  10302. }
  10303. var getSgin = function getSgin(statData) {
  10304. var arr = Object.keys(statData);
  10305. var sortArr = arr.sort();
  10306. var sgin = {};
  10307. var sginStr = '';
  10308. for (var i in sortArr) {
  10309. sgin[sortArr[i]] = statData[sortArr[i]];
  10310. sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
  10311. }
  10312. // const options = sginStr.substr(0, sginStr.length - 1)
  10313. // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
  10314. // const si = crypto.createHash('md5').update(sginStr).digest('hex');
  10315. return {
  10316. sign: '',
  10317. options: sginStr.substr(0, sginStr.length - 1) };
  10318. };
  10319. var getSplicing = function getSplicing(data) {
  10320. var str = '';
  10321. for (var i in data) {
  10322. str += i + '=' + data[i] + '&';
  10323. }
  10324. return str.substr(0, str.length - 1);
  10325. };
  10326. var getTime = function getTime() {
  10327. return parseInt(new Date().getTime() / 1000);
  10328. };
  10329. var getPlatformName = function getPlatformName() {var _platformList;
  10330. var aliArr = ['y', 'a', 'p', 'mp-ali'];
  10331. var platformList = (_platformList = {
  10332. 'app-plus': 'n',
  10333. 'h5': 'h5',
  10334. 'mp-weixin': 'wx' }, _defineProperty(_platformList,
  10335. aliArr.reverse().join(''), 'ali'), _defineProperty(_platformList,
  10336. 'mp-baidu', 'bd'), _defineProperty(_platformList,
  10337. 'mp-toutiao', 'tt'), _defineProperty(_platformList,
  10338. 'mp-qq', 'qq'), _defineProperty(_platformList,
  10339. 'quickapp-native', 'qn'), _defineProperty(_platformList,
  10340. 'mp-kuaishou', 'ks'), _platformList);
  10341. return platformList["mp-weixin"];
  10342. };
  10343. var getPackName = function getPackName() {
  10344. var packName = '';
  10345. if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
  10346. // 兼容微信小程序低版本基础库
  10347. if (uni.canIUse('getAccountInfoSync')) {
  10348. packName = uni.getAccountInfoSync().miniProgram.appId || '';
  10349. }
  10350. }
  10351. return packName;
  10352. };
  10353. var getVersion = function getVersion() {
  10354. return getPlatformName() === 'n' ? plus.runtime.version : '';
  10355. };
  10356. var getChannel = function getChannel() {
  10357. var platformName = getPlatformName();
  10358. var channel = '';
  10359. if (platformName === 'n') {
  10360. channel = plus.runtime.channel;
  10361. }
  10362. return channel;
  10363. };
  10364. var getScene = function getScene(options) {
  10365. var platformName = getPlatformName();
  10366. var scene = '';
  10367. if (options) {
  10368. return options;
  10369. }
  10370. if (platformName === 'wx') {
  10371. scene = uni.getLaunchOptionsSync().scene;
  10372. }
  10373. return scene;
  10374. };
  10375. var First__Visit__Time__KEY = 'First__Visit__Time';
  10376. var Last__Visit__Time__KEY = 'Last__Visit__Time';
  10377. var getFirstVisitTime = function getFirstVisitTime() {
  10378. var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
  10379. var time = 0;
  10380. if (timeStorge) {
  10381. time = timeStorge;
  10382. } else {
  10383. time = getTime();
  10384. uni.setStorageSync(First__Visit__Time__KEY, time);
  10385. uni.removeStorageSync(Last__Visit__Time__KEY);
  10386. }
  10387. return time;
  10388. };
  10389. var getLastVisitTime = function getLastVisitTime() {
  10390. var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
  10391. var time = 0;
  10392. if (timeStorge) {
  10393. time = timeStorge;
  10394. } else {
  10395. time = '';
  10396. }
  10397. uni.setStorageSync(Last__Visit__Time__KEY, getTime());
  10398. return time;
  10399. };
  10400. var PAGE_RESIDENCE_TIME = '__page__residence__time';
  10401. var First_Page_residence_time = 0;
  10402. var Last_Page_residence_time = 0;
  10403. var setPageResidenceTime = function setPageResidenceTime() {
  10404. First_Page_residence_time = getTime();
  10405. if (getPlatformName() === 'n') {
  10406. uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
  10407. }
  10408. return First_Page_residence_time;
  10409. };
  10410. var getPageResidenceTime = function getPageResidenceTime() {
  10411. Last_Page_residence_time = getTime();
  10412. if (getPlatformName() === 'n') {
  10413. First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
  10414. }
  10415. return Last_Page_residence_time - First_Page_residence_time;
  10416. };
  10417. var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
  10418. var getTotalVisitCount = function getTotalVisitCount() {
  10419. var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
  10420. var count = 1;
  10421. if (timeStorge) {
  10422. count = timeStorge;
  10423. count++;
  10424. }
  10425. uni.setStorageSync(TOTAL__VISIT__COUNT, count);
  10426. return count;
  10427. };
  10428. var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
  10429. var data = {};
  10430. for (var prop in statData) {
  10431. data[prop] = encodeURIComponent(statData[prop]);
  10432. }
  10433. return data;
  10434. };
  10435. var Set__First__Time = 0;
  10436. var Set__Last__Time = 0;
  10437. var getFirstTime = function getFirstTime() {
  10438. var time = new Date().getTime();
  10439. Set__First__Time = time;
  10440. Set__Last__Time = 0;
  10441. return time;
  10442. };
  10443. var getLastTime = function getLastTime() {
  10444. var time = new Date().getTime();
  10445. Set__Last__Time = time;
  10446. return time;
  10447. };
  10448. var getResidenceTime = function getResidenceTime(type) {
  10449. var residenceTime = 0;
  10450. if (Set__First__Time !== 0) {
  10451. residenceTime = Set__Last__Time - Set__First__Time;
  10452. }
  10453. residenceTime = parseInt(residenceTime / 1000);
  10454. residenceTime = residenceTime < 1 ? 1 : residenceTime;
  10455. if (type === 'app') {
  10456. var overtime = residenceTime > APP_PVER_TIME ? true : false;
  10457. return {
  10458. residenceTime: residenceTime,
  10459. overtime: overtime };
  10460. }
  10461. if (type === 'page') {
  10462. var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
  10463. return {
  10464. residenceTime: residenceTime,
  10465. overtime: _overtime };
  10466. }
  10467. return {
  10468. residenceTime: residenceTime };
  10469. };
  10470. var getRoute = function getRoute() {
  10471. var pages = getCurrentPages();
  10472. var page = pages[pages.length - 1];
  10473. if (!page) return '';
  10474. var _self = page.$vm;
  10475. if (getPlatformName() === 'bd') {
  10476. return _self.$mp && _self.$mp.page.is;
  10477. } else {
  10478. return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
  10479. }
  10480. };
  10481. var getPageRoute = function getPageRoute(self) {
  10482. var pages = getCurrentPages();
  10483. var page = pages[pages.length - 1];
  10484. if (!page) return '';
  10485. var _self = page.$vm;
  10486. var query = self._query;
  10487. var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
  10488. // clear
  10489. self._query = '';
  10490. if (getPlatformName() === 'bd') {
  10491. return _self.$mp && _self.$mp.page.is + str;
  10492. } else {
  10493. return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
  10494. }
  10495. };
  10496. var getPageTypes = function getPageTypes(self) {
  10497. if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
  10498. return true;
  10499. }
  10500. return false;
  10501. };
  10502. var calibration = function calibration(eventName, options) {
  10503. // login 、 share 、pay_success 、pay_fail 、register 、title
  10504. if (!eventName) {
  10505. console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
  10506. return true;
  10507. }
  10508. if (typeof eventName !== 'string') {
  10509. console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
  10510. return true;
  10511. }
  10512. if (eventName.length > 255) {
  10513. console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  10514. return true;
  10515. }
  10516. if (typeof options !== 'string' && typeof options !== 'object') {
  10517. console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
  10518. return true;
  10519. }
  10520. if (typeof options === 'string' && options.length > 255) {
  10521. console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  10522. return true;
  10523. }
  10524. if (eventName === 'title' && typeof options !== 'string') {
  10525. console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
  10526. return true;
  10527. }
  10528. };
  10529. var Report_Data_Time = 'Report_Data_Time';
  10530. var Report_Status = 'Report_Status';
  10531. var isReportData = function isReportData() {
  10532. return new Promise(function (resolve, reject) {
  10533. var start_time = '';
  10534. var end_time = new Date().getTime();
  10535. var diff_time = DIFF_TIME;
  10536. var report_status = 1;
  10537. try {
  10538. start_time = uni.getStorageSync(Report_Data_Time);
  10539. report_status = uni.getStorageSync(Report_Status);
  10540. } catch (e) {
  10541. start_time = '';
  10542. report_status = 1;
  10543. }
  10544. if (report_status === '') {
  10545. requestData(function (_ref)
  10546. {var enable = _ref.enable;
  10547. uni.setStorageSync(Report_Data_Time, end_time);
  10548. uni.setStorageSync(Report_Status, enable);
  10549. if (enable === 1) {
  10550. resolve();
  10551. }
  10552. });
  10553. return;
  10554. }
  10555. if (report_status === 1) {
  10556. resolve();
  10557. }
  10558. if (!start_time) {
  10559. uni.setStorageSync(Report_Data_Time, end_time);
  10560. start_time = end_time;
  10561. }
  10562. if (end_time - start_time > diff_time) {
  10563. requestData(function (_ref2)
  10564. {var enable = _ref2.enable;
  10565. uni.setStorageSync(Report_Data_Time, end_time);
  10566. uni.setStorageSync(Report_Status, enable);
  10567. });
  10568. }
  10569. });
  10570. };
  10571. var requestData = function requestData(done) {
  10572. var formData = {
  10573. usv: STAT_VERSION,
  10574. conf: JSON.stringify({
  10575. ak: statConfig.appid }) };
  10576. uni.request({
  10577. url: STAT_URL,
  10578. method: 'GET',
  10579. data: formData,
  10580. success: function success(res) {var
  10581. data =
  10582. res.data;
  10583. if (data.ret === 0) {
  10584. typeof done === 'function' && done({
  10585. enable: data.enable });
  10586. }
  10587. },
  10588. fail: function fail(e) {
  10589. var report_status_code = 1;
  10590. try {
  10591. report_status_code = uni.getStorageSync(Report_Status);
  10592. } catch (e) {
  10593. report_status_code = 1;
  10594. }
  10595. if (report_status_code === '') {
  10596. report_status_code = 1;
  10597. }
  10598. typeof done === 'function' && done({
  10599. enable: report_status_code });
  10600. } });
  10601. };
  10602. var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 9).default;
  10603. var statConfig$1 = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
  10604. var resultOptions = uni.getSystemInfoSync();var
  10605. Util = /*#__PURE__*/function () {
  10606. function Util() {_classCallCheck(this, Util);
  10607. this.self = '';
  10608. this._retry = 0;
  10609. this._platform = '';
  10610. this._query = {};
  10611. this._navigationBarTitle = {
  10612. config: '',
  10613. page: '',
  10614. report: '',
  10615. lt: '' };
  10616. this._operatingTime = 0;
  10617. this._reportingRequestData = {
  10618. '1': [],
  10619. '11': [] };
  10620. this.__prevent_triggering = false;
  10621. this.__licationHide = false;
  10622. this.__licationShow = false;
  10623. this._lastPageRoute = '';
  10624. this.statData = {
  10625. uuid: getUuid(),
  10626. ut: getPlatformName(),
  10627. mpn: getPackName(),
  10628. ak: statConfig$1.appid,
  10629. usv: STAT_VERSION,
  10630. v: getVersion(),
  10631. ch: getChannel(),
  10632. cn: '',
  10633. pn: '',
  10634. ct: '',
  10635. t: getTime(),
  10636. tt: '',
  10637. p: resultOptions.platform === 'android' ? 'a' : 'i',
  10638. brand: resultOptions.brand || '',
  10639. md: resultOptions.model,
  10640. sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
  10641. mpsdk: resultOptions.SDKVersion || '',
  10642. mpv: resultOptions.version || '',
  10643. lang: resultOptions.language,
  10644. pr: resultOptions.pixelRatio,
  10645. ww: resultOptions.windowWidth,
  10646. wh: resultOptions.windowHeight,
  10647. sw: resultOptions.screenWidth,
  10648. sh: resultOptions.screenHeight };
  10649. }_createClass(Util, [{ key: "getIsReportData", value: function getIsReportData()
  10650. {
  10651. return isReportData();
  10652. } }, { key: "_applicationShow", value: function _applicationShow()
  10653. {
  10654. if (this.__licationHide) {
  10655. getLastTime();
  10656. var time = getResidenceTime('app');
  10657. if (time.overtime) {
  10658. var options = {
  10659. path: this._lastPageRoute,
  10660. scene: this.statData.sc };
  10661. this._sendReportRequest(options);
  10662. }
  10663. this.__licationHide = false;
  10664. }
  10665. } }, { key: "_applicationHide", value: function _applicationHide(
  10666. self, type) {
  10667. this.__licationHide = true;
  10668. getLastTime();
  10669. var time = getResidenceTime();
  10670. getFirstTime();
  10671. var route = getPageRoute(this);
  10672. this._sendHideRequest({
  10673. urlref: route,
  10674. urlref_ts: time.residenceTime },
  10675. type);
  10676. } }, { key: "_pageShow", value: function _pageShow()
  10677. {
  10678. var route = getPageRoute(this);
  10679. var routepath = getRoute();
  10680. this._navigationBarTitle.config = PagesJson &&
  10681. PagesJson.pages[routepath] &&
  10682. PagesJson.pages[routepath].titleNView &&
  10683. PagesJson.pages[routepath].titleNView.titleText ||
  10684. PagesJson &&
  10685. PagesJson.pages[routepath] &&
  10686. PagesJson.pages[routepath].navigationBarTitleText || '';
  10687. if (this.__licationShow) {
  10688. getFirstTime();
  10689. this.__licationShow = false;
  10690. // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
  10691. this._lastPageRoute = route;
  10692. return;
  10693. }
  10694. getLastTime();
  10695. this._lastPageRoute = route;
  10696. var time = getResidenceTime('page');
  10697. if (time.overtime) {
  10698. var options = {
  10699. path: this._lastPageRoute,
  10700. scene: this.statData.sc };
  10701. this._sendReportRequest(options);
  10702. }
  10703. getFirstTime();
  10704. } }, { key: "_pageHide", value: function _pageHide()
  10705. {
  10706. if (!this.__licationHide) {
  10707. getLastTime();
  10708. var time = getResidenceTime('page');
  10709. this._sendPageRequest({
  10710. url: this._lastPageRoute,
  10711. urlref: this._lastPageRoute,
  10712. urlref_ts: time.residenceTime });
  10713. this._navigationBarTitle = {
  10714. config: '',
  10715. page: '',
  10716. report: '',
  10717. lt: '' };
  10718. return;
  10719. }
  10720. } }, { key: "_login", value: function _login()
  10721. {
  10722. this._sendEventRequest({
  10723. key: 'login' },
  10724. 0);
  10725. } }, { key: "_share", value: function _share()
  10726. {
  10727. this._sendEventRequest({
  10728. key: 'share' },
  10729. 0);
  10730. } }, { key: "_payment", value: function _payment(
  10731. key) {
  10732. this._sendEventRequest({
  10733. key: key },
  10734. 0);
  10735. } }, { key: "_sendReportRequest", value: function _sendReportRequest(
  10736. options) {
  10737. this._navigationBarTitle.lt = '1';
  10738. var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
  10739. this.statData.lt = '1';
  10740. this.statData.url = options.path + query || '';
  10741. this.statData.t = getTime();
  10742. this.statData.sc = getScene(options.scene);
  10743. this.statData.fvts = getFirstVisitTime();
  10744. this.statData.lvts = getLastVisitTime();
  10745. this.statData.tvc = getTotalVisitCount();
  10746. if (getPlatformName() === 'n') {
  10747. this.getProperty();
  10748. } else {
  10749. this.getNetworkInfo();
  10750. }
  10751. } }, { key: "_sendPageRequest", value: function _sendPageRequest(
  10752. opt) {var
  10753. url =
  10754. opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
  10755. this._navigationBarTitle.lt = '11';
  10756. var options = {
  10757. ak: this.statData.ak,
  10758. uuid: this.statData.uuid,
  10759. lt: '11',
  10760. ut: this.statData.ut,
  10761. url: url,
  10762. tt: this.statData.tt,
  10763. urlref: urlref,
  10764. urlref_ts: urlref_ts,
  10765. ch: this.statData.ch,
  10766. usv: this.statData.usv,
  10767. t: getTime(),
  10768. p: this.statData.p };
  10769. this.request(options);
  10770. } }, { key: "_sendHideRequest", value: function _sendHideRequest(
  10771. opt, type) {var
  10772. urlref =
  10773. opt.urlref,urlref_ts = opt.urlref_ts;
  10774. var options = {
  10775. ak: this.statData.ak,
  10776. uuid: this.statData.uuid,
  10777. lt: '3',
  10778. ut: this.statData.ut,
  10779. urlref: urlref,
  10780. urlref_ts: urlref_ts,
  10781. ch: this.statData.ch,
  10782. usv: this.statData.usv,
  10783. t: getTime(),
  10784. p: this.statData.p };
  10785. this.request(options, type);
  10786. } }, { key: "_sendEventRequest", value: function _sendEventRequest()
  10787. {var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref3$key = _ref3.key,key = _ref3$key === void 0 ? '' : _ref3$key,_ref3$value = _ref3.value,value = _ref3$value === void 0 ? "" : _ref3$value;
  10788. var route = this._lastPageRoute;
  10789. var options = {
  10790. ak: this.statData.ak,
  10791. uuid: this.statData.uuid,
  10792. lt: '21',
  10793. ut: this.statData.ut,
  10794. url: route,
  10795. ch: this.statData.ch,
  10796. e_n: key,
  10797. e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
  10798. usv: this.statData.usv,
  10799. t: getTime(),
  10800. p: this.statData.p };
  10801. this.request(options);
  10802. } }, { key: "getNetworkInfo", value: function getNetworkInfo()
  10803. {var _this = this;
  10804. uni.getNetworkType({
  10805. success: function success(result) {
  10806. _this.statData.net = result.networkType;
  10807. _this.getLocation();
  10808. } });
  10809. } }, { key: "getProperty", value: function getProperty()
  10810. {var _this2 = this;
  10811. plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
  10812. _this2.statData.v = wgtinfo.version || '';
  10813. _this2.getNetworkInfo();
  10814. });
  10815. } }, { key: "getLocation", value: function getLocation()
  10816. {var _this3 = this;
  10817. if (statConfig$1.getLocation) {
  10818. uni.getLocation({
  10819. type: 'wgs84',
  10820. geocode: true,
  10821. success: function success(result) {
  10822. if (result.address) {
  10823. _this3.statData.cn = result.address.country;
  10824. _this3.statData.pn = result.address.province;
  10825. _this3.statData.ct = result.address.city;
  10826. }
  10827. _this3.statData.lat = result.latitude;
  10828. _this3.statData.lng = result.longitude;
  10829. _this3.request(_this3.statData);
  10830. } });
  10831. } else {
  10832. this.statData.lat = 0;
  10833. this.statData.lng = 0;
  10834. this.request(this.statData);
  10835. }
  10836. } }, { key: "request", value: function request(
  10837. data, type) {var _this4 = this;
  10838. var time = getTime();
  10839. var title = this._navigationBarTitle;
  10840. data.ttn = title.page;
  10841. data.ttpj = title.config;
  10842. data.ttc = title.report;
  10843. var requestData = this._reportingRequestData;
  10844. if (getPlatformName() === 'n') {
  10845. requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
  10846. }
  10847. if (!requestData[data.lt]) {
  10848. requestData[data.lt] = [];
  10849. }
  10850. requestData[data.lt].push(data);
  10851. if (getPlatformName() === 'n') {
  10852. uni.setStorageSync('__UNI__STAT__DATA', requestData);
  10853. }
  10854. if (getPageResidenceTime() < OPERATING_TIME && !type) {
  10855. return;
  10856. }
  10857. var uniStatData = this._reportingRequestData;
  10858. if (getPlatformName() === 'n') {
  10859. uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
  10860. }
  10861. // 时间超过,重新获取时间戳
  10862. setPageResidenceTime();
  10863. var firstArr = [];
  10864. var contentArr = [];
  10865. var lastArr = [];var _loop = function _loop(
  10866. i) {
  10867. var rd = uniStatData[i];
  10868. rd.forEach(function (elm) {
  10869. var newData = getSplicing(elm);
  10870. if (i === 0) {
  10871. firstArr.push(newData);
  10872. } else if (i === 3) {
  10873. lastArr.push(newData);
  10874. } else {
  10875. contentArr.push(newData);
  10876. }
  10877. });};for (var i in uniStatData) {_loop(i);
  10878. }
  10879. firstArr.push.apply(firstArr, contentArr.concat(lastArr));
  10880. var optionsData = {
  10881. usv: STAT_VERSION, //统计 SDK 版本号
  10882. t: time, //发送请求时的时间戮
  10883. requests: JSON.stringify(firstArr) };
  10884. this._reportingRequestData = {};
  10885. if (getPlatformName() === 'n') {
  10886. uni.removeStorageSync('__UNI__STAT__DATA');
  10887. }
  10888. if (data.ut === 'h5') {
  10889. this.imageRequest(optionsData);
  10890. return;
  10891. }
  10892. if (getPlatformName() === 'n' && this.statData.p === 'a') {
  10893. setTimeout(function () {
  10894. _this4._sendRequest(optionsData);
  10895. }, 200);
  10896. return;
  10897. }
  10898. this._sendRequest(optionsData);
  10899. } }, { key: "_sendRequest", value: function _sendRequest(
  10900. optionsData) {var _this5 = this;
  10901. this.getIsReportData().then(function () {
  10902. uni.request({
  10903. url: STAT_URL,
  10904. method: 'POST',
  10905. // header: {
  10906. // 'content-type': 'application/json' // 默认值
  10907. // },
  10908. data: optionsData,
  10909. success: function success() {
  10910. // if (process.env.NODE_ENV === 'development') {
  10911. // console.log('stat request success');
  10912. // }
  10913. },
  10914. fail: function fail(e) {
  10915. if (++_this5._retry < 3) {
  10916. setTimeout(function () {
  10917. _this5._sendRequest(optionsData);
  10918. }, 1000);
  10919. }
  10920. } });
  10921. });
  10922. }
  10923. /**
  10924. * h5 请求
  10925. */ }, { key: "imageRequest", value: function imageRequest(
  10926. data) {
  10927. this.getIsReportData().then(function () {
  10928. var image = new Image();
  10929. var options = getSgin(GetEncodeURIComponentOptions(data)).options;
  10930. image.src = STAT_H5_URL + '?' + options;
  10931. });
  10932. } }, { key: "sendEvent", value: function sendEvent(
  10933. key, value) {
  10934. // 校验 type 参数
  10935. if (calibration(key, value)) return;
  10936. if (key === 'title') {
  10937. this._navigationBarTitle.report = value;
  10938. return;
  10939. }
  10940. this._sendEventRequest({
  10941. key: key,
  10942. value: typeof value === 'object' ? JSON.stringify(value) : value },
  10943. 1);
  10944. } }]);return Util;}();var
  10945. Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);var _super = _createSuper(Stat);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
  10946. {
  10947. if (!this.instance) {
  10948. this.instance = new Stat();
  10949. }
  10950. return this.instance;
  10951. } }]);
  10952. function Stat() {var _this6;_classCallCheck(this, Stat);
  10953. _this6 = _super.call(this);
  10954. _this6.instance = null;
  10955. // 注册拦截器
  10956. if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
  10957. _this6.addInterceptorInit();
  10958. _this6.interceptLogin();
  10959. _this6.interceptShare(true);
  10960. _this6.interceptRequestPayment();
  10961. }return _this6;
  10962. }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
  10963. {
  10964. var self = this;
  10965. uni.addInterceptor('setNavigationBarTitle', {
  10966. invoke: function invoke(args) {
  10967. self._navigationBarTitle.page = args.title;
  10968. } });
  10969. } }, { key: "interceptLogin", value: function interceptLogin()
  10970. {
  10971. var self = this;
  10972. uni.addInterceptor('login', {
  10973. complete: function complete() {
  10974. self._login();
  10975. } });
  10976. } }, { key: "interceptShare", value: function interceptShare(
  10977. type) {
  10978. var self = this;
  10979. if (!type) {
  10980. self._share();
  10981. return;
  10982. }
  10983. uni.addInterceptor('share', {
  10984. success: function success() {
  10985. self._share();
  10986. },
  10987. fail: function fail() {
  10988. self._share();
  10989. } });
  10990. } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
  10991. {
  10992. var self = this;
  10993. uni.addInterceptor('requestPayment', {
  10994. success: function success() {
  10995. self._payment('pay_success');
  10996. },
  10997. fail: function fail() {
  10998. self._payment('pay_fail');
  10999. } });
  11000. } }, { key: "report", value: function report(
  11001. options, self) {
  11002. this.self = self;
  11003. // if (process.env.NODE_ENV === 'development') {
  11004. // console.log('report init');
  11005. // }
  11006. setPageResidenceTime();
  11007. this.__licationShow = true;
  11008. this._sendReportRequest(options, true);
  11009. } }, { key: "load", value: function load(
  11010. options, self) {
  11011. if (!self.$scope && !self.$mp) {
  11012. var page = getCurrentPages();
  11013. self.$scope = page[page.length - 1];
  11014. }
  11015. this.self = self;
  11016. this._query = options;
  11017. } }, { key: "show", value: function show(
  11018. self) {
  11019. this.self = self;
  11020. if (getPageTypes(self)) {
  11021. this._pageShow(self);
  11022. } else {
  11023. this._applicationShow(self);
  11024. }
  11025. } }, { key: "ready", value: function ready(
  11026. self) {
  11027. // this.self = self;
  11028. // if (getPageTypes(self)) {
  11029. // this._pageShow(self);
  11030. // }
  11031. } }, { key: "hide", value: function hide(
  11032. self) {
  11033. this.self = self;
  11034. if (getPageTypes(self)) {
  11035. this._pageHide(self);
  11036. } else {
  11037. this._applicationHide(self, true);
  11038. }
  11039. } }, { key: "error", value: function error(
  11040. em) {
  11041. if (this._platform === 'devtools') {
  11042. if (true) {
  11043. console.info('当前运行环境为开发者工具,不上报数据。');
  11044. }
  11045. // return;
  11046. }
  11047. var emVal = '';
  11048. if (!em.message) {
  11049. emVal = JSON.stringify(em);
  11050. } else {
  11051. emVal = em.stack;
  11052. }
  11053. var options = {
  11054. ak: this.statData.ak,
  11055. uuid: this.statData.uuid,
  11056. lt: '31',
  11057. ut: this.statData.ut,
  11058. ch: this.statData.ch,
  11059. mpsdk: this.statData.mpsdk,
  11060. mpv: this.statData.mpv,
  11061. v: this.statData.v,
  11062. em: emVal,
  11063. usv: this.statData.usv,
  11064. t: getTime(),
  11065. p: this.statData.p };
  11066. this.request(options);
  11067. } }]);return Stat;}(Util);
  11068. var stat = Stat.getInstance();
  11069. var isHide = false;
  11070. var lifecycle = {
  11071. onLaunch: function onLaunch(options) {
  11072. stat.report(options, this);
  11073. },
  11074. onReady: function onReady() {
  11075. stat.ready(this);
  11076. },
  11077. onLoad: function onLoad(options) {
  11078. stat.load(options, this);
  11079. // 重写分享,获取分享上报事件
  11080. if (this.$scope && this.$scope.onShareAppMessage) {
  11081. var oldShareAppMessage = this.$scope.onShareAppMessage;
  11082. this.$scope.onShareAppMessage = function (options) {
  11083. stat.interceptShare(false);
  11084. return oldShareAppMessage.call(this, options);
  11085. };
  11086. }
  11087. },
  11088. onShow: function onShow() {
  11089. isHide = false;
  11090. stat.show(this);
  11091. },
  11092. onHide: function onHide() {
  11093. isHide = true;
  11094. stat.hide(this);
  11095. },
  11096. onUnload: function onUnload() {
  11097. if (isHide) {
  11098. isHide = false;
  11099. return;
  11100. }
  11101. stat.hide(this);
  11102. },
  11103. onError: function onError(e) {
  11104. stat.error(e);
  11105. } };
  11106. function main() {
  11107. if (true) {
  11108. uni.report = function (type, options) {};
  11109. } else { var Vue; }
  11110. }
  11111. main();
  11112. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11113. /***/ }),
  11114. /***/ 7:
  11115. /*!******************************************************!*\
  11116. !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
  11117. \******************************************************/
  11118. /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, deprecated, description, devDependencies, files, gitHead, homepage, license, main, name, repository, scripts, version, default */
  11119. /***/ (function(module) {
  11120. module.exports = JSON.parse("{\"_from\":\"@dcloudio/uni-stat@next\",\"_id\":\"@dcloudio/uni-stat@2.0.0-32920210926001\",\"_inBundle\":false,\"_integrity\":\"sha512-bVqddjV0ee/Mr9QRHocrer928xApKiwFCqFaDwc6DDshm0njr/l2CvGAdvJZybf3sG5W6+WVE/KOqMFX0UElYg==\",\"_location\":\"/@dcloudio/uni-stat\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"@dcloudio/uni-stat@next\",\"name\":\"@dcloudio/uni-stat\",\"escapedName\":\"@dcloudio%2funi-stat\",\"scope\":\"@dcloudio\",\"rawSpec\":\"next\",\"saveSpec\":null,\"fetchSpec\":\"next\"},\"_requiredBy\":[\"#USER\",\"/\",\"/@dcloudio/vue-cli-plugin-uni\"],\"_resolved\":\"https://registry.npmjs.org/@dcloudio/uni-stat/-/uni-stat-2.0.0-32920210926001.tgz\",\"_shasum\":\"99e890392781b5ab18d6b40c7031da9462038d64\",\"_spec\":\"@dcloudio/uni-stat@next\",\"_where\":\"/Users/guoshengqiang/Documents/dcloud-plugins-new/release/uniapp-cli\",\"author\":\"\",\"bugs\":{\"url\":\"https://github.com/dcloudio/uni-app/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"\",\"devDependencies\":{\"@babel/core\":\"^7.5.5\",\"@babel/preset-env\":\"^7.5.5\",\"eslint\":\"^6.1.0\",\"rollup\":\"^1.19.3\",\"rollup-plugin-babel\":\"^4.3.3\",\"rollup-plugin-clear\":\"^2.0.7\",\"rollup-plugin-commonjs\":\"^10.0.2\",\"rollup-plugin-copy\":\"^3.1.0\",\"rollup-plugin-eslint\":\"^7.0.0\",\"rollup-plugin-json\":\"^4.0.0\",\"rollup-plugin-node-resolve\":\"^5.2.0\",\"rollup-plugin-replace\":\"^2.2.0\",\"rollup-plugin-uglify\":\"^6.0.2\"},\"files\":[\"dist\",\"package.json\",\"LICENSE\"],\"gitHead\":\"5e7404fe087c97dfc46bfa7b0ab9044a2fa90142\",\"homepage\":\"https://github.com/dcloudio/uni-app#readme\",\"license\":\"Apache-2.0\",\"main\":\"dist/index.js\",\"name\":\"@dcloudio/uni-stat\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/dcloudio/uni-app.git\",\"directory\":\"packages/uni-stat\"},\"scripts\":{\"build\":\"NODE_ENV=production rollup -c rollup.config.js\",\"dev\":\"NODE_ENV=development rollup -w -c rollup.config.js\"},\"version\":\"2.0.0-32920210926001\"}");
  11121. /***/ }),
  11122. /***/ 8:
  11123. /*!********************************************************************!*\
  11124. !*** C:/Users/first/Desktop/公司/applets/pages.json?{"type":"stat"} ***!
  11125. \********************************************************************/
  11126. /*! no static exports found */
  11127. /***/ (function(module, exports, __webpack_require__) {
  11128. "use strict";
  11129. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__BAF74FD" };exports.default = _default;
  11130. /***/ }),
  11131. /***/ 9:
  11132. /*!*********************************************************************!*\
  11133. !*** C:/Users/first/Desktop/公司/applets/pages.json?{"type":"style"} ***!
  11134. \*********************************************************************/
  11135. /*! no static exports found */
  11136. /***/ (function(module, exports, __webpack_require__) {
  11137. "use strict";
  11138. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/list/list": { "navigationBarTitleText": "油站列表", "enablePullDownRefresh": false }, "pages/index/index": { "navigationBarTitleText": "一键加油" }, "pages/test/test": { "navigationBarTitleText": "测试页", "enablePullDownRefresh": false }, "pages/succeed/succeed": { "navigationBarTitleText": "支付成功", "enablePullDownRefresh": false }, "pages/authen/identity": { "navigationBarTitleText": "请求授权", "enablePullDownRefresh": false }, "pages/authen/login": { "navigationBarTitleText": "登录", "enablePullDownRefresh": false }, "pages/confirm/confirm": { "navigationBarTitleText": "订单确认", "enablePullDownRefresh": false }, "pages/skip/skip": { "navigationBarTitleText": "跳转中", "enablePullDownRefresh": false } }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } };exports.default = _default;
  11139. /***/ })
  11140. }]);
  11141. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map