vendor.js 498 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  14. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  15. return this;
  16. }();
  17. var key = ['w', 'x'].join('');
  18. var oldWx = target[key];
  19. function isWxKey(key) {
  20. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  21. }
  22. function initWx() {
  23. var newWx = {};
  24. for (var _key in oldWx) {
  25. if (isWxKey(_key)) {
  26. // TODO wrapper function
  27. newWx[_key] = oldWx[_key];
  28. }
  29. }
  30. return newWx;
  31. }
  32. target[key] = initWx();
  33. var _default = target[key];
  34. exports.default = _default;
  35. /***/ }),
  36. /***/ 10:
  37. /*!****************************************************************!*\
  38. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  39. \****************************************************************/
  40. /*! no static exports found */
  41. /***/ (function(module, exports) {
  42. function _nonIterableRest() {
  43. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  44. }
  45. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  46. /***/ }),
  47. /***/ 11:
  48. /*!***************************************************************!*\
  49. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  50. \***************************************************************/
  51. /*! no static exports found */
  52. /***/ (function(module, exports, __webpack_require__) {
  53. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  54. function _defineProperty(obj, key, value) {
  55. key = toPropertyKey(key);
  56. if (key in obj) {
  57. Object.defineProperty(obj, key, {
  58. value: value,
  59. enumerable: true,
  60. configurable: true,
  61. writable: true
  62. });
  63. } else {
  64. obj[key] = value;
  65. }
  66. return obj;
  67. }
  68. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  69. /***/ }),
  70. /***/ 114:
  71. /*!**********************************!*\
  72. !*** D:/工作/项目2/生鲜/sx/api/set.js ***!
  73. \**********************************/
  74. /*! no static exports found */
  75. /***/ (function(module, exports, __webpack_require__) {
  76. "use strict";
  77. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  78. Object.defineProperty(exports, "__esModule", {
  79. value: true
  80. });
  81. exports.binding = binding;
  82. exports.logout = logout;
  83. exports.registerReset = registerReset;
  84. exports.userEdit = userEdit;
  85. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  86. // 修改用户信息
  87. function userEdit(data) {
  88. return (0, _request.default)({
  89. url: '/api/user/edit',
  90. method: 'post',
  91. data: data
  92. });
  93. }
  94. //退出登录
  95. function logout(data) {
  96. return (0, _request.default)({
  97. url: '/api/logout',
  98. method: 'get',
  99. data: data
  100. });
  101. }
  102. //修改密码
  103. function registerReset(data) {
  104. return (0, _request.default)({
  105. url: '/api/register/reset',
  106. method: 'post',
  107. data: data
  108. });
  109. }
  110. //绑定手机
  111. function binding(data) {
  112. return (0, _request.default)({
  113. url: '/api/binding',
  114. method: 'post',
  115. data: data
  116. });
  117. }
  118. /***/ }),
  119. /***/ 12:
  120. /*!**************************************************************!*\
  121. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  122. \**************************************************************/
  123. /*! no static exports found */
  124. /***/ (function(module, exports, __webpack_require__) {
  125. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  126. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  127. function _toPropertyKey(arg) {
  128. var key = toPrimitive(arg, "string");
  129. return _typeof(key) === "symbol" ? key : String(key);
  130. }
  131. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  132. /***/ }),
  133. /***/ 13:
  134. /*!*******************************************************!*\
  135. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  136. \*******************************************************/
  137. /*! no static exports found */
  138. /***/ (function(module, exports) {
  139. function _typeof(obj) {
  140. "@babel/helpers - typeof";
  141. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  142. return typeof obj;
  143. } : function (obj) {
  144. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  145. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  146. }
  147. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  148. /***/ }),
  149. /***/ 14:
  150. /*!************************************************************!*\
  151. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  152. \************************************************************/
  153. /*! no static exports found */
  154. /***/ (function(module, exports, __webpack_require__) {
  155. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  156. function _toPrimitive(input, hint) {
  157. if (_typeof(input) !== "object" || input === null) return input;
  158. var prim = input[Symbol.toPrimitive];
  159. if (prim !== undefined) {
  160. var res = prim.call(input, hint || "default");
  161. if (_typeof(res) !== "object") return res;
  162. throw new TypeError("@@toPrimitive must return a primitive value.");
  163. }
  164. return (hint === "string" ? String : Number)(input);
  165. }
  166. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  167. /***/ }),
  168. /***/ 15:
  169. /*!**********************************************************!*\
  170. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  171. \**********************************************************/
  172. /*! no static exports found */
  173. /***/ (function(module, exports, __webpack_require__) {
  174. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  175. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  176. function _construct(Parent, args, Class) {
  177. if (isNativeReflectConstruct()) {
  178. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  179. } else {
  180. module.exports = _construct = function _construct(Parent, args, Class) {
  181. var a = [null];
  182. a.push.apply(a, args);
  183. var Constructor = Function.bind.apply(Parent, a);
  184. var instance = new Constructor();
  185. if (Class) setPrototypeOf(instance, Class.prototype);
  186. return instance;
  187. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  188. }
  189. return _construct.apply(null, arguments);
  190. }
  191. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  192. /***/ }),
  193. /***/ 155:
  194. /*!************************************!*\
  195. !*** D:/工作/项目2/生鲜/sx/api/order.js ***!
  196. \************************************/
  197. /*! no static exports found */
  198. /***/ (function(module, exports, __webpack_require__) {
  199. "use strict";
  200. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  201. Object.defineProperty(exports, "__esModule", {
  202. value: true
  203. });
  204. exports.GetAdminOrderList = GetAdminOrderList;
  205. exports.aOrderRefund = aOrderRefund;
  206. exports.backDeposit = backDeposit;
  207. exports.backExchangeDeposit = backExchangeDeposit;
  208. exports.computedOrderkey = computedOrderkey;
  209. exports.confirm = confirm;
  210. exports.couponsOrder = couponsOrder;
  211. exports.createOrderkey = createOrderkey;
  212. exports.delivery = delivery;
  213. exports.express_query = express_query;
  214. exports.getAdminExchangeList = getAdminExchangeList;
  215. exports.getCouponsList = getCouponsList;
  216. exports.getGift = getGift;
  217. exports.getMyexchange = getMyexchange;
  218. exports.getUserList = getUserList;
  219. exports.orderAdminDetail = orderAdminDetail;
  220. exports.orderCancel = orderCancel;
  221. exports.orderData = orderData;
  222. exports.orderDel = orderDel;
  223. exports.orderDetail = orderDetail;
  224. exports.orderGive = orderGive;
  225. exports.orderList = orderList;
  226. exports.orderPay = orderPay;
  227. exports.orderTake = orderTake;
  228. exports.order_comment = order_comment;
  229. exports.product = product;
  230. exports.refund = refund;
  231. exports.refundReason = refundReason;
  232. exports.upload = upload;
  233. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 35));
  234. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  235. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  236. // 订单确认
  237. function confirm(data) {
  238. return (0, _request.default)({
  239. url: '/api/order/confirm',
  240. method: 'post',
  241. data: data
  242. });
  243. }
  244. //获取可使用优惠券
  245. function couponsOrder(data, price) {
  246. return (0, _request.default)({
  247. url: '/api/coupons/order/' + price,
  248. method: 'get',
  249. data: data
  250. });
  251. }
  252. //获取优惠券列表
  253. function getCouponsList(data, types) {
  254. //优惠券状态 0全部 1未使用 2已使用
  255. return (0, _request.default)({
  256. url: '/api/coupons/user/' + types,
  257. method: 'get',
  258. data: data
  259. });
  260. }
  261. //提交评论
  262. function order_comment(data) {
  263. return (0, _request.default)({
  264. url: '/api/order/comment',
  265. method: 'post',
  266. data: data
  267. });
  268. }
  269. //订单产品信息
  270. function product(data) {
  271. return (0, _request.default)({
  272. url: '/api/order/product',
  273. method: 'post',
  274. data: data
  275. });
  276. }
  277. // 快递查询
  278. function express_query(data) {
  279. return (0, _request.default)({
  280. url: '/api/order/express_query',
  281. method: 'get',
  282. data: data
  283. });
  284. }
  285. //上传图片
  286. function upload(data) {
  287. return (0, _request.upFilse)({
  288. url: '/api/upload/image',
  289. method: 'post',
  290. data: data
  291. });
  292. }
  293. // 订单列表
  294. function orderList(data) {
  295. return (0, _request.default)({
  296. url: '/api/order/list',
  297. method: 'get',
  298. data: data
  299. });
  300. }
  301. // 订单详细
  302. function orderDetail(data, orderid) {
  303. return (0, _request.default)({
  304. url: '/api/order/detail/' + orderid,
  305. method: 'get',
  306. data: data
  307. });
  308. }
  309. // 订单详细
  310. function orderAdminDetail(data, orderid) {
  311. return (0, _request.default)({
  312. url: '/api/admin/order/detail/' + orderid,
  313. method: 'get',
  314. data: data
  315. });
  316. }
  317. // 取消订单
  318. function orderCancel(data) {
  319. return (0, _request.default)({
  320. url: '/api/order/cancel',
  321. method: 'post',
  322. data: data
  323. });
  324. }
  325. // 删除订单
  326. function orderDel(data) {
  327. return (0, _request.default)({
  328. url: '/api/order/del',
  329. method: 'get',
  330. data: data
  331. });
  332. }
  333. // 申请退款
  334. function refund(data) {
  335. return (0, _request.default)({
  336. url: '/api/order/refund/verify',
  337. method: 'post',
  338. data: data
  339. });
  340. }
  341. // 退款理由列表
  342. function refundReason(data) {
  343. return (0, _request.default)({
  344. url: '/api/order/refund/reason',
  345. method: 'get',
  346. data: data
  347. });
  348. }
  349. // 确认收货
  350. function orderTake(data) {
  351. return (0, _request.default)({
  352. url: '/api/order/take',
  353. method: 'post',
  354. data: data
  355. });
  356. }
  357. // 订单支付
  358. function orderPay(data) {
  359. return (0, _request.default)({
  360. url: '/api/order/pay',
  361. method: 'post',
  362. data: data
  363. });
  364. }
  365. // 创建订单
  366. function createOrderkey(data, key) {
  367. return (0, _request.default)({
  368. url: '/api/order/create/' + key,
  369. method: 'post',
  370. data: data
  371. });
  372. }
  373. // 统计订单金额
  374. function computedOrderkey(data) {
  375. return (0, _request.default)({
  376. url: '/api/order/computed/' + data.orderkey,
  377. method: 'post',
  378. data: data
  379. });
  380. }
  381. //管理orderList
  382. function GetAdminOrderList(data) {
  383. return (0, _request.default)({
  384. url: '/api/admin/order/list',
  385. method: 'get',
  386. data: data
  387. });
  388. }
  389. //同意退款
  390. function aOrderRefund(data) {
  391. return (0, _request.default)({
  392. url: '/api/admin/order/refund',
  393. method: 'post',
  394. data: data
  395. });
  396. }
  397. //退换押金
  398. function backDeposit(data) {
  399. return (0, _request.default)({
  400. url: '/api/admin/order/back_deposit',
  401. method: 'post',
  402. data: data
  403. });
  404. }
  405. function orderData(data) {
  406. return (0, _request.default)({
  407. url: '/api/order/data',
  408. method: 'get',
  409. data: data
  410. });
  411. }
  412. //order/give/:uni 赠送订单
  413. function orderGive(data, uni) {
  414. return (0, _request.default)({
  415. url: '/api/order/give/' + uni,
  416. method: 'post',
  417. data: data
  418. });
  419. }
  420. function getUserList(data) {
  421. return (0, _request.default)({
  422. url: '/api/user_list',
  423. method: 'get',
  424. data: data
  425. });
  426. }
  427. // 发货
  428. function delivery(data) {
  429. return (0, _request.default)({
  430. url: '/api/admin/order/delivery/keep',
  431. method: 'post',
  432. data: data
  433. });
  434. }
  435. // 获取我的兑换券列表
  436. function getMyexchange(data) {
  437. return (0, _request.default)({
  438. url: '/api/exchange/order_list',
  439. method: 'get',
  440. data: data
  441. });
  442. }
  443. //领取兑换券
  444. function getGift(data, id) {
  445. return (0, _request.default)({
  446. url: '/api/exchange_order/give/' + id,
  447. method: 'post',
  448. data: data
  449. });
  450. }
  451. // 获取admin/exchange
  452. function getAdminExchangeList(data) {
  453. return (0, _request.default)({
  454. url: '/api/admin/exchange_order/list',
  455. method: 'get',
  456. data: data
  457. });
  458. }
  459. // 退还兑换券押金
  460. function backExchangeDeposit(data) {
  461. return (0, _request.default)({
  462. url: '/api/admin/exchange_order/back_deposit',
  463. method: 'post',
  464. data: data
  465. });
  466. }
  467. /***/ }),
  468. /***/ 16:
  469. /*!***************************************************************!*\
  470. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  471. \***************************************************************/
  472. /*! no static exports found */
  473. /***/ (function(module, exports) {
  474. function _setPrototypeOf(o, p) {
  475. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  476. o.__proto__ = p;
  477. return o;
  478. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  479. return _setPrototypeOf(o, p);
  480. }
  481. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  482. /***/ }),
  483. /***/ 17:
  484. /*!*************************************************************************!*\
  485. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  486. \*************************************************************************/
  487. /*! no static exports found */
  488. /***/ (function(module, exports) {
  489. function _isNativeReflectConstruct() {
  490. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  491. if (Reflect.construct.sham) return false;
  492. if (typeof Proxy === "function") return true;
  493. try {
  494. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  495. return true;
  496. } catch (e) {
  497. return false;
  498. }
  499. }
  500. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  501. /***/ }),
  502. /***/ 179:
  503. /*!**************************************************!*\
  504. !*** D:/工作/项目2/生鲜/sx/js_sdk/xb-copy/uni-copy.js ***!
  505. \**************************************************/
  506. /*! no static exports found */
  507. /***/ (function(module, exports, __webpack_require__) {
  508. "use strict";
  509. /* WEBPACK VAR INJECTION */(function(uni) {
  510. Object.defineProperty(exports, "__esModule", {
  511. value: true
  512. });
  513. exports.default = uniCopy;
  514. function uniCopy(content) {
  515. /**
  516. * 小程序端 和 app端的复制逻辑
  517. */
  518. uni.setClipboardData({
  519. data: content,
  520. success: function success() {
  521. console.log('success');
  522. return true;
  523. }
  524. });
  525. /**
  526. * H5端的复制逻辑
  527. */
  528. }
  529. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  530. /***/ }),
  531. /***/ 18:
  532. /*!******************************************************************!*\
  533. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  534. \******************************************************************/
  535. /*! no static exports found */
  536. /***/ (function(module, exports, __webpack_require__) {
  537. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  538. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  539. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  540. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  541. function _toConsumableArray(arr) {
  542. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  543. }
  544. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  545. /***/ }),
  546. /***/ 19:
  547. /*!******************************************************************!*\
  548. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  549. \******************************************************************/
  550. /*! no static exports found */
  551. /***/ (function(module, exports, __webpack_require__) {
  552. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  553. function _arrayWithoutHoles(arr) {
  554. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  555. }
  556. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  557. /***/ }),
  558. /***/ 2:
  559. /*!************************************************************!*\
  560. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  561. \************************************************************/
  562. /*! no static exports found */
  563. /***/ (function(module, exports, __webpack_require__) {
  564. "use strict";
  565. /* WEBPACK VAR INJECTION */(function(wx, global) {
  566. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  567. Object.defineProperty(exports, "__esModule", {
  568. value: true
  569. });
  570. exports.createApp = createApp;
  571. exports.createComponent = createComponent;
  572. exports.createPage = createPage;
  573. exports.createPlugin = createPlugin;
  574. exports.createSubpackageApp = createSubpackageApp;
  575. exports.default = void 0;
  576. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  577. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  578. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  579. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  580. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  581. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  582. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  583. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  584. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  585. var realAtob;
  586. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  587. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  588. if (typeof atob !== 'function') {
  589. realAtob = function realAtob(str) {
  590. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  591. if (!b64re.test(str)) {
  592. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  593. }
  594. // Adding the padding if missing, for semplicity
  595. str += '=='.slice(2 - (str.length & 3));
  596. var bitmap;
  597. var result = '';
  598. var r1;
  599. var r2;
  600. var i = 0;
  601. for (; i < str.length;) {
  602. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  603. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  604. }
  605. return result;
  606. };
  607. } else {
  608. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  609. realAtob = atob;
  610. }
  611. function b64DecodeUnicode(str) {
  612. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  613. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  614. }).join(''));
  615. }
  616. function getCurrentUserInfo() {
  617. var token = wx.getStorageSync('uni_id_token') || '';
  618. var tokenArr = token.split('.');
  619. if (!token || tokenArr.length !== 3) {
  620. return {
  621. uid: null,
  622. role: [],
  623. permission: [],
  624. tokenExpired: 0
  625. };
  626. }
  627. var userInfo;
  628. try {
  629. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  630. } catch (error) {
  631. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  632. }
  633. userInfo.tokenExpired = userInfo.exp * 1000;
  634. delete userInfo.exp;
  635. delete userInfo.iat;
  636. return userInfo;
  637. }
  638. function uniIdMixin(Vue) {
  639. Vue.prototype.uniIDHasRole = function (roleId) {
  640. var _getCurrentUserInfo = getCurrentUserInfo(),
  641. role = _getCurrentUserInfo.role;
  642. return role.indexOf(roleId) > -1;
  643. };
  644. Vue.prototype.uniIDHasPermission = function (permissionId) {
  645. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  646. permission = _getCurrentUserInfo2.permission;
  647. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  648. };
  649. Vue.prototype.uniIDTokenValid = function () {
  650. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  651. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  652. return tokenExpired > Date.now();
  653. };
  654. }
  655. var _toString = Object.prototype.toString;
  656. var hasOwnProperty = Object.prototype.hasOwnProperty;
  657. function isFn(fn) {
  658. return typeof fn === 'function';
  659. }
  660. function isStr(str) {
  661. return typeof str === 'string';
  662. }
  663. function isObject(obj) {
  664. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  665. }
  666. function isPlainObject(obj) {
  667. return _toString.call(obj) === '[object Object]';
  668. }
  669. function hasOwn(obj, key) {
  670. return hasOwnProperty.call(obj, key);
  671. }
  672. function noop() {}
  673. /**
  674. * Create a cached version of a pure function.
  675. */
  676. function cached(fn) {
  677. var cache = Object.create(null);
  678. return function cachedFn(str) {
  679. var hit = cache[str];
  680. return hit || (cache[str] = fn(str));
  681. };
  682. }
  683. /**
  684. * Camelize a hyphen-delimited string.
  685. */
  686. var camelizeRE = /-(\w)/g;
  687. var camelize = cached(function (str) {
  688. return str.replace(camelizeRE, function (_, c) {
  689. return c ? c.toUpperCase() : '';
  690. });
  691. });
  692. function sortObject(obj) {
  693. var sortObj = {};
  694. if (isPlainObject(obj)) {
  695. Object.keys(obj).sort().forEach(function (key) {
  696. sortObj[key] = obj[key];
  697. });
  698. }
  699. return !Object.keys(sortObj) ? obj : sortObj;
  700. }
  701. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  702. var globalInterceptors = {};
  703. var scopedInterceptors = {};
  704. function mergeHook(parentVal, childVal) {
  705. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  706. return res ? dedupeHooks(res) : res;
  707. }
  708. function dedupeHooks(hooks) {
  709. var res = [];
  710. for (var i = 0; i < hooks.length; i++) {
  711. if (res.indexOf(hooks[i]) === -1) {
  712. res.push(hooks[i]);
  713. }
  714. }
  715. return res;
  716. }
  717. function removeHook(hooks, hook) {
  718. var index = hooks.indexOf(hook);
  719. if (index !== -1) {
  720. hooks.splice(index, 1);
  721. }
  722. }
  723. function mergeInterceptorHook(interceptor, option) {
  724. Object.keys(option).forEach(function (hook) {
  725. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  726. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  727. }
  728. });
  729. }
  730. function removeInterceptorHook(interceptor, option) {
  731. if (!interceptor || !option) {
  732. return;
  733. }
  734. Object.keys(option).forEach(function (hook) {
  735. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  736. removeHook(interceptor[hook], option[hook]);
  737. }
  738. });
  739. }
  740. function addInterceptor(method, option) {
  741. if (typeof method === 'string' && isPlainObject(option)) {
  742. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  743. } else if (isPlainObject(method)) {
  744. mergeInterceptorHook(globalInterceptors, method);
  745. }
  746. }
  747. function removeInterceptor(method, option) {
  748. if (typeof method === 'string') {
  749. if (isPlainObject(option)) {
  750. removeInterceptorHook(scopedInterceptors[method], option);
  751. } else {
  752. delete scopedInterceptors[method];
  753. }
  754. } else if (isPlainObject(method)) {
  755. removeInterceptorHook(globalInterceptors, method);
  756. }
  757. }
  758. function wrapperHook(hook) {
  759. return function (data) {
  760. return hook(data) || data;
  761. };
  762. }
  763. function isPromise(obj) {
  764. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  765. }
  766. function queue(hooks, data) {
  767. var promise = false;
  768. for (var i = 0; i < hooks.length; i++) {
  769. var hook = hooks[i];
  770. if (promise) {
  771. promise = Promise.resolve(wrapperHook(hook));
  772. } else {
  773. var res = hook(data);
  774. if (isPromise(res)) {
  775. promise = Promise.resolve(res);
  776. }
  777. if (res === false) {
  778. return {
  779. then: function then() {}
  780. };
  781. }
  782. }
  783. }
  784. return promise || {
  785. then: function then(callback) {
  786. return callback(data);
  787. }
  788. };
  789. }
  790. function wrapperOptions(interceptor) {
  791. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  792. ['success', 'fail', 'complete'].forEach(function (name) {
  793. if (Array.isArray(interceptor[name])) {
  794. var oldCallback = options[name];
  795. options[name] = function callbackInterceptor(res) {
  796. queue(interceptor[name], res).then(function (res) {
  797. /* eslint-disable no-mixed-operators */
  798. return isFn(oldCallback) && oldCallback(res) || res;
  799. });
  800. };
  801. }
  802. });
  803. return options;
  804. }
  805. function wrapperReturnValue(method, returnValue) {
  806. var returnValueHooks = [];
  807. if (Array.isArray(globalInterceptors.returnValue)) {
  808. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  809. }
  810. var interceptor = scopedInterceptors[method];
  811. if (interceptor && Array.isArray(interceptor.returnValue)) {
  812. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  813. }
  814. returnValueHooks.forEach(function (hook) {
  815. returnValue = hook(returnValue) || returnValue;
  816. });
  817. return returnValue;
  818. }
  819. function getApiInterceptorHooks(method) {
  820. var interceptor = Object.create(null);
  821. Object.keys(globalInterceptors).forEach(function (hook) {
  822. if (hook !== 'returnValue') {
  823. interceptor[hook] = globalInterceptors[hook].slice();
  824. }
  825. });
  826. var scopedInterceptor = scopedInterceptors[method];
  827. if (scopedInterceptor) {
  828. Object.keys(scopedInterceptor).forEach(function (hook) {
  829. if (hook !== 'returnValue') {
  830. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  831. }
  832. });
  833. }
  834. return interceptor;
  835. }
  836. function invokeApi(method, api, options) {
  837. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  838. params[_key - 3] = arguments[_key];
  839. }
  840. var interceptor = getApiInterceptorHooks(method);
  841. if (interceptor && Object.keys(interceptor).length) {
  842. if (Array.isArray(interceptor.invoke)) {
  843. var res = queue(interceptor.invoke, options);
  844. return res.then(function (options) {
  845. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  846. });
  847. } else {
  848. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  849. }
  850. }
  851. return api.apply(void 0, [options].concat(params));
  852. }
  853. var promiseInterceptor = {
  854. returnValue: function returnValue(res) {
  855. if (!isPromise(res)) {
  856. return res;
  857. }
  858. return new Promise(function (resolve, reject) {
  859. res.then(function (res) {
  860. if (res[0]) {
  861. reject(res[0]);
  862. } else {
  863. resolve(res[1]);
  864. }
  865. });
  866. });
  867. }
  868. };
  869. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/;
  870. var CONTEXT_API_RE = /^create|Manager$/;
  871. // Context例外情况
  872. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  873. // 同步例外情况
  874. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  875. var CALLBACK_API_RE = /^on|^off/;
  876. function isContextApi(name) {
  877. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  878. }
  879. function isSyncApi(name) {
  880. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  881. }
  882. function isCallbackApi(name) {
  883. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  884. }
  885. function handlePromise(promise) {
  886. return promise.then(function (data) {
  887. return [null, data];
  888. }).catch(function (err) {
  889. return [err];
  890. });
  891. }
  892. function shouldPromise(name) {
  893. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  894. return false;
  895. }
  896. return true;
  897. }
  898. /* eslint-disable no-extend-native */
  899. if (!Promise.prototype.finally) {
  900. Promise.prototype.finally = function (callback) {
  901. var promise = this.constructor;
  902. return this.then(function (value) {
  903. return promise.resolve(callback()).then(function () {
  904. return value;
  905. });
  906. }, function (reason) {
  907. return promise.resolve(callback()).then(function () {
  908. throw reason;
  909. });
  910. });
  911. };
  912. }
  913. function promisify(name, api) {
  914. if (!shouldPromise(name) || !isFn(api)) {
  915. return api;
  916. }
  917. return function promiseApi() {
  918. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  919. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  920. params[_key2 - 1] = arguments[_key2];
  921. }
  922. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  923. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  924. }
  925. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  926. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  927. success: resolve,
  928. fail: reject
  929. })].concat(params));
  930. })));
  931. };
  932. }
  933. var EPS = 1e-4;
  934. var BASE_DEVICE_WIDTH = 750;
  935. var isIOS = false;
  936. var deviceWidth = 0;
  937. var deviceDPR = 0;
  938. function checkDeviceWidth() {
  939. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  940. platform = _wx$getSystemInfoSync.platform,
  941. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  942. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  943. deviceWidth = windowWidth;
  944. deviceDPR = pixelRatio;
  945. isIOS = platform === 'ios';
  946. }
  947. function upx2px(number, newDeviceWidth) {
  948. if (deviceWidth === 0) {
  949. checkDeviceWidth();
  950. }
  951. number = Number(number);
  952. if (number === 0) {
  953. return 0;
  954. }
  955. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  956. if (result < 0) {
  957. result = -result;
  958. }
  959. result = Math.floor(result + EPS);
  960. if (result === 0) {
  961. if (deviceDPR === 1 || !isIOS) {
  962. result = 1;
  963. } else {
  964. result = 0.5;
  965. }
  966. }
  967. return number < 0 ? -result : result;
  968. }
  969. var LOCALE_ZH_HANS = 'zh-Hans';
  970. var LOCALE_ZH_HANT = 'zh-Hant';
  971. var LOCALE_EN = 'en';
  972. var LOCALE_FR = 'fr';
  973. var LOCALE_ES = 'es';
  974. var messages = {};
  975. var locale;
  976. {
  977. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  978. }
  979. function initI18nMessages() {
  980. if (!isEnableLocale()) {
  981. return;
  982. }
  983. var localeKeys = Object.keys(__uniConfig.locales);
  984. if (localeKeys.length) {
  985. localeKeys.forEach(function (locale) {
  986. var curMessages = messages[locale];
  987. var userMessages = __uniConfig.locales[locale];
  988. if (curMessages) {
  989. Object.assign(curMessages, userMessages);
  990. } else {
  991. messages[locale] = userMessages;
  992. }
  993. });
  994. }
  995. }
  996. initI18nMessages();
  997. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  998. var t = i18n.t;
  999. var i18nMixin = i18n.mixin = {
  1000. beforeCreate: function beforeCreate() {
  1001. var _this = this;
  1002. var unwatch = i18n.i18n.watchLocale(function () {
  1003. _this.$forceUpdate();
  1004. });
  1005. this.$once('hook:beforeDestroy', function () {
  1006. unwatch();
  1007. });
  1008. },
  1009. methods: {
  1010. $$t: function $$t(key, values) {
  1011. return t(key, values);
  1012. }
  1013. }
  1014. };
  1015. var setLocale = i18n.setLocale;
  1016. var getLocale = i18n.getLocale;
  1017. function initAppLocale(Vue, appVm, locale) {
  1018. var state = Vue.observable({
  1019. locale: locale || i18n.getLocale()
  1020. });
  1021. var localeWatchers = [];
  1022. appVm.$watchLocale = function (fn) {
  1023. localeWatchers.push(fn);
  1024. };
  1025. Object.defineProperty(appVm, '$locale', {
  1026. get: function get() {
  1027. return state.locale;
  1028. },
  1029. set: function set(v) {
  1030. state.locale = v;
  1031. localeWatchers.forEach(function (watch) {
  1032. return watch(v);
  1033. });
  1034. }
  1035. });
  1036. }
  1037. function isEnableLocale() {
  1038. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1039. }
  1040. function include(str, parts) {
  1041. return !!parts.find(function (part) {
  1042. return str.indexOf(part) !== -1;
  1043. });
  1044. }
  1045. function startsWith(str, parts) {
  1046. return parts.find(function (part) {
  1047. return str.indexOf(part) === 0;
  1048. });
  1049. }
  1050. function normalizeLocale(locale, messages) {
  1051. if (!locale) {
  1052. return;
  1053. }
  1054. locale = locale.trim().replace(/_/g, '-');
  1055. if (messages && messages[locale]) {
  1056. return locale;
  1057. }
  1058. locale = locale.toLowerCase();
  1059. if (locale === 'chinese') {
  1060. // 支付宝
  1061. return LOCALE_ZH_HANS;
  1062. }
  1063. if (locale.indexOf('zh') === 0) {
  1064. if (locale.indexOf('-hans') > -1) {
  1065. return LOCALE_ZH_HANS;
  1066. }
  1067. if (locale.indexOf('-hant') > -1) {
  1068. return LOCALE_ZH_HANT;
  1069. }
  1070. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1071. return LOCALE_ZH_HANT;
  1072. }
  1073. return LOCALE_ZH_HANS;
  1074. }
  1075. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1076. if (lang) {
  1077. return lang;
  1078. }
  1079. }
  1080. // export function initI18n() {
  1081. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1082. // if (localeKeys.length) {
  1083. // localeKeys.forEach((locale) =>
  1084. // i18n.add(locale, __uniConfig.locales[locale])
  1085. // )
  1086. // }
  1087. // }
  1088. function getLocale$1() {
  1089. // 优先使用 $locale
  1090. if (isFn(getApp)) {
  1091. var app = getApp({
  1092. allowDefault: true
  1093. });
  1094. if (app && app.$vm) {
  1095. return app.$vm.$locale;
  1096. }
  1097. }
  1098. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1099. }
  1100. function setLocale$1(locale) {
  1101. var app = isFn(getApp) ? getApp() : false;
  1102. if (!app) {
  1103. return false;
  1104. }
  1105. var oldLocale = app.$vm.$locale;
  1106. if (oldLocale !== locale) {
  1107. app.$vm.$locale = locale;
  1108. onLocaleChangeCallbacks.forEach(function (fn) {
  1109. return fn({
  1110. locale: locale
  1111. });
  1112. });
  1113. return true;
  1114. }
  1115. return false;
  1116. }
  1117. var onLocaleChangeCallbacks = [];
  1118. function onLocaleChange(fn) {
  1119. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1120. onLocaleChangeCallbacks.push(fn);
  1121. }
  1122. }
  1123. if (typeof global !== 'undefined') {
  1124. global.getLocale = getLocale$1;
  1125. }
  1126. var interceptors = {
  1127. promiseInterceptor: promiseInterceptor
  1128. };
  1129. var baseApi = /*#__PURE__*/Object.freeze({
  1130. __proto__: null,
  1131. upx2px: upx2px,
  1132. getLocale: getLocale$1,
  1133. setLocale: setLocale$1,
  1134. onLocaleChange: onLocaleChange,
  1135. addInterceptor: addInterceptor,
  1136. removeInterceptor: removeInterceptor,
  1137. interceptors: interceptors
  1138. });
  1139. function findExistsPageIndex(url) {
  1140. var pages = getCurrentPages();
  1141. var len = pages.length;
  1142. while (len--) {
  1143. var page = pages[len];
  1144. if (page.$page && page.$page.fullPath === url) {
  1145. return len;
  1146. }
  1147. }
  1148. return -1;
  1149. }
  1150. var redirectTo = {
  1151. name: function name(fromArgs) {
  1152. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1153. return 'navigateBack';
  1154. }
  1155. return 'redirectTo';
  1156. },
  1157. args: function args(fromArgs) {
  1158. if (fromArgs.exists === 'back' && fromArgs.url) {
  1159. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1160. if (existsPageIndex !== -1) {
  1161. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1162. if (delta > 0) {
  1163. fromArgs.delta = delta;
  1164. }
  1165. }
  1166. }
  1167. }
  1168. };
  1169. var previewImage = {
  1170. args: function args(fromArgs) {
  1171. var currentIndex = parseInt(fromArgs.current);
  1172. if (isNaN(currentIndex)) {
  1173. return;
  1174. }
  1175. var urls = fromArgs.urls;
  1176. if (!Array.isArray(urls)) {
  1177. return;
  1178. }
  1179. var len = urls.length;
  1180. if (!len) {
  1181. return;
  1182. }
  1183. if (currentIndex < 0) {
  1184. currentIndex = 0;
  1185. } else if (currentIndex >= len) {
  1186. currentIndex = len - 1;
  1187. }
  1188. if (currentIndex > 0) {
  1189. fromArgs.current = urls[currentIndex];
  1190. fromArgs.urls = urls.filter(function (item, index) {
  1191. return index < currentIndex ? item !== urls[currentIndex] : true;
  1192. });
  1193. } else {
  1194. fromArgs.current = urls[0];
  1195. }
  1196. return {
  1197. indicator: false,
  1198. loop: false
  1199. };
  1200. }
  1201. };
  1202. var UUID_KEY = '__DC_STAT_UUID';
  1203. var deviceId;
  1204. function useDeviceId(result) {
  1205. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1206. if (!deviceId) {
  1207. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1208. wx.setStorage({
  1209. key: UUID_KEY,
  1210. data: deviceId
  1211. });
  1212. }
  1213. result.deviceId = deviceId;
  1214. }
  1215. function addSafeAreaInsets(result) {
  1216. if (result.safeArea) {
  1217. var safeArea = result.safeArea;
  1218. result.safeAreaInsets = {
  1219. top: safeArea.top,
  1220. left: safeArea.left,
  1221. right: result.windowWidth - safeArea.right,
  1222. bottom: result.screenHeight - safeArea.bottom
  1223. };
  1224. }
  1225. }
  1226. function populateParameters(result) {
  1227. var _result$brand = result.brand,
  1228. brand = _result$brand === void 0 ? '' : _result$brand,
  1229. _result$model = result.model,
  1230. model = _result$model === void 0 ? '' : _result$model,
  1231. _result$system = result.system,
  1232. system = _result$system === void 0 ? '' : _result$system,
  1233. _result$language = result.language,
  1234. language = _result$language === void 0 ? '' : _result$language,
  1235. theme = result.theme,
  1236. version = result.version,
  1237. platform = result.platform,
  1238. fontSizeSetting = result.fontSizeSetting,
  1239. SDKVersion = result.SDKVersion,
  1240. pixelRatio = result.pixelRatio,
  1241. deviceOrientation = result.deviceOrientation;
  1242. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1243. // osName osVersion
  1244. var osName = '';
  1245. var osVersion = '';
  1246. {
  1247. osName = system.split(' ')[0] || '';
  1248. osVersion = system.split(' ')[1] || '';
  1249. }
  1250. var hostVersion = version;
  1251. // deviceType
  1252. var deviceType = getGetDeviceType(result, model);
  1253. // deviceModel
  1254. var deviceBrand = getDeviceBrand(brand);
  1255. // hostName
  1256. var _hostName = getHostName(result);
  1257. // deviceOrientation
  1258. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1259. // devicePixelRatio
  1260. var _devicePixelRatio = pixelRatio;
  1261. // SDKVersion
  1262. var _SDKVersion = SDKVersion;
  1263. // hostLanguage
  1264. var hostLanguage = language.replace(/_/g, '-');
  1265. // wx.getAccountInfoSync
  1266. var parameters = {
  1267. appId: "__UNI__0460A91",
  1268. appName: "某娘生鲜",
  1269. appVersion: "1.0.0",
  1270. appVersionCode: "100",
  1271. appLanguage: getAppLanguage(hostLanguage),
  1272. uniCompileVersion: "3.6.18",
  1273. uniRuntimeVersion: "3.6.18",
  1274. uniPlatform: undefined || "mp-weixin",
  1275. deviceBrand: deviceBrand,
  1276. deviceModel: model,
  1277. deviceType: deviceType,
  1278. devicePixelRatio: _devicePixelRatio,
  1279. deviceOrientation: _deviceOrientation,
  1280. osName: osName.toLocaleLowerCase(),
  1281. osVersion: osVersion,
  1282. hostTheme: theme,
  1283. hostVersion: hostVersion,
  1284. hostLanguage: hostLanguage,
  1285. hostName: _hostName,
  1286. hostSDKVersion: _SDKVersion,
  1287. hostFontSizeSetting: fontSizeSetting,
  1288. windowTop: 0,
  1289. windowBottom: 0,
  1290. // TODO
  1291. osLanguage: undefined,
  1292. osTheme: undefined,
  1293. ua: undefined,
  1294. hostPackageName: undefined,
  1295. browserName: undefined,
  1296. browserVersion: undefined
  1297. };
  1298. Object.assign(result, parameters);
  1299. }
  1300. function getGetDeviceType(result, model) {
  1301. var deviceType = result.deviceType || 'phone';
  1302. {
  1303. var deviceTypeMaps = {
  1304. ipad: 'pad',
  1305. windows: 'pc',
  1306. mac: 'pc'
  1307. };
  1308. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1309. var _model = model.toLocaleLowerCase();
  1310. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1311. var _m = deviceTypeMapsKeys[index];
  1312. if (_model.indexOf(_m) !== -1) {
  1313. deviceType = deviceTypeMaps[_m];
  1314. break;
  1315. }
  1316. }
  1317. }
  1318. return deviceType;
  1319. }
  1320. function getDeviceBrand(brand) {
  1321. var deviceBrand = brand;
  1322. if (deviceBrand) {
  1323. deviceBrand = brand.toLocaleLowerCase();
  1324. }
  1325. return deviceBrand;
  1326. }
  1327. function getAppLanguage(defaultLanguage) {
  1328. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1329. }
  1330. function getHostName(result) {
  1331. var _platform = 'WeChat';
  1332. var _hostName = result.hostName || _platform; // mp-jd
  1333. {
  1334. if (result.environment) {
  1335. _hostName = result.environment;
  1336. } else if (result.host && result.host.env) {
  1337. _hostName = result.host.env;
  1338. }
  1339. }
  1340. return _hostName;
  1341. }
  1342. var getSystemInfo = {
  1343. returnValue: function returnValue(result) {
  1344. useDeviceId(result);
  1345. addSafeAreaInsets(result);
  1346. populateParameters(result);
  1347. }
  1348. };
  1349. var showActionSheet = {
  1350. args: function args(fromArgs) {
  1351. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1352. fromArgs.alertText = fromArgs.title;
  1353. }
  1354. }
  1355. };
  1356. var getAppBaseInfo = {
  1357. returnValue: function returnValue(result) {
  1358. var _result = result,
  1359. version = _result.version,
  1360. language = _result.language,
  1361. SDKVersion = _result.SDKVersion,
  1362. theme = _result.theme;
  1363. var _hostName = getHostName(result);
  1364. var hostLanguage = language.replace('_', '-');
  1365. result = sortObject(Object.assign(result, {
  1366. appId: "__UNI__0460A91",
  1367. appName: "某娘生鲜",
  1368. appVersion: "1.0.0",
  1369. appVersionCode: "100",
  1370. appLanguage: getAppLanguage(hostLanguage),
  1371. hostVersion: version,
  1372. hostLanguage: hostLanguage,
  1373. hostName: _hostName,
  1374. hostSDKVersion: SDKVersion,
  1375. hostTheme: theme
  1376. }));
  1377. }
  1378. };
  1379. var getDeviceInfo = {
  1380. returnValue: function returnValue(result) {
  1381. var _result2 = result,
  1382. brand = _result2.brand,
  1383. model = _result2.model;
  1384. var deviceType = getGetDeviceType(result, model);
  1385. var deviceBrand = getDeviceBrand(brand);
  1386. useDeviceId(result);
  1387. result = sortObject(Object.assign(result, {
  1388. deviceType: deviceType,
  1389. deviceBrand: deviceBrand,
  1390. deviceModel: model
  1391. }));
  1392. }
  1393. };
  1394. var getWindowInfo = {
  1395. returnValue: function returnValue(result) {
  1396. addSafeAreaInsets(result);
  1397. result = sortObject(Object.assign(result, {
  1398. windowTop: 0,
  1399. windowBottom: 0
  1400. }));
  1401. }
  1402. };
  1403. var getAppAuthorizeSetting = {
  1404. returnValue: function returnValue(result) {
  1405. var locationReducedAccuracy = result.locationReducedAccuracy;
  1406. result.locationAccuracy = 'unsupported';
  1407. if (locationReducedAccuracy === true) {
  1408. result.locationAccuracy = 'reduced';
  1409. } else if (locationReducedAccuracy === false) {
  1410. result.locationAccuracy = 'full';
  1411. }
  1412. }
  1413. };
  1414. // import navigateTo from 'uni-helpers/navigate-to'
  1415. var protocols = {
  1416. redirectTo: redirectTo,
  1417. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  1418. previewImage: previewImage,
  1419. getSystemInfo: getSystemInfo,
  1420. getSystemInfoSync: getSystemInfo,
  1421. showActionSheet: showActionSheet,
  1422. getAppBaseInfo: getAppBaseInfo,
  1423. getDeviceInfo: getDeviceInfo,
  1424. getWindowInfo: getWindowInfo,
  1425. getAppAuthorizeSetting: getAppAuthorizeSetting
  1426. };
  1427. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  1428. var canIUses = [];
  1429. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  1430. function processCallback(methodName, method, returnValue) {
  1431. return function (res) {
  1432. return method(processReturnValue(methodName, res, returnValue));
  1433. };
  1434. }
  1435. function processArgs(methodName, fromArgs) {
  1436. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  1437. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1438. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  1439. if (isPlainObject(fromArgs)) {
  1440. // 一般 api 的参数解析
  1441. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  1442. if (isFn(argsOption)) {
  1443. argsOption = argsOption(fromArgs, toArgs) || {};
  1444. }
  1445. for (var key in fromArgs) {
  1446. if (hasOwn(argsOption, key)) {
  1447. var keyOption = argsOption[key];
  1448. if (isFn(keyOption)) {
  1449. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1450. }
  1451. if (!keyOption) {
  1452. // 不支持的参数
  1453. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  1454. } else if (isStr(keyOption)) {
  1455. // 重写参数 key
  1456. toArgs[keyOption] = fromArgs[key];
  1457. } else if (isPlainObject(keyOption)) {
  1458. // {name:newName,value:value}可重新指定参数 key:value
  1459. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1460. }
  1461. } else if (CALLBACKS.indexOf(key) !== -1) {
  1462. if (isFn(fromArgs[key])) {
  1463. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  1464. }
  1465. } else {
  1466. if (!keepFromArgs) {
  1467. toArgs[key] = fromArgs[key];
  1468. }
  1469. }
  1470. }
  1471. return toArgs;
  1472. } else if (isFn(fromArgs)) {
  1473. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1474. }
  1475. return fromArgs;
  1476. }
  1477. function processReturnValue(methodName, res, returnValue) {
  1478. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  1479. if (isFn(protocols.returnValue)) {
  1480. // 处理通用 returnValue
  1481. res = protocols.returnValue(methodName, res);
  1482. }
  1483. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1484. }
  1485. function wrapper(methodName, method) {
  1486. if (hasOwn(protocols, methodName)) {
  1487. var protocol = protocols[methodName];
  1488. if (!protocol) {
  1489. // 暂不支持的 api
  1490. return function () {
  1491. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  1492. };
  1493. }
  1494. return function (arg1, arg2) {
  1495. // 目前 api 最多两个参数
  1496. var options = protocol;
  1497. if (isFn(protocol)) {
  1498. options = protocol(arg1);
  1499. }
  1500. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1501. var args = [arg1];
  1502. if (typeof arg2 !== 'undefined') {
  1503. args.push(arg2);
  1504. }
  1505. if (isFn(options.name)) {
  1506. methodName = options.name(arg1);
  1507. } else if (isStr(options.name)) {
  1508. methodName = options.name;
  1509. }
  1510. var returnValue = wx[methodName].apply(wx, args);
  1511. if (isSyncApi(methodName)) {
  1512. // 同步 api
  1513. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1514. }
  1515. return returnValue;
  1516. };
  1517. }
  1518. return method;
  1519. }
  1520. var todoApis = Object.create(null);
  1521. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1522. function createTodoApi(name) {
  1523. return function todoApi(_ref) {
  1524. var fail = _ref.fail,
  1525. complete = _ref.complete;
  1526. var res = {
  1527. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1528. };
  1529. isFn(fail) && fail(res);
  1530. isFn(complete) && complete(res);
  1531. };
  1532. }
  1533. TODOS.forEach(function (name) {
  1534. todoApis[name] = createTodoApi(name);
  1535. });
  1536. var providers = {
  1537. oauth: ['weixin'],
  1538. share: ['weixin'],
  1539. payment: ['wxpay'],
  1540. push: ['weixin']
  1541. };
  1542. function getProvider(_ref2) {
  1543. var service = _ref2.service,
  1544. success = _ref2.success,
  1545. fail = _ref2.fail,
  1546. complete = _ref2.complete;
  1547. var res = false;
  1548. if (providers[service]) {
  1549. res = {
  1550. errMsg: 'getProvider:ok',
  1551. service: service,
  1552. provider: providers[service]
  1553. };
  1554. isFn(success) && success(res);
  1555. } else {
  1556. res = {
  1557. errMsg: 'getProvider:fail service not found'
  1558. };
  1559. isFn(fail) && fail(res);
  1560. }
  1561. isFn(complete) && complete(res);
  1562. }
  1563. var extraApi = /*#__PURE__*/Object.freeze({
  1564. __proto__: null,
  1565. getProvider: getProvider
  1566. });
  1567. var getEmitter = function () {
  1568. var Emitter;
  1569. return function getUniEmitter() {
  1570. if (!Emitter) {
  1571. Emitter = new _vue.default();
  1572. }
  1573. return Emitter;
  1574. };
  1575. }();
  1576. function apply(ctx, method, args) {
  1577. return ctx[method].apply(ctx, args);
  1578. }
  1579. function $on() {
  1580. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1581. }
  1582. function $off() {
  1583. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1584. }
  1585. function $once() {
  1586. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1587. }
  1588. function $emit() {
  1589. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1590. }
  1591. var eventApi = /*#__PURE__*/Object.freeze({
  1592. __proto__: null,
  1593. $on: $on,
  1594. $off: $off,
  1595. $once: $once,
  1596. $emit: $emit
  1597. });
  1598. /**
  1599. * 框架内 try-catch
  1600. */
  1601. /**
  1602. * 开发者 try-catch
  1603. */
  1604. function tryCatch(fn) {
  1605. return function () {
  1606. try {
  1607. return fn.apply(fn, arguments);
  1608. } catch (e) {
  1609. // TODO
  1610. console.error(e);
  1611. }
  1612. };
  1613. }
  1614. function getApiCallbacks(params) {
  1615. var apiCallbacks = {};
  1616. for (var name in params) {
  1617. var param = params[name];
  1618. if (isFn(param)) {
  1619. apiCallbacks[name] = tryCatch(param);
  1620. delete params[name];
  1621. }
  1622. }
  1623. return apiCallbacks;
  1624. }
  1625. var cid;
  1626. var cidErrMsg;
  1627. var enabled;
  1628. function normalizePushMessage(message) {
  1629. try {
  1630. return JSON.parse(message);
  1631. } catch (e) {}
  1632. return message;
  1633. }
  1634. function invokePushCallback(args) {
  1635. if (args.type === 'enabled') {
  1636. enabled = true;
  1637. } else if (args.type === 'clientId') {
  1638. cid = args.cid;
  1639. cidErrMsg = args.errMsg;
  1640. invokeGetPushCidCallbacks(cid, args.errMsg);
  1641. } else if (args.type === 'pushMsg') {
  1642. var message = {
  1643. type: 'receive',
  1644. data: normalizePushMessage(args.message)
  1645. };
  1646. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1647. var callback = onPushMessageCallbacks[i];
  1648. callback(message);
  1649. // 该消息已被阻止
  1650. if (message.stopped) {
  1651. break;
  1652. }
  1653. }
  1654. } else if (args.type === 'click') {
  1655. onPushMessageCallbacks.forEach(function (callback) {
  1656. callback({
  1657. type: 'click',
  1658. data: normalizePushMessage(args.message)
  1659. });
  1660. });
  1661. }
  1662. }
  1663. var getPushCidCallbacks = [];
  1664. function invokeGetPushCidCallbacks(cid, errMsg) {
  1665. getPushCidCallbacks.forEach(function (callback) {
  1666. callback(cid, errMsg);
  1667. });
  1668. getPushCidCallbacks.length = 0;
  1669. }
  1670. function getPushClientId(args) {
  1671. if (!isPlainObject(args)) {
  1672. args = {};
  1673. }
  1674. var _getApiCallbacks = getApiCallbacks(args),
  1675. success = _getApiCallbacks.success,
  1676. fail = _getApiCallbacks.fail,
  1677. complete = _getApiCallbacks.complete;
  1678. var hasSuccess = isFn(success);
  1679. var hasFail = isFn(fail);
  1680. var hasComplete = isFn(complete);
  1681. Promise.resolve().then(function () {
  1682. if (typeof enabled === 'undefined') {
  1683. enabled = false;
  1684. cid = '';
  1685. cidErrMsg = 'uniPush is not enabled';
  1686. }
  1687. getPushCidCallbacks.push(function (cid, errMsg) {
  1688. var res;
  1689. if (cid) {
  1690. res = {
  1691. errMsg: 'getPushClientId:ok',
  1692. cid: cid
  1693. };
  1694. hasSuccess && success(res);
  1695. } else {
  1696. res = {
  1697. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1698. };
  1699. hasFail && fail(res);
  1700. }
  1701. hasComplete && complete(res);
  1702. });
  1703. if (typeof cid !== 'undefined') {
  1704. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1705. }
  1706. });
  1707. }
  1708. var onPushMessageCallbacks = [];
  1709. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1710. var onPushMessage = function onPushMessage(fn) {
  1711. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1712. onPushMessageCallbacks.push(fn);
  1713. }
  1714. };
  1715. var offPushMessage = function offPushMessage(fn) {
  1716. if (!fn) {
  1717. onPushMessageCallbacks.length = 0;
  1718. } else {
  1719. var index = onPushMessageCallbacks.indexOf(fn);
  1720. if (index > -1) {
  1721. onPushMessageCallbacks.splice(index, 1);
  1722. }
  1723. }
  1724. };
  1725. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1726. if (!baseInfo) {
  1727. baseInfo = wx.getSystemInfoSync();
  1728. }
  1729. var host = baseInfo ? baseInfo.host : null;
  1730. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1731. var api = /*#__PURE__*/Object.freeze({
  1732. __proto__: null,
  1733. shareVideoMessage: shareVideoMessage,
  1734. getPushClientId: getPushClientId,
  1735. onPushMessage: onPushMessage,
  1736. offPushMessage: offPushMessage,
  1737. invokePushCallback: invokePushCallback
  1738. });
  1739. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1740. function findVmByVueId(vm, vuePid) {
  1741. var $children = vm.$children;
  1742. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1743. for (var i = $children.length - 1; i >= 0; i--) {
  1744. var childVm = $children[i];
  1745. if (childVm.$scope._$vueId === vuePid) {
  1746. return childVm;
  1747. }
  1748. }
  1749. // 反向递归查找
  1750. var parentVm;
  1751. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1752. parentVm = findVmByVueId($children[_i], vuePid);
  1753. if (parentVm) {
  1754. return parentVm;
  1755. }
  1756. }
  1757. }
  1758. function initBehavior(options) {
  1759. return Behavior(options);
  1760. }
  1761. function isPage() {
  1762. return !!this.route;
  1763. }
  1764. function initRelation(detail) {
  1765. this.triggerEvent('__l', detail);
  1766. }
  1767. function selectAllComponents(mpInstance, selector, $refs) {
  1768. var components = mpInstance.selectAllComponents(selector) || [];
  1769. components.forEach(function (component) {
  1770. var ref = component.dataset.ref;
  1771. $refs[ref] = component.$vm || toSkip(component);
  1772. {
  1773. if (component.dataset.vueGeneric === 'scoped') {
  1774. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1775. selectAllComponents(scopedComponent, selector, $refs);
  1776. });
  1777. }
  1778. }
  1779. });
  1780. }
  1781. function syncRefs(refs, newRefs) {
  1782. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1783. var newKeys = Object.keys(newRefs);
  1784. newKeys.forEach(function (key) {
  1785. var oldValue = refs[key];
  1786. var newValue = newRefs[key];
  1787. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1788. return oldValue.includes(value);
  1789. })) {
  1790. return;
  1791. }
  1792. refs[key] = newValue;
  1793. oldKeys.delete(key);
  1794. });
  1795. oldKeys.forEach(function (key) {
  1796. delete refs[key];
  1797. });
  1798. return refs;
  1799. }
  1800. function initRefs(vm) {
  1801. var mpInstance = vm.$scope;
  1802. var refs = {};
  1803. Object.defineProperty(vm, '$refs', {
  1804. get: function get() {
  1805. var $refs = {};
  1806. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1807. // TODO 暂不考虑 for 中的 scoped
  1808. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1809. forComponents.forEach(function (component) {
  1810. var ref = component.dataset.ref;
  1811. if (!$refs[ref]) {
  1812. $refs[ref] = [];
  1813. }
  1814. $refs[ref].push(component.$vm || toSkip(component));
  1815. });
  1816. return syncRefs(refs, $refs);
  1817. }
  1818. });
  1819. }
  1820. function handleLink(event) {
  1821. var _ref3 = event.detail || event.value,
  1822. vuePid = _ref3.vuePid,
  1823. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1824. var parentVm;
  1825. if (vuePid) {
  1826. parentVm = findVmByVueId(this.$vm, vuePid);
  1827. }
  1828. if (!parentVm) {
  1829. parentVm = this.$vm;
  1830. }
  1831. vueOptions.parent = parentVm;
  1832. }
  1833. function markMPComponent(component) {
  1834. // 在 Vue 中标记为小程序组件
  1835. var IS_MP = '__v_isMPComponent';
  1836. Object.defineProperty(component, IS_MP, {
  1837. configurable: true,
  1838. enumerable: false,
  1839. value: true
  1840. });
  1841. return component;
  1842. }
  1843. function toSkip(obj) {
  1844. var OB = '__ob__';
  1845. var SKIP = '__v_skip';
  1846. if (isObject(obj) && Object.isExtensible(obj)) {
  1847. // 避免被 @vue/composition-api 观测
  1848. Object.defineProperty(obj, OB, {
  1849. configurable: true,
  1850. enumerable: false,
  1851. value: (0, _defineProperty2.default)({}, SKIP, true)
  1852. });
  1853. }
  1854. return obj;
  1855. }
  1856. var MPPage = Page;
  1857. var MPComponent = Component;
  1858. var customizeRE = /:/g;
  1859. var customize = cached(function (str) {
  1860. return camelize(str.replace(customizeRE, '-'));
  1861. });
  1862. function initTriggerEvent(mpInstance) {
  1863. var oldTriggerEvent = mpInstance.triggerEvent;
  1864. var newTriggerEvent = function newTriggerEvent(event) {
  1865. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1866. args[_key3 - 1] = arguments[_key3];
  1867. }
  1868. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1869. if (this.$vm || this.dataset && this.dataset.comType) {
  1870. event = customize(event);
  1871. } else {
  1872. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1873. var newEvent = customize(event);
  1874. if (newEvent !== event) {
  1875. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1876. }
  1877. }
  1878. return oldTriggerEvent.apply(this, [event].concat(args));
  1879. };
  1880. try {
  1881. // 京东小程序 triggerEvent 为只读
  1882. mpInstance.triggerEvent = newTriggerEvent;
  1883. } catch (error) {
  1884. mpInstance._triggerEvent = newTriggerEvent;
  1885. }
  1886. }
  1887. function initHook(name, options, isComponent) {
  1888. var oldHook = options[name];
  1889. options[name] = function () {
  1890. markMPComponent(this);
  1891. initTriggerEvent(this);
  1892. if (oldHook) {
  1893. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1894. args[_key4] = arguments[_key4];
  1895. }
  1896. return oldHook.apply(this, args);
  1897. }
  1898. };
  1899. }
  1900. if (!MPPage.__$wrappered) {
  1901. MPPage.__$wrappered = true;
  1902. Page = function Page() {
  1903. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1904. initHook('onLoad', options);
  1905. return MPPage(options);
  1906. };
  1907. Page.after = MPPage.after;
  1908. Component = function Component() {
  1909. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1910. initHook('created', options);
  1911. return MPComponent(options);
  1912. };
  1913. }
  1914. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1915. function initMocks(vm, mocks) {
  1916. var mpInstance = vm.$mp[vm.mpType];
  1917. mocks.forEach(function (mock) {
  1918. if (hasOwn(mpInstance, mock)) {
  1919. vm[mock] = mpInstance[mock];
  1920. }
  1921. });
  1922. }
  1923. function hasHook(hook, vueOptions) {
  1924. if (!vueOptions) {
  1925. return true;
  1926. }
  1927. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1928. return true;
  1929. }
  1930. vueOptions = vueOptions.default || vueOptions;
  1931. if (isFn(vueOptions)) {
  1932. if (isFn(vueOptions.extendOptions[hook])) {
  1933. return true;
  1934. }
  1935. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1936. return true;
  1937. }
  1938. return false;
  1939. }
  1940. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1941. return true;
  1942. }
  1943. var mixins = vueOptions.mixins;
  1944. if (Array.isArray(mixins)) {
  1945. return !!mixins.find(function (mixin) {
  1946. return hasHook(hook, mixin);
  1947. });
  1948. }
  1949. }
  1950. function initHooks(mpOptions, hooks, vueOptions) {
  1951. hooks.forEach(function (hook) {
  1952. if (hasHook(hook, vueOptions)) {
  1953. mpOptions[hook] = function (args) {
  1954. return this.$vm && this.$vm.__call_hook(hook, args);
  1955. };
  1956. }
  1957. });
  1958. }
  1959. function initUnknownHooks(mpOptions, vueOptions) {
  1960. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1961. findHooks(vueOptions).forEach(function (hook) {
  1962. return initHook$1(mpOptions, hook, excludes);
  1963. });
  1964. }
  1965. function findHooks(vueOptions) {
  1966. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1967. if (vueOptions) {
  1968. Object.keys(vueOptions).forEach(function (name) {
  1969. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1970. hooks.push(name);
  1971. }
  1972. });
  1973. }
  1974. return hooks;
  1975. }
  1976. function initHook$1(mpOptions, hook, excludes) {
  1977. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1978. mpOptions[hook] = function (args) {
  1979. return this.$vm && this.$vm.__call_hook(hook, args);
  1980. };
  1981. }
  1982. }
  1983. function initVueComponent(Vue, vueOptions) {
  1984. vueOptions = vueOptions.default || vueOptions;
  1985. var VueComponent;
  1986. if (isFn(vueOptions)) {
  1987. VueComponent = vueOptions;
  1988. } else {
  1989. VueComponent = Vue.extend(vueOptions);
  1990. }
  1991. vueOptions = VueComponent.options;
  1992. return [VueComponent, vueOptions];
  1993. }
  1994. function initSlots(vm, vueSlots) {
  1995. if (Array.isArray(vueSlots) && vueSlots.length) {
  1996. var $slots = Object.create(null);
  1997. vueSlots.forEach(function (slotName) {
  1998. $slots[slotName] = true;
  1999. });
  2000. vm.$scopedSlots = vm.$slots = $slots;
  2001. }
  2002. }
  2003. function initVueIds(vueIds, mpInstance) {
  2004. vueIds = (vueIds || '').split(',');
  2005. var len = vueIds.length;
  2006. if (len === 1) {
  2007. mpInstance._$vueId = vueIds[0];
  2008. } else if (len === 2) {
  2009. mpInstance._$vueId = vueIds[0];
  2010. mpInstance._$vuePid = vueIds[1];
  2011. }
  2012. }
  2013. function initData(vueOptions, context) {
  2014. var data = vueOptions.data || {};
  2015. var methods = vueOptions.methods || {};
  2016. if (typeof data === 'function') {
  2017. try {
  2018. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2019. } catch (e) {
  2020. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"某娘生鲜","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2021. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2022. }
  2023. }
  2024. } else {
  2025. try {
  2026. // 对 data 格式化
  2027. data = JSON.parse(JSON.stringify(data));
  2028. } catch (e) {}
  2029. }
  2030. if (!isPlainObject(data)) {
  2031. data = {};
  2032. }
  2033. Object.keys(methods).forEach(function (methodName) {
  2034. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2035. data[methodName] = methods[methodName];
  2036. }
  2037. });
  2038. return data;
  2039. }
  2040. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2041. function createObserver(name) {
  2042. return function observer(newVal, oldVal) {
  2043. if (this.$vm) {
  2044. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2045. }
  2046. };
  2047. }
  2048. function initBehaviors(vueOptions, initBehavior) {
  2049. var vueBehaviors = vueOptions.behaviors;
  2050. var vueExtends = vueOptions.extends;
  2051. var vueMixins = vueOptions.mixins;
  2052. var vueProps = vueOptions.props;
  2053. if (!vueProps) {
  2054. vueOptions.props = vueProps = [];
  2055. }
  2056. var behaviors = [];
  2057. if (Array.isArray(vueBehaviors)) {
  2058. vueBehaviors.forEach(function (behavior) {
  2059. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2060. if (behavior === 'uni://form-field') {
  2061. if (Array.isArray(vueProps)) {
  2062. vueProps.push('name');
  2063. vueProps.push('value');
  2064. } else {
  2065. vueProps.name = {
  2066. type: String,
  2067. default: ''
  2068. };
  2069. vueProps.value = {
  2070. type: [String, Number, Boolean, Array, Object, Date],
  2071. default: ''
  2072. };
  2073. }
  2074. }
  2075. });
  2076. }
  2077. if (isPlainObject(vueExtends) && vueExtends.props) {
  2078. behaviors.push(initBehavior({
  2079. properties: initProperties(vueExtends.props, true)
  2080. }));
  2081. }
  2082. if (Array.isArray(vueMixins)) {
  2083. vueMixins.forEach(function (vueMixin) {
  2084. if (isPlainObject(vueMixin) && vueMixin.props) {
  2085. behaviors.push(initBehavior({
  2086. properties: initProperties(vueMixin.props, true)
  2087. }));
  2088. }
  2089. });
  2090. }
  2091. return behaviors;
  2092. }
  2093. function parsePropType(key, type, defaultValue, file) {
  2094. // [String]=>String
  2095. if (Array.isArray(type) && type.length === 1) {
  2096. return type[0];
  2097. }
  2098. return type;
  2099. }
  2100. function initProperties(props) {
  2101. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2102. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2103. var options = arguments.length > 3 ? arguments[3] : undefined;
  2104. var properties = {};
  2105. if (!isBehavior) {
  2106. properties.vueId = {
  2107. type: String,
  2108. value: ''
  2109. };
  2110. {
  2111. if (options.virtualHost) {
  2112. properties.virtualHostStyle = {
  2113. type: null,
  2114. value: ''
  2115. };
  2116. properties.virtualHostClass = {
  2117. type: null,
  2118. value: ''
  2119. };
  2120. }
  2121. }
  2122. // scopedSlotsCompiler auto
  2123. properties.scopedSlotsCompiler = {
  2124. type: String,
  2125. value: ''
  2126. };
  2127. properties.vueSlots = {
  2128. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2129. type: null,
  2130. value: [],
  2131. observer: function observer(newVal, oldVal) {
  2132. var $slots = Object.create(null);
  2133. newVal.forEach(function (slotName) {
  2134. $slots[slotName] = true;
  2135. });
  2136. this.setData({
  2137. $slots: $slots
  2138. });
  2139. }
  2140. };
  2141. }
  2142. if (Array.isArray(props)) {
  2143. // ['title']
  2144. props.forEach(function (key) {
  2145. properties[key] = {
  2146. type: null,
  2147. observer: createObserver(key)
  2148. };
  2149. });
  2150. } else if (isPlainObject(props)) {
  2151. // {title:{type:String,default:''},content:String}
  2152. Object.keys(props).forEach(function (key) {
  2153. var opts = props[key];
  2154. if (isPlainObject(opts)) {
  2155. // title:{type:String,default:''}
  2156. var value = opts.default;
  2157. if (isFn(value)) {
  2158. value = value();
  2159. }
  2160. opts.type = parsePropType(key, opts.type);
  2161. properties[key] = {
  2162. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2163. value: value,
  2164. observer: createObserver(key)
  2165. };
  2166. } else {
  2167. // content:String
  2168. var type = parsePropType(key, opts);
  2169. properties[key] = {
  2170. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2171. observer: createObserver(key)
  2172. };
  2173. }
  2174. });
  2175. }
  2176. return properties;
  2177. }
  2178. function wrapper$1(event) {
  2179. // TODO 又得兼容 mpvue 的 mp 对象
  2180. try {
  2181. event.mp = JSON.parse(JSON.stringify(event));
  2182. } catch (e) {}
  2183. event.stopPropagation = noop;
  2184. event.preventDefault = noop;
  2185. event.target = event.target || {};
  2186. if (!hasOwn(event, 'detail')) {
  2187. event.detail = {};
  2188. }
  2189. if (hasOwn(event, 'markerId')) {
  2190. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2191. event.detail.markerId = event.markerId;
  2192. }
  2193. if (isPlainObject(event.detail)) {
  2194. event.target = Object.assign({}, event.target, event.detail);
  2195. }
  2196. return event;
  2197. }
  2198. function getExtraValue(vm, dataPathsArray) {
  2199. var context = vm;
  2200. dataPathsArray.forEach(function (dataPathArray) {
  2201. var dataPath = dataPathArray[0];
  2202. var value = dataPathArray[2];
  2203. if (dataPath || typeof value !== 'undefined') {
  2204. // ['','',index,'disable']
  2205. var propPath = dataPathArray[1];
  2206. var valuePath = dataPathArray[3];
  2207. var vFor;
  2208. if (Number.isInteger(dataPath)) {
  2209. vFor = dataPath;
  2210. } else if (!dataPath) {
  2211. vFor = context;
  2212. } else if (typeof dataPath === 'string' && dataPath) {
  2213. if (dataPath.indexOf('#s#') === 0) {
  2214. vFor = dataPath.substr(3);
  2215. } else {
  2216. vFor = vm.__get_value(dataPath, context);
  2217. }
  2218. }
  2219. if (Number.isInteger(vFor)) {
  2220. context = value;
  2221. } else if (!propPath) {
  2222. context = vFor[value];
  2223. } else {
  2224. if (Array.isArray(vFor)) {
  2225. context = vFor.find(function (vForItem) {
  2226. return vm.__get_value(propPath, vForItem) === value;
  2227. });
  2228. } else if (isPlainObject(vFor)) {
  2229. context = Object.keys(vFor).find(function (vForKey) {
  2230. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2231. });
  2232. } else {
  2233. console.error('v-for 暂不支持循环数据:', vFor);
  2234. }
  2235. }
  2236. if (valuePath) {
  2237. context = vm.__get_value(valuePath, context);
  2238. }
  2239. }
  2240. });
  2241. return context;
  2242. }
  2243. function processEventExtra(vm, extra, event, __args__) {
  2244. var extraObj = {};
  2245. if (Array.isArray(extra) && extra.length) {
  2246. /**
  2247. *[
  2248. * ['data.items', 'data.id', item.data.id],
  2249. * ['metas', 'id', meta.id]
  2250. *],
  2251. *[
  2252. * ['data.items', 'data.id', item.data.id],
  2253. * ['metas', 'id', meta.id]
  2254. *],
  2255. *'test'
  2256. */
  2257. extra.forEach(function (dataPath, index) {
  2258. if (typeof dataPath === 'string') {
  2259. if (!dataPath) {
  2260. // model,prop.sync
  2261. extraObj['$' + index] = vm;
  2262. } else {
  2263. if (dataPath === '$event') {
  2264. // $event
  2265. extraObj['$' + index] = event;
  2266. } else if (dataPath === 'arguments') {
  2267. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2268. } else if (dataPath.indexOf('$event.') === 0) {
  2269. // $event.target.value
  2270. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2271. } else {
  2272. extraObj['$' + index] = vm.__get_value(dataPath);
  2273. }
  2274. }
  2275. } else {
  2276. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2277. }
  2278. });
  2279. }
  2280. return extraObj;
  2281. }
  2282. function getObjByArray(arr) {
  2283. var obj = {};
  2284. for (var i = 1; i < arr.length; i++) {
  2285. var element = arr[i];
  2286. obj[element[0]] = element[1];
  2287. }
  2288. return obj;
  2289. }
  2290. function processEventArgs(vm, event) {
  2291. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2292. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2293. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2294. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2295. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2296. // fixed 用户直接触发 mpInstance.triggerEvent
  2297. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2298. if (isCustom) {
  2299. // 自定义事件
  2300. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2301. if (!args.length) {
  2302. // 无参数,直接传入 event 或 detail 数组
  2303. if (isCustomMPEvent) {
  2304. return [event];
  2305. }
  2306. return __args__;
  2307. }
  2308. }
  2309. var extraObj = processEventExtra(vm, extra, event, __args__);
  2310. var ret = [];
  2311. args.forEach(function (arg) {
  2312. if (arg === '$event') {
  2313. if (methodName === '__set_model' && !isCustom) {
  2314. // input v-model value
  2315. ret.push(event.target.value);
  2316. } else {
  2317. if (isCustom && !isCustomMPEvent) {
  2318. ret.push(__args__[0]);
  2319. } else {
  2320. // wxcomponent 组件或内置组件
  2321. ret.push(event);
  2322. }
  2323. }
  2324. } else {
  2325. if (Array.isArray(arg) && arg[0] === 'o') {
  2326. ret.push(getObjByArray(arg));
  2327. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2328. ret.push(extraObj[arg]);
  2329. } else {
  2330. ret.push(arg);
  2331. }
  2332. }
  2333. });
  2334. return ret;
  2335. }
  2336. var ONCE = '~';
  2337. var CUSTOM = '^';
  2338. function isMatchEventType(eventType, optType) {
  2339. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2340. }
  2341. function getContextVm(vm) {
  2342. var $parent = vm.$parent;
  2343. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  2344. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  2345. $parent = $parent.$parent;
  2346. }
  2347. return $parent && $parent.$parent;
  2348. }
  2349. function handleEvent(event) {
  2350. var _this2 = this;
  2351. event = wrapper$1(event);
  2352. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  2353. var dataset = (event.currentTarget || event.target).dataset;
  2354. if (!dataset) {
  2355. return console.warn('事件信息不存在');
  2356. }
  2357. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  2358. if (!eventOpts) {
  2359. return console.warn('事件信息不存在');
  2360. }
  2361. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  2362. var eventType = event.type;
  2363. var ret = [];
  2364. eventOpts.forEach(function (eventOpt) {
  2365. var type = eventOpt[0];
  2366. var eventsArray = eventOpt[1];
  2367. var isCustom = type.charAt(0) === CUSTOM;
  2368. type = isCustom ? type.slice(1) : type;
  2369. var isOnce = type.charAt(0) === ONCE;
  2370. type = isOnce ? type.slice(1) : type;
  2371. if (eventsArray && isMatchEventType(eventType, type)) {
  2372. eventsArray.forEach(function (eventArray) {
  2373. var methodName = eventArray[0];
  2374. if (methodName) {
  2375. var handlerCtx = _this2.$vm;
  2376. if (handlerCtx.$options.generic) {
  2377. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  2378. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  2379. }
  2380. if (methodName === '$emit') {
  2381. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  2382. return;
  2383. }
  2384. var handler = handlerCtx[methodName];
  2385. if (!isFn(handler)) {
  2386. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  2387. var path = _this2.route || _this2.is;
  2388. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  2389. }
  2390. if (isOnce) {
  2391. if (handler.once) {
  2392. return;
  2393. }
  2394. handler.once = true;
  2395. }
  2396. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  2397. params = Array.isArray(params) ? params : [];
  2398. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  2399. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  2400. // eslint-disable-next-line no-sparse-arrays
  2401. params = params.concat([,,,,,,,,,, event]);
  2402. }
  2403. ret.push(handler.apply(handlerCtx, params));
  2404. }
  2405. });
  2406. }
  2407. });
  2408. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  2409. return ret[0];
  2410. }
  2411. }
  2412. var eventChannels = {};
  2413. var eventChannelStack = [];
  2414. function getEventChannel(id) {
  2415. if (id) {
  2416. var eventChannel = eventChannels[id];
  2417. delete eventChannels[id];
  2418. return eventChannel;
  2419. }
  2420. return eventChannelStack.shift();
  2421. }
  2422. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  2423. function initEventChannel() {
  2424. _vue.default.prototype.getOpenerEventChannel = function () {
  2425. // 微信小程序使用自身getOpenerEventChannel
  2426. {
  2427. return this.$scope.getOpenerEventChannel();
  2428. }
  2429. };
  2430. var callHook = _vue.default.prototype.__call_hook;
  2431. _vue.default.prototype.__call_hook = function (hook, args) {
  2432. if (hook === 'onLoad' && args && args.__id__) {
  2433. this.__eventChannel__ = getEventChannel(args.__id__);
  2434. delete args.__id__;
  2435. }
  2436. return callHook.call(this, hook, args);
  2437. };
  2438. }
  2439. function initScopedSlotsParams() {
  2440. var center = {};
  2441. var parents = {};
  2442. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  2443. var has = center[vueId];
  2444. if (!has) {
  2445. parents[vueId] = this;
  2446. this.$on('hook:destroyed', function () {
  2447. delete parents[vueId];
  2448. });
  2449. }
  2450. return has;
  2451. };
  2452. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  2453. var data = center[vueId];
  2454. if (data) {
  2455. var object = data[name] || {};
  2456. return key ? object[key] : object;
  2457. } else {
  2458. parents[vueId] = this;
  2459. this.$on('hook:destroyed', function () {
  2460. delete parents[vueId];
  2461. });
  2462. }
  2463. };
  2464. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  2465. var vueIds = this.$options.propsData.vueId;
  2466. if (vueIds) {
  2467. var vueId = vueIds.split(',')[0];
  2468. var object = center[vueId] = center[vueId] || {};
  2469. object[name] = value;
  2470. if (parents[vueId]) {
  2471. parents[vueId].$forceUpdate();
  2472. }
  2473. }
  2474. };
  2475. _vue.default.mixin({
  2476. destroyed: function destroyed() {
  2477. var propsData = this.$options.propsData;
  2478. var vueId = propsData && propsData.vueId;
  2479. if (vueId) {
  2480. delete center[vueId];
  2481. delete parents[vueId];
  2482. }
  2483. }
  2484. });
  2485. }
  2486. function parseBaseApp(vm, _ref4) {
  2487. var mocks = _ref4.mocks,
  2488. initRefs = _ref4.initRefs;
  2489. initEventChannel();
  2490. {
  2491. initScopedSlotsParams();
  2492. }
  2493. if (vm.$options.store) {
  2494. _vue.default.prototype.$store = vm.$options.store;
  2495. }
  2496. uniIdMixin(_vue.default);
  2497. _vue.default.prototype.mpHost = "mp-weixin";
  2498. _vue.default.mixin({
  2499. beforeCreate: function beforeCreate() {
  2500. if (!this.$options.mpType) {
  2501. return;
  2502. }
  2503. this.mpType = this.$options.mpType;
  2504. this.$mp = (0, _defineProperty2.default)({
  2505. data: {}
  2506. }, this.mpType, this.$options.mpInstance);
  2507. this.$scope = this.$options.mpInstance;
  2508. delete this.$options.mpType;
  2509. delete this.$options.mpInstance;
  2510. if (this.mpType === 'page' && typeof getApp === 'function') {
  2511. // hack vue-i18n
  2512. var app = getApp();
  2513. if (app.$vm && app.$vm.$i18n) {
  2514. this._i18n = app.$vm.$i18n;
  2515. }
  2516. }
  2517. if (this.mpType !== 'app') {
  2518. initRefs(this);
  2519. initMocks(this, mocks);
  2520. }
  2521. }
  2522. });
  2523. var appOptions = {
  2524. onLaunch: function onLaunch(args) {
  2525. if (this.$vm) {
  2526. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2527. return;
  2528. }
  2529. {
  2530. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2531. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2532. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2533. }
  2534. }
  2535. this.$vm = vm;
  2536. this.$vm.$mp = {
  2537. app: this
  2538. };
  2539. this.$vm.$scope = this;
  2540. // vm 上也挂载 globalData
  2541. this.$vm.globalData = this.globalData;
  2542. this.$vm._isMounted = true;
  2543. this.$vm.__call_hook('mounted', args);
  2544. this.$vm.__call_hook('onLaunch', args);
  2545. }
  2546. };
  2547. // 兼容旧版本 globalData
  2548. appOptions.globalData = vm.$options.globalData || {};
  2549. // 将 methods 中的方法挂在 getApp() 中
  2550. var methods = vm.$options.methods;
  2551. if (methods) {
  2552. Object.keys(methods).forEach(function (name) {
  2553. appOptions[name] = methods[name];
  2554. });
  2555. }
  2556. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2557. initHooks(appOptions, hooks);
  2558. initUnknownHooks(appOptions, vm.$options);
  2559. return appOptions;
  2560. }
  2561. function parseApp(vm) {
  2562. return parseBaseApp(vm, {
  2563. mocks: mocks,
  2564. initRefs: initRefs
  2565. });
  2566. }
  2567. function createApp(vm) {
  2568. App(parseApp(vm));
  2569. return vm;
  2570. }
  2571. var encodeReserveRE = /[!'()*]/g;
  2572. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2573. return '%' + c.charCodeAt(0).toString(16);
  2574. };
  2575. var commaRE = /%2C/g;
  2576. // fixed encodeURIComponent which is more conformant to RFC3986:
  2577. // - escapes [!'()*]
  2578. // - preserve commas
  2579. var encode = function encode(str) {
  2580. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2581. };
  2582. function stringifyQuery(obj) {
  2583. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2584. var res = obj ? Object.keys(obj).map(function (key) {
  2585. var val = obj[key];
  2586. if (val === undefined) {
  2587. return '';
  2588. }
  2589. if (val === null) {
  2590. return encodeStr(key);
  2591. }
  2592. if (Array.isArray(val)) {
  2593. var result = [];
  2594. val.forEach(function (val2) {
  2595. if (val2 === undefined) {
  2596. return;
  2597. }
  2598. if (val2 === null) {
  2599. result.push(encodeStr(key));
  2600. } else {
  2601. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2602. }
  2603. });
  2604. return result.join('&');
  2605. }
  2606. return encodeStr(key) + '=' + encodeStr(val);
  2607. }).filter(function (x) {
  2608. return x.length > 0;
  2609. }).join('&') : null;
  2610. return res ? "?".concat(res) : '';
  2611. }
  2612. function parseBaseComponent(vueComponentOptions) {
  2613. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2614. isPage = _ref5.isPage,
  2615. initRelation = _ref5.initRelation;
  2616. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2617. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2618. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2619. VueComponent = _initVueComponent2[0],
  2620. vueOptions = _initVueComponent2[1];
  2621. var options = _objectSpread({
  2622. multipleSlots: true,
  2623. addGlobalClass: true
  2624. }, vueOptions.options || {});
  2625. {
  2626. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2627. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2628. Object.assign(options, vueOptions['mp-weixin'].options);
  2629. }
  2630. }
  2631. var componentOptions = {
  2632. options: options,
  2633. data: initData(vueOptions, _vue.default.prototype),
  2634. behaviors: initBehaviors(vueOptions, initBehavior),
  2635. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2636. lifetimes: {
  2637. attached: function attached() {
  2638. var properties = this.properties;
  2639. var options = {
  2640. mpType: isPage.call(this) ? 'page' : 'component',
  2641. mpInstance: this,
  2642. propsData: properties
  2643. };
  2644. initVueIds(properties.vueId, this);
  2645. // 处理父子关系
  2646. initRelation.call(this, {
  2647. vuePid: this._$vuePid,
  2648. vueOptions: options
  2649. });
  2650. // 初始化 vue 实例
  2651. this.$vm = new VueComponent(options);
  2652. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2653. initSlots(this.$vm, properties.vueSlots);
  2654. // 触发首次 setData
  2655. this.$vm.$mount();
  2656. },
  2657. ready: function ready() {
  2658. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2659. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2660. if (this.$vm) {
  2661. this.$vm._isMounted = true;
  2662. this.$vm.__call_hook('mounted');
  2663. this.$vm.__call_hook('onReady');
  2664. }
  2665. },
  2666. detached: function detached() {
  2667. this.$vm && this.$vm.$destroy();
  2668. }
  2669. },
  2670. pageLifetimes: {
  2671. show: function show(args) {
  2672. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2673. },
  2674. hide: function hide() {
  2675. this.$vm && this.$vm.__call_hook('onPageHide');
  2676. },
  2677. resize: function resize(size) {
  2678. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2679. }
  2680. },
  2681. methods: {
  2682. __l: handleLink,
  2683. __e: handleEvent
  2684. }
  2685. };
  2686. // externalClasses
  2687. if (vueOptions.externalClasses) {
  2688. componentOptions.externalClasses = vueOptions.externalClasses;
  2689. }
  2690. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2691. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2692. componentOptions.methods[callMethod] = function (args) {
  2693. return this.$vm[callMethod](args);
  2694. };
  2695. });
  2696. }
  2697. if (needVueOptions) {
  2698. return [componentOptions, vueOptions, VueComponent];
  2699. }
  2700. if (isPage) {
  2701. return componentOptions;
  2702. }
  2703. return [componentOptions, VueComponent];
  2704. }
  2705. function parseComponent(vueComponentOptions, needVueOptions) {
  2706. return parseBaseComponent(vueComponentOptions, {
  2707. isPage: isPage,
  2708. initRelation: initRelation
  2709. }, needVueOptions);
  2710. }
  2711. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2712. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2713. function parseBasePage(vuePageOptions) {
  2714. var _parseComponent = parseComponent(vuePageOptions, true),
  2715. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2716. pageOptions = _parseComponent2[0],
  2717. vueOptions = _parseComponent2[1];
  2718. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2719. pageOptions.methods.onLoad = function (query) {
  2720. this.options = query;
  2721. var copyQuery = Object.assign({}, query);
  2722. delete copyQuery.__id__;
  2723. this.$page = {
  2724. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2725. };
  2726. this.$vm.$mp.query = query; // 兼容 mpvue
  2727. this.$vm.__call_hook('onLoad', query);
  2728. };
  2729. {
  2730. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2731. }
  2732. return pageOptions;
  2733. }
  2734. function parsePage(vuePageOptions) {
  2735. return parseBasePage(vuePageOptions);
  2736. }
  2737. function createPage(vuePageOptions) {
  2738. {
  2739. return Component(parsePage(vuePageOptions));
  2740. }
  2741. }
  2742. function createComponent(vueOptions) {
  2743. {
  2744. return Component(parseComponent(vueOptions));
  2745. }
  2746. }
  2747. function createSubpackageApp(vm) {
  2748. var appOptions = parseApp(vm);
  2749. var app = getApp({
  2750. allowDefault: true
  2751. });
  2752. vm.$scope = app;
  2753. var globalData = app.globalData;
  2754. if (globalData) {
  2755. Object.keys(appOptions.globalData).forEach(function (name) {
  2756. if (!hasOwn(globalData, name)) {
  2757. globalData[name] = appOptions.globalData[name];
  2758. }
  2759. });
  2760. }
  2761. Object.keys(appOptions).forEach(function (name) {
  2762. if (!hasOwn(app, name)) {
  2763. app[name] = appOptions[name];
  2764. }
  2765. });
  2766. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2767. wx.onAppShow(function () {
  2768. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2769. args[_key5] = arguments[_key5];
  2770. }
  2771. vm.__call_hook('onShow', args);
  2772. });
  2773. }
  2774. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2775. wx.onAppHide(function () {
  2776. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2777. args[_key6] = arguments[_key6];
  2778. }
  2779. vm.__call_hook('onHide', args);
  2780. });
  2781. }
  2782. if (isFn(appOptions.onLaunch)) {
  2783. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2784. vm.__call_hook('onLaunch', args);
  2785. }
  2786. return vm;
  2787. }
  2788. function createPlugin(vm) {
  2789. var appOptions = parseApp(vm);
  2790. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2791. wx.onAppShow(function () {
  2792. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2793. args[_key7] = arguments[_key7];
  2794. }
  2795. vm.__call_hook('onShow', args);
  2796. });
  2797. }
  2798. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2799. wx.onAppHide(function () {
  2800. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2801. args[_key8] = arguments[_key8];
  2802. }
  2803. vm.__call_hook('onHide', args);
  2804. });
  2805. }
  2806. if (isFn(appOptions.onLaunch)) {
  2807. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2808. vm.__call_hook('onLaunch', args);
  2809. }
  2810. return vm;
  2811. }
  2812. todos.forEach(function (todoApi) {
  2813. protocols[todoApi] = false;
  2814. });
  2815. canIUses.forEach(function (canIUseApi) {
  2816. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2817. if (!wx.canIUse(apiName)) {
  2818. protocols[canIUseApi] = false;
  2819. }
  2820. });
  2821. var uni = {};
  2822. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2823. uni = new Proxy({}, {
  2824. get: function get(target, name) {
  2825. if (hasOwn(target, name)) {
  2826. return target[name];
  2827. }
  2828. if (baseApi[name]) {
  2829. return baseApi[name];
  2830. }
  2831. if (api[name]) {
  2832. return promisify(name, api[name]);
  2833. }
  2834. {
  2835. if (extraApi[name]) {
  2836. return promisify(name, extraApi[name]);
  2837. }
  2838. if (todoApis[name]) {
  2839. return promisify(name, todoApis[name]);
  2840. }
  2841. }
  2842. if (eventApi[name]) {
  2843. return eventApi[name];
  2844. }
  2845. return promisify(name, wrapper(name, wx[name]));
  2846. },
  2847. set: function set(target, name, value) {
  2848. target[name] = value;
  2849. return true;
  2850. }
  2851. });
  2852. } else {
  2853. Object.keys(baseApi).forEach(function (name) {
  2854. uni[name] = baseApi[name];
  2855. });
  2856. {
  2857. Object.keys(todoApis).forEach(function (name) {
  2858. uni[name] = promisify(name, todoApis[name]);
  2859. });
  2860. Object.keys(extraApi).forEach(function (name) {
  2861. uni[name] = promisify(name, todoApis[name]);
  2862. });
  2863. }
  2864. Object.keys(eventApi).forEach(function (name) {
  2865. uni[name] = eventApi[name];
  2866. });
  2867. Object.keys(api).forEach(function (name) {
  2868. uni[name] = promisify(name, api[name]);
  2869. });
  2870. Object.keys(wx).forEach(function (name) {
  2871. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2872. uni[name] = promisify(name, wrapper(name, wx[name]));
  2873. }
  2874. });
  2875. }
  2876. wx.createApp = createApp;
  2877. wx.createPage = createPage;
  2878. wx.createComponent = createComponent;
  2879. wx.createSubpackageApp = createSubpackageApp;
  2880. wx.createPlugin = createPlugin;
  2881. var uni$1 = uni;
  2882. var _default = uni$1;
  2883. exports.default = _default;
  2884. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  2885. /***/ }),
  2886. /***/ 20:
  2887. /*!****************************************************************!*\
  2888. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2889. \****************************************************************/
  2890. /*! no static exports found */
  2891. /***/ (function(module, exports) {
  2892. function _iterableToArray(iter) {
  2893. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2894. }
  2895. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2896. /***/ }),
  2897. /***/ 204:
  2898. /*!*************************************!*\
  2899. !*** D:/工作/项目2/生鲜/sx/api/wallet.js ***!
  2900. \*************************************/
  2901. /*! no static exports found */
  2902. /***/ (function(module, exports, __webpack_require__) {
  2903. "use strict";
  2904. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2905. Object.defineProperty(exports, "__esModule", {
  2906. value: true
  2907. });
  2908. exports.aliInfo = aliInfo;
  2909. exports.balance = balance;
  2910. exports.bankInfo = bankInfo;
  2911. exports.extractBank = extractBank;
  2912. exports.extractCash = extractCash;
  2913. exports.getAreaOrderDay = getAreaOrderDay;
  2914. exports.getAreaOrderMonth = getAreaOrderMonth;
  2915. exports.getCommission = getCommission;
  2916. exports.getOrderData = getOrderData;
  2917. exports.getOrderMonth = getOrderMonth;
  2918. exports.getOrderTime = getOrderTime;
  2919. exports.getRechargeList = getRechargeList;
  2920. exports.rechargeRoutine = rechargeRoutine;
  2921. exports.setAliInfo = setAliInfo;
  2922. exports.setBankInfo = setBankInfo;
  2923. exports.spreadCommission = spreadCommission;
  2924. exports.userBalance = userBalance;
  2925. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  2926. // 获取用户消费记录
  2927. function spreadCommission(data, state) {
  2928. return (0, _request.default)({
  2929. url: '/api/spread/commission/' + state,
  2930. method: 'get',
  2931. data: data
  2932. });
  2933. }
  2934. // 获取账户余额
  2935. function userBalance(data) {
  2936. return (0, _request.default)({
  2937. url: '/api/user/balance',
  2938. method: 'get',
  2939. data: data
  2940. });
  2941. }
  2942. // 提现
  2943. function extractCash(data) {
  2944. return (0, _request.default)({
  2945. url: '/api/extract/cash',
  2946. method: 'post',
  2947. data: data
  2948. });
  2949. }
  2950. // 提现信息
  2951. function extractBank(data) {
  2952. return (0, _request.default)({
  2953. url: '/api/extract/bank',
  2954. method: 'get',
  2955. data: data
  2956. });
  2957. }
  2958. // 小程序充值
  2959. function rechargeRoutine(data) {
  2960. return (0, _request.default)({
  2961. url: '/api/recharge/routine',
  2962. method: 'post',
  2963. data: data
  2964. });
  2965. }
  2966. // 获取提现支付宝账号
  2967. function aliInfo(data) {
  2968. return (0, _request.default)({
  2969. url: '/api/ali/info',
  2970. method: 'get',
  2971. data: data
  2972. });
  2973. }
  2974. //获取默认银行卡账号
  2975. function bankInfo(data) {
  2976. return (0, _request.default)({
  2977. url: '/api/bank/info',
  2978. method: 'get',
  2979. data: data
  2980. });
  2981. }
  2982. // 保存提现支付宝账号
  2983. function setAliInfo(data) {
  2984. return (0, _request.default)({
  2985. url: '/api/ali/edit',
  2986. method: 'post',
  2987. data: data
  2988. });
  2989. }
  2990. //保存默认银行卡账号
  2991. function setBankInfo(data) {
  2992. return (0, _request.default)({
  2993. url: '/api/bank/edit',
  2994. method: 'post',
  2995. data: data
  2996. });
  2997. }
  2998. // 账户余额
  2999. function balance(data) {
  3000. return (0, _request.default)({
  3001. url: '/api/user/balance',
  3002. method: 'get',
  3003. data: data
  3004. });
  3005. }
  3006. //推广数据接口
  3007. function getCommission(data) {
  3008. return (0, _request.default)({
  3009. url: '/api/commission',
  3010. method: 'get',
  3011. data: data
  3012. });
  3013. }
  3014. ///api/admin/order/time
  3015. function getOrderTime(data) {
  3016. return (0, _request.default)({
  3017. url: '/api/admin/order/time',
  3018. method: 'get',
  3019. data: data
  3020. });
  3021. }
  3022. ///api/admin/order/data
  3023. function getOrderData(data) {
  3024. return (0, _request.default)({
  3025. url: '/api/admin/order/data',
  3026. method: 'get',
  3027. data: data
  3028. });
  3029. }
  3030. //month
  3031. function getOrderMonth(data) {
  3032. return (0, _request.default)({
  3033. url: '/api/admin/order/month',
  3034. method: 'get',
  3035. data: data
  3036. });
  3037. }
  3038. //admin/recharge
  3039. function getRechargeList(data) {
  3040. return (0, _request.default)({
  3041. url: '/api/admin/recharge',
  3042. method: 'get',
  3043. data: data
  3044. });
  3045. }
  3046. //{{host}}area_admin/order/month
  3047. function getAreaOrderMonth(data) {
  3048. return (0, _request.default)({
  3049. url: '/api/area_admin/order/month',
  3050. method: 'get',
  3051. data: data
  3052. });
  3053. }
  3054. //getAreaOrderDay
  3055. //area_admin/order/time
  3056. function getAreaOrderDay(data) {
  3057. return (0, _request.default)({
  3058. url: '/api/area_admin/order/time',
  3059. method: 'get',
  3060. data: data
  3061. });
  3062. }
  3063. /***/ }),
  3064. /***/ 21:
  3065. /*!******************************************************************!*\
  3066. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3067. \******************************************************************/
  3068. /*! no static exports found */
  3069. /***/ (function(module, exports) {
  3070. function _nonIterableSpread() {
  3071. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3072. }
  3073. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3074. /***/ }),
  3075. /***/ 22:
  3076. /*!*************************************************************!*\
  3077. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3078. \*************************************************************/
  3079. /*! no static exports found */
  3080. /***/ (function(module, exports, __webpack_require__) {
  3081. "use strict";
  3082. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3083. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3084. Object.defineProperty(exports, "__esModule", {
  3085. value: true
  3086. });
  3087. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3088. exports.compileI18nJsonStr = compileI18nJsonStr;
  3089. exports.hasI18nJson = hasI18nJson;
  3090. exports.initVueI18n = initVueI18n;
  3091. exports.isI18nStr = isI18nStr;
  3092. exports.isString = void 0;
  3093. exports.normalizeLocale = normalizeLocale;
  3094. exports.parseI18nJson = parseI18nJson;
  3095. exports.resolveLocale = resolveLocale;
  3096. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3097. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3098. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3099. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3100. var isArray = Array.isArray;
  3101. var isObject = function isObject(val) {
  3102. return val !== null && (0, _typeof2.default)(val) === 'object';
  3103. };
  3104. var defaultDelimiters = ['{', '}'];
  3105. var BaseFormatter = /*#__PURE__*/function () {
  3106. function BaseFormatter() {
  3107. (0, _classCallCheck2.default)(this, BaseFormatter);
  3108. this._caches = Object.create(null);
  3109. }
  3110. (0, _createClass2.default)(BaseFormatter, [{
  3111. key: "interpolate",
  3112. value: function interpolate(message, values) {
  3113. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3114. if (!values) {
  3115. return [message];
  3116. }
  3117. var tokens = this._caches[message];
  3118. if (!tokens) {
  3119. tokens = parse(message, delimiters);
  3120. this._caches[message] = tokens;
  3121. }
  3122. return compile(tokens, values);
  3123. }
  3124. }]);
  3125. return BaseFormatter;
  3126. }();
  3127. exports.Formatter = BaseFormatter;
  3128. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3129. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3130. function parse(format, _ref) {
  3131. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3132. startDelimiter = _ref2[0],
  3133. endDelimiter = _ref2[1];
  3134. var tokens = [];
  3135. var position = 0;
  3136. var text = '';
  3137. while (position < format.length) {
  3138. var char = format[position++];
  3139. if (char === startDelimiter) {
  3140. if (text) {
  3141. tokens.push({
  3142. type: 'text',
  3143. value: text
  3144. });
  3145. }
  3146. text = '';
  3147. var sub = '';
  3148. char = format[position++];
  3149. while (char !== undefined && char !== endDelimiter) {
  3150. sub += char;
  3151. char = format[position++];
  3152. }
  3153. var isClosed = char === endDelimiter;
  3154. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3155. tokens.push({
  3156. value: sub,
  3157. type: type
  3158. });
  3159. }
  3160. // else if (char === '%') {
  3161. // // when found rails i18n syntax, skip text capture
  3162. // if (format[position] !== '{') {
  3163. // text += char
  3164. // }
  3165. // }
  3166. else {
  3167. text += char;
  3168. }
  3169. }
  3170. text && tokens.push({
  3171. type: 'text',
  3172. value: text
  3173. });
  3174. return tokens;
  3175. }
  3176. function compile(tokens, values) {
  3177. var compiled = [];
  3178. var index = 0;
  3179. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3180. if (mode === 'unknown') {
  3181. return compiled;
  3182. }
  3183. while (index < tokens.length) {
  3184. var token = tokens[index];
  3185. switch (token.type) {
  3186. case 'text':
  3187. compiled.push(token.value);
  3188. break;
  3189. case 'list':
  3190. compiled.push(values[parseInt(token.value, 10)]);
  3191. break;
  3192. case 'named':
  3193. if (mode === 'named') {
  3194. compiled.push(values[token.value]);
  3195. } else {
  3196. if (true) {
  3197. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3198. }
  3199. }
  3200. break;
  3201. case 'unknown':
  3202. if (true) {
  3203. console.warn("Detect 'unknown' type of token!");
  3204. }
  3205. break;
  3206. }
  3207. index++;
  3208. }
  3209. return compiled;
  3210. }
  3211. var LOCALE_ZH_HANS = 'zh-Hans';
  3212. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3213. var LOCALE_ZH_HANT = 'zh-Hant';
  3214. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3215. var LOCALE_EN = 'en';
  3216. exports.LOCALE_EN = LOCALE_EN;
  3217. var LOCALE_FR = 'fr';
  3218. exports.LOCALE_FR = LOCALE_FR;
  3219. var LOCALE_ES = 'es';
  3220. exports.LOCALE_ES = LOCALE_ES;
  3221. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3222. var hasOwn = function hasOwn(val, key) {
  3223. return hasOwnProperty.call(val, key);
  3224. };
  3225. var defaultFormatter = new BaseFormatter();
  3226. function include(str, parts) {
  3227. return !!parts.find(function (part) {
  3228. return str.indexOf(part) !== -1;
  3229. });
  3230. }
  3231. function startsWith(str, parts) {
  3232. return parts.find(function (part) {
  3233. return str.indexOf(part) === 0;
  3234. });
  3235. }
  3236. function normalizeLocale(locale, messages) {
  3237. if (!locale) {
  3238. return;
  3239. }
  3240. locale = locale.trim().replace(/_/g, '-');
  3241. if (messages && messages[locale]) {
  3242. return locale;
  3243. }
  3244. locale = locale.toLowerCase();
  3245. if (locale.indexOf('zh') === 0) {
  3246. if (locale.indexOf('-hans') > -1) {
  3247. return LOCALE_ZH_HANS;
  3248. }
  3249. if (locale.indexOf('-hant') > -1) {
  3250. return LOCALE_ZH_HANT;
  3251. }
  3252. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3253. return LOCALE_ZH_HANT;
  3254. }
  3255. return LOCALE_ZH_HANS;
  3256. }
  3257. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  3258. if (lang) {
  3259. return lang;
  3260. }
  3261. }
  3262. var I18n = /*#__PURE__*/function () {
  3263. function I18n(_ref3) {
  3264. var locale = _ref3.locale,
  3265. fallbackLocale = _ref3.fallbackLocale,
  3266. messages = _ref3.messages,
  3267. watcher = _ref3.watcher,
  3268. formater = _ref3.formater;
  3269. (0, _classCallCheck2.default)(this, I18n);
  3270. this.locale = LOCALE_EN;
  3271. this.fallbackLocale = LOCALE_EN;
  3272. this.message = {};
  3273. this.messages = {};
  3274. this.watchers = [];
  3275. if (fallbackLocale) {
  3276. this.fallbackLocale = fallbackLocale;
  3277. }
  3278. this.formater = formater || defaultFormatter;
  3279. this.messages = messages || {};
  3280. this.setLocale(locale || LOCALE_EN);
  3281. if (watcher) {
  3282. this.watchLocale(watcher);
  3283. }
  3284. }
  3285. (0, _createClass2.default)(I18n, [{
  3286. key: "setLocale",
  3287. value: function setLocale(locale) {
  3288. var _this = this;
  3289. var oldLocale = this.locale;
  3290. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3291. if (!this.messages[this.locale]) {
  3292. // 可能初始化时不存在
  3293. this.messages[this.locale] = {};
  3294. }
  3295. this.message = this.messages[this.locale];
  3296. // 仅发生变化时,通知
  3297. if (oldLocale !== this.locale) {
  3298. this.watchers.forEach(function (watcher) {
  3299. watcher(_this.locale, oldLocale);
  3300. });
  3301. }
  3302. }
  3303. }, {
  3304. key: "getLocale",
  3305. value: function getLocale() {
  3306. return this.locale;
  3307. }
  3308. }, {
  3309. key: "watchLocale",
  3310. value: function watchLocale(fn) {
  3311. var _this2 = this;
  3312. var index = this.watchers.push(fn) - 1;
  3313. return function () {
  3314. _this2.watchers.splice(index, 1);
  3315. };
  3316. }
  3317. }, {
  3318. key: "add",
  3319. value: function add(locale, message) {
  3320. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3321. var curMessages = this.messages[locale];
  3322. if (curMessages) {
  3323. if (override) {
  3324. Object.assign(curMessages, message);
  3325. } else {
  3326. Object.keys(message).forEach(function (key) {
  3327. if (!hasOwn(curMessages, key)) {
  3328. curMessages[key] = message[key];
  3329. }
  3330. });
  3331. }
  3332. } else {
  3333. this.messages[locale] = message;
  3334. }
  3335. }
  3336. }, {
  3337. key: "f",
  3338. value: function f(message, values, delimiters) {
  3339. return this.formater.interpolate(message, values, delimiters).join('');
  3340. }
  3341. }, {
  3342. key: "t",
  3343. value: function t(key, locale, values) {
  3344. var message = this.message;
  3345. if (typeof locale === 'string') {
  3346. locale = normalizeLocale(locale, this.messages);
  3347. locale && (message = this.messages[locale]);
  3348. } else {
  3349. values = locale;
  3350. }
  3351. if (!hasOwn(message, key)) {
  3352. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3353. return key;
  3354. }
  3355. return this.formater.interpolate(message[key], values).join('');
  3356. }
  3357. }]);
  3358. return I18n;
  3359. }();
  3360. exports.I18n = I18n;
  3361. function watchAppLocale(appVm, i18n) {
  3362. // 需要保证 watch 的触发在组件渲染之前
  3363. if (appVm.$watchLocale) {
  3364. // vue2
  3365. appVm.$watchLocale(function (newLocale) {
  3366. i18n.setLocale(newLocale);
  3367. });
  3368. } else {
  3369. appVm.$watch(function () {
  3370. return appVm.$locale;
  3371. }, function (newLocale) {
  3372. i18n.setLocale(newLocale);
  3373. });
  3374. }
  3375. }
  3376. function getDefaultLocale() {
  3377. if (typeof uni !== 'undefined' && uni.getLocale) {
  3378. return uni.getLocale();
  3379. }
  3380. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3381. if (typeof global !== 'undefined' && global.getLocale) {
  3382. return global.getLocale();
  3383. }
  3384. return LOCALE_EN;
  3385. }
  3386. function initVueI18n(locale) {
  3387. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3388. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3389. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3390. // 兼容旧版本入参
  3391. if (typeof locale !== 'string') {
  3392. var _ref4 = [messages, locale];
  3393. locale = _ref4[0];
  3394. messages = _ref4[1];
  3395. }
  3396. if (typeof locale !== 'string') {
  3397. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3398. locale = getDefaultLocale();
  3399. }
  3400. if (typeof fallbackLocale !== 'string') {
  3401. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3402. }
  3403. var i18n = new I18n({
  3404. locale: locale,
  3405. fallbackLocale: fallbackLocale,
  3406. messages: messages,
  3407. watcher: watcher
  3408. });
  3409. var _t = function t(key, values) {
  3410. if (typeof getApp !== 'function') {
  3411. // app view
  3412. /* eslint-disable no-func-assign */
  3413. _t = function t(key, values) {
  3414. return i18n.t(key, values);
  3415. };
  3416. } else {
  3417. var isWatchedAppLocale = false;
  3418. _t = function t(key, values) {
  3419. var appVm = getApp().$vm;
  3420. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3421. // options: {
  3422. // type: Array,
  3423. // default () {
  3424. // return [{
  3425. // icon: 'shop',
  3426. // text: t("uni-goods-nav.options.shop"),
  3427. // }, {
  3428. // icon: 'cart',
  3429. // text: t("uni-goods-nav.options.cart")
  3430. // }]
  3431. // }
  3432. // },
  3433. if (appVm) {
  3434. // 触发响应式
  3435. appVm.$locale;
  3436. if (!isWatchedAppLocale) {
  3437. isWatchedAppLocale = true;
  3438. watchAppLocale(appVm, i18n);
  3439. }
  3440. }
  3441. return i18n.t(key, values);
  3442. };
  3443. }
  3444. return _t(key, values);
  3445. };
  3446. return {
  3447. i18n: i18n,
  3448. f: function f(message, values, delimiters) {
  3449. return i18n.f(message, values, delimiters);
  3450. },
  3451. t: function t(key, values) {
  3452. return _t(key, values);
  3453. },
  3454. add: function add(locale, message) {
  3455. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3456. return i18n.add(locale, message, override);
  3457. },
  3458. watch: function watch(fn) {
  3459. return i18n.watchLocale(fn);
  3460. },
  3461. getLocale: function getLocale() {
  3462. return i18n.getLocale();
  3463. },
  3464. setLocale: function setLocale(newLocale) {
  3465. return i18n.setLocale(newLocale);
  3466. }
  3467. };
  3468. }
  3469. var isString = function isString(val) {
  3470. return typeof val === 'string';
  3471. };
  3472. exports.isString = isString;
  3473. var formater;
  3474. function hasI18nJson(jsonObj, delimiters) {
  3475. if (!formater) {
  3476. formater = new BaseFormatter();
  3477. }
  3478. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3479. var value = jsonObj[key];
  3480. if (isString(value)) {
  3481. if (isI18nStr(value, delimiters)) {
  3482. return true;
  3483. }
  3484. } else {
  3485. return hasI18nJson(value, delimiters);
  3486. }
  3487. });
  3488. }
  3489. function parseI18nJson(jsonObj, values, delimiters) {
  3490. if (!formater) {
  3491. formater = new BaseFormatter();
  3492. }
  3493. walkJsonObj(jsonObj, function (jsonObj, key) {
  3494. var value = jsonObj[key];
  3495. if (isString(value)) {
  3496. if (isI18nStr(value, delimiters)) {
  3497. jsonObj[key] = compileStr(value, values, delimiters);
  3498. }
  3499. } else {
  3500. parseI18nJson(value, values, delimiters);
  3501. }
  3502. });
  3503. return jsonObj;
  3504. }
  3505. function compileI18nJsonStr(jsonStr, _ref5) {
  3506. var locale = _ref5.locale,
  3507. locales = _ref5.locales,
  3508. delimiters = _ref5.delimiters;
  3509. if (!isI18nStr(jsonStr, delimiters)) {
  3510. return jsonStr;
  3511. }
  3512. if (!formater) {
  3513. formater = new BaseFormatter();
  3514. }
  3515. var localeValues = [];
  3516. Object.keys(locales).forEach(function (name) {
  3517. if (name !== locale) {
  3518. localeValues.push({
  3519. locale: name,
  3520. values: locales[name]
  3521. });
  3522. }
  3523. });
  3524. localeValues.unshift({
  3525. locale: locale,
  3526. values: locales[locale]
  3527. });
  3528. try {
  3529. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3530. } catch (e) {}
  3531. return jsonStr;
  3532. }
  3533. function isI18nStr(value, delimiters) {
  3534. return value.indexOf(delimiters[0]) > -1;
  3535. }
  3536. function compileStr(value, values, delimiters) {
  3537. return formater.interpolate(value, values, delimiters).join('');
  3538. }
  3539. function compileValue(jsonObj, key, localeValues, delimiters) {
  3540. var value = jsonObj[key];
  3541. if (isString(value)) {
  3542. // 存在国际化
  3543. if (isI18nStr(value, delimiters)) {
  3544. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3545. if (localeValues.length > 1) {
  3546. // 格式化国际化语言
  3547. var valueLocales = jsonObj[key + 'Locales'] = {};
  3548. localeValues.forEach(function (localValue) {
  3549. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3550. });
  3551. }
  3552. }
  3553. } else {
  3554. compileJsonObj(value, localeValues, delimiters);
  3555. }
  3556. }
  3557. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3558. walkJsonObj(jsonObj, function (jsonObj, key) {
  3559. compileValue(jsonObj, key, localeValues, delimiters);
  3560. });
  3561. return jsonObj;
  3562. }
  3563. function walkJsonObj(jsonObj, walk) {
  3564. if (isArray(jsonObj)) {
  3565. for (var i = 0; i < jsonObj.length; i++) {
  3566. if (walk(jsonObj, i)) {
  3567. return true;
  3568. }
  3569. }
  3570. } else if (isObject(jsonObj)) {
  3571. for (var key in jsonObj) {
  3572. if (walk(jsonObj, key)) {
  3573. return true;
  3574. }
  3575. }
  3576. }
  3577. return false;
  3578. }
  3579. function resolveLocale(locales) {
  3580. return function (locale) {
  3581. if (!locale) {
  3582. return locale;
  3583. }
  3584. locale = normalizeLocale(locale) || locale;
  3585. return resolveLocaleChain(locale).find(function (locale) {
  3586. return locales.indexOf(locale) > -1;
  3587. });
  3588. };
  3589. }
  3590. function resolveLocaleChain(locale) {
  3591. var chain = [];
  3592. var tokens = locale.split('-');
  3593. while (tokens.length) {
  3594. chain.push(tokens.join('-'));
  3595. tokens.pop();
  3596. }
  3597. return chain;
  3598. }
  3599. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3600. /***/ }),
  3601. /***/ 221:
  3602. /*!*********************************************!*\
  3603. !*** D:/工作/项目2/生鲜/sx/api/functionalUnit.js ***!
  3604. \*********************************************/
  3605. /*! no static exports found */
  3606. /***/ (function(module, exports, __webpack_require__) {
  3607. "use strict";
  3608. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3609. Object.defineProperty(exports, "__esModule", {
  3610. value: true
  3611. });
  3612. exports.couponsOrder = couponsOrder;
  3613. exports.getCouponsList = getCouponsList;
  3614. exports.integral = integral;
  3615. exports.integrallist = integrallist;
  3616. exports.setCoupons = setCoupons;
  3617. exports.signList = signList;
  3618. exports.signUser = signUser;
  3619. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  3620. //获取优惠券列表
  3621. function getCouponsList(data, types) {
  3622. //优惠券状态 0全部 1未使用 2已使用
  3623. return (0, _request.default)({
  3624. url: '/api/coupons/user/' + types,
  3625. method: 'get',
  3626. data: data
  3627. });
  3628. }
  3629. //领取优惠券
  3630. function setCoupons(data) {
  3631. return (0, _request.default)({
  3632. url: '/api/coupon/receive',
  3633. method: 'post',
  3634. data: data
  3635. });
  3636. }
  3637. //获取可使用优惠券
  3638. function couponsOrder(data, price) {
  3639. return (0, _request.default)({
  3640. url: '/api/coupons/order/' + price,
  3641. method: 'get',
  3642. data: data
  3643. });
  3644. }
  3645. // 积分列表
  3646. function integrallist(data) {
  3647. return (0, _request.default)({
  3648. url: '/api/integral/list',
  3649. method: 'get',
  3650. data: data
  3651. });
  3652. }
  3653. // 获取签到列表
  3654. function signList(data) {
  3655. return (0, _request.default)({
  3656. url: '/api/sign/list',
  3657. method: 'get',
  3658. data: data
  3659. });
  3660. }
  3661. // 点击签到
  3662. function integral(data) {
  3663. return (0, _request.default)({
  3664. url: '/api/sign/integral',
  3665. method: 'post',
  3666. data: data
  3667. });
  3668. }
  3669. // 签到信息
  3670. function signUser(data) {
  3671. return (0, _request.default)({
  3672. url: '/api/sign/user',
  3673. method: 'post',
  3674. data: data
  3675. });
  3676. }
  3677. /***/ }),
  3678. /***/ 23:
  3679. /*!***************************************************************!*\
  3680. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3681. \***************************************************************/
  3682. /*! no static exports found */
  3683. /***/ (function(module, exports) {
  3684. function _classCallCheck(instance, Constructor) {
  3685. if (!(instance instanceof Constructor)) {
  3686. throw new TypeError("Cannot call a class as a function");
  3687. }
  3688. }
  3689. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3690. /***/ }),
  3691. /***/ 24:
  3692. /*!************************************************************!*\
  3693. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3694. \************************************************************/
  3695. /*! no static exports found */
  3696. /***/ (function(module, exports, __webpack_require__) {
  3697. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3698. function _defineProperties(target, props) {
  3699. for (var i = 0; i < props.length; i++) {
  3700. var descriptor = props[i];
  3701. descriptor.enumerable = descriptor.enumerable || false;
  3702. descriptor.configurable = true;
  3703. if ("value" in descriptor) descriptor.writable = true;
  3704. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3705. }
  3706. }
  3707. function _createClass(Constructor, protoProps, staticProps) {
  3708. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3709. if (staticProps) _defineProperties(Constructor, staticProps);
  3710. Object.defineProperty(Constructor, "prototype", {
  3711. writable: false
  3712. });
  3713. return Constructor;
  3714. }
  3715. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3716. /***/ }),
  3717. /***/ 25:
  3718. /*!******************************************************************************************!*\
  3719. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3720. \******************************************************************************************/
  3721. /*! exports provided: default */
  3722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3723. "use strict";
  3724. __webpack_require__.r(__webpack_exports__);
  3725. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3726. * Vue.js v2.6.11
  3727. * (c) 2014-2022 Evan You
  3728. * Released under the MIT License.
  3729. */
  3730. /* */
  3731. var emptyObject = Object.freeze({});
  3732. // These helpers produce better VM code in JS engines due to their
  3733. // explicitness and function inlining.
  3734. function isUndef (v) {
  3735. return v === undefined || v === null
  3736. }
  3737. function isDef (v) {
  3738. return v !== undefined && v !== null
  3739. }
  3740. function isTrue (v) {
  3741. return v === true
  3742. }
  3743. function isFalse (v) {
  3744. return v === false
  3745. }
  3746. /**
  3747. * Check if value is primitive.
  3748. */
  3749. function isPrimitive (value) {
  3750. return (
  3751. typeof value === 'string' ||
  3752. typeof value === 'number' ||
  3753. // $flow-disable-line
  3754. typeof value === 'symbol' ||
  3755. typeof value === 'boolean'
  3756. )
  3757. }
  3758. /**
  3759. * Quick object check - this is primarily used to tell
  3760. * Objects from primitive values when we know the value
  3761. * is a JSON-compliant type.
  3762. */
  3763. function isObject (obj) {
  3764. return obj !== null && typeof obj === 'object'
  3765. }
  3766. /**
  3767. * Get the raw type string of a value, e.g., [object Object].
  3768. */
  3769. var _toString = Object.prototype.toString;
  3770. function toRawType (value) {
  3771. return _toString.call(value).slice(8, -1)
  3772. }
  3773. /**
  3774. * Strict object type check. Only returns true
  3775. * for plain JavaScript objects.
  3776. */
  3777. function isPlainObject (obj) {
  3778. return _toString.call(obj) === '[object Object]'
  3779. }
  3780. function isRegExp (v) {
  3781. return _toString.call(v) === '[object RegExp]'
  3782. }
  3783. /**
  3784. * Check if val is a valid array index.
  3785. */
  3786. function isValidArrayIndex (val) {
  3787. var n = parseFloat(String(val));
  3788. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3789. }
  3790. function isPromise (val) {
  3791. return (
  3792. isDef(val) &&
  3793. typeof val.then === 'function' &&
  3794. typeof val.catch === 'function'
  3795. )
  3796. }
  3797. /**
  3798. * Convert a value to a string that is actually rendered.
  3799. */
  3800. function toString (val) {
  3801. return val == null
  3802. ? ''
  3803. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3804. ? JSON.stringify(val, null, 2)
  3805. : String(val)
  3806. }
  3807. /**
  3808. * Convert an input value to a number for persistence.
  3809. * If the conversion fails, return original string.
  3810. */
  3811. function toNumber (val) {
  3812. var n = parseFloat(val);
  3813. return isNaN(n) ? val : n
  3814. }
  3815. /**
  3816. * Make a map and return a function for checking if a key
  3817. * is in that map.
  3818. */
  3819. function makeMap (
  3820. str,
  3821. expectsLowerCase
  3822. ) {
  3823. var map = Object.create(null);
  3824. var list = str.split(',');
  3825. for (var i = 0; i < list.length; i++) {
  3826. map[list[i]] = true;
  3827. }
  3828. return expectsLowerCase
  3829. ? function (val) { return map[val.toLowerCase()]; }
  3830. : function (val) { return map[val]; }
  3831. }
  3832. /**
  3833. * Check if a tag is a built-in tag.
  3834. */
  3835. var isBuiltInTag = makeMap('slot,component', true);
  3836. /**
  3837. * Check if an attribute is a reserved attribute.
  3838. */
  3839. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3840. /**
  3841. * Remove an item from an array.
  3842. */
  3843. function remove (arr, item) {
  3844. if (arr.length) {
  3845. var index = arr.indexOf(item);
  3846. if (index > -1) {
  3847. return arr.splice(index, 1)
  3848. }
  3849. }
  3850. }
  3851. /**
  3852. * Check whether an object has the property.
  3853. */
  3854. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3855. function hasOwn (obj, key) {
  3856. return hasOwnProperty.call(obj, key)
  3857. }
  3858. /**
  3859. * Create a cached version of a pure function.
  3860. */
  3861. function cached (fn) {
  3862. var cache = Object.create(null);
  3863. return (function cachedFn (str) {
  3864. var hit = cache[str];
  3865. return hit || (cache[str] = fn(str))
  3866. })
  3867. }
  3868. /**
  3869. * Camelize a hyphen-delimited string.
  3870. */
  3871. var camelizeRE = /-(\w)/g;
  3872. var camelize = cached(function (str) {
  3873. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3874. });
  3875. /**
  3876. * Capitalize a string.
  3877. */
  3878. var capitalize = cached(function (str) {
  3879. return str.charAt(0).toUpperCase() + str.slice(1)
  3880. });
  3881. /**
  3882. * Hyphenate a camelCase string.
  3883. */
  3884. var hyphenateRE = /\B([A-Z])/g;
  3885. var hyphenate = cached(function (str) {
  3886. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3887. });
  3888. /**
  3889. * Simple bind polyfill for environments that do not support it,
  3890. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3891. * since native bind is now performant enough in most browsers.
  3892. * But removing it would mean breaking code that was able to run in
  3893. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3894. */
  3895. /* istanbul ignore next */
  3896. function polyfillBind (fn, ctx) {
  3897. function boundFn (a) {
  3898. var l = arguments.length;
  3899. return l
  3900. ? l > 1
  3901. ? fn.apply(ctx, arguments)
  3902. : fn.call(ctx, a)
  3903. : fn.call(ctx)
  3904. }
  3905. boundFn._length = fn.length;
  3906. return boundFn
  3907. }
  3908. function nativeBind (fn, ctx) {
  3909. return fn.bind(ctx)
  3910. }
  3911. var bind = Function.prototype.bind
  3912. ? nativeBind
  3913. : polyfillBind;
  3914. /**
  3915. * Convert an Array-like object to a real Array.
  3916. */
  3917. function toArray (list, start) {
  3918. start = start || 0;
  3919. var i = list.length - start;
  3920. var ret = new Array(i);
  3921. while (i--) {
  3922. ret[i] = list[i + start];
  3923. }
  3924. return ret
  3925. }
  3926. /**
  3927. * Mix properties into target object.
  3928. */
  3929. function extend (to, _from) {
  3930. for (var key in _from) {
  3931. to[key] = _from[key];
  3932. }
  3933. return to
  3934. }
  3935. /**
  3936. * Merge an Array of Objects into a single Object.
  3937. */
  3938. function toObject (arr) {
  3939. var res = {};
  3940. for (var i = 0; i < arr.length; i++) {
  3941. if (arr[i]) {
  3942. extend(res, arr[i]);
  3943. }
  3944. }
  3945. return res
  3946. }
  3947. /* eslint-disable no-unused-vars */
  3948. /**
  3949. * Perform no operation.
  3950. * Stubbing args to make Flow happy without leaving useless transpiled code
  3951. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3952. */
  3953. function noop (a, b, c) {}
  3954. /**
  3955. * Always return false.
  3956. */
  3957. var no = function (a, b, c) { return false; };
  3958. /* eslint-enable no-unused-vars */
  3959. /**
  3960. * Return the same value.
  3961. */
  3962. var identity = function (_) { return _; };
  3963. /**
  3964. * Check if two values are loosely equal - that is,
  3965. * if they are plain objects, do they have the same shape?
  3966. */
  3967. function looseEqual (a, b) {
  3968. if (a === b) { return true }
  3969. var isObjectA = isObject(a);
  3970. var isObjectB = isObject(b);
  3971. if (isObjectA && isObjectB) {
  3972. try {
  3973. var isArrayA = Array.isArray(a);
  3974. var isArrayB = Array.isArray(b);
  3975. if (isArrayA && isArrayB) {
  3976. return a.length === b.length && a.every(function (e, i) {
  3977. return looseEqual(e, b[i])
  3978. })
  3979. } else if (a instanceof Date && b instanceof Date) {
  3980. return a.getTime() === b.getTime()
  3981. } else if (!isArrayA && !isArrayB) {
  3982. var keysA = Object.keys(a);
  3983. var keysB = Object.keys(b);
  3984. return keysA.length === keysB.length && keysA.every(function (key) {
  3985. return looseEqual(a[key], b[key])
  3986. })
  3987. } else {
  3988. /* istanbul ignore next */
  3989. return false
  3990. }
  3991. } catch (e) {
  3992. /* istanbul ignore next */
  3993. return false
  3994. }
  3995. } else if (!isObjectA && !isObjectB) {
  3996. return String(a) === String(b)
  3997. } else {
  3998. return false
  3999. }
  4000. }
  4001. /**
  4002. * Return the first index at which a loosely equal value can be
  4003. * found in the array (if value is a plain object, the array must
  4004. * contain an object of the same shape), or -1 if it is not present.
  4005. */
  4006. function looseIndexOf (arr, val) {
  4007. for (var i = 0; i < arr.length; i++) {
  4008. if (looseEqual(arr[i], val)) { return i }
  4009. }
  4010. return -1
  4011. }
  4012. /**
  4013. * Ensure a function is called only once.
  4014. */
  4015. function once (fn) {
  4016. var called = false;
  4017. return function () {
  4018. if (!called) {
  4019. called = true;
  4020. fn.apply(this, arguments);
  4021. }
  4022. }
  4023. }
  4024. var ASSET_TYPES = [
  4025. 'component',
  4026. 'directive',
  4027. 'filter'
  4028. ];
  4029. var LIFECYCLE_HOOKS = [
  4030. 'beforeCreate',
  4031. 'created',
  4032. 'beforeMount',
  4033. 'mounted',
  4034. 'beforeUpdate',
  4035. 'updated',
  4036. 'beforeDestroy',
  4037. 'destroyed',
  4038. 'activated',
  4039. 'deactivated',
  4040. 'errorCaptured',
  4041. 'serverPrefetch'
  4042. ];
  4043. /* */
  4044. var config = ({
  4045. /**
  4046. * Option merge strategies (used in core/util/options)
  4047. */
  4048. // $flow-disable-line
  4049. optionMergeStrategies: Object.create(null),
  4050. /**
  4051. * Whether to suppress warnings.
  4052. */
  4053. silent: false,
  4054. /**
  4055. * Show production mode tip message on boot?
  4056. */
  4057. productionTip: "development" !== 'production',
  4058. /**
  4059. * Whether to enable devtools
  4060. */
  4061. devtools: "development" !== 'production',
  4062. /**
  4063. * Whether to record perf
  4064. */
  4065. performance: false,
  4066. /**
  4067. * Error handler for watcher errors
  4068. */
  4069. errorHandler: null,
  4070. /**
  4071. * Warn handler for watcher warns
  4072. */
  4073. warnHandler: null,
  4074. /**
  4075. * Ignore certain custom elements
  4076. */
  4077. ignoredElements: [],
  4078. /**
  4079. * Custom user key aliases for v-on
  4080. */
  4081. // $flow-disable-line
  4082. keyCodes: Object.create(null),
  4083. /**
  4084. * Check if a tag is reserved so that it cannot be registered as a
  4085. * component. This is platform-dependent and may be overwritten.
  4086. */
  4087. isReservedTag: no,
  4088. /**
  4089. * Check if an attribute is reserved so that it cannot be used as a component
  4090. * prop. This is platform-dependent and may be overwritten.
  4091. */
  4092. isReservedAttr: no,
  4093. /**
  4094. * Check if a tag is an unknown element.
  4095. * Platform-dependent.
  4096. */
  4097. isUnknownElement: no,
  4098. /**
  4099. * Get the namespace of an element
  4100. */
  4101. getTagNamespace: noop,
  4102. /**
  4103. * Parse the real tag name for the specific platform.
  4104. */
  4105. parsePlatformTagName: identity,
  4106. /**
  4107. * Check if an attribute must be bound using property, e.g. value
  4108. * Platform-dependent.
  4109. */
  4110. mustUseProp: no,
  4111. /**
  4112. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4113. * This will significantly reduce performance if set to false.
  4114. */
  4115. async: true,
  4116. /**
  4117. * Exposed for legacy reasons
  4118. */
  4119. _lifecycleHooks: LIFECYCLE_HOOKS
  4120. });
  4121. /* */
  4122. /**
  4123. * unicode letters used for parsing html tags, component names and property paths.
  4124. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4125. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4126. */
  4127. 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/;
  4128. /**
  4129. * Check if a string starts with $ or _
  4130. */
  4131. function isReserved (str) {
  4132. var c = (str + '').charCodeAt(0);
  4133. return c === 0x24 || c === 0x5F
  4134. }
  4135. /**
  4136. * Define a property.
  4137. */
  4138. function def (obj, key, val, enumerable) {
  4139. Object.defineProperty(obj, key, {
  4140. value: val,
  4141. enumerable: !!enumerable,
  4142. writable: true,
  4143. configurable: true
  4144. });
  4145. }
  4146. /**
  4147. * Parse simple path.
  4148. */
  4149. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4150. function parsePath (path) {
  4151. if (bailRE.test(path)) {
  4152. return
  4153. }
  4154. var segments = path.split('.');
  4155. return function (obj) {
  4156. for (var i = 0; i < segments.length; i++) {
  4157. if (!obj) { return }
  4158. obj = obj[segments[i]];
  4159. }
  4160. return obj
  4161. }
  4162. }
  4163. /* */
  4164. // can we use __proto__?
  4165. var hasProto = '__proto__' in {};
  4166. // Browser environment sniffing
  4167. var inBrowser = typeof window !== 'undefined';
  4168. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4169. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4170. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4171. var isIE = UA && /msie|trident/.test(UA);
  4172. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4173. var isEdge = UA && UA.indexOf('edge/') > 0;
  4174. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4175. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4176. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4177. var isPhantomJS = UA && /phantomjs/.test(UA);
  4178. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4179. // Firefox has a "watch" function on Object.prototype...
  4180. var nativeWatch = ({}).watch;
  4181. if (inBrowser) {
  4182. try {
  4183. var opts = {};
  4184. Object.defineProperty(opts, 'passive', ({
  4185. get: function get () {
  4186. }
  4187. })); // https://github.com/facebook/flow/issues/285
  4188. window.addEventListener('test-passive', null, opts);
  4189. } catch (e) {}
  4190. }
  4191. // this needs to be lazy-evaled because vue may be required before
  4192. // vue-server-renderer can set VUE_ENV
  4193. var _isServer;
  4194. var isServerRendering = function () {
  4195. if (_isServer === undefined) {
  4196. /* istanbul ignore if */
  4197. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4198. // detect presence of vue-server-renderer and avoid
  4199. // Webpack shimming the process
  4200. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4201. } else {
  4202. _isServer = false;
  4203. }
  4204. }
  4205. return _isServer
  4206. };
  4207. // detect devtools
  4208. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4209. /* istanbul ignore next */
  4210. function isNative (Ctor) {
  4211. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4212. }
  4213. var hasSymbol =
  4214. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4215. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4216. var _Set;
  4217. /* istanbul ignore if */ // $flow-disable-line
  4218. if (typeof Set !== 'undefined' && isNative(Set)) {
  4219. // use native Set when available.
  4220. _Set = Set;
  4221. } else {
  4222. // a non-standard Set polyfill that only works with primitive keys.
  4223. _Set = /*@__PURE__*/(function () {
  4224. function Set () {
  4225. this.set = Object.create(null);
  4226. }
  4227. Set.prototype.has = function has (key) {
  4228. return this.set[key] === true
  4229. };
  4230. Set.prototype.add = function add (key) {
  4231. this.set[key] = true;
  4232. };
  4233. Set.prototype.clear = function clear () {
  4234. this.set = Object.create(null);
  4235. };
  4236. return Set;
  4237. }());
  4238. }
  4239. /* */
  4240. var warn = noop;
  4241. var tip = noop;
  4242. var generateComponentTrace = (noop); // work around flow check
  4243. var formatComponentName = (noop);
  4244. if (true) {
  4245. var hasConsole = typeof console !== 'undefined';
  4246. var classifyRE = /(?:^|[-_])(\w)/g;
  4247. var classify = function (str) { return str
  4248. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4249. .replace(/[-_]/g, ''); };
  4250. warn = function (msg, vm) {
  4251. var trace = vm ? generateComponentTrace(vm) : '';
  4252. if (config.warnHandler) {
  4253. config.warnHandler.call(null, msg, vm, trace);
  4254. } else if (hasConsole && (!config.silent)) {
  4255. console.error(("[Vue warn]: " + msg + trace));
  4256. }
  4257. };
  4258. tip = function (msg, vm) {
  4259. if (hasConsole && (!config.silent)) {
  4260. console.warn("[Vue tip]: " + msg + (
  4261. vm ? generateComponentTrace(vm) : ''
  4262. ));
  4263. }
  4264. };
  4265. formatComponentName = function (vm, includeFile) {
  4266. if (vm.$root === vm) {
  4267. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4268. return ('') + vm.$options.__file
  4269. }
  4270. return '<Root>'
  4271. }
  4272. var options = typeof vm === 'function' && vm.cid != null
  4273. ? vm.options
  4274. : vm._isVue
  4275. ? vm.$options || vm.constructor.options
  4276. : vm;
  4277. var name = options.name || options._componentTag;
  4278. var file = options.__file;
  4279. if (!name && file) {
  4280. var match = file.match(/([^/\\]+)\.vue$/);
  4281. name = match && match[1];
  4282. }
  4283. return (
  4284. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4285. (file && includeFile !== false ? (" at " + file) : '')
  4286. )
  4287. };
  4288. var repeat = function (str, n) {
  4289. var res = '';
  4290. while (n) {
  4291. if (n % 2 === 1) { res += str; }
  4292. if (n > 1) { str += str; }
  4293. n >>= 1;
  4294. }
  4295. return res
  4296. };
  4297. generateComponentTrace = function (vm) {
  4298. if (vm._isVue && vm.$parent) {
  4299. var tree = [];
  4300. var currentRecursiveSequence = 0;
  4301. while (vm && vm.$options.name !== 'PageBody') {
  4302. if (tree.length > 0) {
  4303. var last = tree[tree.length - 1];
  4304. if (last.constructor === vm.constructor) {
  4305. currentRecursiveSequence++;
  4306. vm = vm.$parent;
  4307. continue
  4308. } else if (currentRecursiveSequence > 0) {
  4309. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4310. currentRecursiveSequence = 0;
  4311. }
  4312. }
  4313. !vm.$options.isReserved && tree.push(vm);
  4314. vm = vm.$parent;
  4315. }
  4316. return '\n\nfound in\n\n' + tree
  4317. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4318. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4319. : formatComponentName(vm))); })
  4320. .join('\n')
  4321. } else {
  4322. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4323. }
  4324. };
  4325. }
  4326. /* */
  4327. var uid = 0;
  4328. /**
  4329. * A dep is an observable that can have multiple
  4330. * directives subscribing to it.
  4331. */
  4332. var Dep = function Dep () {
  4333. this.id = uid++;
  4334. this.subs = [];
  4335. };
  4336. Dep.prototype.addSub = function addSub (sub) {
  4337. this.subs.push(sub);
  4338. };
  4339. Dep.prototype.removeSub = function removeSub (sub) {
  4340. remove(this.subs, sub);
  4341. };
  4342. Dep.prototype.depend = function depend () {
  4343. if (Dep.SharedObject.target) {
  4344. Dep.SharedObject.target.addDep(this);
  4345. }
  4346. };
  4347. Dep.prototype.notify = function notify () {
  4348. // stabilize the subscriber list first
  4349. var subs = this.subs.slice();
  4350. if ( true && !config.async) {
  4351. // subs aren't sorted in scheduler if not running async
  4352. // we need to sort them now to make sure they fire in correct
  4353. // order
  4354. subs.sort(function (a, b) { return a.id - b.id; });
  4355. }
  4356. for (var i = 0, l = subs.length; i < l; i++) {
  4357. subs[i].update();
  4358. }
  4359. };
  4360. // The current target watcher being evaluated.
  4361. // This is globally unique because only one watcher
  4362. // can be evaluated at a time.
  4363. // fixed by xxxxxx (nvue shared vuex)
  4364. /* eslint-disable no-undef */
  4365. Dep.SharedObject = {};
  4366. Dep.SharedObject.target = null;
  4367. Dep.SharedObject.targetStack = [];
  4368. function pushTarget (target) {
  4369. Dep.SharedObject.targetStack.push(target);
  4370. Dep.SharedObject.target = target;
  4371. Dep.target = target;
  4372. }
  4373. function popTarget () {
  4374. Dep.SharedObject.targetStack.pop();
  4375. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4376. Dep.target = Dep.SharedObject.target;
  4377. }
  4378. /* */
  4379. var VNode = function VNode (
  4380. tag,
  4381. data,
  4382. children,
  4383. text,
  4384. elm,
  4385. context,
  4386. componentOptions,
  4387. asyncFactory
  4388. ) {
  4389. this.tag = tag;
  4390. this.data = data;
  4391. this.children = children;
  4392. this.text = text;
  4393. this.elm = elm;
  4394. this.ns = undefined;
  4395. this.context = context;
  4396. this.fnContext = undefined;
  4397. this.fnOptions = undefined;
  4398. this.fnScopeId = undefined;
  4399. this.key = data && data.key;
  4400. this.componentOptions = componentOptions;
  4401. this.componentInstance = undefined;
  4402. this.parent = undefined;
  4403. this.raw = false;
  4404. this.isStatic = false;
  4405. this.isRootInsert = true;
  4406. this.isComment = false;
  4407. this.isCloned = false;
  4408. this.isOnce = false;
  4409. this.asyncFactory = asyncFactory;
  4410. this.asyncMeta = undefined;
  4411. this.isAsyncPlaceholder = false;
  4412. };
  4413. var prototypeAccessors = { child: { configurable: true } };
  4414. // DEPRECATED: alias for componentInstance for backwards compat.
  4415. /* istanbul ignore next */
  4416. prototypeAccessors.child.get = function () {
  4417. return this.componentInstance
  4418. };
  4419. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4420. var createEmptyVNode = function (text) {
  4421. if ( text === void 0 ) text = '';
  4422. var node = new VNode();
  4423. node.text = text;
  4424. node.isComment = true;
  4425. return node
  4426. };
  4427. function createTextVNode (val) {
  4428. return new VNode(undefined, undefined, undefined, String(val))
  4429. }
  4430. // optimized shallow clone
  4431. // used for static nodes and slot nodes because they may be reused across
  4432. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4433. // on their elm reference.
  4434. function cloneVNode (vnode) {
  4435. var cloned = new VNode(
  4436. vnode.tag,
  4437. vnode.data,
  4438. // #7975
  4439. // clone children array to avoid mutating original in case of cloning
  4440. // a child.
  4441. vnode.children && vnode.children.slice(),
  4442. vnode.text,
  4443. vnode.elm,
  4444. vnode.context,
  4445. vnode.componentOptions,
  4446. vnode.asyncFactory
  4447. );
  4448. cloned.ns = vnode.ns;
  4449. cloned.isStatic = vnode.isStatic;
  4450. cloned.key = vnode.key;
  4451. cloned.isComment = vnode.isComment;
  4452. cloned.fnContext = vnode.fnContext;
  4453. cloned.fnOptions = vnode.fnOptions;
  4454. cloned.fnScopeId = vnode.fnScopeId;
  4455. cloned.asyncMeta = vnode.asyncMeta;
  4456. cloned.isCloned = true;
  4457. return cloned
  4458. }
  4459. /*
  4460. * not type checking this file because flow doesn't play well with
  4461. * dynamically accessing methods on Array prototype
  4462. */
  4463. var arrayProto = Array.prototype;
  4464. var arrayMethods = Object.create(arrayProto);
  4465. var methodsToPatch = [
  4466. 'push',
  4467. 'pop',
  4468. 'shift',
  4469. 'unshift',
  4470. 'splice',
  4471. 'sort',
  4472. 'reverse'
  4473. ];
  4474. /**
  4475. * Intercept mutating methods and emit events
  4476. */
  4477. methodsToPatch.forEach(function (method) {
  4478. // cache original method
  4479. var original = arrayProto[method];
  4480. def(arrayMethods, method, function mutator () {
  4481. var args = [], len = arguments.length;
  4482. while ( len-- ) args[ len ] = arguments[ len ];
  4483. var result = original.apply(this, args);
  4484. var ob = this.__ob__;
  4485. var inserted;
  4486. switch (method) {
  4487. case 'push':
  4488. case 'unshift':
  4489. inserted = args;
  4490. break
  4491. case 'splice':
  4492. inserted = args.slice(2);
  4493. break
  4494. }
  4495. if (inserted) { ob.observeArray(inserted); }
  4496. // notify change
  4497. ob.dep.notify();
  4498. return result
  4499. });
  4500. });
  4501. /* */
  4502. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4503. /**
  4504. * In some cases we may want to disable observation inside a component's
  4505. * update computation.
  4506. */
  4507. var shouldObserve = true;
  4508. function toggleObserving (value) {
  4509. shouldObserve = value;
  4510. }
  4511. /**
  4512. * Observer class that is attached to each observed
  4513. * object. Once attached, the observer converts the target
  4514. * object's property keys into getter/setters that
  4515. * collect dependencies and dispatch updates.
  4516. */
  4517. var Observer = function Observer (value) {
  4518. this.value = value;
  4519. this.dep = new Dep();
  4520. this.vmCount = 0;
  4521. def(value, '__ob__', this);
  4522. if (Array.isArray(value)) {
  4523. if (hasProto) {
  4524. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4525. if(value.push !== value.__proto__.push){
  4526. copyAugment(value, arrayMethods, arrayKeys);
  4527. } else {
  4528. protoAugment(value, arrayMethods);
  4529. }
  4530. }
  4531. } else {
  4532. copyAugment(value, arrayMethods, arrayKeys);
  4533. }
  4534. this.observeArray(value);
  4535. } else {
  4536. this.walk(value);
  4537. }
  4538. };
  4539. /**
  4540. * Walk through all properties and convert them into
  4541. * getter/setters. This method should only be called when
  4542. * value type is Object.
  4543. */
  4544. Observer.prototype.walk = function walk (obj) {
  4545. var keys = Object.keys(obj);
  4546. for (var i = 0; i < keys.length; i++) {
  4547. defineReactive$$1(obj, keys[i]);
  4548. }
  4549. };
  4550. /**
  4551. * Observe a list of Array items.
  4552. */
  4553. Observer.prototype.observeArray = function observeArray (items) {
  4554. for (var i = 0, l = items.length; i < l; i++) {
  4555. observe(items[i]);
  4556. }
  4557. };
  4558. // helpers
  4559. /**
  4560. * Augment a target Object or Array by intercepting
  4561. * the prototype chain using __proto__
  4562. */
  4563. function protoAugment (target, src) {
  4564. /* eslint-disable no-proto */
  4565. target.__proto__ = src;
  4566. /* eslint-enable no-proto */
  4567. }
  4568. /**
  4569. * Augment a target Object or Array by defining
  4570. * hidden properties.
  4571. */
  4572. /* istanbul ignore next */
  4573. function copyAugment (target, src, keys) {
  4574. for (var i = 0, l = keys.length; i < l; i++) {
  4575. var key = keys[i];
  4576. def(target, key, src[key]);
  4577. }
  4578. }
  4579. /**
  4580. * Attempt to create an observer instance for a value,
  4581. * returns the new observer if successfully observed,
  4582. * or the existing observer if the value already has one.
  4583. */
  4584. function observe (value, asRootData) {
  4585. if (!isObject(value) || value instanceof VNode) {
  4586. return
  4587. }
  4588. var ob;
  4589. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4590. ob = value.__ob__;
  4591. } else if (
  4592. shouldObserve &&
  4593. !isServerRendering() &&
  4594. (Array.isArray(value) || isPlainObject(value)) &&
  4595. Object.isExtensible(value) &&
  4596. !value._isVue &&
  4597. !value.__v_isMPComponent
  4598. ) {
  4599. ob = new Observer(value);
  4600. }
  4601. if (asRootData && ob) {
  4602. ob.vmCount++;
  4603. }
  4604. return ob
  4605. }
  4606. /**
  4607. * Define a reactive property on an Object.
  4608. */
  4609. function defineReactive$$1 (
  4610. obj,
  4611. key,
  4612. val,
  4613. customSetter,
  4614. shallow
  4615. ) {
  4616. var dep = new Dep();
  4617. var property = Object.getOwnPropertyDescriptor(obj, key);
  4618. if (property && property.configurable === false) {
  4619. return
  4620. }
  4621. // cater for pre-defined getter/setters
  4622. var getter = property && property.get;
  4623. var setter = property && property.set;
  4624. if ((!getter || setter) && arguments.length === 2) {
  4625. val = obj[key];
  4626. }
  4627. var childOb = !shallow && observe(val);
  4628. Object.defineProperty(obj, key, {
  4629. enumerable: true,
  4630. configurable: true,
  4631. get: function reactiveGetter () {
  4632. var value = getter ? getter.call(obj) : val;
  4633. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4634. dep.depend();
  4635. if (childOb) {
  4636. childOb.dep.depend();
  4637. if (Array.isArray(value)) {
  4638. dependArray(value);
  4639. }
  4640. }
  4641. }
  4642. return value
  4643. },
  4644. set: function reactiveSetter (newVal) {
  4645. var value = getter ? getter.call(obj) : val;
  4646. /* eslint-disable no-self-compare */
  4647. if (newVal === value || (newVal !== newVal && value !== value)) {
  4648. return
  4649. }
  4650. /* eslint-enable no-self-compare */
  4651. if ( true && customSetter) {
  4652. customSetter();
  4653. }
  4654. // #7981: for accessor properties without setter
  4655. if (getter && !setter) { return }
  4656. if (setter) {
  4657. setter.call(obj, newVal);
  4658. } else {
  4659. val = newVal;
  4660. }
  4661. childOb = !shallow && observe(newVal);
  4662. dep.notify();
  4663. }
  4664. });
  4665. }
  4666. /**
  4667. * Set a property on an object. Adds the new property and
  4668. * triggers change notification if the property doesn't
  4669. * already exist.
  4670. */
  4671. function set (target, key, val) {
  4672. if ( true &&
  4673. (isUndef(target) || isPrimitive(target))
  4674. ) {
  4675. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4676. }
  4677. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4678. target.length = Math.max(target.length, key);
  4679. target.splice(key, 1, val);
  4680. return val
  4681. }
  4682. if (key in target && !(key in Object.prototype)) {
  4683. target[key] = val;
  4684. return val
  4685. }
  4686. var ob = (target).__ob__;
  4687. if (target._isVue || (ob && ob.vmCount)) {
  4688. true && warn(
  4689. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4690. 'at runtime - declare it upfront in the data option.'
  4691. );
  4692. return val
  4693. }
  4694. if (!ob) {
  4695. target[key] = val;
  4696. return val
  4697. }
  4698. defineReactive$$1(ob.value, key, val);
  4699. ob.dep.notify();
  4700. return val
  4701. }
  4702. /**
  4703. * Delete a property and trigger change if necessary.
  4704. */
  4705. function del (target, key) {
  4706. if ( true &&
  4707. (isUndef(target) || isPrimitive(target))
  4708. ) {
  4709. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4710. }
  4711. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4712. target.splice(key, 1);
  4713. return
  4714. }
  4715. var ob = (target).__ob__;
  4716. if (target._isVue || (ob && ob.vmCount)) {
  4717. true && warn(
  4718. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4719. '- just set it to null.'
  4720. );
  4721. return
  4722. }
  4723. if (!hasOwn(target, key)) {
  4724. return
  4725. }
  4726. delete target[key];
  4727. if (!ob) {
  4728. return
  4729. }
  4730. ob.dep.notify();
  4731. }
  4732. /**
  4733. * Collect dependencies on array elements when the array is touched, since
  4734. * we cannot intercept array element access like property getters.
  4735. */
  4736. function dependArray (value) {
  4737. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4738. e = value[i];
  4739. e && e.__ob__ && e.__ob__.dep.depend();
  4740. if (Array.isArray(e)) {
  4741. dependArray(e);
  4742. }
  4743. }
  4744. }
  4745. /* */
  4746. /**
  4747. * Option overwriting strategies are functions that handle
  4748. * how to merge a parent option value and a child option
  4749. * value into the final value.
  4750. */
  4751. var strats = config.optionMergeStrategies;
  4752. /**
  4753. * Options with restrictions
  4754. */
  4755. if (true) {
  4756. strats.el = strats.propsData = function (parent, child, vm, key) {
  4757. if (!vm) {
  4758. warn(
  4759. "option \"" + key + "\" can only be used during instance " +
  4760. 'creation with the `new` keyword.'
  4761. );
  4762. }
  4763. return defaultStrat(parent, child)
  4764. };
  4765. }
  4766. /**
  4767. * Helper that recursively merges two data objects together.
  4768. */
  4769. function mergeData (to, from) {
  4770. if (!from) { return to }
  4771. var key, toVal, fromVal;
  4772. var keys = hasSymbol
  4773. ? Reflect.ownKeys(from)
  4774. : Object.keys(from);
  4775. for (var i = 0; i < keys.length; i++) {
  4776. key = keys[i];
  4777. // in case the object is already observed...
  4778. if (key === '__ob__') { continue }
  4779. toVal = to[key];
  4780. fromVal = from[key];
  4781. if (!hasOwn(to, key)) {
  4782. set(to, key, fromVal);
  4783. } else if (
  4784. toVal !== fromVal &&
  4785. isPlainObject(toVal) &&
  4786. isPlainObject(fromVal)
  4787. ) {
  4788. mergeData(toVal, fromVal);
  4789. }
  4790. }
  4791. return to
  4792. }
  4793. /**
  4794. * Data
  4795. */
  4796. function mergeDataOrFn (
  4797. parentVal,
  4798. childVal,
  4799. vm
  4800. ) {
  4801. if (!vm) {
  4802. // in a Vue.extend merge, both should be functions
  4803. if (!childVal) {
  4804. return parentVal
  4805. }
  4806. if (!parentVal) {
  4807. return childVal
  4808. }
  4809. // when parentVal & childVal are both present,
  4810. // we need to return a function that returns the
  4811. // merged result of both functions... no need to
  4812. // check if parentVal is a function here because
  4813. // it has to be a function to pass previous merges.
  4814. return function mergedDataFn () {
  4815. return mergeData(
  4816. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4817. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4818. )
  4819. }
  4820. } else {
  4821. return function mergedInstanceDataFn () {
  4822. // instance merge
  4823. var instanceData = typeof childVal === 'function'
  4824. ? childVal.call(vm, vm)
  4825. : childVal;
  4826. var defaultData = typeof parentVal === 'function'
  4827. ? parentVal.call(vm, vm)
  4828. : parentVal;
  4829. if (instanceData) {
  4830. return mergeData(instanceData, defaultData)
  4831. } else {
  4832. return defaultData
  4833. }
  4834. }
  4835. }
  4836. }
  4837. strats.data = function (
  4838. parentVal,
  4839. childVal,
  4840. vm
  4841. ) {
  4842. if (!vm) {
  4843. if (childVal && typeof childVal !== 'function') {
  4844. true && warn(
  4845. 'The "data" option should be a function ' +
  4846. 'that returns a per-instance value in component ' +
  4847. 'definitions.',
  4848. vm
  4849. );
  4850. return parentVal
  4851. }
  4852. return mergeDataOrFn(parentVal, childVal)
  4853. }
  4854. return mergeDataOrFn(parentVal, childVal, vm)
  4855. };
  4856. /**
  4857. * Hooks and props are merged as arrays.
  4858. */
  4859. function mergeHook (
  4860. parentVal,
  4861. childVal
  4862. ) {
  4863. var res = childVal
  4864. ? parentVal
  4865. ? parentVal.concat(childVal)
  4866. : Array.isArray(childVal)
  4867. ? childVal
  4868. : [childVal]
  4869. : parentVal;
  4870. return res
  4871. ? dedupeHooks(res)
  4872. : res
  4873. }
  4874. function dedupeHooks (hooks) {
  4875. var res = [];
  4876. for (var i = 0; i < hooks.length; i++) {
  4877. if (res.indexOf(hooks[i]) === -1) {
  4878. res.push(hooks[i]);
  4879. }
  4880. }
  4881. return res
  4882. }
  4883. LIFECYCLE_HOOKS.forEach(function (hook) {
  4884. strats[hook] = mergeHook;
  4885. });
  4886. /**
  4887. * Assets
  4888. *
  4889. * When a vm is present (instance creation), we need to do
  4890. * a three-way merge between constructor options, instance
  4891. * options and parent options.
  4892. */
  4893. function mergeAssets (
  4894. parentVal,
  4895. childVal,
  4896. vm,
  4897. key
  4898. ) {
  4899. var res = Object.create(parentVal || null);
  4900. if (childVal) {
  4901. true && assertObjectType(key, childVal, vm);
  4902. return extend(res, childVal)
  4903. } else {
  4904. return res
  4905. }
  4906. }
  4907. ASSET_TYPES.forEach(function (type) {
  4908. strats[type + 's'] = mergeAssets;
  4909. });
  4910. /**
  4911. * Watchers.
  4912. *
  4913. * Watchers hashes should not overwrite one
  4914. * another, so we merge them as arrays.
  4915. */
  4916. strats.watch = function (
  4917. parentVal,
  4918. childVal,
  4919. vm,
  4920. key
  4921. ) {
  4922. // work around Firefox's Object.prototype.watch...
  4923. if (parentVal === nativeWatch) { parentVal = undefined; }
  4924. if (childVal === nativeWatch) { childVal = undefined; }
  4925. /* istanbul ignore if */
  4926. if (!childVal) { return Object.create(parentVal || null) }
  4927. if (true) {
  4928. assertObjectType(key, childVal, vm);
  4929. }
  4930. if (!parentVal) { return childVal }
  4931. var ret = {};
  4932. extend(ret, parentVal);
  4933. for (var key$1 in childVal) {
  4934. var parent = ret[key$1];
  4935. var child = childVal[key$1];
  4936. if (parent && !Array.isArray(parent)) {
  4937. parent = [parent];
  4938. }
  4939. ret[key$1] = parent
  4940. ? parent.concat(child)
  4941. : Array.isArray(child) ? child : [child];
  4942. }
  4943. return ret
  4944. };
  4945. /**
  4946. * Other object hashes.
  4947. */
  4948. strats.props =
  4949. strats.methods =
  4950. strats.inject =
  4951. strats.computed = function (
  4952. parentVal,
  4953. childVal,
  4954. vm,
  4955. key
  4956. ) {
  4957. if (childVal && "development" !== 'production') {
  4958. assertObjectType(key, childVal, vm);
  4959. }
  4960. if (!parentVal) { return childVal }
  4961. var ret = Object.create(null);
  4962. extend(ret, parentVal);
  4963. if (childVal) { extend(ret, childVal); }
  4964. return ret
  4965. };
  4966. strats.provide = mergeDataOrFn;
  4967. /**
  4968. * Default strategy.
  4969. */
  4970. var defaultStrat = function (parentVal, childVal) {
  4971. return childVal === undefined
  4972. ? parentVal
  4973. : childVal
  4974. };
  4975. /**
  4976. * Validate component names
  4977. */
  4978. function checkComponents (options) {
  4979. for (var key in options.components) {
  4980. validateComponentName(key);
  4981. }
  4982. }
  4983. function validateComponentName (name) {
  4984. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4985. warn(
  4986. 'Invalid component name: "' + name + '". Component names ' +
  4987. 'should conform to valid custom element name in html5 specification.'
  4988. );
  4989. }
  4990. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4991. warn(
  4992. 'Do not use built-in or reserved HTML elements as component ' +
  4993. 'id: ' + name
  4994. );
  4995. }
  4996. }
  4997. /**
  4998. * Ensure all props option syntax are normalized into the
  4999. * Object-based format.
  5000. */
  5001. function normalizeProps (options, vm) {
  5002. var props = options.props;
  5003. if (!props) { return }
  5004. var res = {};
  5005. var i, val, name;
  5006. if (Array.isArray(props)) {
  5007. i = props.length;
  5008. while (i--) {
  5009. val = props[i];
  5010. if (typeof val === 'string') {
  5011. name = camelize(val);
  5012. res[name] = { type: null };
  5013. } else if (true) {
  5014. warn('props must be strings when using array syntax.');
  5015. }
  5016. }
  5017. } else if (isPlainObject(props)) {
  5018. for (var key in props) {
  5019. val = props[key];
  5020. name = camelize(key);
  5021. res[name] = isPlainObject(val)
  5022. ? val
  5023. : { type: val };
  5024. }
  5025. } else if (true) {
  5026. warn(
  5027. "Invalid value for option \"props\": expected an Array or an Object, " +
  5028. "but got " + (toRawType(props)) + ".",
  5029. vm
  5030. );
  5031. }
  5032. options.props = res;
  5033. }
  5034. /**
  5035. * Normalize all injections into Object-based format
  5036. */
  5037. function normalizeInject (options, vm) {
  5038. var inject = options.inject;
  5039. if (!inject) { return }
  5040. var normalized = options.inject = {};
  5041. if (Array.isArray(inject)) {
  5042. for (var i = 0; i < inject.length; i++) {
  5043. normalized[inject[i]] = { from: inject[i] };
  5044. }
  5045. } else if (isPlainObject(inject)) {
  5046. for (var key in inject) {
  5047. var val = inject[key];
  5048. normalized[key] = isPlainObject(val)
  5049. ? extend({ from: key }, val)
  5050. : { from: val };
  5051. }
  5052. } else if (true) {
  5053. warn(
  5054. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5055. "but got " + (toRawType(inject)) + ".",
  5056. vm
  5057. );
  5058. }
  5059. }
  5060. /**
  5061. * Normalize raw function directives into object format.
  5062. */
  5063. function normalizeDirectives (options) {
  5064. var dirs = options.directives;
  5065. if (dirs) {
  5066. for (var key in dirs) {
  5067. var def$$1 = dirs[key];
  5068. if (typeof def$$1 === 'function') {
  5069. dirs[key] = { bind: def$$1, update: def$$1 };
  5070. }
  5071. }
  5072. }
  5073. }
  5074. function assertObjectType (name, value, vm) {
  5075. if (!isPlainObject(value)) {
  5076. warn(
  5077. "Invalid value for option \"" + name + "\": expected an Object, " +
  5078. "but got " + (toRawType(value)) + ".",
  5079. vm
  5080. );
  5081. }
  5082. }
  5083. /**
  5084. * Merge two option objects into a new one.
  5085. * Core utility used in both instantiation and inheritance.
  5086. */
  5087. function mergeOptions (
  5088. parent,
  5089. child,
  5090. vm
  5091. ) {
  5092. if (true) {
  5093. checkComponents(child);
  5094. }
  5095. if (typeof child === 'function') {
  5096. child = child.options;
  5097. }
  5098. normalizeProps(child, vm);
  5099. normalizeInject(child, vm);
  5100. normalizeDirectives(child);
  5101. // Apply extends and mixins on the child options,
  5102. // but only if it is a raw options object that isn't
  5103. // the result of another mergeOptions call.
  5104. // Only merged options has the _base property.
  5105. if (!child._base) {
  5106. if (child.extends) {
  5107. parent = mergeOptions(parent, child.extends, vm);
  5108. }
  5109. if (child.mixins) {
  5110. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5111. parent = mergeOptions(parent, child.mixins[i], vm);
  5112. }
  5113. }
  5114. }
  5115. var options = {};
  5116. var key;
  5117. for (key in parent) {
  5118. mergeField(key);
  5119. }
  5120. for (key in child) {
  5121. if (!hasOwn(parent, key)) {
  5122. mergeField(key);
  5123. }
  5124. }
  5125. function mergeField (key) {
  5126. var strat = strats[key] || defaultStrat;
  5127. options[key] = strat(parent[key], child[key], vm, key);
  5128. }
  5129. return options
  5130. }
  5131. /**
  5132. * Resolve an asset.
  5133. * This function is used because child instances need access
  5134. * to assets defined in its ancestor chain.
  5135. */
  5136. function resolveAsset (
  5137. options,
  5138. type,
  5139. id,
  5140. warnMissing
  5141. ) {
  5142. /* istanbul ignore if */
  5143. if (typeof id !== 'string') {
  5144. return
  5145. }
  5146. var assets = options[type];
  5147. // check local registration variations first
  5148. if (hasOwn(assets, id)) { return assets[id] }
  5149. var camelizedId = camelize(id);
  5150. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5151. var PascalCaseId = capitalize(camelizedId);
  5152. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5153. // fallback to prototype chain
  5154. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5155. if ( true && warnMissing && !res) {
  5156. warn(
  5157. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5158. options
  5159. );
  5160. }
  5161. return res
  5162. }
  5163. /* */
  5164. function validateProp (
  5165. key,
  5166. propOptions,
  5167. propsData,
  5168. vm
  5169. ) {
  5170. var prop = propOptions[key];
  5171. var absent = !hasOwn(propsData, key);
  5172. var value = propsData[key];
  5173. // boolean casting
  5174. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5175. if (booleanIndex > -1) {
  5176. if (absent && !hasOwn(prop, 'default')) {
  5177. value = false;
  5178. } else if (value === '' || value === hyphenate(key)) {
  5179. // only cast empty string / same name to boolean if
  5180. // boolean has higher priority
  5181. var stringIndex = getTypeIndex(String, prop.type);
  5182. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5183. value = true;
  5184. }
  5185. }
  5186. }
  5187. // check default value
  5188. if (value === undefined) {
  5189. value = getPropDefaultValue(vm, prop, key);
  5190. // since the default value is a fresh copy,
  5191. // make sure to observe it.
  5192. var prevShouldObserve = shouldObserve;
  5193. toggleObserving(true);
  5194. observe(value);
  5195. toggleObserving(prevShouldObserve);
  5196. }
  5197. if (
  5198. true
  5199. ) {
  5200. assertProp(prop, key, value, vm, absent);
  5201. }
  5202. return value
  5203. }
  5204. /**
  5205. * Get the default value of a prop.
  5206. */
  5207. function getPropDefaultValue (vm, prop, key) {
  5208. // no default, return undefined
  5209. if (!hasOwn(prop, 'default')) {
  5210. return undefined
  5211. }
  5212. var def = prop.default;
  5213. // warn against non-factory defaults for Object & Array
  5214. if ( true && isObject(def)) {
  5215. warn(
  5216. 'Invalid default value for prop "' + key + '": ' +
  5217. 'Props with type Object/Array must use a factory function ' +
  5218. 'to return the default value.',
  5219. vm
  5220. );
  5221. }
  5222. // the raw prop value was also undefined from previous render,
  5223. // return previous default value to avoid unnecessary watcher trigger
  5224. if (vm && vm.$options.propsData &&
  5225. vm.$options.propsData[key] === undefined &&
  5226. vm._props[key] !== undefined
  5227. ) {
  5228. return vm._props[key]
  5229. }
  5230. // call factory function for non-Function types
  5231. // a value is Function if its prototype is function even across different execution context
  5232. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5233. ? def.call(vm)
  5234. : def
  5235. }
  5236. /**
  5237. * Assert whether a prop is valid.
  5238. */
  5239. function assertProp (
  5240. prop,
  5241. name,
  5242. value,
  5243. vm,
  5244. absent
  5245. ) {
  5246. if (prop.required && absent) {
  5247. warn(
  5248. 'Missing required prop: "' + name + '"',
  5249. vm
  5250. );
  5251. return
  5252. }
  5253. if (value == null && !prop.required) {
  5254. return
  5255. }
  5256. var type = prop.type;
  5257. var valid = !type || type === true;
  5258. var expectedTypes = [];
  5259. if (type) {
  5260. if (!Array.isArray(type)) {
  5261. type = [type];
  5262. }
  5263. for (var i = 0; i < type.length && !valid; i++) {
  5264. var assertedType = assertType(value, type[i]);
  5265. expectedTypes.push(assertedType.expectedType || '');
  5266. valid = assertedType.valid;
  5267. }
  5268. }
  5269. if (!valid) {
  5270. warn(
  5271. getInvalidTypeMessage(name, value, expectedTypes),
  5272. vm
  5273. );
  5274. return
  5275. }
  5276. var validator = prop.validator;
  5277. if (validator) {
  5278. if (!validator(value)) {
  5279. warn(
  5280. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5281. vm
  5282. );
  5283. }
  5284. }
  5285. }
  5286. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5287. function assertType (value, type) {
  5288. var valid;
  5289. var expectedType = getType(type);
  5290. if (simpleCheckRE.test(expectedType)) {
  5291. var t = typeof value;
  5292. valid = t === expectedType.toLowerCase();
  5293. // for primitive wrapper objects
  5294. if (!valid && t === 'object') {
  5295. valid = value instanceof type;
  5296. }
  5297. } else if (expectedType === 'Object') {
  5298. valid = isPlainObject(value);
  5299. } else if (expectedType === 'Array') {
  5300. valid = Array.isArray(value);
  5301. } else {
  5302. valid = value instanceof type;
  5303. }
  5304. return {
  5305. valid: valid,
  5306. expectedType: expectedType
  5307. }
  5308. }
  5309. /**
  5310. * Use function string name to check built-in types,
  5311. * because a simple equality check will fail when running
  5312. * across different vms / iframes.
  5313. */
  5314. function getType (fn) {
  5315. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5316. return match ? match[1] : ''
  5317. }
  5318. function isSameType (a, b) {
  5319. return getType(a) === getType(b)
  5320. }
  5321. function getTypeIndex (type, expectedTypes) {
  5322. if (!Array.isArray(expectedTypes)) {
  5323. return isSameType(expectedTypes, type) ? 0 : -1
  5324. }
  5325. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5326. if (isSameType(expectedTypes[i], type)) {
  5327. return i
  5328. }
  5329. }
  5330. return -1
  5331. }
  5332. function getInvalidTypeMessage (name, value, expectedTypes) {
  5333. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5334. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5335. var expectedType = expectedTypes[0];
  5336. var receivedType = toRawType(value);
  5337. var expectedValue = styleValue(value, expectedType);
  5338. var receivedValue = styleValue(value, receivedType);
  5339. // check if we need to specify expected value
  5340. if (expectedTypes.length === 1 &&
  5341. isExplicable(expectedType) &&
  5342. !isBoolean(expectedType, receivedType)) {
  5343. message += " with value " + expectedValue;
  5344. }
  5345. message += ", got " + receivedType + " ";
  5346. // check if we need to specify received value
  5347. if (isExplicable(receivedType)) {
  5348. message += "with value " + receivedValue + ".";
  5349. }
  5350. return message
  5351. }
  5352. function styleValue (value, type) {
  5353. if (type === 'String') {
  5354. return ("\"" + value + "\"")
  5355. } else if (type === 'Number') {
  5356. return ("" + (Number(value)))
  5357. } else {
  5358. return ("" + value)
  5359. }
  5360. }
  5361. function isExplicable (value) {
  5362. var explicitTypes = ['string', 'number', 'boolean'];
  5363. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5364. }
  5365. function isBoolean () {
  5366. var args = [], len = arguments.length;
  5367. while ( len-- ) args[ len ] = arguments[ len ];
  5368. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5369. }
  5370. /* */
  5371. function handleError (err, vm, info) {
  5372. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5373. // See: https://github.com/vuejs/vuex/issues/1505
  5374. pushTarget();
  5375. try {
  5376. if (vm) {
  5377. var cur = vm;
  5378. while ((cur = cur.$parent)) {
  5379. var hooks = cur.$options.errorCaptured;
  5380. if (hooks) {
  5381. for (var i = 0; i < hooks.length; i++) {
  5382. try {
  5383. var capture = hooks[i].call(cur, err, vm, info) === false;
  5384. if (capture) { return }
  5385. } catch (e) {
  5386. globalHandleError(e, cur, 'errorCaptured hook');
  5387. }
  5388. }
  5389. }
  5390. }
  5391. }
  5392. globalHandleError(err, vm, info);
  5393. } finally {
  5394. popTarget();
  5395. }
  5396. }
  5397. function invokeWithErrorHandling (
  5398. handler,
  5399. context,
  5400. args,
  5401. vm,
  5402. info
  5403. ) {
  5404. var res;
  5405. try {
  5406. res = args ? handler.apply(context, args) : handler.call(context);
  5407. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5408. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5409. // issue #9511
  5410. // avoid catch triggering multiple times when nested calls
  5411. res._handled = true;
  5412. }
  5413. } catch (e) {
  5414. handleError(e, vm, info);
  5415. }
  5416. return res
  5417. }
  5418. function globalHandleError (err, vm, info) {
  5419. if (config.errorHandler) {
  5420. try {
  5421. return config.errorHandler.call(null, err, vm, info)
  5422. } catch (e) {
  5423. // if the user intentionally throws the original error in the handler,
  5424. // do not log it twice
  5425. if (e !== err) {
  5426. logError(e, null, 'config.errorHandler');
  5427. }
  5428. }
  5429. }
  5430. logError(err, vm, info);
  5431. }
  5432. function logError (err, vm, info) {
  5433. if (true) {
  5434. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5435. }
  5436. /* istanbul ignore else */
  5437. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5438. console.error(err);
  5439. } else {
  5440. throw err
  5441. }
  5442. }
  5443. /* */
  5444. var callbacks = [];
  5445. var pending = false;
  5446. function flushCallbacks () {
  5447. pending = false;
  5448. var copies = callbacks.slice(0);
  5449. callbacks.length = 0;
  5450. for (var i = 0; i < copies.length; i++) {
  5451. copies[i]();
  5452. }
  5453. }
  5454. // Here we have async deferring wrappers using microtasks.
  5455. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5456. // However, it has subtle problems when state is changed right before repaint
  5457. // (e.g. #6813, out-in transitions).
  5458. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5459. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5460. // So we now use microtasks everywhere, again.
  5461. // A major drawback of this tradeoff is that there are some scenarios
  5462. // where microtasks have too high a priority and fire in between supposedly
  5463. // sequential events (e.g. #4521, #6690, which have workarounds)
  5464. // or even between bubbling of the same event (#6566).
  5465. var timerFunc;
  5466. // The nextTick behavior leverages the microtask queue, which can be accessed
  5467. // via either native Promise.then or MutationObserver.
  5468. // MutationObserver has wider support, however it is seriously bugged in
  5469. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5470. // completely stops working after triggering a few times... so, if native
  5471. // Promise is available, we will use it:
  5472. /* istanbul ignore next, $flow-disable-line */
  5473. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5474. var p = Promise.resolve();
  5475. timerFunc = function () {
  5476. p.then(flushCallbacks);
  5477. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5478. // it can get stuck in a weird state where callbacks are pushed into the
  5479. // microtask queue but the queue isn't being flushed, until the browser
  5480. // needs to do some other work, e.g. handle a timer. Therefore we can
  5481. // "force" the microtask queue to be flushed by adding an empty timer.
  5482. if (isIOS) { setTimeout(noop); }
  5483. };
  5484. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5485. isNative(MutationObserver) ||
  5486. // PhantomJS and iOS 7.x
  5487. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5488. )) {
  5489. // Use MutationObserver where native Promise is not available,
  5490. // e.g. PhantomJS, iOS7, Android 4.4
  5491. // (#6466 MutationObserver is unreliable in IE11)
  5492. var counter = 1;
  5493. var observer = new MutationObserver(flushCallbacks);
  5494. var textNode = document.createTextNode(String(counter));
  5495. observer.observe(textNode, {
  5496. characterData: true
  5497. });
  5498. timerFunc = function () {
  5499. counter = (counter + 1) % 2;
  5500. textNode.data = String(counter);
  5501. };
  5502. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5503. // Fallback to setImmediate.
  5504. // Technically it leverages the (macro) task queue,
  5505. // but it is still a better choice than setTimeout.
  5506. timerFunc = function () {
  5507. setImmediate(flushCallbacks);
  5508. };
  5509. } else {
  5510. // Fallback to setTimeout.
  5511. timerFunc = function () {
  5512. setTimeout(flushCallbacks, 0);
  5513. };
  5514. }
  5515. function nextTick (cb, ctx) {
  5516. var _resolve;
  5517. callbacks.push(function () {
  5518. if (cb) {
  5519. try {
  5520. cb.call(ctx);
  5521. } catch (e) {
  5522. handleError(e, ctx, 'nextTick');
  5523. }
  5524. } else if (_resolve) {
  5525. _resolve(ctx);
  5526. }
  5527. });
  5528. if (!pending) {
  5529. pending = true;
  5530. timerFunc();
  5531. }
  5532. // $flow-disable-line
  5533. if (!cb && typeof Promise !== 'undefined') {
  5534. return new Promise(function (resolve) {
  5535. _resolve = resolve;
  5536. })
  5537. }
  5538. }
  5539. /* */
  5540. /* not type checking this file because flow doesn't play well with Proxy */
  5541. var initProxy;
  5542. if (true) {
  5543. var allowedGlobals = makeMap(
  5544. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5545. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5546. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5547. 'require' // for Webpack/Browserify
  5548. );
  5549. var warnNonPresent = function (target, key) {
  5550. warn(
  5551. "Property or method \"" + key + "\" is not defined on the instance but " +
  5552. 'referenced during render. Make sure that this property is reactive, ' +
  5553. 'either in the data option, or for class-based components, by ' +
  5554. 'initializing the property. ' +
  5555. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5556. target
  5557. );
  5558. };
  5559. var warnReservedPrefix = function (target, key) {
  5560. warn(
  5561. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5562. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5563. 'prevent conflicts with Vue internals. ' +
  5564. 'See: https://vuejs.org/v2/api/#data',
  5565. target
  5566. );
  5567. };
  5568. var hasProxy =
  5569. typeof Proxy !== 'undefined' && isNative(Proxy);
  5570. if (hasProxy) {
  5571. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5572. config.keyCodes = new Proxy(config.keyCodes, {
  5573. set: function set (target, key, value) {
  5574. if (isBuiltInModifier(key)) {
  5575. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5576. return false
  5577. } else {
  5578. target[key] = value;
  5579. return true
  5580. }
  5581. }
  5582. });
  5583. }
  5584. var hasHandler = {
  5585. has: function has (target, key) {
  5586. var has = key in target;
  5587. var isAllowed = allowedGlobals(key) ||
  5588. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5589. if (!has && !isAllowed) {
  5590. if (key in target.$data) { warnReservedPrefix(target, key); }
  5591. else { warnNonPresent(target, key); }
  5592. }
  5593. return has || !isAllowed
  5594. }
  5595. };
  5596. var getHandler = {
  5597. get: function get (target, key) {
  5598. if (typeof key === 'string' && !(key in target)) {
  5599. if (key in target.$data) { warnReservedPrefix(target, key); }
  5600. else { warnNonPresent(target, key); }
  5601. }
  5602. return target[key]
  5603. }
  5604. };
  5605. initProxy = function initProxy (vm) {
  5606. if (hasProxy) {
  5607. // determine which proxy handler to use
  5608. var options = vm.$options;
  5609. var handlers = options.render && options.render._withStripped
  5610. ? getHandler
  5611. : hasHandler;
  5612. vm._renderProxy = new Proxy(vm, handlers);
  5613. } else {
  5614. vm._renderProxy = vm;
  5615. }
  5616. };
  5617. }
  5618. /* */
  5619. var seenObjects = new _Set();
  5620. /**
  5621. * Recursively traverse an object to evoke all converted
  5622. * getters, so that every nested property inside the object
  5623. * is collected as a "deep" dependency.
  5624. */
  5625. function traverse (val) {
  5626. _traverse(val, seenObjects);
  5627. seenObjects.clear();
  5628. }
  5629. function _traverse (val, seen) {
  5630. var i, keys;
  5631. var isA = Array.isArray(val);
  5632. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5633. return
  5634. }
  5635. if (val.__ob__) {
  5636. var depId = val.__ob__.dep.id;
  5637. if (seen.has(depId)) {
  5638. return
  5639. }
  5640. seen.add(depId);
  5641. }
  5642. if (isA) {
  5643. i = val.length;
  5644. while (i--) { _traverse(val[i], seen); }
  5645. } else {
  5646. keys = Object.keys(val);
  5647. i = keys.length;
  5648. while (i--) { _traverse(val[keys[i]], seen); }
  5649. }
  5650. }
  5651. var mark;
  5652. var measure;
  5653. if (true) {
  5654. var perf = inBrowser && window.performance;
  5655. /* istanbul ignore if */
  5656. if (
  5657. perf &&
  5658. perf.mark &&
  5659. perf.measure &&
  5660. perf.clearMarks &&
  5661. perf.clearMeasures
  5662. ) {
  5663. mark = function (tag) { return perf.mark(tag); };
  5664. measure = function (name, startTag, endTag) {
  5665. perf.measure(name, startTag, endTag);
  5666. perf.clearMarks(startTag);
  5667. perf.clearMarks(endTag);
  5668. // perf.clearMeasures(name)
  5669. };
  5670. }
  5671. }
  5672. /* */
  5673. var normalizeEvent = cached(function (name) {
  5674. var passive = name.charAt(0) === '&';
  5675. name = passive ? name.slice(1) : name;
  5676. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5677. name = once$$1 ? name.slice(1) : name;
  5678. var capture = name.charAt(0) === '!';
  5679. name = capture ? name.slice(1) : name;
  5680. return {
  5681. name: name,
  5682. once: once$$1,
  5683. capture: capture,
  5684. passive: passive
  5685. }
  5686. });
  5687. function createFnInvoker (fns, vm) {
  5688. function invoker () {
  5689. var arguments$1 = arguments;
  5690. var fns = invoker.fns;
  5691. if (Array.isArray(fns)) {
  5692. var cloned = fns.slice();
  5693. for (var i = 0; i < cloned.length; i++) {
  5694. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5695. }
  5696. } else {
  5697. // return handler return value for single handlers
  5698. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5699. }
  5700. }
  5701. invoker.fns = fns;
  5702. return invoker
  5703. }
  5704. function updateListeners (
  5705. on,
  5706. oldOn,
  5707. add,
  5708. remove$$1,
  5709. createOnceHandler,
  5710. vm
  5711. ) {
  5712. var name, def$$1, cur, old, event;
  5713. for (name in on) {
  5714. def$$1 = cur = on[name];
  5715. old = oldOn[name];
  5716. event = normalizeEvent(name);
  5717. if (isUndef(cur)) {
  5718. true && warn(
  5719. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5720. vm
  5721. );
  5722. } else if (isUndef(old)) {
  5723. if (isUndef(cur.fns)) {
  5724. cur = on[name] = createFnInvoker(cur, vm);
  5725. }
  5726. if (isTrue(event.once)) {
  5727. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5728. }
  5729. add(event.name, cur, event.capture, event.passive, event.params);
  5730. } else if (cur !== old) {
  5731. old.fns = cur;
  5732. on[name] = old;
  5733. }
  5734. }
  5735. for (name in oldOn) {
  5736. if (isUndef(on[name])) {
  5737. event = normalizeEvent(name);
  5738. remove$$1(event.name, oldOn[name], event.capture);
  5739. }
  5740. }
  5741. }
  5742. /* */
  5743. /* */
  5744. // fixed by xxxxxx (mp properties)
  5745. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5746. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5747. if (isUndef(propOptions)) {
  5748. return res
  5749. }
  5750. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5751. var attrs = data.attrs;
  5752. var props = data.props;
  5753. if (isDef(attrs) || isDef(props)) {
  5754. for (var key in propOptions) {
  5755. var altKey = hyphenate(key);
  5756. var result = checkProp(res, props, key, altKey, true) ||
  5757. checkProp(res, attrs, key, altKey, false);
  5758. // externalClass
  5759. if (
  5760. result &&
  5761. res[key] &&
  5762. externalClasses.indexOf(altKey) !== -1 &&
  5763. context[camelize(res[key])]
  5764. ) {
  5765. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5766. res[key] = context[camelize(res[key])];
  5767. }
  5768. }
  5769. }
  5770. return res
  5771. }
  5772. function extractPropsFromVNodeData (
  5773. data,
  5774. Ctor,
  5775. tag,
  5776. context// fixed by xxxxxx
  5777. ) {
  5778. // we are only extracting raw values here.
  5779. // validation and default values are handled in the child
  5780. // component itself.
  5781. var propOptions = Ctor.options.props;
  5782. if (isUndef(propOptions)) {
  5783. // fixed by xxxxxx
  5784. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5785. }
  5786. var res = {};
  5787. var attrs = data.attrs;
  5788. var props = data.props;
  5789. if (isDef(attrs) || isDef(props)) {
  5790. for (var key in propOptions) {
  5791. var altKey = hyphenate(key);
  5792. if (true) {
  5793. var keyInLowerCase = key.toLowerCase();
  5794. if (
  5795. key !== keyInLowerCase &&
  5796. attrs && hasOwn(attrs, keyInLowerCase)
  5797. ) {
  5798. tip(
  5799. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5800. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5801. " \"" + key + "\". " +
  5802. "Note that HTML attributes are case-insensitive and camelCased " +
  5803. "props need to use their kebab-case equivalents when using in-DOM " +
  5804. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5805. );
  5806. }
  5807. }
  5808. checkProp(res, props, key, altKey, true) ||
  5809. checkProp(res, attrs, key, altKey, false);
  5810. }
  5811. }
  5812. // fixed by xxxxxx
  5813. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5814. }
  5815. function checkProp (
  5816. res,
  5817. hash,
  5818. key,
  5819. altKey,
  5820. preserve
  5821. ) {
  5822. if (isDef(hash)) {
  5823. if (hasOwn(hash, key)) {
  5824. res[key] = hash[key];
  5825. if (!preserve) {
  5826. delete hash[key];
  5827. }
  5828. return true
  5829. } else if (hasOwn(hash, altKey)) {
  5830. res[key] = hash[altKey];
  5831. if (!preserve) {
  5832. delete hash[altKey];
  5833. }
  5834. return true
  5835. }
  5836. }
  5837. return false
  5838. }
  5839. /* */
  5840. // The template compiler attempts to minimize the need for normalization by
  5841. // statically analyzing the template at compile time.
  5842. //
  5843. // For plain HTML markup, normalization can be completely skipped because the
  5844. // generated render function is guaranteed to return Array<VNode>. There are
  5845. // two cases where extra normalization is needed:
  5846. // 1. When the children contains components - because a functional component
  5847. // may return an Array instead of a single root. In this case, just a simple
  5848. // normalization is needed - if any child is an Array, we flatten the whole
  5849. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5850. // because functional components already normalize their own children.
  5851. function simpleNormalizeChildren (children) {
  5852. for (var i = 0; i < children.length; i++) {
  5853. if (Array.isArray(children[i])) {
  5854. return Array.prototype.concat.apply([], children)
  5855. }
  5856. }
  5857. return children
  5858. }
  5859. // 2. When the children contains constructs that always generated nested Arrays,
  5860. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5861. // with hand-written render functions / JSX. In such cases a full normalization
  5862. // is needed to cater to all possible types of children values.
  5863. function normalizeChildren (children) {
  5864. return isPrimitive(children)
  5865. ? [createTextVNode(children)]
  5866. : Array.isArray(children)
  5867. ? normalizeArrayChildren(children)
  5868. : undefined
  5869. }
  5870. function isTextNode (node) {
  5871. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5872. }
  5873. function normalizeArrayChildren (children, nestedIndex) {
  5874. var res = [];
  5875. var i, c, lastIndex, last;
  5876. for (i = 0; i < children.length; i++) {
  5877. c = children[i];
  5878. if (isUndef(c) || typeof c === 'boolean') { continue }
  5879. lastIndex = res.length - 1;
  5880. last = res[lastIndex];
  5881. // nested
  5882. if (Array.isArray(c)) {
  5883. if (c.length > 0) {
  5884. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5885. // merge adjacent text nodes
  5886. if (isTextNode(c[0]) && isTextNode(last)) {
  5887. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5888. c.shift();
  5889. }
  5890. res.push.apply(res, c);
  5891. }
  5892. } else if (isPrimitive(c)) {
  5893. if (isTextNode(last)) {
  5894. // merge adjacent text nodes
  5895. // this is necessary for SSR hydration because text nodes are
  5896. // essentially merged when rendered to HTML strings
  5897. res[lastIndex] = createTextVNode(last.text + c);
  5898. } else if (c !== '') {
  5899. // convert primitive to vnode
  5900. res.push(createTextVNode(c));
  5901. }
  5902. } else {
  5903. if (isTextNode(c) && isTextNode(last)) {
  5904. // merge adjacent text nodes
  5905. res[lastIndex] = createTextVNode(last.text + c.text);
  5906. } else {
  5907. // default key for nested array children (likely generated by v-for)
  5908. if (isTrue(children._isVList) &&
  5909. isDef(c.tag) &&
  5910. isUndef(c.key) &&
  5911. isDef(nestedIndex)) {
  5912. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5913. }
  5914. res.push(c);
  5915. }
  5916. }
  5917. }
  5918. return res
  5919. }
  5920. /* */
  5921. function initProvide (vm) {
  5922. var provide = vm.$options.provide;
  5923. if (provide) {
  5924. vm._provided = typeof provide === 'function'
  5925. ? provide.call(vm)
  5926. : provide;
  5927. }
  5928. }
  5929. function initInjections (vm) {
  5930. var result = resolveInject(vm.$options.inject, vm);
  5931. if (result) {
  5932. toggleObserving(false);
  5933. Object.keys(result).forEach(function (key) {
  5934. /* istanbul ignore else */
  5935. if (true) {
  5936. defineReactive$$1(vm, key, result[key], function () {
  5937. warn(
  5938. "Avoid mutating an injected value directly since the changes will be " +
  5939. "overwritten whenever the provided component re-renders. " +
  5940. "injection being mutated: \"" + key + "\"",
  5941. vm
  5942. );
  5943. });
  5944. } else {}
  5945. });
  5946. toggleObserving(true);
  5947. }
  5948. }
  5949. function resolveInject (inject, vm) {
  5950. if (inject) {
  5951. // inject is :any because flow is not smart enough to figure out cached
  5952. var result = Object.create(null);
  5953. var keys = hasSymbol
  5954. ? Reflect.ownKeys(inject)
  5955. : Object.keys(inject);
  5956. for (var i = 0; i < keys.length; i++) {
  5957. var key = keys[i];
  5958. // #6574 in case the inject object is observed...
  5959. if (key === '__ob__') { continue }
  5960. var provideKey = inject[key].from;
  5961. var source = vm;
  5962. while (source) {
  5963. if (source._provided && hasOwn(source._provided, provideKey)) {
  5964. result[key] = source._provided[provideKey];
  5965. break
  5966. }
  5967. source = source.$parent;
  5968. }
  5969. if (!source) {
  5970. if ('default' in inject[key]) {
  5971. var provideDefault = inject[key].default;
  5972. result[key] = typeof provideDefault === 'function'
  5973. ? provideDefault.call(vm)
  5974. : provideDefault;
  5975. } else if (true) {
  5976. warn(("Injection \"" + key + "\" not found"), vm);
  5977. }
  5978. }
  5979. }
  5980. return result
  5981. }
  5982. }
  5983. /* */
  5984. /**
  5985. * Runtime helper for resolving raw children VNodes into a slot object.
  5986. */
  5987. function resolveSlots (
  5988. children,
  5989. context
  5990. ) {
  5991. if (!children || !children.length) {
  5992. return {}
  5993. }
  5994. var slots = {};
  5995. for (var i = 0, l = children.length; i < l; i++) {
  5996. var child = children[i];
  5997. var data = child.data;
  5998. // remove slot attribute if the node is resolved as a Vue slot node
  5999. if (data && data.attrs && data.attrs.slot) {
  6000. delete data.attrs.slot;
  6001. }
  6002. // named slots should only be respected if the vnode was rendered in the
  6003. // same context.
  6004. if ((child.context === context || child.fnContext === context) &&
  6005. data && data.slot != null
  6006. ) {
  6007. var name = data.slot;
  6008. var slot = (slots[name] || (slots[name] = []));
  6009. if (child.tag === 'template') {
  6010. slot.push.apply(slot, child.children || []);
  6011. } else {
  6012. slot.push(child);
  6013. }
  6014. } else {
  6015. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6016. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6017. (slots['page'] || (slots['page'] = [])).push(child);
  6018. }else{
  6019. (slots.default || (slots.default = [])).push(child);
  6020. }
  6021. }
  6022. }
  6023. // ignore slots that contains only whitespace
  6024. for (var name$1 in slots) {
  6025. if (slots[name$1].every(isWhitespace)) {
  6026. delete slots[name$1];
  6027. }
  6028. }
  6029. return slots
  6030. }
  6031. function isWhitespace (node) {
  6032. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6033. }
  6034. /* */
  6035. function normalizeScopedSlots (
  6036. slots,
  6037. normalSlots,
  6038. prevSlots
  6039. ) {
  6040. var res;
  6041. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6042. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6043. var key = slots && slots.$key;
  6044. if (!slots) {
  6045. res = {};
  6046. } else if (slots._normalized) {
  6047. // fast path 1: child component re-render only, parent did not change
  6048. return slots._normalized
  6049. } else if (
  6050. isStable &&
  6051. prevSlots &&
  6052. prevSlots !== emptyObject &&
  6053. key === prevSlots.$key &&
  6054. !hasNormalSlots &&
  6055. !prevSlots.$hasNormal
  6056. ) {
  6057. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6058. // only need to normalize once
  6059. return prevSlots
  6060. } else {
  6061. res = {};
  6062. for (var key$1 in slots) {
  6063. if (slots[key$1] && key$1[0] !== '$') {
  6064. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6065. }
  6066. }
  6067. }
  6068. // expose normal slots on scopedSlots
  6069. for (var key$2 in normalSlots) {
  6070. if (!(key$2 in res)) {
  6071. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6072. }
  6073. }
  6074. // avoriaz seems to mock a non-extensible $scopedSlots object
  6075. // and when that is passed down this would cause an error
  6076. if (slots && Object.isExtensible(slots)) {
  6077. (slots)._normalized = res;
  6078. }
  6079. def(res, '$stable', isStable);
  6080. def(res, '$key', key);
  6081. def(res, '$hasNormal', hasNormalSlots);
  6082. return res
  6083. }
  6084. function normalizeScopedSlot(normalSlots, key, fn) {
  6085. var normalized = function () {
  6086. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6087. res = res && typeof res === 'object' && !Array.isArray(res)
  6088. ? [res] // single vnode
  6089. : normalizeChildren(res);
  6090. return res && (
  6091. res.length === 0 ||
  6092. (res.length === 1 && res[0].isComment) // #9658
  6093. ) ? undefined
  6094. : res
  6095. };
  6096. // this is a slot using the new v-slot syntax without scope. although it is
  6097. // compiled as a scoped slot, render fn users would expect it to be present
  6098. // on this.$slots because the usage is semantically a normal slot.
  6099. if (fn.proxy) {
  6100. Object.defineProperty(normalSlots, key, {
  6101. get: normalized,
  6102. enumerable: true,
  6103. configurable: true
  6104. });
  6105. }
  6106. return normalized
  6107. }
  6108. function proxyNormalSlot(slots, key) {
  6109. return function () { return slots[key]; }
  6110. }
  6111. /* */
  6112. /**
  6113. * Runtime helper for rendering v-for lists.
  6114. */
  6115. function renderList (
  6116. val,
  6117. render
  6118. ) {
  6119. var ret, i, l, keys, key;
  6120. if (Array.isArray(val) || typeof val === 'string') {
  6121. ret = new Array(val.length);
  6122. for (i = 0, l = val.length; i < l; i++) {
  6123. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6124. }
  6125. } else if (typeof val === 'number') {
  6126. ret = new Array(val);
  6127. for (i = 0; i < val; i++) {
  6128. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6129. }
  6130. } else if (isObject(val)) {
  6131. if (hasSymbol && val[Symbol.iterator]) {
  6132. ret = [];
  6133. var iterator = val[Symbol.iterator]();
  6134. var result = iterator.next();
  6135. while (!result.done) {
  6136. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6137. result = iterator.next();
  6138. }
  6139. } else {
  6140. keys = Object.keys(val);
  6141. ret = new Array(keys.length);
  6142. for (i = 0, l = keys.length; i < l; i++) {
  6143. key = keys[i];
  6144. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6145. }
  6146. }
  6147. }
  6148. if (!isDef(ret)) {
  6149. ret = [];
  6150. }
  6151. (ret)._isVList = true;
  6152. return ret
  6153. }
  6154. /* */
  6155. /**
  6156. * Runtime helper for rendering <slot>
  6157. */
  6158. function renderSlot (
  6159. name,
  6160. fallback,
  6161. props,
  6162. bindObject
  6163. ) {
  6164. var scopedSlotFn = this.$scopedSlots[name];
  6165. var nodes;
  6166. if (scopedSlotFn) { // scoped slot
  6167. props = props || {};
  6168. if (bindObject) {
  6169. if ( true && !isObject(bindObject)) {
  6170. warn(
  6171. 'slot v-bind without argument expects an Object',
  6172. this
  6173. );
  6174. }
  6175. props = extend(extend({}, bindObject), props);
  6176. }
  6177. // fixed by xxxxxx app-plus scopedSlot
  6178. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6179. } else {
  6180. nodes = this.$slots[name] || fallback;
  6181. }
  6182. var target = props && props.slot;
  6183. if (target) {
  6184. return this.$createElement('template', { slot: target }, nodes)
  6185. } else {
  6186. return nodes
  6187. }
  6188. }
  6189. /* */
  6190. /**
  6191. * Runtime helper for resolving filters
  6192. */
  6193. function resolveFilter (id) {
  6194. return resolveAsset(this.$options, 'filters', id, true) || identity
  6195. }
  6196. /* */
  6197. function isKeyNotMatch (expect, actual) {
  6198. if (Array.isArray(expect)) {
  6199. return expect.indexOf(actual) === -1
  6200. } else {
  6201. return expect !== actual
  6202. }
  6203. }
  6204. /**
  6205. * Runtime helper for checking keyCodes from config.
  6206. * exposed as Vue.prototype._k
  6207. * passing in eventKeyName as last argument separately for backwards compat
  6208. */
  6209. function checkKeyCodes (
  6210. eventKeyCode,
  6211. key,
  6212. builtInKeyCode,
  6213. eventKeyName,
  6214. builtInKeyName
  6215. ) {
  6216. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6217. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6218. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6219. } else if (mappedKeyCode) {
  6220. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6221. } else if (eventKeyName) {
  6222. return hyphenate(eventKeyName) !== key
  6223. }
  6224. }
  6225. /* */
  6226. /**
  6227. * Runtime helper for merging v-bind="object" into a VNode's data.
  6228. */
  6229. function bindObjectProps (
  6230. data,
  6231. tag,
  6232. value,
  6233. asProp,
  6234. isSync
  6235. ) {
  6236. if (value) {
  6237. if (!isObject(value)) {
  6238. true && warn(
  6239. 'v-bind without argument expects an Object or Array value',
  6240. this
  6241. );
  6242. } else {
  6243. if (Array.isArray(value)) {
  6244. value = toObject(value);
  6245. }
  6246. var hash;
  6247. var loop = function ( key ) {
  6248. if (
  6249. key === 'class' ||
  6250. key === 'style' ||
  6251. isReservedAttribute(key)
  6252. ) {
  6253. hash = data;
  6254. } else {
  6255. var type = data.attrs && data.attrs.type;
  6256. hash = asProp || config.mustUseProp(tag, type, key)
  6257. ? data.domProps || (data.domProps = {})
  6258. : data.attrs || (data.attrs = {});
  6259. }
  6260. var camelizedKey = camelize(key);
  6261. var hyphenatedKey = hyphenate(key);
  6262. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6263. hash[key] = value[key];
  6264. if (isSync) {
  6265. var on = data.on || (data.on = {});
  6266. on[("update:" + key)] = function ($event) {
  6267. value[key] = $event;
  6268. };
  6269. }
  6270. }
  6271. };
  6272. for (var key in value) loop( key );
  6273. }
  6274. }
  6275. return data
  6276. }
  6277. /* */
  6278. /**
  6279. * Runtime helper for rendering static trees.
  6280. */
  6281. function renderStatic (
  6282. index,
  6283. isInFor
  6284. ) {
  6285. var cached = this._staticTrees || (this._staticTrees = []);
  6286. var tree = cached[index];
  6287. // if has already-rendered static tree and not inside v-for,
  6288. // we can reuse the same tree.
  6289. if (tree && !isInFor) {
  6290. return tree
  6291. }
  6292. // otherwise, render a fresh tree.
  6293. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6294. this._renderProxy,
  6295. null,
  6296. this // for render fns generated for functional component templates
  6297. );
  6298. markStatic(tree, ("__static__" + index), false);
  6299. return tree
  6300. }
  6301. /**
  6302. * Runtime helper for v-once.
  6303. * Effectively it means marking the node as static with a unique key.
  6304. */
  6305. function markOnce (
  6306. tree,
  6307. index,
  6308. key
  6309. ) {
  6310. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6311. return tree
  6312. }
  6313. function markStatic (
  6314. tree,
  6315. key,
  6316. isOnce
  6317. ) {
  6318. if (Array.isArray(tree)) {
  6319. for (var i = 0; i < tree.length; i++) {
  6320. if (tree[i] && typeof tree[i] !== 'string') {
  6321. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6322. }
  6323. }
  6324. } else {
  6325. markStaticNode(tree, key, isOnce);
  6326. }
  6327. }
  6328. function markStaticNode (node, key, isOnce) {
  6329. node.isStatic = true;
  6330. node.key = key;
  6331. node.isOnce = isOnce;
  6332. }
  6333. /* */
  6334. function bindObjectListeners (data, value) {
  6335. if (value) {
  6336. if (!isPlainObject(value)) {
  6337. true && warn(
  6338. 'v-on without argument expects an Object value',
  6339. this
  6340. );
  6341. } else {
  6342. var on = data.on = data.on ? extend({}, data.on) : {};
  6343. for (var key in value) {
  6344. var existing = on[key];
  6345. var ours = value[key];
  6346. on[key] = existing ? [].concat(existing, ours) : ours;
  6347. }
  6348. }
  6349. }
  6350. return data
  6351. }
  6352. /* */
  6353. function resolveScopedSlots (
  6354. fns, // see flow/vnode
  6355. res,
  6356. // the following are added in 2.6
  6357. hasDynamicKeys,
  6358. contentHashKey
  6359. ) {
  6360. res = res || { $stable: !hasDynamicKeys };
  6361. for (var i = 0; i < fns.length; i++) {
  6362. var slot = fns[i];
  6363. if (Array.isArray(slot)) {
  6364. resolveScopedSlots(slot, res, hasDynamicKeys);
  6365. } else if (slot) {
  6366. // marker for reverse proxying v-slot without scope on this.$slots
  6367. if (slot.proxy) {
  6368. slot.fn.proxy = true;
  6369. }
  6370. res[slot.key] = slot.fn;
  6371. }
  6372. }
  6373. if (contentHashKey) {
  6374. (res).$key = contentHashKey;
  6375. }
  6376. return res
  6377. }
  6378. /* */
  6379. function bindDynamicKeys (baseObj, values) {
  6380. for (var i = 0; i < values.length; i += 2) {
  6381. var key = values[i];
  6382. if (typeof key === 'string' && key) {
  6383. baseObj[values[i]] = values[i + 1];
  6384. } else if ( true && key !== '' && key !== null) {
  6385. // null is a special value for explicitly removing a binding
  6386. warn(
  6387. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6388. this
  6389. );
  6390. }
  6391. }
  6392. return baseObj
  6393. }
  6394. // helper to dynamically append modifier runtime markers to event names.
  6395. // ensure only append when value is already string, otherwise it will be cast
  6396. // to string and cause the type check to miss.
  6397. function prependModifier (value, symbol) {
  6398. return typeof value === 'string' ? symbol + value : value
  6399. }
  6400. /* */
  6401. function installRenderHelpers (target) {
  6402. target._o = markOnce;
  6403. target._n = toNumber;
  6404. target._s = toString;
  6405. target._l = renderList;
  6406. target._t = renderSlot;
  6407. target._q = looseEqual;
  6408. target._i = looseIndexOf;
  6409. target._m = renderStatic;
  6410. target._f = resolveFilter;
  6411. target._k = checkKeyCodes;
  6412. target._b = bindObjectProps;
  6413. target._v = createTextVNode;
  6414. target._e = createEmptyVNode;
  6415. target._u = resolveScopedSlots;
  6416. target._g = bindObjectListeners;
  6417. target._d = bindDynamicKeys;
  6418. target._p = prependModifier;
  6419. }
  6420. /* */
  6421. function FunctionalRenderContext (
  6422. data,
  6423. props,
  6424. children,
  6425. parent,
  6426. Ctor
  6427. ) {
  6428. var this$1 = this;
  6429. var options = Ctor.options;
  6430. // ensure the createElement function in functional components
  6431. // gets a unique context - this is necessary for correct named slot check
  6432. var contextVm;
  6433. if (hasOwn(parent, '_uid')) {
  6434. contextVm = Object.create(parent);
  6435. // $flow-disable-line
  6436. contextVm._original = parent;
  6437. } else {
  6438. // the context vm passed in is a functional context as well.
  6439. // in this case we want to make sure we are able to get a hold to the
  6440. // real context instance.
  6441. contextVm = parent;
  6442. // $flow-disable-line
  6443. parent = parent._original;
  6444. }
  6445. var isCompiled = isTrue(options._compiled);
  6446. var needNormalization = !isCompiled;
  6447. this.data = data;
  6448. this.props = props;
  6449. this.children = children;
  6450. this.parent = parent;
  6451. this.listeners = data.on || emptyObject;
  6452. this.injections = resolveInject(options.inject, parent);
  6453. this.slots = function () {
  6454. if (!this$1.$slots) {
  6455. normalizeScopedSlots(
  6456. data.scopedSlots,
  6457. this$1.$slots = resolveSlots(children, parent)
  6458. );
  6459. }
  6460. return this$1.$slots
  6461. };
  6462. Object.defineProperty(this, 'scopedSlots', ({
  6463. enumerable: true,
  6464. get: function get () {
  6465. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6466. }
  6467. }));
  6468. // support for compiled functional template
  6469. if (isCompiled) {
  6470. // exposing $options for renderStatic()
  6471. this.$options = options;
  6472. // pre-resolve slots for renderSlot()
  6473. this.$slots = this.slots();
  6474. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6475. }
  6476. if (options._scopeId) {
  6477. this._c = function (a, b, c, d) {
  6478. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6479. if (vnode && !Array.isArray(vnode)) {
  6480. vnode.fnScopeId = options._scopeId;
  6481. vnode.fnContext = parent;
  6482. }
  6483. return vnode
  6484. };
  6485. } else {
  6486. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6487. }
  6488. }
  6489. installRenderHelpers(FunctionalRenderContext.prototype);
  6490. function createFunctionalComponent (
  6491. Ctor,
  6492. propsData,
  6493. data,
  6494. contextVm,
  6495. children
  6496. ) {
  6497. var options = Ctor.options;
  6498. var props = {};
  6499. var propOptions = options.props;
  6500. if (isDef(propOptions)) {
  6501. for (var key in propOptions) {
  6502. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6503. }
  6504. } else {
  6505. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6506. if (isDef(data.props)) { mergeProps(props, data.props); }
  6507. }
  6508. var renderContext = new FunctionalRenderContext(
  6509. data,
  6510. props,
  6511. children,
  6512. contextVm,
  6513. Ctor
  6514. );
  6515. var vnode = options.render.call(null, renderContext._c, renderContext);
  6516. if (vnode instanceof VNode) {
  6517. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6518. } else if (Array.isArray(vnode)) {
  6519. var vnodes = normalizeChildren(vnode) || [];
  6520. var res = new Array(vnodes.length);
  6521. for (var i = 0; i < vnodes.length; i++) {
  6522. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6523. }
  6524. return res
  6525. }
  6526. }
  6527. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6528. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6529. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6530. // that should not be matched to match.
  6531. var clone = cloneVNode(vnode);
  6532. clone.fnContext = contextVm;
  6533. clone.fnOptions = options;
  6534. if (true) {
  6535. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6536. }
  6537. if (data.slot) {
  6538. (clone.data || (clone.data = {})).slot = data.slot;
  6539. }
  6540. return clone
  6541. }
  6542. function mergeProps (to, from) {
  6543. for (var key in from) {
  6544. to[camelize(key)] = from[key];
  6545. }
  6546. }
  6547. /* */
  6548. /* */
  6549. /* */
  6550. /* */
  6551. // inline hooks to be invoked on component VNodes during patch
  6552. var componentVNodeHooks = {
  6553. init: function init (vnode, hydrating) {
  6554. if (
  6555. vnode.componentInstance &&
  6556. !vnode.componentInstance._isDestroyed &&
  6557. vnode.data.keepAlive
  6558. ) {
  6559. // kept-alive components, treat as a patch
  6560. var mountedNode = vnode; // work around flow
  6561. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6562. } else {
  6563. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6564. vnode,
  6565. activeInstance
  6566. );
  6567. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6568. }
  6569. },
  6570. prepatch: function prepatch (oldVnode, vnode) {
  6571. var options = vnode.componentOptions;
  6572. var child = vnode.componentInstance = oldVnode.componentInstance;
  6573. updateChildComponent(
  6574. child,
  6575. options.propsData, // updated props
  6576. options.listeners, // updated listeners
  6577. vnode, // new parent vnode
  6578. options.children // new children
  6579. );
  6580. },
  6581. insert: function insert (vnode) {
  6582. var context = vnode.context;
  6583. var componentInstance = vnode.componentInstance;
  6584. if (!componentInstance._isMounted) {
  6585. callHook(componentInstance, 'onServiceCreated');
  6586. callHook(componentInstance, 'onServiceAttached');
  6587. componentInstance._isMounted = true;
  6588. callHook(componentInstance, 'mounted');
  6589. }
  6590. if (vnode.data.keepAlive) {
  6591. if (context._isMounted) {
  6592. // vue-router#1212
  6593. // During updates, a kept-alive component's child components may
  6594. // change, so directly walking the tree here may call activated hooks
  6595. // on incorrect children. Instead we push them into a queue which will
  6596. // be processed after the whole patch process ended.
  6597. queueActivatedComponent(componentInstance);
  6598. } else {
  6599. activateChildComponent(componentInstance, true /* direct */);
  6600. }
  6601. }
  6602. },
  6603. destroy: function destroy (vnode) {
  6604. var componentInstance = vnode.componentInstance;
  6605. if (!componentInstance._isDestroyed) {
  6606. if (!vnode.data.keepAlive) {
  6607. componentInstance.$destroy();
  6608. } else {
  6609. deactivateChildComponent(componentInstance, true /* direct */);
  6610. }
  6611. }
  6612. }
  6613. };
  6614. var hooksToMerge = Object.keys(componentVNodeHooks);
  6615. function createComponent (
  6616. Ctor,
  6617. data,
  6618. context,
  6619. children,
  6620. tag
  6621. ) {
  6622. if (isUndef(Ctor)) {
  6623. return
  6624. }
  6625. var baseCtor = context.$options._base;
  6626. // plain options object: turn it into a constructor
  6627. if (isObject(Ctor)) {
  6628. Ctor = baseCtor.extend(Ctor);
  6629. }
  6630. // if at this stage it's not a constructor or an async component factory,
  6631. // reject.
  6632. if (typeof Ctor !== 'function') {
  6633. if (true) {
  6634. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6635. }
  6636. return
  6637. }
  6638. // async component
  6639. var asyncFactory;
  6640. if (isUndef(Ctor.cid)) {
  6641. asyncFactory = Ctor;
  6642. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6643. if (Ctor === undefined) {
  6644. // return a placeholder node for async component, which is rendered
  6645. // as a comment node but preserves all the raw information for the node.
  6646. // the information will be used for async server-rendering and hydration.
  6647. return createAsyncPlaceholder(
  6648. asyncFactory,
  6649. data,
  6650. context,
  6651. children,
  6652. tag
  6653. )
  6654. }
  6655. }
  6656. data = data || {};
  6657. // resolve constructor options in case global mixins are applied after
  6658. // component constructor creation
  6659. resolveConstructorOptions(Ctor);
  6660. // transform component v-model data into props & events
  6661. if (isDef(data.model)) {
  6662. transformModel(Ctor.options, data);
  6663. }
  6664. // extract props
  6665. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6666. // functional component
  6667. if (isTrue(Ctor.options.functional)) {
  6668. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6669. }
  6670. // extract listeners, since these needs to be treated as
  6671. // child component listeners instead of DOM listeners
  6672. var listeners = data.on;
  6673. // replace with listeners with .native modifier
  6674. // so it gets processed during parent component patch.
  6675. data.on = data.nativeOn;
  6676. if (isTrue(Ctor.options.abstract)) {
  6677. // abstract components do not keep anything
  6678. // other than props & listeners & slot
  6679. // work around flow
  6680. var slot = data.slot;
  6681. data = {};
  6682. if (slot) {
  6683. data.slot = slot;
  6684. }
  6685. }
  6686. // install component management hooks onto the placeholder node
  6687. installComponentHooks(data);
  6688. // return a placeholder vnode
  6689. var name = Ctor.options.name || tag;
  6690. var vnode = new VNode(
  6691. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6692. data, undefined, undefined, undefined, context,
  6693. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6694. asyncFactory
  6695. );
  6696. return vnode
  6697. }
  6698. function createComponentInstanceForVnode (
  6699. vnode, // we know it's MountedComponentVNode but flow doesn't
  6700. parent // activeInstance in lifecycle state
  6701. ) {
  6702. var options = {
  6703. _isComponent: true,
  6704. _parentVnode: vnode,
  6705. parent: parent
  6706. };
  6707. // check inline-template render functions
  6708. var inlineTemplate = vnode.data.inlineTemplate;
  6709. if (isDef(inlineTemplate)) {
  6710. options.render = inlineTemplate.render;
  6711. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6712. }
  6713. return new vnode.componentOptions.Ctor(options)
  6714. }
  6715. function installComponentHooks (data) {
  6716. var hooks = data.hook || (data.hook = {});
  6717. for (var i = 0; i < hooksToMerge.length; i++) {
  6718. var key = hooksToMerge[i];
  6719. var existing = hooks[key];
  6720. var toMerge = componentVNodeHooks[key];
  6721. if (existing !== toMerge && !(existing && existing._merged)) {
  6722. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6723. }
  6724. }
  6725. }
  6726. function mergeHook$1 (f1, f2) {
  6727. var merged = function (a, b) {
  6728. // flow complains about extra args which is why we use any
  6729. f1(a, b);
  6730. f2(a, b);
  6731. };
  6732. merged._merged = true;
  6733. return merged
  6734. }
  6735. // transform component v-model info (value and callback) into
  6736. // prop and event handler respectively.
  6737. function transformModel (options, data) {
  6738. var prop = (options.model && options.model.prop) || 'value';
  6739. var event = (options.model && options.model.event) || 'input'
  6740. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6741. var on = data.on || (data.on = {});
  6742. var existing = on[event];
  6743. var callback = data.model.callback;
  6744. if (isDef(existing)) {
  6745. if (
  6746. Array.isArray(existing)
  6747. ? existing.indexOf(callback) === -1
  6748. : existing !== callback
  6749. ) {
  6750. on[event] = [callback].concat(existing);
  6751. }
  6752. } else {
  6753. on[event] = callback;
  6754. }
  6755. }
  6756. /* */
  6757. var SIMPLE_NORMALIZE = 1;
  6758. var ALWAYS_NORMALIZE = 2;
  6759. // wrapper function for providing a more flexible interface
  6760. // without getting yelled at by flow
  6761. function createElement (
  6762. context,
  6763. tag,
  6764. data,
  6765. children,
  6766. normalizationType,
  6767. alwaysNormalize
  6768. ) {
  6769. if (Array.isArray(data) || isPrimitive(data)) {
  6770. normalizationType = children;
  6771. children = data;
  6772. data = undefined;
  6773. }
  6774. if (isTrue(alwaysNormalize)) {
  6775. normalizationType = ALWAYS_NORMALIZE;
  6776. }
  6777. return _createElement(context, tag, data, children, normalizationType)
  6778. }
  6779. function _createElement (
  6780. context,
  6781. tag,
  6782. data,
  6783. children,
  6784. normalizationType
  6785. ) {
  6786. if (isDef(data) && isDef((data).__ob__)) {
  6787. true && warn(
  6788. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6789. 'Always create fresh vnode data objects in each render!',
  6790. context
  6791. );
  6792. return createEmptyVNode()
  6793. }
  6794. // object syntax in v-bind
  6795. if (isDef(data) && isDef(data.is)) {
  6796. tag = data.is;
  6797. }
  6798. if (!tag) {
  6799. // in case of component :is set to falsy value
  6800. return createEmptyVNode()
  6801. }
  6802. // warn against non-primitive key
  6803. if ( true &&
  6804. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6805. ) {
  6806. {
  6807. warn(
  6808. 'Avoid using non-primitive value as key, ' +
  6809. 'use string/number value instead.',
  6810. context
  6811. );
  6812. }
  6813. }
  6814. // support single function children as default scoped slot
  6815. if (Array.isArray(children) &&
  6816. typeof children[0] === 'function'
  6817. ) {
  6818. data = data || {};
  6819. data.scopedSlots = { default: children[0] };
  6820. children.length = 0;
  6821. }
  6822. if (normalizationType === ALWAYS_NORMALIZE) {
  6823. children = normalizeChildren(children);
  6824. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6825. children = simpleNormalizeChildren(children);
  6826. }
  6827. var vnode, ns;
  6828. if (typeof tag === 'string') {
  6829. var Ctor;
  6830. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6831. if (config.isReservedTag(tag)) {
  6832. // platform built-in elements
  6833. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6834. warn(
  6835. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6836. context
  6837. );
  6838. }
  6839. vnode = new VNode(
  6840. config.parsePlatformTagName(tag), data, children,
  6841. undefined, undefined, context
  6842. );
  6843. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6844. // component
  6845. vnode = createComponent(Ctor, data, context, children, tag);
  6846. } else {
  6847. // unknown or unlisted namespaced elements
  6848. // check at runtime because it may get assigned a namespace when its
  6849. // parent normalizes children
  6850. vnode = new VNode(
  6851. tag, data, children,
  6852. undefined, undefined, context
  6853. );
  6854. }
  6855. } else {
  6856. // direct component options / constructor
  6857. vnode = createComponent(tag, data, context, children);
  6858. }
  6859. if (Array.isArray(vnode)) {
  6860. return vnode
  6861. } else if (isDef(vnode)) {
  6862. if (isDef(ns)) { applyNS(vnode, ns); }
  6863. if (isDef(data)) { registerDeepBindings(data); }
  6864. return vnode
  6865. } else {
  6866. return createEmptyVNode()
  6867. }
  6868. }
  6869. function applyNS (vnode, ns, force) {
  6870. vnode.ns = ns;
  6871. if (vnode.tag === 'foreignObject') {
  6872. // use default namespace inside foreignObject
  6873. ns = undefined;
  6874. force = true;
  6875. }
  6876. if (isDef(vnode.children)) {
  6877. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6878. var child = vnode.children[i];
  6879. if (isDef(child.tag) && (
  6880. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6881. applyNS(child, ns, force);
  6882. }
  6883. }
  6884. }
  6885. }
  6886. // ref #5318
  6887. // necessary to ensure parent re-render when deep bindings like :style and
  6888. // :class are used on slot nodes
  6889. function registerDeepBindings (data) {
  6890. if (isObject(data.style)) {
  6891. traverse(data.style);
  6892. }
  6893. if (isObject(data.class)) {
  6894. traverse(data.class);
  6895. }
  6896. }
  6897. /* */
  6898. function initRender (vm) {
  6899. vm._vnode = null; // the root of the child tree
  6900. vm._staticTrees = null; // v-once cached trees
  6901. var options = vm.$options;
  6902. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6903. var renderContext = parentVnode && parentVnode.context;
  6904. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6905. vm.$scopedSlots = emptyObject;
  6906. // bind the createElement fn to this instance
  6907. // so that we get proper render context inside it.
  6908. // args order: tag, data, children, normalizationType, alwaysNormalize
  6909. // internal version is used by render functions compiled from templates
  6910. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6911. // normalization is always applied for the public version, used in
  6912. // user-written render functions.
  6913. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6914. // $attrs & $listeners are exposed for easier HOC creation.
  6915. // they need to be reactive so that HOCs using them are always updated
  6916. var parentData = parentVnode && parentVnode.data;
  6917. /* istanbul ignore else */
  6918. if (true) {
  6919. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6920. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6921. }, true);
  6922. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6923. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6924. }, true);
  6925. } else {}
  6926. }
  6927. var currentRenderingInstance = null;
  6928. function renderMixin (Vue) {
  6929. // install runtime convenience helpers
  6930. installRenderHelpers(Vue.prototype);
  6931. Vue.prototype.$nextTick = function (fn) {
  6932. return nextTick(fn, this)
  6933. };
  6934. Vue.prototype._render = function () {
  6935. var vm = this;
  6936. var ref = vm.$options;
  6937. var render = ref.render;
  6938. var _parentVnode = ref._parentVnode;
  6939. if (_parentVnode) {
  6940. vm.$scopedSlots = normalizeScopedSlots(
  6941. _parentVnode.data.scopedSlots,
  6942. vm.$slots,
  6943. vm.$scopedSlots
  6944. );
  6945. }
  6946. // set parent vnode. this allows render functions to have access
  6947. // to the data on the placeholder node.
  6948. vm.$vnode = _parentVnode;
  6949. // render self
  6950. var vnode;
  6951. try {
  6952. // There's no need to maintain a stack because all render fns are called
  6953. // separately from one another. Nested component's render fns are called
  6954. // when parent component is patched.
  6955. currentRenderingInstance = vm;
  6956. vnode = render.call(vm._renderProxy, vm.$createElement);
  6957. } catch (e) {
  6958. handleError(e, vm, "render");
  6959. // return error render result,
  6960. // or previous vnode to prevent render error causing blank component
  6961. /* istanbul ignore else */
  6962. if ( true && vm.$options.renderError) {
  6963. try {
  6964. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6965. } catch (e) {
  6966. handleError(e, vm, "renderError");
  6967. vnode = vm._vnode;
  6968. }
  6969. } else {
  6970. vnode = vm._vnode;
  6971. }
  6972. } finally {
  6973. currentRenderingInstance = null;
  6974. }
  6975. // if the returned array contains only a single node, allow it
  6976. if (Array.isArray(vnode) && vnode.length === 1) {
  6977. vnode = vnode[0];
  6978. }
  6979. // return empty vnode in case the render function errored out
  6980. if (!(vnode instanceof VNode)) {
  6981. if ( true && Array.isArray(vnode)) {
  6982. warn(
  6983. 'Multiple root nodes returned from render function. Render function ' +
  6984. 'should return a single root node.',
  6985. vm
  6986. );
  6987. }
  6988. vnode = createEmptyVNode();
  6989. }
  6990. // set parent
  6991. vnode.parent = _parentVnode;
  6992. return vnode
  6993. };
  6994. }
  6995. /* */
  6996. function ensureCtor (comp, base) {
  6997. if (
  6998. comp.__esModule ||
  6999. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7000. ) {
  7001. comp = comp.default;
  7002. }
  7003. return isObject(comp)
  7004. ? base.extend(comp)
  7005. : comp
  7006. }
  7007. function createAsyncPlaceholder (
  7008. factory,
  7009. data,
  7010. context,
  7011. children,
  7012. tag
  7013. ) {
  7014. var node = createEmptyVNode();
  7015. node.asyncFactory = factory;
  7016. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7017. return node
  7018. }
  7019. function resolveAsyncComponent (
  7020. factory,
  7021. baseCtor
  7022. ) {
  7023. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7024. return factory.errorComp
  7025. }
  7026. if (isDef(factory.resolved)) {
  7027. return factory.resolved
  7028. }
  7029. var owner = currentRenderingInstance;
  7030. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7031. // already pending
  7032. factory.owners.push(owner);
  7033. }
  7034. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7035. return factory.loadingComp
  7036. }
  7037. if (owner && !isDef(factory.owners)) {
  7038. var owners = factory.owners = [owner];
  7039. var sync = true;
  7040. var timerLoading = null;
  7041. var timerTimeout = null
  7042. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7043. var forceRender = function (renderCompleted) {
  7044. for (var i = 0, l = owners.length; i < l; i++) {
  7045. (owners[i]).$forceUpdate();
  7046. }
  7047. if (renderCompleted) {
  7048. owners.length = 0;
  7049. if (timerLoading !== null) {
  7050. clearTimeout(timerLoading);
  7051. timerLoading = null;
  7052. }
  7053. if (timerTimeout !== null) {
  7054. clearTimeout(timerTimeout);
  7055. timerTimeout = null;
  7056. }
  7057. }
  7058. };
  7059. var resolve = once(function (res) {
  7060. // cache resolved
  7061. factory.resolved = ensureCtor(res, baseCtor);
  7062. // invoke callbacks only if this is not a synchronous resolve
  7063. // (async resolves are shimmed as synchronous during SSR)
  7064. if (!sync) {
  7065. forceRender(true);
  7066. } else {
  7067. owners.length = 0;
  7068. }
  7069. });
  7070. var reject = once(function (reason) {
  7071. true && warn(
  7072. "Failed to resolve async component: " + (String(factory)) +
  7073. (reason ? ("\nReason: " + reason) : '')
  7074. );
  7075. if (isDef(factory.errorComp)) {
  7076. factory.error = true;
  7077. forceRender(true);
  7078. }
  7079. });
  7080. var res = factory(resolve, reject);
  7081. if (isObject(res)) {
  7082. if (isPromise(res)) {
  7083. // () => Promise
  7084. if (isUndef(factory.resolved)) {
  7085. res.then(resolve, reject);
  7086. }
  7087. } else if (isPromise(res.component)) {
  7088. res.component.then(resolve, reject);
  7089. if (isDef(res.error)) {
  7090. factory.errorComp = ensureCtor(res.error, baseCtor);
  7091. }
  7092. if (isDef(res.loading)) {
  7093. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7094. if (res.delay === 0) {
  7095. factory.loading = true;
  7096. } else {
  7097. timerLoading = setTimeout(function () {
  7098. timerLoading = null;
  7099. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7100. factory.loading = true;
  7101. forceRender(false);
  7102. }
  7103. }, res.delay || 200);
  7104. }
  7105. }
  7106. if (isDef(res.timeout)) {
  7107. timerTimeout = setTimeout(function () {
  7108. timerTimeout = null;
  7109. if (isUndef(factory.resolved)) {
  7110. reject(
  7111. true
  7112. ? ("timeout (" + (res.timeout) + "ms)")
  7113. : undefined
  7114. );
  7115. }
  7116. }, res.timeout);
  7117. }
  7118. }
  7119. }
  7120. sync = false;
  7121. // return in case resolved synchronously
  7122. return factory.loading
  7123. ? factory.loadingComp
  7124. : factory.resolved
  7125. }
  7126. }
  7127. /* */
  7128. function isAsyncPlaceholder (node) {
  7129. return node.isComment && node.asyncFactory
  7130. }
  7131. /* */
  7132. function getFirstComponentChild (children) {
  7133. if (Array.isArray(children)) {
  7134. for (var i = 0; i < children.length; i++) {
  7135. var c = children[i];
  7136. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7137. return c
  7138. }
  7139. }
  7140. }
  7141. }
  7142. /* */
  7143. /* */
  7144. function initEvents (vm) {
  7145. vm._events = Object.create(null);
  7146. vm._hasHookEvent = false;
  7147. // init parent attached events
  7148. var listeners = vm.$options._parentListeners;
  7149. if (listeners) {
  7150. updateComponentListeners(vm, listeners);
  7151. }
  7152. }
  7153. var target;
  7154. function add (event, fn) {
  7155. target.$on(event, fn);
  7156. }
  7157. function remove$1 (event, fn) {
  7158. target.$off(event, fn);
  7159. }
  7160. function createOnceHandler (event, fn) {
  7161. var _target = target;
  7162. return function onceHandler () {
  7163. var res = fn.apply(null, arguments);
  7164. if (res !== null) {
  7165. _target.$off(event, onceHandler);
  7166. }
  7167. }
  7168. }
  7169. function updateComponentListeners (
  7170. vm,
  7171. listeners,
  7172. oldListeners
  7173. ) {
  7174. target = vm;
  7175. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7176. target = undefined;
  7177. }
  7178. function eventsMixin (Vue) {
  7179. var hookRE = /^hook:/;
  7180. Vue.prototype.$on = function (event, fn) {
  7181. var vm = this;
  7182. if (Array.isArray(event)) {
  7183. for (var i = 0, l = event.length; i < l; i++) {
  7184. vm.$on(event[i], fn);
  7185. }
  7186. } else {
  7187. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7188. // optimize hook:event cost by using a boolean flag marked at registration
  7189. // instead of a hash lookup
  7190. if (hookRE.test(event)) {
  7191. vm._hasHookEvent = true;
  7192. }
  7193. }
  7194. return vm
  7195. };
  7196. Vue.prototype.$once = function (event, fn) {
  7197. var vm = this;
  7198. function on () {
  7199. vm.$off(event, on);
  7200. fn.apply(vm, arguments);
  7201. }
  7202. on.fn = fn;
  7203. vm.$on(event, on);
  7204. return vm
  7205. };
  7206. Vue.prototype.$off = function (event, fn) {
  7207. var vm = this;
  7208. // all
  7209. if (!arguments.length) {
  7210. vm._events = Object.create(null);
  7211. return vm
  7212. }
  7213. // array of events
  7214. if (Array.isArray(event)) {
  7215. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7216. vm.$off(event[i$1], fn);
  7217. }
  7218. return vm
  7219. }
  7220. // specific event
  7221. var cbs = vm._events[event];
  7222. if (!cbs) {
  7223. return vm
  7224. }
  7225. if (!fn) {
  7226. vm._events[event] = null;
  7227. return vm
  7228. }
  7229. // specific handler
  7230. var cb;
  7231. var i = cbs.length;
  7232. while (i--) {
  7233. cb = cbs[i];
  7234. if (cb === fn || cb.fn === fn) {
  7235. cbs.splice(i, 1);
  7236. break
  7237. }
  7238. }
  7239. return vm
  7240. };
  7241. Vue.prototype.$emit = function (event) {
  7242. var vm = this;
  7243. if (true) {
  7244. var lowerCaseEvent = event.toLowerCase();
  7245. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7246. tip(
  7247. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7248. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7249. "Note that HTML attributes are case-insensitive and you cannot use " +
  7250. "v-on to listen to camelCase events when using in-DOM templates. " +
  7251. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7252. );
  7253. }
  7254. }
  7255. var cbs = vm._events[event];
  7256. if (cbs) {
  7257. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7258. var args = toArray(arguments, 1);
  7259. var info = "event handler for \"" + event + "\"";
  7260. for (var i = 0, l = cbs.length; i < l; i++) {
  7261. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7262. }
  7263. }
  7264. return vm
  7265. };
  7266. }
  7267. /* */
  7268. var activeInstance = null;
  7269. var isUpdatingChildComponent = false;
  7270. function setActiveInstance(vm) {
  7271. var prevActiveInstance = activeInstance;
  7272. activeInstance = vm;
  7273. return function () {
  7274. activeInstance = prevActiveInstance;
  7275. }
  7276. }
  7277. function initLifecycle (vm) {
  7278. var options = vm.$options;
  7279. // locate first non-abstract parent
  7280. var parent = options.parent;
  7281. if (parent && !options.abstract) {
  7282. while (parent.$options.abstract && parent.$parent) {
  7283. parent = parent.$parent;
  7284. }
  7285. parent.$children.push(vm);
  7286. }
  7287. vm.$parent = parent;
  7288. vm.$root = parent ? parent.$root : vm;
  7289. vm.$children = [];
  7290. vm.$refs = {};
  7291. vm._watcher = null;
  7292. vm._inactive = null;
  7293. vm._directInactive = false;
  7294. vm._isMounted = false;
  7295. vm._isDestroyed = false;
  7296. vm._isBeingDestroyed = false;
  7297. }
  7298. function lifecycleMixin (Vue) {
  7299. Vue.prototype._update = function (vnode, hydrating) {
  7300. var vm = this;
  7301. var prevEl = vm.$el;
  7302. var prevVnode = vm._vnode;
  7303. var restoreActiveInstance = setActiveInstance(vm);
  7304. vm._vnode = vnode;
  7305. // Vue.prototype.__patch__ is injected in entry points
  7306. // based on the rendering backend used.
  7307. if (!prevVnode) {
  7308. // initial render
  7309. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7310. } else {
  7311. // updates
  7312. vm.$el = vm.__patch__(prevVnode, vnode);
  7313. }
  7314. restoreActiveInstance();
  7315. // update __vue__ reference
  7316. if (prevEl) {
  7317. prevEl.__vue__ = null;
  7318. }
  7319. if (vm.$el) {
  7320. vm.$el.__vue__ = vm;
  7321. }
  7322. // if parent is an HOC, update its $el as well
  7323. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7324. vm.$parent.$el = vm.$el;
  7325. }
  7326. // updated hook is called by the scheduler to ensure that children are
  7327. // updated in a parent's updated hook.
  7328. };
  7329. Vue.prototype.$forceUpdate = function () {
  7330. var vm = this;
  7331. if (vm._watcher) {
  7332. vm._watcher.update();
  7333. }
  7334. };
  7335. Vue.prototype.$destroy = function () {
  7336. var vm = this;
  7337. if (vm._isBeingDestroyed) {
  7338. return
  7339. }
  7340. callHook(vm, 'beforeDestroy');
  7341. vm._isBeingDestroyed = true;
  7342. // remove self from parent
  7343. var parent = vm.$parent;
  7344. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7345. remove(parent.$children, vm);
  7346. }
  7347. // teardown watchers
  7348. if (vm._watcher) {
  7349. vm._watcher.teardown();
  7350. }
  7351. var i = vm._watchers.length;
  7352. while (i--) {
  7353. vm._watchers[i].teardown();
  7354. }
  7355. // remove reference from data ob
  7356. // frozen object may not have observer.
  7357. if (vm._data.__ob__) {
  7358. vm._data.__ob__.vmCount--;
  7359. }
  7360. // call the last hook...
  7361. vm._isDestroyed = true;
  7362. // invoke destroy hooks on current rendered tree
  7363. vm.__patch__(vm._vnode, null);
  7364. // fire destroyed hook
  7365. callHook(vm, 'destroyed');
  7366. // turn off all instance listeners.
  7367. vm.$off();
  7368. // remove __vue__ reference
  7369. if (vm.$el) {
  7370. vm.$el.__vue__ = null;
  7371. }
  7372. // release circular reference (#6759)
  7373. if (vm.$vnode) {
  7374. vm.$vnode.parent = null;
  7375. }
  7376. };
  7377. }
  7378. function updateChildComponent (
  7379. vm,
  7380. propsData,
  7381. listeners,
  7382. parentVnode,
  7383. renderChildren
  7384. ) {
  7385. if (true) {
  7386. isUpdatingChildComponent = true;
  7387. }
  7388. // determine whether component has slot children
  7389. // we need to do this before overwriting $options._renderChildren.
  7390. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7391. // dynamic slot names). Static scoped slots compiled from template has the
  7392. // "$stable" marker.
  7393. var newScopedSlots = parentVnode.data.scopedSlots;
  7394. var oldScopedSlots = vm.$scopedSlots;
  7395. var hasDynamicScopedSlot = !!(
  7396. (newScopedSlots && !newScopedSlots.$stable) ||
  7397. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7398. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7399. );
  7400. // Any static slot children from the parent may have changed during parent's
  7401. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7402. // update is necessary to ensure correctness.
  7403. var needsForceUpdate = !!(
  7404. renderChildren || // has new static slots
  7405. vm.$options._renderChildren || // has old static slots
  7406. hasDynamicScopedSlot
  7407. );
  7408. vm.$options._parentVnode = parentVnode;
  7409. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7410. if (vm._vnode) { // update child tree's parent
  7411. vm._vnode.parent = parentVnode;
  7412. }
  7413. vm.$options._renderChildren = renderChildren;
  7414. // update $attrs and $listeners hash
  7415. // these are also reactive so they may trigger child update if the child
  7416. // used them during render
  7417. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7418. vm.$listeners = listeners || emptyObject;
  7419. // update props
  7420. if (propsData && vm.$options.props) {
  7421. toggleObserving(false);
  7422. var props = vm._props;
  7423. var propKeys = vm.$options._propKeys || [];
  7424. for (var i = 0; i < propKeys.length; i++) {
  7425. var key = propKeys[i];
  7426. var propOptions = vm.$options.props; // wtf flow?
  7427. props[key] = validateProp(key, propOptions, propsData, vm);
  7428. }
  7429. toggleObserving(true);
  7430. // keep a copy of raw propsData
  7431. vm.$options.propsData = propsData;
  7432. }
  7433. // fixed by xxxxxx update properties(mp runtime)
  7434. vm._$updateProperties && vm._$updateProperties(vm);
  7435. // update listeners
  7436. listeners = listeners || emptyObject;
  7437. var oldListeners = vm.$options._parentListeners;
  7438. vm.$options._parentListeners = listeners;
  7439. updateComponentListeners(vm, listeners, oldListeners);
  7440. // resolve slots + force update if has children
  7441. if (needsForceUpdate) {
  7442. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7443. vm.$forceUpdate();
  7444. }
  7445. if (true) {
  7446. isUpdatingChildComponent = false;
  7447. }
  7448. }
  7449. function isInInactiveTree (vm) {
  7450. while (vm && (vm = vm.$parent)) {
  7451. if (vm._inactive) { return true }
  7452. }
  7453. return false
  7454. }
  7455. function activateChildComponent (vm, direct) {
  7456. if (direct) {
  7457. vm._directInactive = false;
  7458. if (isInInactiveTree(vm)) {
  7459. return
  7460. }
  7461. } else if (vm._directInactive) {
  7462. return
  7463. }
  7464. if (vm._inactive || vm._inactive === null) {
  7465. vm._inactive = false;
  7466. for (var i = 0; i < vm.$children.length; i++) {
  7467. activateChildComponent(vm.$children[i]);
  7468. }
  7469. callHook(vm, 'activated');
  7470. }
  7471. }
  7472. function deactivateChildComponent (vm, direct) {
  7473. if (direct) {
  7474. vm._directInactive = true;
  7475. if (isInInactiveTree(vm)) {
  7476. return
  7477. }
  7478. }
  7479. if (!vm._inactive) {
  7480. vm._inactive = true;
  7481. for (var i = 0; i < vm.$children.length; i++) {
  7482. deactivateChildComponent(vm.$children[i]);
  7483. }
  7484. callHook(vm, 'deactivated');
  7485. }
  7486. }
  7487. function callHook (vm, hook) {
  7488. // #7573 disable dep collection when invoking lifecycle hooks
  7489. pushTarget();
  7490. var handlers = vm.$options[hook];
  7491. var info = hook + " hook";
  7492. if (handlers) {
  7493. for (var i = 0, j = handlers.length; i < j; i++) {
  7494. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7495. }
  7496. }
  7497. if (vm._hasHookEvent) {
  7498. vm.$emit('hook:' + hook);
  7499. }
  7500. popTarget();
  7501. }
  7502. /* */
  7503. var MAX_UPDATE_COUNT = 100;
  7504. var queue = [];
  7505. var activatedChildren = [];
  7506. var has = {};
  7507. var circular = {};
  7508. var waiting = false;
  7509. var flushing = false;
  7510. var index = 0;
  7511. /**
  7512. * Reset the scheduler's state.
  7513. */
  7514. function resetSchedulerState () {
  7515. index = queue.length = activatedChildren.length = 0;
  7516. has = {};
  7517. if (true) {
  7518. circular = {};
  7519. }
  7520. waiting = flushing = false;
  7521. }
  7522. // Async edge case #6566 requires saving the timestamp when event listeners are
  7523. // attached. However, calling performance.now() has a perf overhead especially
  7524. // if the page has thousands of event listeners. Instead, we take a timestamp
  7525. // every time the scheduler flushes and use that for all event listeners
  7526. // attached during that flush.
  7527. var currentFlushTimestamp = 0;
  7528. // Async edge case fix requires storing an event listener's attach timestamp.
  7529. var getNow = Date.now;
  7530. // Determine what event timestamp the browser is using. Annoyingly, the
  7531. // timestamp can either be hi-res (relative to page load) or low-res
  7532. // (relative to UNIX epoch), so in order to compare time we have to use the
  7533. // same timestamp type when saving the flush timestamp.
  7534. // All IE versions use low-res event timestamps, and have problematic clock
  7535. // implementations (#9632)
  7536. if (inBrowser && !isIE) {
  7537. var performance = window.performance;
  7538. if (
  7539. performance &&
  7540. typeof performance.now === 'function' &&
  7541. getNow() > document.createEvent('Event').timeStamp
  7542. ) {
  7543. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7544. // smaller than it, it means the event is using a hi-res timestamp,
  7545. // and we need to use the hi-res version for event listener timestamps as
  7546. // well.
  7547. getNow = function () { return performance.now(); };
  7548. }
  7549. }
  7550. /**
  7551. * Flush both queues and run the watchers.
  7552. */
  7553. function flushSchedulerQueue () {
  7554. currentFlushTimestamp = getNow();
  7555. flushing = true;
  7556. var watcher, id;
  7557. // Sort queue before flush.
  7558. // This ensures that:
  7559. // 1. Components are updated from parent to child. (because parent is always
  7560. // created before the child)
  7561. // 2. A component's user watchers are run before its render watcher (because
  7562. // user watchers are created before the render watcher)
  7563. // 3. If a component is destroyed during a parent component's watcher run,
  7564. // its watchers can be skipped.
  7565. queue.sort(function (a, b) { return a.id - b.id; });
  7566. // do not cache length because more watchers might be pushed
  7567. // as we run existing watchers
  7568. for (index = 0; index < queue.length; index++) {
  7569. watcher = queue[index];
  7570. if (watcher.before) {
  7571. watcher.before();
  7572. }
  7573. id = watcher.id;
  7574. has[id] = null;
  7575. watcher.run();
  7576. // in dev build, check and stop circular updates.
  7577. if ( true && has[id] != null) {
  7578. circular[id] = (circular[id] || 0) + 1;
  7579. if (circular[id] > MAX_UPDATE_COUNT) {
  7580. warn(
  7581. 'You may have an infinite update loop ' + (
  7582. watcher.user
  7583. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7584. : "in a component render function."
  7585. ),
  7586. watcher.vm
  7587. );
  7588. break
  7589. }
  7590. }
  7591. }
  7592. // keep copies of post queues before resetting state
  7593. var activatedQueue = activatedChildren.slice();
  7594. var updatedQueue = queue.slice();
  7595. resetSchedulerState();
  7596. // call component updated and activated hooks
  7597. callActivatedHooks(activatedQueue);
  7598. callUpdatedHooks(updatedQueue);
  7599. // devtool hook
  7600. /* istanbul ignore if */
  7601. if (devtools && config.devtools) {
  7602. devtools.emit('flush');
  7603. }
  7604. }
  7605. function callUpdatedHooks (queue) {
  7606. var i = queue.length;
  7607. while (i--) {
  7608. var watcher = queue[i];
  7609. var vm = watcher.vm;
  7610. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7611. callHook(vm, 'updated');
  7612. }
  7613. }
  7614. }
  7615. /**
  7616. * Queue a kept-alive component that was activated during patch.
  7617. * The queue will be processed after the entire tree has been patched.
  7618. */
  7619. function queueActivatedComponent (vm) {
  7620. // setting _inactive to false here so that a render function can
  7621. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7622. vm._inactive = false;
  7623. activatedChildren.push(vm);
  7624. }
  7625. function callActivatedHooks (queue) {
  7626. for (var i = 0; i < queue.length; i++) {
  7627. queue[i]._inactive = true;
  7628. activateChildComponent(queue[i], true /* true */);
  7629. }
  7630. }
  7631. /**
  7632. * Push a watcher into the watcher queue.
  7633. * Jobs with duplicate IDs will be skipped unless it's
  7634. * pushed when the queue is being flushed.
  7635. */
  7636. function queueWatcher (watcher) {
  7637. var id = watcher.id;
  7638. if (has[id] == null) {
  7639. has[id] = true;
  7640. if (!flushing) {
  7641. queue.push(watcher);
  7642. } else {
  7643. // if already flushing, splice the watcher based on its id
  7644. // if already past its id, it will be run next immediately.
  7645. var i = queue.length - 1;
  7646. while (i > index && queue[i].id > watcher.id) {
  7647. i--;
  7648. }
  7649. queue.splice(i + 1, 0, watcher);
  7650. }
  7651. // queue the flush
  7652. if (!waiting) {
  7653. waiting = true;
  7654. if ( true && !config.async) {
  7655. flushSchedulerQueue();
  7656. return
  7657. }
  7658. nextTick(flushSchedulerQueue);
  7659. }
  7660. }
  7661. }
  7662. /* */
  7663. var uid$2 = 0;
  7664. /**
  7665. * A watcher parses an expression, collects dependencies,
  7666. * and fires callback when the expression value changes.
  7667. * This is used for both the $watch() api and directives.
  7668. */
  7669. var Watcher = function Watcher (
  7670. vm,
  7671. expOrFn,
  7672. cb,
  7673. options,
  7674. isRenderWatcher
  7675. ) {
  7676. this.vm = vm;
  7677. if (isRenderWatcher) {
  7678. vm._watcher = this;
  7679. }
  7680. vm._watchers.push(this);
  7681. // options
  7682. if (options) {
  7683. this.deep = !!options.deep;
  7684. this.user = !!options.user;
  7685. this.lazy = !!options.lazy;
  7686. this.sync = !!options.sync;
  7687. this.before = options.before;
  7688. } else {
  7689. this.deep = this.user = this.lazy = this.sync = false;
  7690. }
  7691. this.cb = cb;
  7692. this.id = ++uid$2; // uid for batching
  7693. this.active = true;
  7694. this.dirty = this.lazy; // for lazy watchers
  7695. this.deps = [];
  7696. this.newDeps = [];
  7697. this.depIds = new _Set();
  7698. this.newDepIds = new _Set();
  7699. this.expression = true
  7700. ? expOrFn.toString()
  7701. : undefined;
  7702. // parse expression for getter
  7703. if (typeof expOrFn === 'function') {
  7704. this.getter = expOrFn;
  7705. } else {
  7706. this.getter = parsePath(expOrFn);
  7707. if (!this.getter) {
  7708. this.getter = noop;
  7709. true && warn(
  7710. "Failed watching path: \"" + expOrFn + "\" " +
  7711. 'Watcher only accepts simple dot-delimited paths. ' +
  7712. 'For full control, use a function instead.',
  7713. vm
  7714. );
  7715. }
  7716. }
  7717. this.value = this.lazy
  7718. ? undefined
  7719. : this.get();
  7720. };
  7721. /**
  7722. * Evaluate the getter, and re-collect dependencies.
  7723. */
  7724. Watcher.prototype.get = function get () {
  7725. pushTarget(this);
  7726. var value;
  7727. var vm = this.vm;
  7728. try {
  7729. value = this.getter.call(vm, vm);
  7730. } catch (e) {
  7731. if (this.user) {
  7732. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7733. } else {
  7734. throw e
  7735. }
  7736. } finally {
  7737. // "touch" every property so they are all tracked as
  7738. // dependencies for deep watching
  7739. if (this.deep) {
  7740. traverse(value);
  7741. }
  7742. popTarget();
  7743. this.cleanupDeps();
  7744. }
  7745. return value
  7746. };
  7747. /**
  7748. * Add a dependency to this directive.
  7749. */
  7750. Watcher.prototype.addDep = function addDep (dep) {
  7751. var id = dep.id;
  7752. if (!this.newDepIds.has(id)) {
  7753. this.newDepIds.add(id);
  7754. this.newDeps.push(dep);
  7755. if (!this.depIds.has(id)) {
  7756. dep.addSub(this);
  7757. }
  7758. }
  7759. };
  7760. /**
  7761. * Clean up for dependency collection.
  7762. */
  7763. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7764. var i = this.deps.length;
  7765. while (i--) {
  7766. var dep = this.deps[i];
  7767. if (!this.newDepIds.has(dep.id)) {
  7768. dep.removeSub(this);
  7769. }
  7770. }
  7771. var tmp = this.depIds;
  7772. this.depIds = this.newDepIds;
  7773. this.newDepIds = tmp;
  7774. this.newDepIds.clear();
  7775. tmp = this.deps;
  7776. this.deps = this.newDeps;
  7777. this.newDeps = tmp;
  7778. this.newDeps.length = 0;
  7779. };
  7780. /**
  7781. * Subscriber interface.
  7782. * Will be called when a dependency changes.
  7783. */
  7784. Watcher.prototype.update = function update () {
  7785. /* istanbul ignore else */
  7786. if (this.lazy) {
  7787. this.dirty = true;
  7788. } else if (this.sync) {
  7789. this.run();
  7790. } else {
  7791. queueWatcher(this);
  7792. }
  7793. };
  7794. /**
  7795. * Scheduler job interface.
  7796. * Will be called by the scheduler.
  7797. */
  7798. Watcher.prototype.run = function run () {
  7799. if (this.active) {
  7800. var value = this.get();
  7801. if (
  7802. value !== this.value ||
  7803. // Deep watchers and watchers on Object/Arrays should fire even
  7804. // when the value is the same, because the value may
  7805. // have mutated.
  7806. isObject(value) ||
  7807. this.deep
  7808. ) {
  7809. // set new value
  7810. var oldValue = this.value;
  7811. this.value = value;
  7812. if (this.user) {
  7813. try {
  7814. this.cb.call(this.vm, value, oldValue);
  7815. } catch (e) {
  7816. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7817. }
  7818. } else {
  7819. this.cb.call(this.vm, value, oldValue);
  7820. }
  7821. }
  7822. }
  7823. };
  7824. /**
  7825. * Evaluate the value of the watcher.
  7826. * This only gets called for lazy watchers.
  7827. */
  7828. Watcher.prototype.evaluate = function evaluate () {
  7829. this.value = this.get();
  7830. this.dirty = false;
  7831. };
  7832. /**
  7833. * Depend on all deps collected by this watcher.
  7834. */
  7835. Watcher.prototype.depend = function depend () {
  7836. var i = this.deps.length;
  7837. while (i--) {
  7838. this.deps[i].depend();
  7839. }
  7840. };
  7841. /**
  7842. * Remove self from all dependencies' subscriber list.
  7843. */
  7844. Watcher.prototype.teardown = function teardown () {
  7845. if (this.active) {
  7846. // remove self from vm's watcher list
  7847. // this is a somewhat expensive operation so we skip it
  7848. // if the vm is being destroyed.
  7849. if (!this.vm._isBeingDestroyed) {
  7850. remove(this.vm._watchers, this);
  7851. }
  7852. var i = this.deps.length;
  7853. while (i--) {
  7854. this.deps[i].removeSub(this);
  7855. }
  7856. this.active = false;
  7857. }
  7858. };
  7859. /* */
  7860. var sharedPropertyDefinition = {
  7861. enumerable: true,
  7862. configurable: true,
  7863. get: noop,
  7864. set: noop
  7865. };
  7866. function proxy (target, sourceKey, key) {
  7867. sharedPropertyDefinition.get = function proxyGetter () {
  7868. return this[sourceKey][key]
  7869. };
  7870. sharedPropertyDefinition.set = function proxySetter (val) {
  7871. this[sourceKey][key] = val;
  7872. };
  7873. Object.defineProperty(target, key, sharedPropertyDefinition);
  7874. }
  7875. function initState (vm) {
  7876. vm._watchers = [];
  7877. var opts = vm.$options;
  7878. if (opts.props) { initProps(vm, opts.props); }
  7879. if (opts.methods) { initMethods(vm, opts.methods); }
  7880. if (opts.data) {
  7881. initData(vm);
  7882. } else {
  7883. observe(vm._data = {}, true /* asRootData */);
  7884. }
  7885. if (opts.computed) { initComputed(vm, opts.computed); }
  7886. if (opts.watch && opts.watch !== nativeWatch) {
  7887. initWatch(vm, opts.watch);
  7888. }
  7889. }
  7890. function initProps (vm, propsOptions) {
  7891. var propsData = vm.$options.propsData || {};
  7892. var props = vm._props = {};
  7893. // cache prop keys so that future props updates can iterate using Array
  7894. // instead of dynamic object key enumeration.
  7895. var keys = vm.$options._propKeys = [];
  7896. var isRoot = !vm.$parent;
  7897. // root instance props should be converted
  7898. if (!isRoot) {
  7899. toggleObserving(false);
  7900. }
  7901. var loop = function ( key ) {
  7902. keys.push(key);
  7903. var value = validateProp(key, propsOptions, propsData, vm);
  7904. /* istanbul ignore else */
  7905. if (true) {
  7906. var hyphenatedKey = hyphenate(key);
  7907. if (isReservedAttribute(hyphenatedKey) ||
  7908. config.isReservedAttr(hyphenatedKey)) {
  7909. warn(
  7910. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7911. vm
  7912. );
  7913. }
  7914. defineReactive$$1(props, key, value, function () {
  7915. if (!isRoot && !isUpdatingChildComponent) {
  7916. {
  7917. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7918. return
  7919. }
  7920. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7921. if(
  7922. key === 'value' &&
  7923. Array.isArray(vm.$options.behaviors) &&
  7924. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7925. ){
  7926. return
  7927. }
  7928. if(vm._getFormData){
  7929. return
  7930. }
  7931. var $parent = vm.$parent;
  7932. while($parent){
  7933. if($parent.__next_tick_pending){
  7934. return
  7935. }
  7936. $parent = $parent.$parent;
  7937. }
  7938. }
  7939. warn(
  7940. "Avoid mutating a prop directly since the value will be " +
  7941. "overwritten whenever the parent component re-renders. " +
  7942. "Instead, use a data or computed property based on the prop's " +
  7943. "value. Prop being mutated: \"" + key + "\"",
  7944. vm
  7945. );
  7946. }
  7947. });
  7948. } else {}
  7949. // static props are already proxied on the component's prototype
  7950. // during Vue.extend(). We only need to proxy props defined at
  7951. // instantiation here.
  7952. if (!(key in vm)) {
  7953. proxy(vm, "_props", key);
  7954. }
  7955. };
  7956. for (var key in propsOptions) loop( key );
  7957. toggleObserving(true);
  7958. }
  7959. function initData (vm) {
  7960. var data = vm.$options.data;
  7961. data = vm._data = typeof data === 'function'
  7962. ? getData(data, vm)
  7963. : data || {};
  7964. if (!isPlainObject(data)) {
  7965. data = {};
  7966. true && warn(
  7967. 'data functions should return an object:\n' +
  7968. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7969. vm
  7970. );
  7971. }
  7972. // proxy data on instance
  7973. var keys = Object.keys(data);
  7974. var props = vm.$options.props;
  7975. var methods = vm.$options.methods;
  7976. var i = keys.length;
  7977. while (i--) {
  7978. var key = keys[i];
  7979. if (true) {
  7980. if (methods && hasOwn(methods, key)) {
  7981. warn(
  7982. ("Method \"" + key + "\" has already been defined as a data property."),
  7983. vm
  7984. );
  7985. }
  7986. }
  7987. if (props && hasOwn(props, key)) {
  7988. true && warn(
  7989. "The data property \"" + key + "\" is already declared as a prop. " +
  7990. "Use prop default value instead.",
  7991. vm
  7992. );
  7993. } else if (!isReserved(key)) {
  7994. proxy(vm, "_data", key);
  7995. }
  7996. }
  7997. // observe data
  7998. observe(data, true /* asRootData */);
  7999. }
  8000. function getData (data, vm) {
  8001. // #7573 disable dep collection when invoking data getters
  8002. pushTarget();
  8003. try {
  8004. return data.call(vm, vm)
  8005. } catch (e) {
  8006. handleError(e, vm, "data()");
  8007. return {}
  8008. } finally {
  8009. popTarget();
  8010. }
  8011. }
  8012. var computedWatcherOptions = { lazy: true };
  8013. function initComputed (vm, computed) {
  8014. // $flow-disable-line
  8015. var watchers = vm._computedWatchers = Object.create(null);
  8016. // computed properties are just getters during SSR
  8017. var isSSR = isServerRendering();
  8018. for (var key in computed) {
  8019. var userDef = computed[key];
  8020. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8021. if ( true && getter == null) {
  8022. warn(
  8023. ("Getter is missing for computed property \"" + key + "\"."),
  8024. vm
  8025. );
  8026. }
  8027. if (!isSSR) {
  8028. // create internal watcher for the computed property.
  8029. watchers[key] = new Watcher(
  8030. vm,
  8031. getter || noop,
  8032. noop,
  8033. computedWatcherOptions
  8034. );
  8035. }
  8036. // component-defined computed properties are already defined on the
  8037. // component prototype. We only need to define computed properties defined
  8038. // at instantiation here.
  8039. if (!(key in vm)) {
  8040. defineComputed(vm, key, userDef);
  8041. } else if (true) {
  8042. if (key in vm.$data) {
  8043. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8044. } else if (vm.$options.props && key in vm.$options.props) {
  8045. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8046. }
  8047. }
  8048. }
  8049. }
  8050. function defineComputed (
  8051. target,
  8052. key,
  8053. userDef
  8054. ) {
  8055. var shouldCache = !isServerRendering();
  8056. if (typeof userDef === 'function') {
  8057. sharedPropertyDefinition.get = shouldCache
  8058. ? createComputedGetter(key)
  8059. : createGetterInvoker(userDef);
  8060. sharedPropertyDefinition.set = noop;
  8061. } else {
  8062. sharedPropertyDefinition.get = userDef.get
  8063. ? shouldCache && userDef.cache !== false
  8064. ? createComputedGetter(key)
  8065. : createGetterInvoker(userDef.get)
  8066. : noop;
  8067. sharedPropertyDefinition.set = userDef.set || noop;
  8068. }
  8069. if ( true &&
  8070. sharedPropertyDefinition.set === noop) {
  8071. sharedPropertyDefinition.set = function () {
  8072. warn(
  8073. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8074. this
  8075. );
  8076. };
  8077. }
  8078. Object.defineProperty(target, key, sharedPropertyDefinition);
  8079. }
  8080. function createComputedGetter (key) {
  8081. return function computedGetter () {
  8082. var watcher = this._computedWatchers && this._computedWatchers[key];
  8083. if (watcher) {
  8084. if (watcher.dirty) {
  8085. watcher.evaluate();
  8086. }
  8087. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8088. watcher.depend();
  8089. }
  8090. return watcher.value
  8091. }
  8092. }
  8093. }
  8094. function createGetterInvoker(fn) {
  8095. return function computedGetter () {
  8096. return fn.call(this, this)
  8097. }
  8098. }
  8099. function initMethods (vm, methods) {
  8100. var props = vm.$options.props;
  8101. for (var key in methods) {
  8102. if (true) {
  8103. if (typeof methods[key] !== 'function') {
  8104. warn(
  8105. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8106. "Did you reference the function correctly?",
  8107. vm
  8108. );
  8109. }
  8110. if (props && hasOwn(props, key)) {
  8111. warn(
  8112. ("Method \"" + key + "\" has already been defined as a prop."),
  8113. vm
  8114. );
  8115. }
  8116. if ((key in vm) && isReserved(key)) {
  8117. warn(
  8118. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8119. "Avoid defining component methods that start with _ or $."
  8120. );
  8121. }
  8122. }
  8123. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8124. }
  8125. }
  8126. function initWatch (vm, watch) {
  8127. for (var key in watch) {
  8128. var handler = watch[key];
  8129. if (Array.isArray(handler)) {
  8130. for (var i = 0; i < handler.length; i++) {
  8131. createWatcher(vm, key, handler[i]);
  8132. }
  8133. } else {
  8134. createWatcher(vm, key, handler);
  8135. }
  8136. }
  8137. }
  8138. function createWatcher (
  8139. vm,
  8140. expOrFn,
  8141. handler,
  8142. options
  8143. ) {
  8144. if (isPlainObject(handler)) {
  8145. options = handler;
  8146. handler = handler.handler;
  8147. }
  8148. if (typeof handler === 'string') {
  8149. handler = vm[handler];
  8150. }
  8151. return vm.$watch(expOrFn, handler, options)
  8152. }
  8153. function stateMixin (Vue) {
  8154. // flow somehow has problems with directly declared definition object
  8155. // when using Object.defineProperty, so we have to procedurally build up
  8156. // the object here.
  8157. var dataDef = {};
  8158. dataDef.get = function () { return this._data };
  8159. var propsDef = {};
  8160. propsDef.get = function () { return this._props };
  8161. if (true) {
  8162. dataDef.set = function () {
  8163. warn(
  8164. 'Avoid replacing instance root $data. ' +
  8165. 'Use nested data properties instead.',
  8166. this
  8167. );
  8168. };
  8169. propsDef.set = function () {
  8170. warn("$props is readonly.", this);
  8171. };
  8172. }
  8173. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8174. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8175. Vue.prototype.$set = set;
  8176. Vue.prototype.$delete = del;
  8177. Vue.prototype.$watch = function (
  8178. expOrFn,
  8179. cb,
  8180. options
  8181. ) {
  8182. var vm = this;
  8183. if (isPlainObject(cb)) {
  8184. return createWatcher(vm, expOrFn, cb, options)
  8185. }
  8186. options = options || {};
  8187. options.user = true;
  8188. var watcher = new Watcher(vm, expOrFn, cb, options);
  8189. if (options.immediate) {
  8190. try {
  8191. cb.call(vm, watcher.value);
  8192. } catch (error) {
  8193. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8194. }
  8195. }
  8196. return function unwatchFn () {
  8197. watcher.teardown();
  8198. }
  8199. };
  8200. }
  8201. /* */
  8202. var uid$3 = 0;
  8203. function initMixin (Vue) {
  8204. Vue.prototype._init = function (options) {
  8205. var vm = this;
  8206. // a uid
  8207. vm._uid = uid$3++;
  8208. var startTag, endTag;
  8209. /* istanbul ignore if */
  8210. if ( true && config.performance && mark) {
  8211. startTag = "vue-perf-start:" + (vm._uid);
  8212. endTag = "vue-perf-end:" + (vm._uid);
  8213. mark(startTag);
  8214. }
  8215. // a flag to avoid this being observed
  8216. vm._isVue = true;
  8217. // merge options
  8218. if (options && options._isComponent) {
  8219. // optimize internal component instantiation
  8220. // since dynamic options merging is pretty slow, and none of the
  8221. // internal component options needs special treatment.
  8222. initInternalComponent(vm, options);
  8223. } else {
  8224. vm.$options = mergeOptions(
  8225. resolveConstructorOptions(vm.constructor),
  8226. options || {},
  8227. vm
  8228. );
  8229. }
  8230. /* istanbul ignore else */
  8231. if (true) {
  8232. initProxy(vm);
  8233. } else {}
  8234. // expose real self
  8235. vm._self = vm;
  8236. initLifecycle(vm);
  8237. initEvents(vm);
  8238. initRender(vm);
  8239. callHook(vm, 'beforeCreate');
  8240. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8241. initState(vm);
  8242. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8243. !vm._$fallback && callHook(vm, 'created');
  8244. /* istanbul ignore if */
  8245. if ( true && config.performance && mark) {
  8246. vm._name = formatComponentName(vm, false);
  8247. mark(endTag);
  8248. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8249. }
  8250. if (vm.$options.el) {
  8251. vm.$mount(vm.$options.el);
  8252. }
  8253. };
  8254. }
  8255. function initInternalComponent (vm, options) {
  8256. var opts = vm.$options = Object.create(vm.constructor.options);
  8257. // doing this because it's faster than dynamic enumeration.
  8258. var parentVnode = options._parentVnode;
  8259. opts.parent = options.parent;
  8260. opts._parentVnode = parentVnode;
  8261. var vnodeComponentOptions = parentVnode.componentOptions;
  8262. opts.propsData = vnodeComponentOptions.propsData;
  8263. opts._parentListeners = vnodeComponentOptions.listeners;
  8264. opts._renderChildren = vnodeComponentOptions.children;
  8265. opts._componentTag = vnodeComponentOptions.tag;
  8266. if (options.render) {
  8267. opts.render = options.render;
  8268. opts.staticRenderFns = options.staticRenderFns;
  8269. }
  8270. }
  8271. function resolveConstructorOptions (Ctor) {
  8272. var options = Ctor.options;
  8273. if (Ctor.super) {
  8274. var superOptions = resolveConstructorOptions(Ctor.super);
  8275. var cachedSuperOptions = Ctor.superOptions;
  8276. if (superOptions !== cachedSuperOptions) {
  8277. // super option changed,
  8278. // need to resolve new options.
  8279. Ctor.superOptions = superOptions;
  8280. // check if there are any late-modified/attached options (#4976)
  8281. var modifiedOptions = resolveModifiedOptions(Ctor);
  8282. // update base extend options
  8283. if (modifiedOptions) {
  8284. extend(Ctor.extendOptions, modifiedOptions);
  8285. }
  8286. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8287. if (options.name) {
  8288. options.components[options.name] = Ctor;
  8289. }
  8290. }
  8291. }
  8292. return options
  8293. }
  8294. function resolveModifiedOptions (Ctor) {
  8295. var modified;
  8296. var latest = Ctor.options;
  8297. var sealed = Ctor.sealedOptions;
  8298. for (var key in latest) {
  8299. if (latest[key] !== sealed[key]) {
  8300. if (!modified) { modified = {}; }
  8301. modified[key] = latest[key];
  8302. }
  8303. }
  8304. return modified
  8305. }
  8306. function Vue (options) {
  8307. if ( true &&
  8308. !(this instanceof Vue)
  8309. ) {
  8310. warn('Vue is a constructor and should be called with the `new` keyword');
  8311. }
  8312. this._init(options);
  8313. }
  8314. initMixin(Vue);
  8315. stateMixin(Vue);
  8316. eventsMixin(Vue);
  8317. lifecycleMixin(Vue);
  8318. renderMixin(Vue);
  8319. /* */
  8320. function initUse (Vue) {
  8321. Vue.use = function (plugin) {
  8322. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8323. if (installedPlugins.indexOf(plugin) > -1) {
  8324. return this
  8325. }
  8326. // additional parameters
  8327. var args = toArray(arguments, 1);
  8328. args.unshift(this);
  8329. if (typeof plugin.install === 'function') {
  8330. plugin.install.apply(plugin, args);
  8331. } else if (typeof plugin === 'function') {
  8332. plugin.apply(null, args);
  8333. }
  8334. installedPlugins.push(plugin);
  8335. return this
  8336. };
  8337. }
  8338. /* */
  8339. function initMixin$1 (Vue) {
  8340. Vue.mixin = function (mixin) {
  8341. this.options = mergeOptions(this.options, mixin);
  8342. return this
  8343. };
  8344. }
  8345. /* */
  8346. function initExtend (Vue) {
  8347. /**
  8348. * Each instance constructor, including Vue, has a unique
  8349. * cid. This enables us to create wrapped "child
  8350. * constructors" for prototypal inheritance and cache them.
  8351. */
  8352. Vue.cid = 0;
  8353. var cid = 1;
  8354. /**
  8355. * Class inheritance
  8356. */
  8357. Vue.extend = function (extendOptions) {
  8358. extendOptions = extendOptions || {};
  8359. var Super = this;
  8360. var SuperId = Super.cid;
  8361. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8362. if (cachedCtors[SuperId]) {
  8363. return cachedCtors[SuperId]
  8364. }
  8365. var name = extendOptions.name || Super.options.name;
  8366. if ( true && name) {
  8367. validateComponentName(name);
  8368. }
  8369. var Sub = function VueComponent (options) {
  8370. this._init(options);
  8371. };
  8372. Sub.prototype = Object.create(Super.prototype);
  8373. Sub.prototype.constructor = Sub;
  8374. Sub.cid = cid++;
  8375. Sub.options = mergeOptions(
  8376. Super.options,
  8377. extendOptions
  8378. );
  8379. Sub['super'] = Super;
  8380. // For props and computed properties, we define the proxy getters on
  8381. // the Vue instances at extension time, on the extended prototype. This
  8382. // avoids Object.defineProperty calls for each instance created.
  8383. if (Sub.options.props) {
  8384. initProps$1(Sub);
  8385. }
  8386. if (Sub.options.computed) {
  8387. initComputed$1(Sub);
  8388. }
  8389. // allow further extension/mixin/plugin usage
  8390. Sub.extend = Super.extend;
  8391. Sub.mixin = Super.mixin;
  8392. Sub.use = Super.use;
  8393. // create asset registers, so extended classes
  8394. // can have their private assets too.
  8395. ASSET_TYPES.forEach(function (type) {
  8396. Sub[type] = Super[type];
  8397. });
  8398. // enable recursive self-lookup
  8399. if (name) {
  8400. Sub.options.components[name] = Sub;
  8401. }
  8402. // keep a reference to the super options at extension time.
  8403. // later at instantiation we can check if Super's options have
  8404. // been updated.
  8405. Sub.superOptions = Super.options;
  8406. Sub.extendOptions = extendOptions;
  8407. Sub.sealedOptions = extend({}, Sub.options);
  8408. // cache constructor
  8409. cachedCtors[SuperId] = Sub;
  8410. return Sub
  8411. };
  8412. }
  8413. function initProps$1 (Comp) {
  8414. var props = Comp.options.props;
  8415. for (var key in props) {
  8416. proxy(Comp.prototype, "_props", key);
  8417. }
  8418. }
  8419. function initComputed$1 (Comp) {
  8420. var computed = Comp.options.computed;
  8421. for (var key in computed) {
  8422. defineComputed(Comp.prototype, key, computed[key]);
  8423. }
  8424. }
  8425. /* */
  8426. function initAssetRegisters (Vue) {
  8427. /**
  8428. * Create asset registration methods.
  8429. */
  8430. ASSET_TYPES.forEach(function (type) {
  8431. Vue[type] = function (
  8432. id,
  8433. definition
  8434. ) {
  8435. if (!definition) {
  8436. return this.options[type + 's'][id]
  8437. } else {
  8438. /* istanbul ignore if */
  8439. if ( true && type === 'component') {
  8440. validateComponentName(id);
  8441. }
  8442. if (type === 'component' && isPlainObject(definition)) {
  8443. definition.name = definition.name || id;
  8444. definition = this.options._base.extend(definition);
  8445. }
  8446. if (type === 'directive' && typeof definition === 'function') {
  8447. definition = { bind: definition, update: definition };
  8448. }
  8449. this.options[type + 's'][id] = definition;
  8450. return definition
  8451. }
  8452. };
  8453. });
  8454. }
  8455. /* */
  8456. function getComponentName (opts) {
  8457. return opts && (opts.Ctor.options.name || opts.tag)
  8458. }
  8459. function matches (pattern, name) {
  8460. if (Array.isArray(pattern)) {
  8461. return pattern.indexOf(name) > -1
  8462. } else if (typeof pattern === 'string') {
  8463. return pattern.split(',').indexOf(name) > -1
  8464. } else if (isRegExp(pattern)) {
  8465. return pattern.test(name)
  8466. }
  8467. /* istanbul ignore next */
  8468. return false
  8469. }
  8470. function pruneCache (keepAliveInstance, filter) {
  8471. var cache = keepAliveInstance.cache;
  8472. var keys = keepAliveInstance.keys;
  8473. var _vnode = keepAliveInstance._vnode;
  8474. for (var key in cache) {
  8475. var cachedNode = cache[key];
  8476. if (cachedNode) {
  8477. var name = getComponentName(cachedNode.componentOptions);
  8478. if (name && !filter(name)) {
  8479. pruneCacheEntry(cache, key, keys, _vnode);
  8480. }
  8481. }
  8482. }
  8483. }
  8484. function pruneCacheEntry (
  8485. cache,
  8486. key,
  8487. keys,
  8488. current
  8489. ) {
  8490. var cached$$1 = cache[key];
  8491. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8492. cached$$1.componentInstance.$destroy();
  8493. }
  8494. cache[key] = null;
  8495. remove(keys, key);
  8496. }
  8497. var patternTypes = [String, RegExp, Array];
  8498. var KeepAlive = {
  8499. name: 'keep-alive',
  8500. abstract: true,
  8501. props: {
  8502. include: patternTypes,
  8503. exclude: patternTypes,
  8504. max: [String, Number]
  8505. },
  8506. created: function created () {
  8507. this.cache = Object.create(null);
  8508. this.keys = [];
  8509. },
  8510. destroyed: function destroyed () {
  8511. for (var key in this.cache) {
  8512. pruneCacheEntry(this.cache, key, this.keys);
  8513. }
  8514. },
  8515. mounted: function mounted () {
  8516. var this$1 = this;
  8517. this.$watch('include', function (val) {
  8518. pruneCache(this$1, function (name) { return matches(val, name); });
  8519. });
  8520. this.$watch('exclude', function (val) {
  8521. pruneCache(this$1, function (name) { return !matches(val, name); });
  8522. });
  8523. },
  8524. render: function render () {
  8525. var slot = this.$slots.default;
  8526. var vnode = getFirstComponentChild(slot);
  8527. var componentOptions = vnode && vnode.componentOptions;
  8528. if (componentOptions) {
  8529. // check pattern
  8530. var name = getComponentName(componentOptions);
  8531. var ref = this;
  8532. var include = ref.include;
  8533. var exclude = ref.exclude;
  8534. if (
  8535. // not included
  8536. (include && (!name || !matches(include, name))) ||
  8537. // excluded
  8538. (exclude && name && matches(exclude, name))
  8539. ) {
  8540. return vnode
  8541. }
  8542. var ref$1 = this;
  8543. var cache = ref$1.cache;
  8544. var keys = ref$1.keys;
  8545. var key = vnode.key == null
  8546. // same constructor may get registered as different local components
  8547. // so cid alone is not enough (#3269)
  8548. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8549. : vnode.key;
  8550. if (cache[key]) {
  8551. vnode.componentInstance = cache[key].componentInstance;
  8552. // make current key freshest
  8553. remove(keys, key);
  8554. keys.push(key);
  8555. } else {
  8556. cache[key] = vnode;
  8557. keys.push(key);
  8558. // prune oldest entry
  8559. if (this.max && keys.length > parseInt(this.max)) {
  8560. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8561. }
  8562. }
  8563. vnode.data.keepAlive = true;
  8564. }
  8565. return vnode || (slot && slot[0])
  8566. }
  8567. };
  8568. var builtInComponents = {
  8569. KeepAlive: KeepAlive
  8570. };
  8571. /* */
  8572. function initGlobalAPI (Vue) {
  8573. // config
  8574. var configDef = {};
  8575. configDef.get = function () { return config; };
  8576. if (true) {
  8577. configDef.set = function () {
  8578. warn(
  8579. 'Do not replace the Vue.config object, set individual fields instead.'
  8580. );
  8581. };
  8582. }
  8583. Object.defineProperty(Vue, 'config', configDef);
  8584. // exposed util methods.
  8585. // NOTE: these are not considered part of the public API - avoid relying on
  8586. // them unless you are aware of the risk.
  8587. Vue.util = {
  8588. warn: warn,
  8589. extend: extend,
  8590. mergeOptions: mergeOptions,
  8591. defineReactive: defineReactive$$1
  8592. };
  8593. Vue.set = set;
  8594. Vue.delete = del;
  8595. Vue.nextTick = nextTick;
  8596. // 2.6 explicit observable API
  8597. Vue.observable = function (obj) {
  8598. observe(obj);
  8599. return obj
  8600. };
  8601. Vue.options = Object.create(null);
  8602. ASSET_TYPES.forEach(function (type) {
  8603. Vue.options[type + 's'] = Object.create(null);
  8604. });
  8605. // this is used to identify the "base" constructor to extend all plain-object
  8606. // components with in Weex's multi-instance scenarios.
  8607. Vue.options._base = Vue;
  8608. extend(Vue.options.components, builtInComponents);
  8609. initUse(Vue);
  8610. initMixin$1(Vue);
  8611. initExtend(Vue);
  8612. initAssetRegisters(Vue);
  8613. }
  8614. initGlobalAPI(Vue);
  8615. Object.defineProperty(Vue.prototype, '$isServer', {
  8616. get: isServerRendering
  8617. });
  8618. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8619. get: function get () {
  8620. /* istanbul ignore next */
  8621. return this.$vnode && this.$vnode.ssrContext
  8622. }
  8623. });
  8624. // expose FunctionalRenderContext for ssr runtime helper installation
  8625. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8626. value: FunctionalRenderContext
  8627. });
  8628. Vue.version = '2.6.11';
  8629. /**
  8630. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8631. */
  8632. var ARRAYTYPE = '[object Array]';
  8633. var OBJECTTYPE = '[object Object]';
  8634. var NULLTYPE = '[object Null]';
  8635. var UNDEFINEDTYPE = '[object Undefined]';
  8636. // const FUNCTIONTYPE = '[object Function]'
  8637. function diff(current, pre) {
  8638. var result = {};
  8639. syncKeys(current, pre);
  8640. _diff(current, pre, '', result);
  8641. return result
  8642. }
  8643. function syncKeys(current, pre) {
  8644. if (current === pre) { return }
  8645. var rootCurrentType = type(current);
  8646. var rootPreType = type(pre);
  8647. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8648. if(Object.keys(current).length >= Object.keys(pre).length){
  8649. for (var key in pre) {
  8650. var currentValue = current[key];
  8651. if (currentValue === undefined) {
  8652. current[key] = null;
  8653. } else {
  8654. syncKeys(currentValue, pre[key]);
  8655. }
  8656. }
  8657. }
  8658. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8659. if (current.length >= pre.length) {
  8660. pre.forEach(function (item, index) {
  8661. syncKeys(current[index], item);
  8662. });
  8663. }
  8664. }
  8665. }
  8666. function nullOrUndefined(currentType, preType) {
  8667. if(
  8668. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8669. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8670. ) {
  8671. return false
  8672. }
  8673. return true
  8674. }
  8675. function _diff(current, pre, path, result) {
  8676. if (current === pre) { return }
  8677. var rootCurrentType = type(current);
  8678. var rootPreType = type(pre);
  8679. if (rootCurrentType == OBJECTTYPE) {
  8680. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8681. setResult(result, path, current);
  8682. } else {
  8683. var loop = function ( key ) {
  8684. var currentValue = current[key];
  8685. var preValue = pre[key];
  8686. var currentType = type(currentValue);
  8687. var preType = type(preValue);
  8688. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8689. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8690. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8691. }
  8692. } else if (currentType == ARRAYTYPE) {
  8693. if (preType != ARRAYTYPE) {
  8694. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8695. } else {
  8696. if (currentValue.length < preValue.length) {
  8697. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8698. } else {
  8699. currentValue.forEach(function (item, index) {
  8700. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8701. });
  8702. }
  8703. }
  8704. } else if (currentType == OBJECTTYPE) {
  8705. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8706. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8707. } else {
  8708. for (var subKey in currentValue) {
  8709. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8710. }
  8711. }
  8712. }
  8713. };
  8714. for (var key in current) loop( key );
  8715. }
  8716. } else if (rootCurrentType == ARRAYTYPE) {
  8717. if (rootPreType != ARRAYTYPE) {
  8718. setResult(result, path, current);
  8719. } else {
  8720. if (current.length < pre.length) {
  8721. setResult(result, path, current);
  8722. } else {
  8723. current.forEach(function (item, index) {
  8724. _diff(item, pre[index], path + '[' + index + ']', result);
  8725. });
  8726. }
  8727. }
  8728. } else {
  8729. setResult(result, path, current);
  8730. }
  8731. }
  8732. function setResult(result, k, v) {
  8733. // if (type(v) != FUNCTIONTYPE) {
  8734. result[k] = v;
  8735. // }
  8736. }
  8737. function type(obj) {
  8738. return Object.prototype.toString.call(obj)
  8739. }
  8740. /* */
  8741. function flushCallbacks$1(vm) {
  8742. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8743. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"某娘生鲜","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8744. var mpInstance = vm.$scope;
  8745. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8746. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8747. }
  8748. var copies = vm.__next_tick_callbacks.slice(0);
  8749. vm.__next_tick_callbacks.length = 0;
  8750. for (var i = 0; i < copies.length; i++) {
  8751. copies[i]();
  8752. }
  8753. }
  8754. }
  8755. function hasRenderWatcher(vm) {
  8756. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8757. }
  8758. function nextTick$1(vm, cb) {
  8759. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8760. //2.nextTick 之前存在 render watcher
  8761. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8762. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"某娘生鲜","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8763. var mpInstance = vm.$scope;
  8764. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8765. ']:nextVueTick');
  8766. }
  8767. return nextTick(cb, vm)
  8768. }else{
  8769. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"某娘生鲜","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8770. var mpInstance$1 = vm.$scope;
  8771. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8772. ']:nextMPTick');
  8773. }
  8774. }
  8775. var _resolve;
  8776. if (!vm.__next_tick_callbacks) {
  8777. vm.__next_tick_callbacks = [];
  8778. }
  8779. vm.__next_tick_callbacks.push(function () {
  8780. if (cb) {
  8781. try {
  8782. cb.call(vm);
  8783. } catch (e) {
  8784. handleError(e, vm, 'nextTick');
  8785. }
  8786. } else if (_resolve) {
  8787. _resolve(vm);
  8788. }
  8789. });
  8790. // $flow-disable-line
  8791. if (!cb && typeof Promise !== 'undefined') {
  8792. return new Promise(function (resolve) {
  8793. _resolve = resolve;
  8794. })
  8795. }
  8796. }
  8797. /* */
  8798. function clearInstance(key, value) {
  8799. // 简易去除 Vue 和小程序组件实例
  8800. if (value) {
  8801. if (value._isVue || value.__v_isMPComponent) {
  8802. return {}
  8803. }
  8804. }
  8805. return value
  8806. }
  8807. function cloneWithData(vm) {
  8808. // 确保当前 vm 所有数据被同步
  8809. var ret = Object.create(null);
  8810. var dataKeys = [].concat(
  8811. Object.keys(vm._data || {}),
  8812. Object.keys(vm._computedWatchers || {}));
  8813. dataKeys.reduce(function(ret, key) {
  8814. ret[key] = vm[key];
  8815. return ret
  8816. }, ret);
  8817. // vue-composition-api
  8818. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8819. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8820. if (rawBindings) {
  8821. Object.keys(rawBindings).forEach(function (key) {
  8822. ret[key] = vm[key];
  8823. });
  8824. }
  8825. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8826. Object.assign(ret, vm.$mp.data || {});
  8827. if (
  8828. Array.isArray(vm.$options.behaviors) &&
  8829. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8830. ) { //form-field
  8831. ret['name'] = vm.name;
  8832. ret['value'] = vm.value;
  8833. }
  8834. return JSON.parse(JSON.stringify(ret, clearInstance))
  8835. }
  8836. var patch = function(oldVnode, vnode) {
  8837. var this$1 = this;
  8838. if (vnode === null) { //destroy
  8839. return
  8840. }
  8841. if (this.mpType === 'page' || this.mpType === 'component') {
  8842. var mpInstance = this.$scope;
  8843. var data = Object.create(null);
  8844. try {
  8845. data = cloneWithData(this);
  8846. } catch (err) {
  8847. console.error(err);
  8848. }
  8849. data.__webviewId__ = mpInstance.data.__webviewId__;
  8850. var mpData = Object.create(null);
  8851. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8852. mpData[key] = mpInstance.data[key];
  8853. });
  8854. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8855. if (Object.keys(diffData).length) {
  8856. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"某娘生鲜","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8857. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8858. ']差量更新',
  8859. JSON.stringify(diffData));
  8860. }
  8861. this.__next_tick_pending = true;
  8862. mpInstance.setData(diffData, function () {
  8863. this$1.__next_tick_pending = false;
  8864. flushCallbacks$1(this$1);
  8865. });
  8866. } else {
  8867. flushCallbacks$1(this);
  8868. }
  8869. }
  8870. };
  8871. /* */
  8872. function createEmptyRender() {
  8873. }
  8874. function mountComponent$1(
  8875. vm,
  8876. el,
  8877. hydrating
  8878. ) {
  8879. if (!vm.mpType) {//main.js 中的 new Vue
  8880. return vm
  8881. }
  8882. if (vm.mpType === 'app') {
  8883. vm.$options.render = createEmptyRender;
  8884. }
  8885. if (!vm.$options.render) {
  8886. vm.$options.render = createEmptyRender;
  8887. if (true) {
  8888. /* istanbul ignore if */
  8889. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8890. vm.$options.el || el) {
  8891. warn(
  8892. 'You are using the runtime-only build of Vue where the template ' +
  8893. 'compiler is not available. Either pre-compile the templates into ' +
  8894. 'render functions, or use the compiler-included build.',
  8895. vm
  8896. );
  8897. } else {
  8898. warn(
  8899. 'Failed to mount component: template or render function not defined.',
  8900. vm
  8901. );
  8902. }
  8903. }
  8904. }
  8905. !vm._$fallback && callHook(vm, 'beforeMount');
  8906. var updateComponent = function () {
  8907. vm._update(vm._render(), hydrating);
  8908. };
  8909. // we set this to vm._watcher inside the watcher's constructor
  8910. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8911. // component's mounted hook), which relies on vm._watcher being already defined
  8912. new Watcher(vm, updateComponent, noop, {
  8913. before: function before() {
  8914. if (vm._isMounted && !vm._isDestroyed) {
  8915. callHook(vm, 'beforeUpdate');
  8916. }
  8917. }
  8918. }, true /* isRenderWatcher */);
  8919. hydrating = false;
  8920. return vm
  8921. }
  8922. /* */
  8923. function renderClass (
  8924. staticClass,
  8925. dynamicClass
  8926. ) {
  8927. if (isDef(staticClass) || isDef(dynamicClass)) {
  8928. return concat(staticClass, stringifyClass(dynamicClass))
  8929. }
  8930. /* istanbul ignore next */
  8931. return ''
  8932. }
  8933. function concat (a, b) {
  8934. return a ? b ? (a + ' ' + b) : a : (b || '')
  8935. }
  8936. function stringifyClass (value) {
  8937. if (Array.isArray(value)) {
  8938. return stringifyArray(value)
  8939. }
  8940. if (isObject(value)) {
  8941. return stringifyObject(value)
  8942. }
  8943. if (typeof value === 'string') {
  8944. return value
  8945. }
  8946. /* istanbul ignore next */
  8947. return ''
  8948. }
  8949. function stringifyArray (value) {
  8950. var res = '';
  8951. var stringified;
  8952. for (var i = 0, l = value.length; i < l; i++) {
  8953. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8954. if (res) { res += ' '; }
  8955. res += stringified;
  8956. }
  8957. }
  8958. return res
  8959. }
  8960. function stringifyObject (value) {
  8961. var res = '';
  8962. for (var key in value) {
  8963. if (value[key]) {
  8964. if (res) { res += ' '; }
  8965. res += key;
  8966. }
  8967. }
  8968. return res
  8969. }
  8970. /* */
  8971. var parseStyleText = cached(function (cssText) {
  8972. var res = {};
  8973. var listDelimiter = /;(?![^(]*\))/g;
  8974. var propertyDelimiter = /:(.+)/;
  8975. cssText.split(listDelimiter).forEach(function (item) {
  8976. if (item) {
  8977. var tmp = item.split(propertyDelimiter);
  8978. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8979. }
  8980. });
  8981. return res
  8982. });
  8983. // normalize possible array / string values into Object
  8984. function normalizeStyleBinding (bindingStyle) {
  8985. if (Array.isArray(bindingStyle)) {
  8986. return toObject(bindingStyle)
  8987. }
  8988. if (typeof bindingStyle === 'string') {
  8989. return parseStyleText(bindingStyle)
  8990. }
  8991. return bindingStyle
  8992. }
  8993. /* */
  8994. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8995. function getTarget(obj, path) {
  8996. var parts = path.split('.');
  8997. var key = parts[0];
  8998. if (key.indexOf('__$n') === 0) { //number index
  8999. key = parseInt(key.replace('__$n', ''));
  9000. }
  9001. if (parts.length === 1) {
  9002. return obj[key]
  9003. }
  9004. return getTarget(obj[key], parts.slice(1).join('.'))
  9005. }
  9006. function internalMixin(Vue) {
  9007. Vue.config.errorHandler = function(err, vm, info) {
  9008. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9009. console.error(err);
  9010. /* eslint-disable no-undef */
  9011. var app = typeof getApp === 'function' && getApp();
  9012. if (app && app.onError) {
  9013. app.onError(err);
  9014. }
  9015. };
  9016. var oldEmit = Vue.prototype.$emit;
  9017. Vue.prototype.$emit = function(event) {
  9018. if (this.$scope && event) {
  9019. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9020. if (triggerEvent) {
  9021. try {
  9022. triggerEvent.call(this.$scope, event, {
  9023. __args__: toArray(arguments, 1)
  9024. });
  9025. } catch (error) {
  9026. }
  9027. }
  9028. }
  9029. return oldEmit.apply(this, arguments)
  9030. };
  9031. Vue.prototype.$nextTick = function(fn) {
  9032. return nextTick$1(this, fn)
  9033. };
  9034. MP_METHODS.forEach(function (method) {
  9035. Vue.prototype[method] = function(args) {
  9036. if (this.$scope && this.$scope[method]) {
  9037. return this.$scope[method](args)
  9038. }
  9039. // mp-alipay
  9040. if (typeof my === 'undefined') {
  9041. return
  9042. }
  9043. if (method === 'createSelectorQuery') {
  9044. /* eslint-disable no-undef */
  9045. return my.createSelectorQuery(args)
  9046. } else if (method === 'createIntersectionObserver') {
  9047. /* eslint-disable no-undef */
  9048. return my.createIntersectionObserver(args)
  9049. }
  9050. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9051. };
  9052. });
  9053. Vue.prototype.__init_provide = initProvide;
  9054. Vue.prototype.__init_injections = initInjections;
  9055. Vue.prototype.__call_hook = function(hook, args) {
  9056. var vm = this;
  9057. // #7573 disable dep collection when invoking lifecycle hooks
  9058. pushTarget();
  9059. var handlers = vm.$options[hook];
  9060. var info = hook + " hook";
  9061. var ret;
  9062. if (handlers) {
  9063. for (var i = 0, j = handlers.length; i < j; i++) {
  9064. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9065. }
  9066. }
  9067. if (vm._hasHookEvent) {
  9068. vm.$emit('hook:' + hook, args);
  9069. }
  9070. popTarget();
  9071. return ret
  9072. };
  9073. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9074. if (Array.isArray(modifiers)) {
  9075. if (modifiers.indexOf('trim') !== -1) {
  9076. value = value.trim();
  9077. }
  9078. if (modifiers.indexOf('number') !== -1) {
  9079. value = this._n(value);
  9080. }
  9081. }
  9082. if (!target) {
  9083. target = this;
  9084. }
  9085. // 解决动态属性添加
  9086. Vue.set(target, key, value);
  9087. };
  9088. Vue.prototype.__set_sync = function(target, key, value) {
  9089. if (!target) {
  9090. target = this;
  9091. }
  9092. // 解决动态属性添加
  9093. Vue.set(target, key, value);
  9094. };
  9095. Vue.prototype.__get_orig = function(item) {
  9096. if (isPlainObject(item)) {
  9097. return item['$orig'] || item
  9098. }
  9099. return item
  9100. };
  9101. Vue.prototype.__get_value = function(dataPath, target) {
  9102. return getTarget(target || this, dataPath)
  9103. };
  9104. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9105. return renderClass(staticClass, dynamicClass)
  9106. };
  9107. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9108. if (!dynamicStyle && !staticStyle) {
  9109. return ''
  9110. }
  9111. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9112. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9113. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9114. };
  9115. Vue.prototype.__map = function(val, iteratee) {
  9116. //TODO 暂不考虑 string
  9117. var ret, i, l, keys, key;
  9118. if (Array.isArray(val)) {
  9119. ret = new Array(val.length);
  9120. for (i = 0, l = val.length; i < l; i++) {
  9121. ret[i] = iteratee(val[i], i);
  9122. }
  9123. return ret
  9124. } else if (isObject(val)) {
  9125. keys = Object.keys(val);
  9126. ret = Object.create(null);
  9127. for (i = 0, l = keys.length; i < l; i++) {
  9128. key = keys[i];
  9129. ret[key] = iteratee(val[key], key, i);
  9130. }
  9131. return ret
  9132. } else if (typeof val === 'number') {
  9133. ret = new Array(val);
  9134. for (i = 0, l = val; i < l; i++) {
  9135. // 第一个参数暂时仍和小程序一致
  9136. ret[i] = iteratee(i, i);
  9137. }
  9138. return ret
  9139. }
  9140. return []
  9141. };
  9142. }
  9143. /* */
  9144. var LIFECYCLE_HOOKS$1 = [
  9145. //App
  9146. 'onLaunch',
  9147. 'onShow',
  9148. 'onHide',
  9149. 'onUniNViewMessage',
  9150. 'onPageNotFound',
  9151. 'onThemeChange',
  9152. 'onError',
  9153. 'onUnhandledRejection',
  9154. //Page
  9155. 'onInit',
  9156. 'onLoad',
  9157. // 'onShow',
  9158. 'onReady',
  9159. // 'onHide',
  9160. 'onUnload',
  9161. 'onPullDownRefresh',
  9162. 'onReachBottom',
  9163. 'onTabItemTap',
  9164. 'onAddToFavorites',
  9165. 'onShareTimeline',
  9166. 'onShareAppMessage',
  9167. 'onResize',
  9168. 'onPageScroll',
  9169. 'onNavigationBarButtonTap',
  9170. 'onBackPress',
  9171. 'onNavigationBarSearchInputChanged',
  9172. 'onNavigationBarSearchInputConfirmed',
  9173. 'onNavigationBarSearchInputClicked',
  9174. //Component
  9175. // 'onReady', // 兼容旧版本,应该移除该事件
  9176. 'onPageShow',
  9177. 'onPageHide',
  9178. 'onPageResize',
  9179. 'onUploadDouyinVideo'
  9180. ];
  9181. function lifecycleMixin$1(Vue) {
  9182. //fixed vue-class-component
  9183. var oldExtend = Vue.extend;
  9184. Vue.extend = function(extendOptions) {
  9185. extendOptions = extendOptions || {};
  9186. var methods = extendOptions.methods;
  9187. if (methods) {
  9188. Object.keys(methods).forEach(function (methodName) {
  9189. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9190. extendOptions[methodName] = methods[methodName];
  9191. delete methods[methodName];
  9192. }
  9193. });
  9194. }
  9195. return oldExtend.call(this, extendOptions)
  9196. };
  9197. var strategies = Vue.config.optionMergeStrategies;
  9198. var mergeHook = strategies.created;
  9199. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9200. strategies[hook] = mergeHook;
  9201. });
  9202. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9203. }
  9204. /* */
  9205. // install platform patch function
  9206. Vue.prototype.__patch__ = patch;
  9207. // public mount method
  9208. Vue.prototype.$mount = function(
  9209. el ,
  9210. hydrating
  9211. ) {
  9212. return mountComponent$1(this, el, hydrating)
  9213. };
  9214. lifecycleMixin$1(Vue);
  9215. internalMixin(Vue);
  9216. /* */
  9217. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9218. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9219. /***/ }),
  9220. /***/ 26:
  9221. /*!**********************************!*\
  9222. !*** D:/工作/项目2/生鲜/sx/pages.json ***!
  9223. \**********************************/
  9224. /*! no static exports found */
  9225. /***/ (function(module, exports) {
  9226. /***/ }),
  9227. /***/ 27:
  9228. /*!**************************************!*\
  9229. !*** D:/工作/项目2/生鲜/sx/store/index.js ***!
  9230. \**************************************/
  9231. /*! no static exports found */
  9232. /***/ (function(module, exports, __webpack_require__) {
  9233. "use strict";
  9234. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9235. Object.defineProperty(exports, "__esModule", {
  9236. value: true
  9237. });
  9238. exports.default = void 0;
  9239. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  9240. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 28));
  9241. var _user = _interopRequireDefault(__webpack_require__(/*! ./model/user */ 29));
  9242. _vue.default.use(_vuex.default);
  9243. var store = new _vuex.default.Store({
  9244. state: {
  9245. //baseURL:'http://base.liuniu946.com',//请求地址配置
  9246. baseURL: 'https://mnxs.liuniu946.com',
  9247. urlFile: '/index',
  9248. //项目部署所在文件夹
  9249. loginInterceptor: false,
  9250. //是否打开强制登录
  9251. weichatInfo: {},
  9252. //保存微信注册信息
  9253. weichatObj: '',
  9254. //微信对象
  9255. hasLogin: false,
  9256. isUp: true
  9257. },
  9258. mutations: {
  9259. //保存微信信息
  9260. setWeiChatInfo: function setWeiChatInfo(state, provider) {
  9261. state.weichatInfo = provider;
  9262. },
  9263. //保存微信对象
  9264. setWeiChatObj: function setWeiChatObj(state, provider) {
  9265. state.weichatObj = provider;
  9266. },
  9267. setIsUp: function setIsUp(state, provider) {
  9268. if (provider == '1') {
  9269. state.isUp = true;
  9270. }
  9271. if (provider == '0') {
  9272. state.isUp = false;
  9273. }
  9274. }
  9275. },
  9276. modules: {
  9277. user: _user.default
  9278. },
  9279. actions: {}
  9280. });
  9281. var _default = store;
  9282. exports.default = _default;
  9283. /***/ }),
  9284. /***/ 275:
  9285. /*!*******************************************************!*\
  9286. !*** D:/工作/项目2/生鲜/sx/components/tki-qrcode/qrcode.js ***!
  9287. \*******************************************************/
  9288. /*! no static exports found */
  9289. /***/ (function(module, exports, __webpack_require__) {
  9290. "use strict";
  9291. /* WEBPACK VAR INJECTION */(function(uni) {
  9292. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9293. Object.defineProperty(exports, "__esModule", {
  9294. value: true
  9295. });
  9296. exports.default = void 0;
  9297. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9298. var QRCode = {};
  9299. (function () {
  9300. /**
  9301. * 获取单个字符的utf8编码
  9302. * unicode BMP平面约65535个字符
  9303. * @param {num} code
  9304. * return {array}
  9305. */
  9306. function unicodeFormat8(code) {
  9307. // 1 byte
  9308. var c0, c1, c2;
  9309. if (code < 128) {
  9310. return [code];
  9311. // 2 bytes
  9312. } else if (code < 2048) {
  9313. c0 = 192 + (code >> 6);
  9314. c1 = 128 + (code & 63);
  9315. return [c0, c1];
  9316. // 3 bytes
  9317. } else {
  9318. c0 = 224 + (code >> 12);
  9319. c1 = 128 + (code >> 6 & 63);
  9320. c2 = 128 + (code & 63);
  9321. return [c0, c1, c2];
  9322. }
  9323. }
  9324. /**
  9325. * 获取字符串的utf8编码字节串
  9326. * @param {string} string
  9327. * @return {array}
  9328. */
  9329. function getUTF8Bytes(string) {
  9330. var utf8codes = [];
  9331. for (var i = 0; i < string.length; i++) {
  9332. var code = string.charCodeAt(i);
  9333. var utf8 = unicodeFormat8(code);
  9334. for (var j = 0; j < utf8.length; j++) {
  9335. utf8codes.push(utf8[j]);
  9336. }
  9337. }
  9338. return utf8codes;
  9339. }
  9340. /**
  9341. * 二维码算法实现
  9342. * @param {string} data 要编码的信息字符串
  9343. * @param {num} errorCorrectLevel 纠错等级
  9344. */
  9345. function QRCodeAlg(data, errorCorrectLevel) {
  9346. this.typeNumber = -1; //版本
  9347. this.errorCorrectLevel = errorCorrectLevel;
  9348. this.modules = null; //二维矩阵,存放最终结果
  9349. this.moduleCount = 0; //矩阵大小
  9350. this.dataCache = null; //数据缓存
  9351. this.rsBlocks = null; //版本数据信息
  9352. this.totalDataCount = -1; //可使用的数据量
  9353. this.data = data;
  9354. this.utf8bytes = getUTF8Bytes(data);
  9355. this.make();
  9356. }
  9357. QRCodeAlg.prototype = {
  9358. constructor: QRCodeAlg,
  9359. /**
  9360. * 获取二维码矩阵大小
  9361. * @return {num} 矩阵大小
  9362. */
  9363. getModuleCount: function getModuleCount() {
  9364. return this.moduleCount;
  9365. },
  9366. /**
  9367. * 编码
  9368. */
  9369. make: function make() {
  9370. this.getRightType();
  9371. this.dataCache = this.createData();
  9372. this.createQrcode();
  9373. },
  9374. /**
  9375. * 设置二位矩阵功能图形
  9376. * @param {bool} test 表示是否在寻找最好掩膜阶段
  9377. * @param {num} maskPattern 掩膜的版本
  9378. */
  9379. makeImpl: function makeImpl(maskPattern) {
  9380. this.moduleCount = this.typeNumber * 4 + 17;
  9381. this.modules = new Array(this.moduleCount);
  9382. for (var row = 0; row < this.moduleCount; row++) {
  9383. this.modules[row] = new Array(this.moduleCount);
  9384. }
  9385. this.setupPositionProbePattern(0, 0);
  9386. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  9387. this.setupPositionProbePattern(0, this.moduleCount - 7);
  9388. this.setupPositionAdjustPattern();
  9389. this.setupTimingPattern();
  9390. this.setupTypeInfo(true, maskPattern);
  9391. if (this.typeNumber >= 7) {
  9392. this.setupTypeNumber(true);
  9393. }
  9394. this.mapData(this.dataCache, maskPattern);
  9395. },
  9396. /**
  9397. * 设置二维码的位置探测图形
  9398. * @param {num} row 探测图形的中心横坐标
  9399. * @param {num} col 探测图形的中心纵坐标
  9400. */
  9401. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  9402. for (var r = -1; r <= 7; r++) {
  9403. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  9404. for (var c = -1; c <= 7; c++) {
  9405. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  9406. if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  9407. this.modules[row + r][col + c] = true;
  9408. } else {
  9409. this.modules[row + r][col + c] = false;
  9410. }
  9411. }
  9412. }
  9413. },
  9414. /**
  9415. * 创建二维码
  9416. * @return {[type]} [description]
  9417. */
  9418. createQrcode: function createQrcode() {
  9419. var minLostPoint = 0;
  9420. var pattern = 0;
  9421. var bestModules = null;
  9422. for (var i = 0; i < 8; i++) {
  9423. this.makeImpl(i);
  9424. var lostPoint = QRUtil.getLostPoint(this);
  9425. if (i == 0 || minLostPoint > lostPoint) {
  9426. minLostPoint = lostPoint;
  9427. pattern = i;
  9428. bestModules = this.modules;
  9429. }
  9430. }
  9431. this.modules = bestModules;
  9432. this.setupTypeInfo(false, pattern);
  9433. if (this.typeNumber >= 7) {
  9434. this.setupTypeNumber(false);
  9435. }
  9436. },
  9437. /**
  9438. * 设置定位图形
  9439. * @return {[type]} [description]
  9440. */
  9441. setupTimingPattern: function setupTimingPattern() {
  9442. for (var r = 8; r < this.moduleCount - 8; r++) {
  9443. if (this.modules[r][6] != null) {
  9444. continue;
  9445. }
  9446. this.modules[r][6] = r % 2 == 0;
  9447. if (this.modules[6][r] != null) {
  9448. continue;
  9449. }
  9450. this.modules[6][r] = r % 2 == 0;
  9451. }
  9452. },
  9453. /**
  9454. * 设置矫正图形
  9455. * @return {[type]} [description]
  9456. */
  9457. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  9458. var pos = QRUtil.getPatternPosition(this.typeNumber);
  9459. for (var i = 0; i < pos.length; i++) {
  9460. for (var j = 0; j < pos.length; j++) {
  9461. var row = pos[i];
  9462. var col = pos[j];
  9463. if (this.modules[row][col] != null) {
  9464. continue;
  9465. }
  9466. for (var r = -2; r <= 2; r++) {
  9467. for (var c = -2; c <= 2; c++) {
  9468. if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
  9469. this.modules[row + r][col + c] = true;
  9470. } else {
  9471. this.modules[row + r][col + c] = false;
  9472. }
  9473. }
  9474. }
  9475. }
  9476. }
  9477. },
  9478. /**
  9479. * 设置版本信息(7以上版本才有)
  9480. * @param {bool} test 是否处于判断最佳掩膜阶段
  9481. * @return {[type]} [description]
  9482. */
  9483. setupTypeNumber: function setupTypeNumber(test) {
  9484. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  9485. for (var i = 0; i < 18; i++) {
  9486. var mod = !test && (bits >> i & 1) == 1;
  9487. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  9488. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  9489. }
  9490. },
  9491. /**
  9492. * 设置格式信息(纠错等级和掩膜版本)
  9493. * @param {bool} test
  9494. * @param {num} maskPattern 掩膜版本
  9495. * @return {}
  9496. */
  9497. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  9498. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  9499. var bits = QRUtil.getBCHTypeInfo(data);
  9500. // vertical
  9501. for (var i = 0; i < 15; i++) {
  9502. var mod = !test && (bits >> i & 1) == 1;
  9503. if (i < 6) {
  9504. this.modules[i][8] = mod;
  9505. } else if (i < 8) {
  9506. this.modules[i + 1][8] = mod;
  9507. } else {
  9508. this.modules[this.moduleCount - 15 + i][8] = mod;
  9509. }
  9510. // horizontal
  9511. var mod = !test && (bits >> i & 1) == 1;
  9512. if (i < 8) {
  9513. this.modules[8][this.moduleCount - i - 1] = mod;
  9514. } else if (i < 9) {
  9515. this.modules[8][15 - i - 1 + 1] = mod;
  9516. } else {
  9517. this.modules[8][15 - i - 1] = mod;
  9518. }
  9519. }
  9520. // fixed module
  9521. this.modules[this.moduleCount - 8][8] = !test;
  9522. },
  9523. /**
  9524. * 数据编码
  9525. * @return {[type]} [description]
  9526. */
  9527. createData: function createData() {
  9528. var buffer = new QRBitBuffer();
  9529. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  9530. buffer.put(4, 4); //添加模式
  9531. buffer.put(this.utf8bytes.length, lengthBits);
  9532. for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
  9533. buffer.put(this.utf8bytes[i], 8);
  9534. }
  9535. if (buffer.length + 4 <= this.totalDataCount * 8) {
  9536. buffer.put(0, 4);
  9537. }
  9538. // padding
  9539. while (buffer.length % 8 != 0) {
  9540. buffer.putBit(false);
  9541. }
  9542. // padding
  9543. while (true) {
  9544. if (buffer.length >= this.totalDataCount * 8) {
  9545. break;
  9546. }
  9547. buffer.put(QRCodeAlg.PAD0, 8);
  9548. if (buffer.length >= this.totalDataCount * 8) {
  9549. break;
  9550. }
  9551. buffer.put(QRCodeAlg.PAD1, 8);
  9552. }
  9553. return this.createBytes(buffer);
  9554. },
  9555. /**
  9556. * 纠错码编码
  9557. * @param {buffer} buffer 数据编码
  9558. * @return {[type]}
  9559. */
  9560. createBytes: function createBytes(buffer) {
  9561. var offset = 0;
  9562. var maxDcCount = 0;
  9563. var maxEcCount = 0;
  9564. var length = this.rsBlock.length / 3;
  9565. var rsBlocks = new Array();
  9566. for (var i = 0; i < length; i++) {
  9567. var count = this.rsBlock[i * 3 + 0];
  9568. var totalCount = this.rsBlock[i * 3 + 1];
  9569. var dataCount = this.rsBlock[i * 3 + 2];
  9570. for (var j = 0; j < count; j++) {
  9571. rsBlocks.push([dataCount, totalCount]);
  9572. }
  9573. }
  9574. var dcdata = new Array(rsBlocks.length);
  9575. var ecdata = new Array(rsBlocks.length);
  9576. for (var r = 0; r < rsBlocks.length; r++) {
  9577. var dcCount = rsBlocks[r][0];
  9578. var ecCount = rsBlocks[r][1] - dcCount;
  9579. maxDcCount = Math.max(maxDcCount, dcCount);
  9580. maxEcCount = Math.max(maxEcCount, ecCount);
  9581. dcdata[r] = new Array(dcCount);
  9582. for (var i = 0; i < dcdata[r].length; i++) {
  9583. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  9584. }
  9585. offset += dcCount;
  9586. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  9587. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  9588. var modPoly = rawPoly.mod(rsPoly);
  9589. ecdata[r] = new Array(rsPoly.getLength() - 1);
  9590. for (var i = 0; i < ecdata[r].length; i++) {
  9591. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  9592. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  9593. }
  9594. }
  9595. var data = new Array(this.totalDataCount);
  9596. var index = 0;
  9597. for (var i = 0; i < maxDcCount; i++) {
  9598. for (var r = 0; r < rsBlocks.length; r++) {
  9599. if (i < dcdata[r].length) {
  9600. data[index++] = dcdata[r][i];
  9601. }
  9602. }
  9603. }
  9604. for (var i = 0; i < maxEcCount; i++) {
  9605. for (var r = 0; r < rsBlocks.length; r++) {
  9606. if (i < ecdata[r].length) {
  9607. data[index++] = ecdata[r][i];
  9608. }
  9609. }
  9610. }
  9611. return data;
  9612. },
  9613. /**
  9614. * 布置模块,构建最终信息
  9615. * @param {} data
  9616. * @param {} maskPattern
  9617. * @return {}
  9618. */
  9619. mapData: function mapData(data, maskPattern) {
  9620. var inc = -1;
  9621. var row = this.moduleCount - 1;
  9622. var bitIndex = 7;
  9623. var byteIndex = 0;
  9624. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  9625. if (col == 6) col--;
  9626. while (true) {
  9627. for (var c = 0; c < 2; c++) {
  9628. if (this.modules[row][col - c] == null) {
  9629. var dark = false;
  9630. if (byteIndex < data.length) {
  9631. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  9632. }
  9633. var mask = QRUtil.getMask(maskPattern, row, col - c);
  9634. if (mask) {
  9635. dark = !dark;
  9636. }
  9637. this.modules[row][col - c] = dark;
  9638. bitIndex--;
  9639. if (bitIndex == -1) {
  9640. byteIndex++;
  9641. bitIndex = 7;
  9642. }
  9643. }
  9644. }
  9645. row += inc;
  9646. if (row < 0 || this.moduleCount <= row) {
  9647. row -= inc;
  9648. inc = -inc;
  9649. break;
  9650. }
  9651. }
  9652. }
  9653. }
  9654. };
  9655. /**
  9656. * 填充字段
  9657. */
  9658. QRCodeAlg.PAD0 = 0xEC;
  9659. QRCodeAlg.PAD1 = 0x11;
  9660. //---------------------------------------------------------------------
  9661. // 纠错等级对应的编码
  9662. //---------------------------------------------------------------------
  9663. var QRErrorCorrectLevel = [1, 0, 3, 2];
  9664. //---------------------------------------------------------------------
  9665. // 掩膜版本
  9666. //---------------------------------------------------------------------
  9667. var QRMaskPattern = {
  9668. PATTERN000: 0,
  9669. PATTERN001: 1,
  9670. PATTERN010: 2,
  9671. PATTERN011: 3,
  9672. PATTERN100: 4,
  9673. PATTERN101: 5,
  9674. PATTERN110: 6,
  9675. PATTERN111: 7
  9676. };
  9677. //---------------------------------------------------------------------
  9678. // 工具类
  9679. //---------------------------------------------------------------------
  9680. var QRUtil = {
  9681. /*
  9682. 每个版本矫正图形的位置
  9683. */
  9684. PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],
  9685. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  9686. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  9687. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  9688. /*
  9689. BCH编码格式信息
  9690. */
  9691. getBCHTypeInfo: function getBCHTypeInfo(data) {
  9692. var d = data << 10;
  9693. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  9694. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  9695. }
  9696. return (data << 10 | d) ^ QRUtil.G15_MASK;
  9697. },
  9698. /*
  9699. BCH编码版本信息
  9700. */
  9701. getBCHTypeNumber: function getBCHTypeNumber(data) {
  9702. var d = data << 12;
  9703. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  9704. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  9705. }
  9706. return data << 12 | d;
  9707. },
  9708. /*
  9709. 获取BCH位信息
  9710. */
  9711. getBCHDigit: function getBCHDigit(data) {
  9712. var digit = 0;
  9713. while (data != 0) {
  9714. digit++;
  9715. data >>>= 1;
  9716. }
  9717. return digit;
  9718. },
  9719. /*
  9720. 获取版本对应的矫正图形位置
  9721. */
  9722. getPatternPosition: function getPatternPosition(typeNumber) {
  9723. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  9724. },
  9725. /*
  9726. 掩膜算法
  9727. */
  9728. getMask: function getMask(maskPattern, i, j) {
  9729. switch (maskPattern) {
  9730. case QRMaskPattern.PATTERN000:
  9731. return (i + j) % 2 == 0;
  9732. case QRMaskPattern.PATTERN001:
  9733. return i % 2 == 0;
  9734. case QRMaskPattern.PATTERN010:
  9735. return j % 3 == 0;
  9736. case QRMaskPattern.PATTERN011:
  9737. return (i + j) % 3 == 0;
  9738. case QRMaskPattern.PATTERN100:
  9739. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  9740. case QRMaskPattern.PATTERN101:
  9741. return i * j % 2 + i * j % 3 == 0;
  9742. case QRMaskPattern.PATTERN110:
  9743. return (i * j % 2 + i * j % 3) % 2 == 0;
  9744. case QRMaskPattern.PATTERN111:
  9745. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  9746. default:
  9747. throw new Error("bad maskPattern:" + maskPattern);
  9748. }
  9749. },
  9750. /*
  9751. 获取RS的纠错多项式
  9752. */
  9753. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  9754. var a = new QRPolynomial([1], 0);
  9755. for (var i = 0; i < errorCorrectLength; i++) {
  9756. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  9757. }
  9758. return a;
  9759. },
  9760. /*
  9761. 获取评价
  9762. */
  9763. getLostPoint: function getLostPoint(qrCode) {
  9764. var moduleCount = qrCode.getModuleCount(),
  9765. lostPoint = 0,
  9766. darkCount = 0;
  9767. for (var row = 0; row < moduleCount; row++) {
  9768. var sameCount = 0;
  9769. var head = qrCode.modules[row][0];
  9770. for (var col = 0; col < moduleCount; col++) {
  9771. var current = qrCode.modules[row][col];
  9772. //level 3 评价
  9773. if (col < moduleCount - 6) {
  9774. if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
  9775. if (col < moduleCount - 10) {
  9776. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  9777. lostPoint += 40;
  9778. }
  9779. } else if (col > 3) {
  9780. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  9781. lostPoint += 40;
  9782. }
  9783. }
  9784. }
  9785. }
  9786. //level 2 评价
  9787. if (row < moduleCount - 1 && col < moduleCount - 1) {
  9788. var count = 0;
  9789. if (current) count++;
  9790. if (qrCode.modules[row + 1][col]) count++;
  9791. if (qrCode.modules[row][col + 1]) count++;
  9792. if (qrCode.modules[row + 1][col + 1]) count++;
  9793. if (count == 0 || count == 4) {
  9794. lostPoint += 3;
  9795. }
  9796. }
  9797. //level 1 评价
  9798. if (head ^ current) {
  9799. sameCount++;
  9800. } else {
  9801. head = current;
  9802. if (sameCount >= 5) {
  9803. lostPoint += 3 + sameCount - 5;
  9804. }
  9805. sameCount = 1;
  9806. }
  9807. //level 4 评价
  9808. if (current) {
  9809. darkCount++;
  9810. }
  9811. }
  9812. }
  9813. for (var col = 0; col < moduleCount; col++) {
  9814. var sameCount = 0;
  9815. var head = qrCode.modules[0][col];
  9816. for (var row = 0; row < moduleCount; row++) {
  9817. var current = qrCode.modules[row][col];
  9818. //level 3 评价
  9819. if (row < moduleCount - 6) {
  9820. if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
  9821. if (row < moduleCount - 10) {
  9822. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  9823. lostPoint += 40;
  9824. }
  9825. } else if (row > 3) {
  9826. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  9827. lostPoint += 40;
  9828. }
  9829. }
  9830. }
  9831. }
  9832. //level 1 评价
  9833. if (head ^ current) {
  9834. sameCount++;
  9835. } else {
  9836. head = current;
  9837. if (sameCount >= 5) {
  9838. lostPoint += 3 + sameCount - 5;
  9839. }
  9840. sameCount = 1;
  9841. }
  9842. }
  9843. }
  9844. // LEVEL4
  9845. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  9846. lostPoint += ratio * 10;
  9847. return lostPoint;
  9848. }
  9849. };
  9850. //---------------------------------------------------------------------
  9851. // QRMath使用的数学工具
  9852. //---------------------------------------------------------------------
  9853. var QRMath = {
  9854. /*
  9855. 将n转化为a^m
  9856. */
  9857. glog: function glog(n) {
  9858. if (n < 1) {
  9859. throw new Error("glog(" + n + ")");
  9860. }
  9861. return QRMath.LOG_TABLE[n];
  9862. },
  9863. /*
  9864. 将a^m转化为n
  9865. */
  9866. gexp: function gexp(n) {
  9867. while (n < 0) {
  9868. n += 255;
  9869. }
  9870. while (n >= 256) {
  9871. n -= 255;
  9872. }
  9873. return QRMath.EXP_TABLE[n];
  9874. },
  9875. EXP_TABLE: new Array(256),
  9876. LOG_TABLE: new Array(256)
  9877. };
  9878. for (var i = 0; i < 8; i++) {
  9879. QRMath.EXP_TABLE[i] = 1 << i;
  9880. }
  9881. for (var i = 8; i < 256; i++) {
  9882. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
  9883. }
  9884. for (var i = 0; i < 255; i++) {
  9885. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  9886. }
  9887. //---------------------------------------------------------------------
  9888. // QRPolynomial 多项式
  9889. //---------------------------------------------------------------------
  9890. /**
  9891. * 多项式类
  9892. * @param {Array} num 系数
  9893. * @param {num} shift a^shift
  9894. */
  9895. function QRPolynomial(num, shift) {
  9896. if (num.length == undefined) {
  9897. throw new Error(num.length + "/" + shift);
  9898. }
  9899. var offset = 0;
  9900. while (offset < num.length && num[offset] == 0) {
  9901. offset++;
  9902. }
  9903. this.num = new Array(num.length - offset + shift);
  9904. for (var i = 0; i < num.length - offset; i++) {
  9905. this.num[i] = num[i + offset];
  9906. }
  9907. }
  9908. QRPolynomial.prototype = {
  9909. get: function get(index) {
  9910. return this.num[index];
  9911. },
  9912. getLength: function getLength() {
  9913. return this.num.length;
  9914. },
  9915. /**
  9916. * 多项式乘法
  9917. * @param {QRPolynomial} e 被乘多项式
  9918. * @return {[type]} [description]
  9919. */
  9920. multiply: function multiply(e) {
  9921. var num = new Array(this.getLength() + e.getLength() - 1);
  9922. for (var i = 0; i < this.getLength(); i++) {
  9923. for (var j = 0; j < e.getLength(); j++) {
  9924. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  9925. }
  9926. }
  9927. return new QRPolynomial(num, 0);
  9928. },
  9929. /**
  9930. * 多项式模运算
  9931. * @param {QRPolynomial} e 模多项式
  9932. * @return {}
  9933. */
  9934. mod: function mod(e) {
  9935. var tl = this.getLength(),
  9936. el = e.getLength();
  9937. if (tl - el < 0) {
  9938. return this;
  9939. }
  9940. var num = new Array(tl);
  9941. for (var i = 0; i < tl; i++) {
  9942. num[i] = this.get(i);
  9943. }
  9944. while (num.length >= el) {
  9945. var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
  9946. for (var i = 0; i < e.getLength(); i++) {
  9947. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  9948. }
  9949. while (num[0] == 0) {
  9950. num.shift();
  9951. }
  9952. }
  9953. return new QRPolynomial(num, 0);
  9954. }
  9955. };
  9956. //---------------------------------------------------------------------
  9957. // RS_BLOCK_TABLE
  9958. //---------------------------------------------------------------------
  9959. /*
  9960. 二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
  9961. */
  9962. var RS_BLOCK_TABLE = [
  9963. // L
  9964. // M
  9965. // Q
  9966. // H
  9967. // 1
  9968. [1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9],
  9969. // 2
  9970. [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16],
  9971. // 3
  9972. [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13],
  9973. // 4
  9974. [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9],
  9975. // 5
  9976. [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12],
  9977. // 6
  9978. [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15],
  9979. // 7
  9980. [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14],
  9981. // 8
  9982. [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15],
  9983. // 9
  9984. [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13],
  9985. // 10
  9986. [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16],
  9987. // 11
  9988. [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13],
  9989. // 12
  9990. [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15],
  9991. // 13
  9992. [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12],
  9993. // 14
  9994. [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13],
  9995. // 15
  9996. [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12],
  9997. // 16
  9998. [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16],
  9999. // 17
  10000. [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15],
  10001. // 18
  10002. [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15],
  10003. // 19
  10004. [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14],
  10005. // 20
  10006. [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16],
  10007. // 21
  10008. [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17],
  10009. // 22
  10010. [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13],
  10011. // 23
  10012. [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16],
  10013. // 24
  10014. [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17],
  10015. // 25
  10016. [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16],
  10017. // 26
  10018. [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17],
  10019. // 27
  10020. [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16],
  10021. // 28
  10022. [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16],
  10023. // 29
  10024. [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16],
  10025. // 30
  10026. [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16],
  10027. // 31
  10028. [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16],
  10029. // 32
  10030. [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16],
  10031. // 33
  10032. [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16],
  10033. // 34
  10034. [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17],
  10035. // 35
  10036. [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16],
  10037. // 36
  10038. [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16],
  10039. // 37
  10040. [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16],
  10041. // 38
  10042. [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16],
  10043. // 39
  10044. [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16],
  10045. // 40
  10046. [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
  10047. /**
  10048. * 根据数据获取对应版本
  10049. * @return {[type]} [description]
  10050. */
  10051. QRCodeAlg.prototype.getRightType = function () {
  10052. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  10053. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  10054. if (rsBlock == undefined) {
  10055. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  10056. }
  10057. var length = rsBlock.length / 3;
  10058. var totalDataCount = 0;
  10059. for (var i = 0; i < length; i++) {
  10060. var count = rsBlock[i * 3 + 0];
  10061. var dataCount = rsBlock[i * 3 + 2];
  10062. totalDataCount += dataCount * count;
  10063. }
  10064. var lengthBytes = typeNumber > 9 ? 2 : 1;
  10065. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  10066. this.typeNumber = typeNumber;
  10067. this.rsBlock = rsBlock;
  10068. this.totalDataCount = totalDataCount;
  10069. break;
  10070. }
  10071. }
  10072. };
  10073. //---------------------------------------------------------------------
  10074. // QRBitBuffer
  10075. //---------------------------------------------------------------------
  10076. function QRBitBuffer() {
  10077. this.buffer = new Array();
  10078. this.length = 0;
  10079. }
  10080. QRBitBuffer.prototype = {
  10081. get: function get(index) {
  10082. var bufIndex = Math.floor(index / 8);
  10083. return this.buffer[bufIndex] >>> 7 - index % 8 & 1;
  10084. },
  10085. put: function put(num, length) {
  10086. for (var i = 0; i < length; i++) {
  10087. this.putBit(num >>> length - i - 1 & 1);
  10088. }
  10089. },
  10090. putBit: function putBit(bit) {
  10091. var bufIndex = Math.floor(this.length / 8);
  10092. if (this.buffer.length <= bufIndex) {
  10093. this.buffer.push(0);
  10094. }
  10095. if (bit) {
  10096. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  10097. }
  10098. this.length++;
  10099. }
  10100. };
  10101. // xzedit
  10102. var qrcodeAlgObjCache = [];
  10103. /**
  10104. * 二维码构造函数,主要用于绘制
  10105. * @param {参数列表} opt 传递参数
  10106. * @return {}
  10107. */
  10108. QRCode = function QRCode(opt) {
  10109. //设置默认参数
  10110. this.options = {
  10111. text: '',
  10112. size: 256,
  10113. correctLevel: 3,
  10114. background: '#ffffff',
  10115. foreground: '#000000',
  10116. pdground: '#000000',
  10117. image: '',
  10118. imageSize: 30,
  10119. canvasId: opt.canvasId,
  10120. context: opt.context,
  10121. usingComponents: opt.usingComponents,
  10122. showLoading: opt.showLoading,
  10123. loadingText: opt.loadingText
  10124. };
  10125. if (typeof opt === 'string') {
  10126. // 只编码ASCII字符串
  10127. opt = {
  10128. text: opt
  10129. };
  10130. }
  10131. if (opt) {
  10132. for (var i in opt) {
  10133. this.options[i] = opt[i];
  10134. }
  10135. }
  10136. //使用QRCodeAlg创建二维码结构
  10137. var qrCodeAlg = null;
  10138. for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
  10139. if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
  10140. qrCodeAlg = qrcodeAlgObjCache[i].obj;
  10141. break;
  10142. }
  10143. }
  10144. if (i == l) {
  10145. qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
  10146. qrcodeAlgObjCache.push({
  10147. text: this.options.text,
  10148. correctLevel: this.options.correctLevel,
  10149. obj: qrCodeAlg
  10150. });
  10151. }
  10152. /**
  10153. * 计算矩阵点的前景色
  10154. * @param {Obj} config
  10155. * @param {Number} config.row 点x坐标
  10156. * @param {Number} config.col 点y坐标
  10157. * @param {Number} config.count 矩阵大小
  10158. * @param {Number} config.options 组件的options
  10159. * @return {String}
  10160. */
  10161. var getForeGround = function getForeGround(config) {
  10162. var options = config.options;
  10163. if (options.pdground && (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 || config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 || config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2)) {
  10164. return options.pdground;
  10165. }
  10166. return options.foreground;
  10167. };
  10168. // 创建canvas
  10169. var createCanvas = function createCanvas(options) {
  10170. if (options.showLoading) {
  10171. uni.showLoading({
  10172. title: options.loadingText,
  10173. mask: true
  10174. });
  10175. }
  10176. var ctx = uni.createCanvasContext(options.canvasId, options.context);
  10177. var count = qrCodeAlg.getModuleCount();
  10178. var ratioSize = options.size;
  10179. var ratioImgSize = options.imageSize;
  10180. //计算每个点的长宽
  10181. var tileW = (ratioSize / count).toPrecision(4);
  10182. var tileH = (ratioSize / count).toPrecision(4);
  10183. //绘制
  10184. for (var row = 0; row < count; row++) {
  10185. for (var col = 0; col < count; col++) {
  10186. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  10187. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  10188. var foreground = getForeGround({
  10189. row: row,
  10190. col: col,
  10191. count: count,
  10192. options: options
  10193. });
  10194. ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
  10195. ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
  10196. }
  10197. }
  10198. if (options.image) {
  10199. // 画圆角矩形
  10200. var drawRoundedRect = function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
  10201. ctxi.setLineWidth(lineWidth);
  10202. ctxi.setFillStyle(options.background);
  10203. ctxi.setStrokeStyle(options.background);
  10204. ctxi.beginPath(); // draw top and top right corner
  10205. ctxi.moveTo(x + r, y);
  10206. ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
  10207. ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
  10208. ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
  10209. ctxi.arcTo(x, y, x + r, y, r);
  10210. ctxi.closePath();
  10211. if (fill) {
  10212. ctxi.fill();
  10213. }
  10214. if (stroke) {
  10215. ctxi.stroke();
  10216. }
  10217. };
  10218. var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
  10219. var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
  10220. drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true);
  10221. ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
  10222. }
  10223. setTimeout(function () {
  10224. ctx.draw(true, function () {
  10225. // 保存到临时区域
  10226. setTimeout(function () {
  10227. uni.canvasToTempFilePath({
  10228. width: options.width,
  10229. height: options.height,
  10230. destWidth: options.width,
  10231. destHeight: options.height,
  10232. canvasId: options.canvasId,
  10233. quality: Number(1),
  10234. success: function success(res) {
  10235. if (options.cbResult) {
  10236. options.cbResult(res.tempFilePath);
  10237. }
  10238. },
  10239. fail: function fail(res) {
  10240. if (options.cbResult) {
  10241. options.cbResult(res);
  10242. }
  10243. },
  10244. complete: function complete() {
  10245. if (options.showLoading) {
  10246. uni.hideLoading();
  10247. }
  10248. }
  10249. }, options.context);
  10250. }, options.text.length + 100);
  10251. });
  10252. }, options.usingComponents ? 0 : 150);
  10253. };
  10254. createCanvas(this.options);
  10255. // 空判定
  10256. var empty = function empty(v) {
  10257. var tp = (0, _typeof2.default)(v),
  10258. rt = false;
  10259. if (tp == "number" && String(v) == "") {
  10260. rt = true;
  10261. } else if (tp == "undefined") {
  10262. rt = true;
  10263. } else if (tp == "object") {
  10264. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true;
  10265. } else if (tp == "string") {
  10266. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true;
  10267. } else if (tp == "function") {
  10268. rt = false;
  10269. }
  10270. return rt;
  10271. };
  10272. };
  10273. QRCode.prototype.clear = function (fn) {
  10274. var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context);
  10275. ctx.clearRect(0, 0, this.options.size, this.options.size);
  10276. ctx.draw(false, function () {
  10277. if (fn) {
  10278. fn();
  10279. }
  10280. });
  10281. };
  10282. })();
  10283. var _default = QRCode;
  10284. exports.default = _default;
  10285. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10286. /***/ }),
  10287. /***/ 28:
  10288. /*!**************************************************************************************!*\
  10289. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  10290. \**************************************************************************************/
  10291. /*! no static exports found */
  10292. /***/ (function(module, exports, __webpack_require__) {
  10293. "use strict";
  10294. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10295. * vuex v3.6.2
  10296. * (c) 2021 Evan You
  10297. * @license MIT
  10298. */
  10299. function applyMixin (Vue) {
  10300. var version = Number(Vue.version.split('.')[0]);
  10301. if (version >= 2) {
  10302. Vue.mixin({ beforeCreate: vuexInit });
  10303. } else {
  10304. // override init and inject vuex init procedure
  10305. // for 1.x backwards compatibility.
  10306. var _init = Vue.prototype._init;
  10307. Vue.prototype._init = function (options) {
  10308. if ( options === void 0 ) options = {};
  10309. options.init = options.init
  10310. ? [vuexInit].concat(options.init)
  10311. : vuexInit;
  10312. _init.call(this, options);
  10313. };
  10314. }
  10315. /**
  10316. * Vuex init hook, injected into each instances init hooks list.
  10317. */
  10318. function vuexInit () {
  10319. var options = this.$options;
  10320. // store injection
  10321. if (options.store) {
  10322. this.$store = typeof options.store === 'function'
  10323. ? options.store()
  10324. : options.store;
  10325. } else if (options.parent && options.parent.$store) {
  10326. this.$store = options.parent.$store;
  10327. }
  10328. }
  10329. }
  10330. var target = typeof window !== 'undefined'
  10331. ? window
  10332. : typeof global !== 'undefined'
  10333. ? global
  10334. : {};
  10335. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10336. function devtoolPlugin (store) {
  10337. if (!devtoolHook) { return }
  10338. store._devtoolHook = devtoolHook;
  10339. devtoolHook.emit('vuex:init', store);
  10340. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10341. store.replaceState(targetState);
  10342. });
  10343. store.subscribe(function (mutation, state) {
  10344. devtoolHook.emit('vuex:mutation', mutation, state);
  10345. }, { prepend: true });
  10346. store.subscribeAction(function (action, state) {
  10347. devtoolHook.emit('vuex:action', action, state);
  10348. }, { prepend: true });
  10349. }
  10350. /**
  10351. * Get the first item that pass the test
  10352. * by second argument function
  10353. *
  10354. * @param {Array} list
  10355. * @param {Function} f
  10356. * @return {*}
  10357. */
  10358. function find (list, f) {
  10359. return list.filter(f)[0]
  10360. }
  10361. /**
  10362. * Deep copy the given object considering circular structure.
  10363. * This function caches all nested objects and its copies.
  10364. * If it detects circular structure, use cached copy to avoid infinite loop.
  10365. *
  10366. * @param {*} obj
  10367. * @param {Array<Object>} cache
  10368. * @return {*}
  10369. */
  10370. function deepCopy (obj, cache) {
  10371. if ( cache === void 0 ) cache = [];
  10372. // just return if obj is immutable value
  10373. if (obj === null || typeof obj !== 'object') {
  10374. return obj
  10375. }
  10376. // if obj is hit, it is in circular structure
  10377. var hit = find(cache, function (c) { return c.original === obj; });
  10378. if (hit) {
  10379. return hit.copy
  10380. }
  10381. var copy = Array.isArray(obj) ? [] : {};
  10382. // put the copy into cache at first
  10383. // because we want to refer it in recursive deepCopy
  10384. cache.push({
  10385. original: obj,
  10386. copy: copy
  10387. });
  10388. Object.keys(obj).forEach(function (key) {
  10389. copy[key] = deepCopy(obj[key], cache);
  10390. });
  10391. return copy
  10392. }
  10393. /**
  10394. * forEach for object
  10395. */
  10396. function forEachValue (obj, fn) {
  10397. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10398. }
  10399. function isObject (obj) {
  10400. return obj !== null && typeof obj === 'object'
  10401. }
  10402. function isPromise (val) {
  10403. return val && typeof val.then === 'function'
  10404. }
  10405. function assert (condition, msg) {
  10406. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10407. }
  10408. function partial (fn, arg) {
  10409. return function () {
  10410. return fn(arg)
  10411. }
  10412. }
  10413. // Base data struct for store's module, package with some attribute and method
  10414. var Module = function Module (rawModule, runtime) {
  10415. this.runtime = runtime;
  10416. // Store some children item
  10417. this._children = Object.create(null);
  10418. // Store the origin module object which passed by programmer
  10419. this._rawModule = rawModule;
  10420. var rawState = rawModule.state;
  10421. // Store the origin module's state
  10422. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10423. };
  10424. var prototypeAccessors = { namespaced: { configurable: true } };
  10425. prototypeAccessors.namespaced.get = function () {
  10426. return !!this._rawModule.namespaced
  10427. };
  10428. Module.prototype.addChild = function addChild (key, module) {
  10429. this._children[key] = module;
  10430. };
  10431. Module.prototype.removeChild = function removeChild (key) {
  10432. delete this._children[key];
  10433. };
  10434. Module.prototype.getChild = function getChild (key) {
  10435. return this._children[key]
  10436. };
  10437. Module.prototype.hasChild = function hasChild (key) {
  10438. return key in this._children
  10439. };
  10440. Module.prototype.update = function update (rawModule) {
  10441. this._rawModule.namespaced = rawModule.namespaced;
  10442. if (rawModule.actions) {
  10443. this._rawModule.actions = rawModule.actions;
  10444. }
  10445. if (rawModule.mutations) {
  10446. this._rawModule.mutations = rawModule.mutations;
  10447. }
  10448. if (rawModule.getters) {
  10449. this._rawModule.getters = rawModule.getters;
  10450. }
  10451. };
  10452. Module.prototype.forEachChild = function forEachChild (fn) {
  10453. forEachValue(this._children, fn);
  10454. };
  10455. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10456. if (this._rawModule.getters) {
  10457. forEachValue(this._rawModule.getters, fn);
  10458. }
  10459. };
  10460. Module.prototype.forEachAction = function forEachAction (fn) {
  10461. if (this._rawModule.actions) {
  10462. forEachValue(this._rawModule.actions, fn);
  10463. }
  10464. };
  10465. Module.prototype.forEachMutation = function forEachMutation (fn) {
  10466. if (this._rawModule.mutations) {
  10467. forEachValue(this._rawModule.mutations, fn);
  10468. }
  10469. };
  10470. Object.defineProperties( Module.prototype, prototypeAccessors );
  10471. var ModuleCollection = function ModuleCollection (rawRootModule) {
  10472. // register root module (Vuex.Store options)
  10473. this.register([], rawRootModule, false);
  10474. };
  10475. ModuleCollection.prototype.get = function get (path) {
  10476. return path.reduce(function (module, key) {
  10477. return module.getChild(key)
  10478. }, this.root)
  10479. };
  10480. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  10481. var module = this.root;
  10482. return path.reduce(function (namespace, key) {
  10483. module = module.getChild(key);
  10484. return namespace + (module.namespaced ? key + '/' : '')
  10485. }, '')
  10486. };
  10487. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  10488. update([], this.root, rawRootModule);
  10489. };
  10490. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  10491. var this$1 = this;
  10492. if ( runtime === void 0 ) runtime = true;
  10493. if ((true)) {
  10494. assertRawModule(path, rawModule);
  10495. }
  10496. var newModule = new Module(rawModule, runtime);
  10497. if (path.length === 0) {
  10498. this.root = newModule;
  10499. } else {
  10500. var parent = this.get(path.slice(0, -1));
  10501. parent.addChild(path[path.length - 1], newModule);
  10502. }
  10503. // register nested modules
  10504. if (rawModule.modules) {
  10505. forEachValue(rawModule.modules, function (rawChildModule, key) {
  10506. this$1.register(path.concat(key), rawChildModule, runtime);
  10507. });
  10508. }
  10509. };
  10510. ModuleCollection.prototype.unregister = function unregister (path) {
  10511. var parent = this.get(path.slice(0, -1));
  10512. var key = path[path.length - 1];
  10513. var child = parent.getChild(key);
  10514. if (!child) {
  10515. if ((true)) {
  10516. console.warn(
  10517. "[vuex] trying to unregister module '" + key + "', which is " +
  10518. "not registered"
  10519. );
  10520. }
  10521. return
  10522. }
  10523. if (!child.runtime) {
  10524. return
  10525. }
  10526. parent.removeChild(key);
  10527. };
  10528. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  10529. var parent = this.get(path.slice(0, -1));
  10530. var key = path[path.length - 1];
  10531. if (parent) {
  10532. return parent.hasChild(key)
  10533. }
  10534. return false
  10535. };
  10536. function update (path, targetModule, newModule) {
  10537. if ((true)) {
  10538. assertRawModule(path, newModule);
  10539. }
  10540. // update target module
  10541. targetModule.update(newModule);
  10542. // update nested modules
  10543. if (newModule.modules) {
  10544. for (var key in newModule.modules) {
  10545. if (!targetModule.getChild(key)) {
  10546. if ((true)) {
  10547. console.warn(
  10548. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  10549. 'manual reload is needed'
  10550. );
  10551. }
  10552. return
  10553. }
  10554. update(
  10555. path.concat(key),
  10556. targetModule.getChild(key),
  10557. newModule.modules[key]
  10558. );
  10559. }
  10560. }
  10561. }
  10562. var functionAssert = {
  10563. assert: function (value) { return typeof value === 'function'; },
  10564. expected: 'function'
  10565. };
  10566. var objectAssert = {
  10567. assert: function (value) { return typeof value === 'function' ||
  10568. (typeof value === 'object' && typeof value.handler === 'function'); },
  10569. expected: 'function or object with "handler" function'
  10570. };
  10571. var assertTypes = {
  10572. getters: functionAssert,
  10573. mutations: functionAssert,
  10574. actions: objectAssert
  10575. };
  10576. function assertRawModule (path, rawModule) {
  10577. Object.keys(assertTypes).forEach(function (key) {
  10578. if (!rawModule[key]) { return }
  10579. var assertOptions = assertTypes[key];
  10580. forEachValue(rawModule[key], function (value, type) {
  10581. assert(
  10582. assertOptions.assert(value),
  10583. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  10584. );
  10585. });
  10586. });
  10587. }
  10588. function makeAssertionMessage (path, key, type, value, expected) {
  10589. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  10590. if (path.length > 0) {
  10591. buf += " in module \"" + (path.join('.')) + "\"";
  10592. }
  10593. buf += " is " + (JSON.stringify(value)) + ".";
  10594. return buf
  10595. }
  10596. var Vue; // bind on install
  10597. var Store = function Store (options) {
  10598. var this$1 = this;
  10599. if ( options === void 0 ) options = {};
  10600. // Auto install if it is not done yet and `window` has `Vue`.
  10601. // To allow users to avoid auto-installation in some cases,
  10602. // this code should be placed here. See #731
  10603. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  10604. install(window.Vue);
  10605. }
  10606. if ((true)) {
  10607. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  10608. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  10609. assert(this instanceof Store, "store must be called with the new operator.");
  10610. }
  10611. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  10612. var strict = options.strict; if ( strict === void 0 ) strict = false;
  10613. // store internal state
  10614. this._committing = false;
  10615. this._actions = Object.create(null);
  10616. this._actionSubscribers = [];
  10617. this._mutations = Object.create(null);
  10618. this._wrappedGetters = Object.create(null);
  10619. this._modules = new ModuleCollection(options);
  10620. this._modulesNamespaceMap = Object.create(null);
  10621. this._subscribers = [];
  10622. this._watcherVM = new Vue();
  10623. this._makeLocalGettersCache = Object.create(null);
  10624. // bind commit and dispatch to self
  10625. var store = this;
  10626. var ref = this;
  10627. var dispatch = ref.dispatch;
  10628. var commit = ref.commit;
  10629. this.dispatch = function boundDispatch (type, payload) {
  10630. return dispatch.call(store, type, payload)
  10631. };
  10632. this.commit = function boundCommit (type, payload, options) {
  10633. return commit.call(store, type, payload, options)
  10634. };
  10635. // strict mode
  10636. this.strict = strict;
  10637. var state = this._modules.root.state;
  10638. // init root module.
  10639. // this also recursively registers all sub-modules
  10640. // and collects all module getters inside this._wrappedGetters
  10641. installModule(this, state, [], this._modules.root);
  10642. // initialize the store vm, which is responsible for the reactivity
  10643. // (also registers _wrappedGetters as computed properties)
  10644. resetStoreVM(this, state);
  10645. // apply plugins
  10646. plugins.forEach(function (plugin) { return plugin(this$1); });
  10647. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  10648. if (useDevtools) {
  10649. devtoolPlugin(this);
  10650. }
  10651. };
  10652. var prototypeAccessors$1 = { state: { configurable: true } };
  10653. prototypeAccessors$1.state.get = function () {
  10654. return this._vm._data.$$state
  10655. };
  10656. prototypeAccessors$1.state.set = function (v) {
  10657. if ((true)) {
  10658. assert(false, "use store.replaceState() to explicit replace store state.");
  10659. }
  10660. };
  10661. Store.prototype.commit = function commit (_type, _payload, _options) {
  10662. var this$1 = this;
  10663. // check object-style commit
  10664. var ref = unifyObjectStyle(_type, _payload, _options);
  10665. var type = ref.type;
  10666. var payload = ref.payload;
  10667. var options = ref.options;
  10668. var mutation = { type: type, payload: payload };
  10669. var entry = this._mutations[type];
  10670. if (!entry) {
  10671. if ((true)) {
  10672. console.error(("[vuex] unknown mutation type: " + type));
  10673. }
  10674. return
  10675. }
  10676. this._withCommit(function () {
  10677. entry.forEach(function commitIterator (handler) {
  10678. handler(payload);
  10679. });
  10680. });
  10681. this._subscribers
  10682. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10683. .forEach(function (sub) { return sub(mutation, this$1.state); });
  10684. if (
  10685. ( true) &&
  10686. options && options.silent
  10687. ) {
  10688. console.warn(
  10689. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  10690. 'Use the filter functionality in the vue-devtools'
  10691. );
  10692. }
  10693. };
  10694. Store.prototype.dispatch = function dispatch (_type, _payload) {
  10695. var this$1 = this;
  10696. // check object-style dispatch
  10697. var ref = unifyObjectStyle(_type, _payload);
  10698. var type = ref.type;
  10699. var payload = ref.payload;
  10700. var action = { type: type, payload: payload };
  10701. var entry = this._actions[type];
  10702. if (!entry) {
  10703. if ((true)) {
  10704. console.error(("[vuex] unknown action type: " + type));
  10705. }
  10706. return
  10707. }
  10708. try {
  10709. this._actionSubscribers
  10710. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10711. .filter(function (sub) { return sub.before; })
  10712. .forEach(function (sub) { return sub.before(action, this$1.state); });
  10713. } catch (e) {
  10714. if ((true)) {
  10715. console.warn("[vuex] error in before action subscribers: ");
  10716. console.error(e);
  10717. }
  10718. }
  10719. var result = entry.length > 1
  10720. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  10721. : entry[0](payload);
  10722. return new Promise(function (resolve, reject) {
  10723. result.then(function (res) {
  10724. try {
  10725. this$1._actionSubscribers
  10726. .filter(function (sub) { return sub.after; })
  10727. .forEach(function (sub) { return sub.after(action, this$1.state); });
  10728. } catch (e) {
  10729. if ((true)) {
  10730. console.warn("[vuex] error in after action subscribers: ");
  10731. console.error(e);
  10732. }
  10733. }
  10734. resolve(res);
  10735. }, function (error) {
  10736. try {
  10737. this$1._actionSubscribers
  10738. .filter(function (sub) { return sub.error; })
  10739. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  10740. } catch (e) {
  10741. if ((true)) {
  10742. console.warn("[vuex] error in error action subscribers: ");
  10743. console.error(e);
  10744. }
  10745. }
  10746. reject(error);
  10747. });
  10748. })
  10749. };
  10750. Store.prototype.subscribe = function subscribe (fn, options) {
  10751. return genericSubscribe(fn, this._subscribers, options)
  10752. };
  10753. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  10754. var subs = typeof fn === 'function' ? { before: fn } : fn;
  10755. return genericSubscribe(subs, this._actionSubscribers, options)
  10756. };
  10757. Store.prototype.watch = function watch (getter, cb, options) {
  10758. var this$1 = this;
  10759. if ((true)) {
  10760. assert(typeof getter === 'function', "store.watch only accepts a function.");
  10761. }
  10762. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  10763. };
  10764. Store.prototype.replaceState = function replaceState (state) {
  10765. var this$1 = this;
  10766. this._withCommit(function () {
  10767. this$1._vm._data.$$state = state;
  10768. });
  10769. };
  10770. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  10771. if ( options === void 0 ) options = {};
  10772. if (typeof path === 'string') { path = [path]; }
  10773. if ((true)) {
  10774. assert(Array.isArray(path), "module path must be a string or an Array.");
  10775. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  10776. }
  10777. this._modules.register(path, rawModule);
  10778. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  10779. // reset store to update getters...
  10780. resetStoreVM(this, this.state);
  10781. };
  10782. Store.prototype.unregisterModule = function unregisterModule (path) {
  10783. var this$1 = this;
  10784. if (typeof path === 'string') { path = [path]; }
  10785. if ((true)) {
  10786. assert(Array.isArray(path), "module path must be a string or an Array.");
  10787. }
  10788. this._modules.unregister(path);
  10789. this._withCommit(function () {
  10790. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  10791. Vue.delete(parentState, path[path.length - 1]);
  10792. });
  10793. resetStore(this);
  10794. };
  10795. Store.prototype.hasModule = function hasModule (path) {
  10796. if (typeof path === 'string') { path = [path]; }
  10797. if ((true)) {
  10798. assert(Array.isArray(path), "module path must be a string or an Array.");
  10799. }
  10800. return this._modules.isRegistered(path)
  10801. };
  10802. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  10803. this._modules.update(newOptions);
  10804. resetStore(this, true);
  10805. };
  10806. Store.prototype._withCommit = function _withCommit (fn) {
  10807. var committing = this._committing;
  10808. this._committing = true;
  10809. fn();
  10810. this._committing = committing;
  10811. };
  10812. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  10813. function genericSubscribe (fn, subs, options) {
  10814. if (subs.indexOf(fn) < 0) {
  10815. options && options.prepend
  10816. ? subs.unshift(fn)
  10817. : subs.push(fn);
  10818. }
  10819. return function () {
  10820. var i = subs.indexOf(fn);
  10821. if (i > -1) {
  10822. subs.splice(i, 1);
  10823. }
  10824. }
  10825. }
  10826. function resetStore (store, hot) {
  10827. store._actions = Object.create(null);
  10828. store._mutations = Object.create(null);
  10829. store._wrappedGetters = Object.create(null);
  10830. store._modulesNamespaceMap = Object.create(null);
  10831. var state = store.state;
  10832. // init all modules
  10833. installModule(store, state, [], store._modules.root, true);
  10834. // reset vm
  10835. resetStoreVM(store, state, hot);
  10836. }
  10837. function resetStoreVM (store, state, hot) {
  10838. var oldVm = store._vm;
  10839. // bind store public getters
  10840. store.getters = {};
  10841. // reset local getters cache
  10842. store._makeLocalGettersCache = Object.create(null);
  10843. var wrappedGetters = store._wrappedGetters;
  10844. var computed = {};
  10845. forEachValue(wrappedGetters, function (fn, key) {
  10846. // use computed to leverage its lazy-caching mechanism
  10847. // direct inline function use will lead to closure preserving oldVm.
  10848. // using partial to return function with only arguments preserved in closure environment.
  10849. computed[key] = partial(fn, store);
  10850. Object.defineProperty(store.getters, key, {
  10851. get: function () { return store._vm[key]; },
  10852. enumerable: true // for local getters
  10853. });
  10854. });
  10855. // use a Vue instance to store the state tree
  10856. // suppress warnings just in case the user has added
  10857. // some funky global mixins
  10858. var silent = Vue.config.silent;
  10859. Vue.config.silent = true;
  10860. store._vm = new Vue({
  10861. data: {
  10862. $$state: state
  10863. },
  10864. computed: computed
  10865. });
  10866. Vue.config.silent = silent;
  10867. // enable strict mode for new vm
  10868. if (store.strict) {
  10869. enableStrictMode(store);
  10870. }
  10871. if (oldVm) {
  10872. if (hot) {
  10873. // dispatch changes in all subscribed watchers
  10874. // to force getter re-evaluation for hot reloading.
  10875. store._withCommit(function () {
  10876. oldVm._data.$$state = null;
  10877. });
  10878. }
  10879. Vue.nextTick(function () { return oldVm.$destroy(); });
  10880. }
  10881. }
  10882. function installModule (store, rootState, path, module, hot) {
  10883. var isRoot = !path.length;
  10884. var namespace = store._modules.getNamespace(path);
  10885. // register in namespace map
  10886. if (module.namespaced) {
  10887. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  10888. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  10889. }
  10890. store._modulesNamespaceMap[namespace] = module;
  10891. }
  10892. // set state
  10893. if (!isRoot && !hot) {
  10894. var parentState = getNestedState(rootState, path.slice(0, -1));
  10895. var moduleName = path[path.length - 1];
  10896. store._withCommit(function () {
  10897. if ((true)) {
  10898. if (moduleName in parentState) {
  10899. console.warn(
  10900. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  10901. );
  10902. }
  10903. }
  10904. Vue.set(parentState, moduleName, module.state);
  10905. });
  10906. }
  10907. var local = module.context = makeLocalContext(store, namespace, path);
  10908. module.forEachMutation(function (mutation, key) {
  10909. var namespacedType = namespace + key;
  10910. registerMutation(store, namespacedType, mutation, local);
  10911. });
  10912. module.forEachAction(function (action, key) {
  10913. var type = action.root ? key : namespace + key;
  10914. var handler = action.handler || action;
  10915. registerAction(store, type, handler, local);
  10916. });
  10917. module.forEachGetter(function (getter, key) {
  10918. var namespacedType = namespace + key;
  10919. registerGetter(store, namespacedType, getter, local);
  10920. });
  10921. module.forEachChild(function (child, key) {
  10922. installModule(store, rootState, path.concat(key), child, hot);
  10923. });
  10924. }
  10925. /**
  10926. * make localized dispatch, commit, getters and state
  10927. * if there is no namespace, just use root ones
  10928. */
  10929. function makeLocalContext (store, namespace, path) {
  10930. var noNamespace = namespace === '';
  10931. var local = {
  10932. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  10933. var args = unifyObjectStyle(_type, _payload, _options);
  10934. var payload = args.payload;
  10935. var options = args.options;
  10936. var type = args.type;
  10937. if (!options || !options.root) {
  10938. type = namespace + type;
  10939. if (( true) && !store._actions[type]) {
  10940. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  10941. return
  10942. }
  10943. }
  10944. return store.dispatch(type, payload)
  10945. },
  10946. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  10947. var args = unifyObjectStyle(_type, _payload, _options);
  10948. var payload = args.payload;
  10949. var options = args.options;
  10950. var type = args.type;
  10951. if (!options || !options.root) {
  10952. type = namespace + type;
  10953. if (( true) && !store._mutations[type]) {
  10954. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  10955. return
  10956. }
  10957. }
  10958. store.commit(type, payload, options);
  10959. }
  10960. };
  10961. // getters and state object must be gotten lazily
  10962. // because they will be changed by vm update
  10963. Object.defineProperties(local, {
  10964. getters: {
  10965. get: noNamespace
  10966. ? function () { return store.getters; }
  10967. : function () { return makeLocalGetters(store, namespace); }
  10968. },
  10969. state: {
  10970. get: function () { return getNestedState(store.state, path); }
  10971. }
  10972. });
  10973. return local
  10974. }
  10975. function makeLocalGetters (store, namespace) {
  10976. if (!store._makeLocalGettersCache[namespace]) {
  10977. var gettersProxy = {};
  10978. var splitPos = namespace.length;
  10979. Object.keys(store.getters).forEach(function (type) {
  10980. // skip if the target getter is not match this namespace
  10981. if (type.slice(0, splitPos) !== namespace) { return }
  10982. // extract local getter type
  10983. var localType = type.slice(splitPos);
  10984. // Add a port to the getters proxy.
  10985. // Define as getter property because
  10986. // we do not want to evaluate the getters in this time.
  10987. Object.defineProperty(gettersProxy, localType, {
  10988. get: function () { return store.getters[type]; },
  10989. enumerable: true
  10990. });
  10991. });
  10992. store._makeLocalGettersCache[namespace] = gettersProxy;
  10993. }
  10994. return store._makeLocalGettersCache[namespace]
  10995. }
  10996. function registerMutation (store, type, handler, local) {
  10997. var entry = store._mutations[type] || (store._mutations[type] = []);
  10998. entry.push(function wrappedMutationHandler (payload) {
  10999. handler.call(store, local.state, payload);
  11000. });
  11001. }
  11002. function registerAction (store, type, handler, local) {
  11003. var entry = store._actions[type] || (store._actions[type] = []);
  11004. entry.push(function wrappedActionHandler (payload) {
  11005. var res = handler.call(store, {
  11006. dispatch: local.dispatch,
  11007. commit: local.commit,
  11008. getters: local.getters,
  11009. state: local.state,
  11010. rootGetters: store.getters,
  11011. rootState: store.state
  11012. }, payload);
  11013. if (!isPromise(res)) {
  11014. res = Promise.resolve(res);
  11015. }
  11016. if (store._devtoolHook) {
  11017. return res.catch(function (err) {
  11018. store._devtoolHook.emit('vuex:error', err);
  11019. throw err
  11020. })
  11021. } else {
  11022. return res
  11023. }
  11024. });
  11025. }
  11026. function registerGetter (store, type, rawGetter, local) {
  11027. if (store._wrappedGetters[type]) {
  11028. if ((true)) {
  11029. console.error(("[vuex] duplicate getter key: " + type));
  11030. }
  11031. return
  11032. }
  11033. store._wrappedGetters[type] = function wrappedGetter (store) {
  11034. return rawGetter(
  11035. local.state, // local state
  11036. local.getters, // local getters
  11037. store.state, // root state
  11038. store.getters // root getters
  11039. )
  11040. };
  11041. }
  11042. function enableStrictMode (store) {
  11043. store._vm.$watch(function () { return this._data.$$state }, function () {
  11044. if ((true)) {
  11045. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  11046. }
  11047. }, { deep: true, sync: true });
  11048. }
  11049. function getNestedState (state, path) {
  11050. return path.reduce(function (state, key) { return state[key]; }, state)
  11051. }
  11052. function unifyObjectStyle (type, payload, options) {
  11053. if (isObject(type) && type.type) {
  11054. options = payload;
  11055. payload = type;
  11056. type = type.type;
  11057. }
  11058. if ((true)) {
  11059. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  11060. }
  11061. return { type: type, payload: payload, options: options }
  11062. }
  11063. function install (_Vue) {
  11064. if (Vue && _Vue === Vue) {
  11065. if ((true)) {
  11066. console.error(
  11067. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  11068. );
  11069. }
  11070. return
  11071. }
  11072. Vue = _Vue;
  11073. applyMixin(Vue);
  11074. }
  11075. /**
  11076. * Reduce the code which written in Vue.js for getting the state.
  11077. * @param {String} [namespace] - Module's namespace
  11078. * @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.
  11079. * @param {Object}
  11080. */
  11081. var mapState = normalizeNamespace(function (namespace, states) {
  11082. var res = {};
  11083. if (( true) && !isValidMap(states)) {
  11084. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  11085. }
  11086. normalizeMap(states).forEach(function (ref) {
  11087. var key = ref.key;
  11088. var val = ref.val;
  11089. res[key] = function mappedState () {
  11090. var state = this.$store.state;
  11091. var getters = this.$store.getters;
  11092. if (namespace) {
  11093. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  11094. if (!module) {
  11095. return
  11096. }
  11097. state = module.context.state;
  11098. getters = module.context.getters;
  11099. }
  11100. return typeof val === 'function'
  11101. ? val.call(this, state, getters)
  11102. : state[val]
  11103. };
  11104. // mark vuex getter for devtools
  11105. res[key].vuex = true;
  11106. });
  11107. return res
  11108. });
  11109. /**
  11110. * Reduce the code which written in Vue.js for committing the mutation
  11111. * @param {String} [namespace] - Module's namespace
  11112. * @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.
  11113. * @return {Object}
  11114. */
  11115. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  11116. var res = {};
  11117. if (( true) && !isValidMap(mutations)) {
  11118. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  11119. }
  11120. normalizeMap(mutations).forEach(function (ref) {
  11121. var key = ref.key;
  11122. var val = ref.val;
  11123. res[key] = function mappedMutation () {
  11124. var args = [], len = arguments.length;
  11125. while ( len-- ) args[ len ] = arguments[ len ];
  11126. // Get the commit method from store
  11127. var commit = this.$store.commit;
  11128. if (namespace) {
  11129. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  11130. if (!module) {
  11131. return
  11132. }
  11133. commit = module.context.commit;
  11134. }
  11135. return typeof val === 'function'
  11136. ? val.apply(this, [commit].concat(args))
  11137. : commit.apply(this.$store, [val].concat(args))
  11138. };
  11139. });
  11140. return res
  11141. });
  11142. /**
  11143. * Reduce the code which written in Vue.js for getting the getters
  11144. * @param {String} [namespace] - Module's namespace
  11145. * @param {Object|Array} getters
  11146. * @return {Object}
  11147. */
  11148. var mapGetters = normalizeNamespace(function (namespace, getters) {
  11149. var res = {};
  11150. if (( true) && !isValidMap(getters)) {
  11151. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  11152. }
  11153. normalizeMap(getters).forEach(function (ref) {
  11154. var key = ref.key;
  11155. var val = ref.val;
  11156. // The namespace has been mutated by normalizeNamespace
  11157. val = namespace + val;
  11158. res[key] = function mappedGetter () {
  11159. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  11160. return
  11161. }
  11162. if (( true) && !(val in this.$store.getters)) {
  11163. console.error(("[vuex] unknown getter: " + val));
  11164. return
  11165. }
  11166. return this.$store.getters[val]
  11167. };
  11168. // mark vuex getter for devtools
  11169. res[key].vuex = true;
  11170. });
  11171. return res
  11172. });
  11173. /**
  11174. * Reduce the code which written in Vue.js for dispatch the action
  11175. * @param {String} [namespace] - Module's namespace
  11176. * @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.
  11177. * @return {Object}
  11178. */
  11179. var mapActions = normalizeNamespace(function (namespace, actions) {
  11180. var res = {};
  11181. if (( true) && !isValidMap(actions)) {
  11182. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  11183. }
  11184. normalizeMap(actions).forEach(function (ref) {
  11185. var key = ref.key;
  11186. var val = ref.val;
  11187. res[key] = function mappedAction () {
  11188. var args = [], len = arguments.length;
  11189. while ( len-- ) args[ len ] = arguments[ len ];
  11190. // get dispatch function from store
  11191. var dispatch = this.$store.dispatch;
  11192. if (namespace) {
  11193. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  11194. if (!module) {
  11195. return
  11196. }
  11197. dispatch = module.context.dispatch;
  11198. }
  11199. return typeof val === 'function'
  11200. ? val.apply(this, [dispatch].concat(args))
  11201. : dispatch.apply(this.$store, [val].concat(args))
  11202. };
  11203. });
  11204. return res
  11205. });
  11206. /**
  11207. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  11208. * @param {String} namespace
  11209. * @return {Object}
  11210. */
  11211. var createNamespacedHelpers = function (namespace) { return ({
  11212. mapState: mapState.bind(null, namespace),
  11213. mapGetters: mapGetters.bind(null, namespace),
  11214. mapMutations: mapMutations.bind(null, namespace),
  11215. mapActions: mapActions.bind(null, namespace)
  11216. }); };
  11217. /**
  11218. * Normalize the map
  11219. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  11220. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  11221. * @param {Array|Object} map
  11222. * @return {Object}
  11223. */
  11224. function normalizeMap (map) {
  11225. if (!isValidMap(map)) {
  11226. return []
  11227. }
  11228. return Array.isArray(map)
  11229. ? map.map(function (key) { return ({ key: key, val: key }); })
  11230. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  11231. }
  11232. /**
  11233. * Validate whether given map is valid or not
  11234. * @param {*} map
  11235. * @return {Boolean}
  11236. */
  11237. function isValidMap (map) {
  11238. return Array.isArray(map) || isObject(map)
  11239. }
  11240. /**
  11241. * 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.
  11242. * @param {Function} fn
  11243. * @return {Function}
  11244. */
  11245. function normalizeNamespace (fn) {
  11246. return function (namespace, map) {
  11247. if (typeof namespace !== 'string') {
  11248. map = namespace;
  11249. namespace = '';
  11250. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  11251. namespace += '/';
  11252. }
  11253. return fn(namespace, map)
  11254. }
  11255. }
  11256. /**
  11257. * Search a special module from store by namespace. if module not exist, print error message.
  11258. * @param {Object} store
  11259. * @param {String} helper
  11260. * @param {String} namespace
  11261. * @return {Object}
  11262. */
  11263. function getModuleByNamespace (store, helper, namespace) {
  11264. var module = store._modulesNamespaceMap[namespace];
  11265. if (( true) && !module) {
  11266. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  11267. }
  11268. return module
  11269. }
  11270. // Credits: borrowed code from fcomb/redux-logger
  11271. function createLogger (ref) {
  11272. if ( ref === void 0 ) ref = {};
  11273. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  11274. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  11275. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  11276. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  11277. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  11278. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  11279. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  11280. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  11281. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  11282. return function (store) {
  11283. var prevState = deepCopy(store.state);
  11284. if (typeof logger === 'undefined') {
  11285. return
  11286. }
  11287. if (logMutations) {
  11288. store.subscribe(function (mutation, state) {
  11289. var nextState = deepCopy(state);
  11290. if (filter(mutation, prevState, nextState)) {
  11291. var formattedTime = getFormattedTime();
  11292. var formattedMutation = mutationTransformer(mutation);
  11293. var message = "mutation " + (mutation.type) + formattedTime;
  11294. startMessage(logger, message, collapsed);
  11295. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  11296. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  11297. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  11298. endMessage(logger);
  11299. }
  11300. prevState = nextState;
  11301. });
  11302. }
  11303. if (logActions) {
  11304. store.subscribeAction(function (action, state) {
  11305. if (actionFilter(action, state)) {
  11306. var formattedTime = getFormattedTime();
  11307. var formattedAction = actionTransformer(action);
  11308. var message = "action " + (action.type) + formattedTime;
  11309. startMessage(logger, message, collapsed);
  11310. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  11311. endMessage(logger);
  11312. }
  11313. });
  11314. }
  11315. }
  11316. }
  11317. function startMessage (logger, message, collapsed) {
  11318. var startMessage = collapsed
  11319. ? logger.groupCollapsed
  11320. : logger.group;
  11321. // render
  11322. try {
  11323. startMessage.call(logger, message);
  11324. } catch (e) {
  11325. logger.log(message);
  11326. }
  11327. }
  11328. function endMessage (logger) {
  11329. try {
  11330. logger.groupEnd();
  11331. } catch (e) {
  11332. logger.log('—— log end ——');
  11333. }
  11334. }
  11335. function getFormattedTime () {
  11336. var time = new Date();
  11337. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  11338. }
  11339. function repeat (str, times) {
  11340. return (new Array(times + 1)).join(str)
  11341. }
  11342. function pad (num, maxLength) {
  11343. return repeat('0', maxLength - num.toString().length) + num
  11344. }
  11345. var index_cjs = {
  11346. Store: Store,
  11347. install: install,
  11348. version: '3.6.2',
  11349. mapState: mapState,
  11350. mapMutations: mapMutations,
  11351. mapGetters: mapGetters,
  11352. mapActions: mapActions,
  11353. createNamespacedHelpers: createNamespacedHelpers,
  11354. createLogger: createLogger
  11355. };
  11356. module.exports = index_cjs;
  11357. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  11358. /***/ }),
  11359. /***/ 29:
  11360. /*!*******************************************!*\
  11361. !*** D:/工作/项目2/生鲜/sx/store/model/user.js ***!
  11362. \*******************************************/
  11363. /*! no static exports found */
  11364. /***/ (function(module, exports, __webpack_require__) {
  11365. "use strict";
  11366. /* WEBPACK VAR INJECTION */(function(uni) {
  11367. Object.defineProperty(exports, "__esModule", {
  11368. value: true
  11369. });
  11370. exports.default = void 0;
  11371. var state = {
  11372. userInfo: {},
  11373. //用户信息
  11374. orderInfo: {
  11375. complete_count: 0,
  11376. //完成
  11377. received_count: 0,
  11378. //待收货
  11379. unshipped_count: 0,
  11380. //待发货
  11381. order_count: 0,
  11382. //订单总数
  11383. unpaid_count: 0 //待付款
  11384. },
  11385. //订单信息
  11386. hasLogin: false,
  11387. //是否登录
  11388. checkedStore: {},
  11389. checkedPoint: '',
  11390. latlng: '',
  11391. //当前坐标
  11392. latitude: '',
  11393. longitude: '',
  11394. des: '',
  11395. //距离
  11396. dhqList: [],
  11397. //优惠券
  11398. distribution: 2 //配送方式1是自提2是外卖
  11399. };
  11400. var mutations = {
  11401. // 登录
  11402. login: function login(state) {
  11403. state.hasLogin = true;
  11404. },
  11405. // 退出登录
  11406. logout: function logout(state, provider) {
  11407. state.hasLogin = false;
  11408. // 清空基础信息
  11409. state.userInfo = {};
  11410. state.orderInfo = {
  11411. complete_count: 0,
  11412. //完成
  11413. received_count: 0,
  11414. //待收货
  11415. unshipped_count: 0,
  11416. //待发货
  11417. order_count: 0,
  11418. //订单总数
  11419. unpaid_count: 0 //待付款
  11420. };
  11421. // 清除缓存用户信息
  11422. uni.removeStorage({
  11423. key: 'userInfo'
  11424. });
  11425. // 清除缓存token
  11426. uni.removeStorage({
  11427. key: 'token'
  11428. });
  11429. },
  11430. // 保存用户信息
  11431. setUserInfo: function setUserInfo(state, provider) {
  11432. state.userInfo = provider;
  11433. uni.setStorage({
  11434. //缓存用户登陆状态
  11435. key: 'userInfo',
  11436. data: provider
  11437. });
  11438. },
  11439. // 保存订单信息
  11440. setOrderInfo: function setOrderInfo(state, provider) {
  11441. state.orderInfo = provider;
  11442. },
  11443. setStoreInfo: function setStoreInfo(state, provider) {
  11444. state.checkedStore = provider;
  11445. // uni.removeStorageSync('store');
  11446. // uni.setStorageSync('store',provider)
  11447. uni.setStorage({
  11448. //缓存用户登陆状态
  11449. key: 'store',
  11450. data: provider
  11451. });
  11452. },
  11453. setPointInfo: function setPointInfo(state, provider) {
  11454. state.checkedPoint = provider;
  11455. },
  11456. setDes: function setDes(state, provider) {
  11457. state.des = provider;
  11458. },
  11459. setLatlng: function setLatlng(state, provider) {
  11460. state.latlng = provider;
  11461. },
  11462. setLatitude: function setLatitude(state, provider) {
  11463. state.latitude = provider;
  11464. },
  11465. setLongitude: function setLongitude(state, provider) {
  11466. state.longitude = provider;
  11467. },
  11468. setDhqList: function setDhqList(state, provider) {
  11469. state.dhqList = provider;
  11470. },
  11471. setDistribution: function setDistribution(state, provider) {
  11472. state.distribution = provider;
  11473. }
  11474. };
  11475. var getters = {};
  11476. var _default = {
  11477. namespaced: true,
  11478. state: state,
  11479. mutations: mutations,
  11480. getters: getters
  11481. };
  11482. exports.default = _default;
  11483. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11484. /***/ }),
  11485. /***/ 3:
  11486. /*!***********************************!*\
  11487. !*** (webpack)/buildin/global.js ***!
  11488. \***********************************/
  11489. /*! no static exports found */
  11490. /***/ (function(module, exports) {
  11491. var g;
  11492. // This works in non-strict mode
  11493. g = (function() {
  11494. return this;
  11495. })();
  11496. try {
  11497. // This works if eval is allowed (see CSP)
  11498. g = g || new Function("return this")();
  11499. } catch (e) {
  11500. // This works if the window reference is available
  11501. if (typeof window === "object") g = window;
  11502. }
  11503. // g can still be undefined, but nothing to do about it...
  11504. // We return undefined, instead of nothing here, so it's
  11505. // easier to handle this case. if(!global) { ...}
  11506. module.exports = g;
  11507. /***/ }),
  11508. /***/ 310:
  11509. /*!*****************************************!*\
  11510. !*** D:/工作/项目2/生鲜/sx/utils/platform.js ***!
  11511. \*****************************************/
  11512. /*! no static exports found */
  11513. /***/ (function(module, exports, __webpack_require__) {
  11514. "use strict";
  11515. Object.defineProperty(exports, "__esModule", {
  11516. value: true
  11517. });
  11518. exports.default = void 0;
  11519. exports.isAndroid = isAndroid;
  11520. exports.isIOS = isIOS;
  11521. exports.isPad = isPad;
  11522. exports.isWinPad = isWinPad;
  11523. function isAndroid() {
  11524. var ua = navigator.userAgent,
  11525. _isAndroid = ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1;
  11526. return _isAndroid;
  11527. }
  11528. function isIOS() {
  11529. return !!navigator.userAgent.match(/(i[^;]+\;(U;)? CPU.+Mac OS X)/);
  11530. }
  11531. function isPad() {
  11532. return navigator.userAgent.toLowerCase().match(/iPad/i) == "ipad";
  11533. }
  11534. function isWinPad() {
  11535. return navigator.userAgent.indexOf("Windows NT") >= 0;
  11536. }
  11537. var _default = {
  11538. isAndroid: isAndroid,
  11539. isIOS: isIOS,
  11540. isPad: isPad,
  11541. isWinPad: isWinPad
  11542. };
  11543. exports.default = _default;
  11544. /***/ }),
  11545. /***/ 33:
  11546. /*!*****************************************!*\
  11547. !*** D:/工作/项目2/生鲜/sx/utils/rocessor.js ***!
  11548. \*****************************************/
  11549. /*! no static exports found */
  11550. /***/ (function(module, exports, __webpack_require__) {
  11551. "use strict";
  11552. /* WEBPACK VAR INJECTION */(function(wx, uni) {
  11553. Object.defineProperty(exports, "__esModule", {
  11554. value: true
  11555. });
  11556. exports.getMoneyStyle = getMoneyStyle;
  11557. exports.getTime = getTime;
  11558. exports.isCardNo = isCardNo;
  11559. exports.openMap = openMap;
  11560. exports.space = space;
  11561. exports.timeComputed = timeComputed;
  11562. //身份证验证
  11563. function isCardNo(card) {
  11564. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  11565. var reg = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
  11566. if (reg.test(card) === false) {
  11567. console.log(card);
  11568. return false;
  11569. }
  11570. return true;
  11571. }
  11572. // 金额显示变化
  11573. function getMoneyStyle() {
  11574. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  11575. if (typeof value == 'string') {
  11576. value = (+value).toFixed(2);
  11577. }
  11578. if (typeof value == 'number') {
  11579. value = value.toFixed(2);
  11580. }
  11581. // 将字符串转为数组
  11582. var n = value.split("");
  11583. // 反转数组并复制循环处理
  11584. var arr = n.reverse().map(function (e, ind, ar) {
  11585. // 判断当前下标是否为3的整数倍数且不为最后一个下标
  11586. if (ind % 3 == 0 && ind / 3 > 1 && ind != ar.length) {
  11587. return e + ',';
  11588. } else {
  11589. return e;
  11590. }
  11591. });
  11592. // 反转数组回复原来排序并合并回字符串
  11593. arr = arr.reverse().join('');
  11594. return arr;
  11595. }
  11596. // 倒计时计算
  11597. // 计算倒计时时间
  11598. function timeComputed(time) {
  11599. // 判断是否当前时间大于结束时间
  11600. var tpye = false;
  11601. // 获取当前时间
  11602. var actTime = new Date().getTime();
  11603. // 获取到期时间
  11604. var stopTime = time - actTime;
  11605. // 判断是否小于0
  11606. if (stopTime < 0) {
  11607. stopTime = stopTime * -1;
  11608. tpye = true;
  11609. }
  11610. var day = Math.floor(stopTime / 1000 / 60 / 60 / 24); //获取剩余天数
  11611. var hours = Math.floor(stopTime / 1000 / 60 / 60 % 24); //获取剩余小时数
  11612. var minutes = Math.floor(stopTime / 1000 / 60 % 60); //获取分钟
  11613. var seconds = Math.floor(stopTime / 1000 % 60); //获取秒数
  11614. return {
  11615. hours: hours,
  11616. //倒计时小时数
  11617. minutes: minutes,
  11618. //倒计时分钟数
  11619. seconds: seconds,
  11620. //倒计时秒数
  11621. day: day,
  11622. //倒计时天数
  11623. tpye: tpye
  11624. };
  11625. }
  11626. // 调用打开地图方法
  11627. function openMap(e) {
  11628. var that = this;
  11629. return new Promise(function (resolve, reject) {
  11630. wx.getSetting({
  11631. success: function success(res) {
  11632. //这里判断是否有地位权限
  11633. if (!res.authSetting['scope.userLocation']) {
  11634. wx.showModal({
  11635. title: '提示',
  11636. content: '请求获取位置权限',
  11637. success: function success(res) {
  11638. if (res.confirm == false) {
  11639. // 授权失败
  11640. reject();
  11641. return false;
  11642. }
  11643. wx.openSetting({
  11644. success: function success(res) {
  11645. //如果再次拒绝则返回页面并提示
  11646. if (!res.authSetting['scope.userLocation']) {
  11647. wx.showToast({
  11648. title: '此功能需获取位置信息,请重新设置',
  11649. duration: 3000,
  11650. icon: 'none'
  11651. });
  11652. } else {
  11653. //允许授权,调用地图
  11654. resolve();
  11655. }
  11656. }
  11657. });
  11658. }
  11659. });
  11660. } else {
  11661. //如果有定位权限,调用地图
  11662. resolve();
  11663. }
  11664. }
  11665. });
  11666. });
  11667. }
  11668. //时间戳转换成时间
  11669. function getTime(time) {
  11670. var num = 13 - (time + '').length;
  11671. var l = 1; //倍数
  11672. for (var i = 0; i < num; i++) {
  11673. l += '0';
  11674. }
  11675. // 重新解析为数字
  11676. l = parseInt(l);
  11677. var date = new Date(parseInt(time) * l);
  11678. var year = date.getFullYear();
  11679. var mon = date.getMonth() + 1;
  11680. var day = date.getDate();
  11681. var hours = date.getHours();
  11682. var minu = date.getMinutes();
  11683. var sec = date.getSeconds();
  11684. return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
  11685. }
  11686. //获取位置距离
  11687. function space(lat1, lng1) {
  11688. var sp = uni.getStorageSync('latlon');
  11689. var arr1 = sp.split(',');
  11690. var lat2 = arr1[0];
  11691. var lng2 = arr1[1];
  11692. console.log(lat1, lng1, lat2, lng2);
  11693. var radLat1 = lat1 * Math.PI / 180.0;
  11694. var radLat2 = lat2 * Math.PI / 180.0;
  11695. var a = radLat1 - radLat2;
  11696. var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
  11697. var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
  11698. s = s * 6378.137;
  11699. s = Math.round(s * 10000) / 10000;
  11700. return s * 1000; // 单位米
  11701. }
  11702. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11703. /***/ }),
  11704. /***/ 34:
  11705. /*!************************************!*\
  11706. !*** D:/工作/项目2/生鲜/sx/api/index.js ***!
  11707. \************************************/
  11708. /*! no static exports found */
  11709. /***/ (function(module, exports, __webpack_require__) {
  11710. "use strict";
  11711. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11712. Object.defineProperty(exports, "__esModule", {
  11713. value: true
  11714. });
  11715. exports.getArticleDetail = getArticleDetail;
  11716. exports.getCoupon = getCoupon;
  11717. exports.getCouponsList = getCouponsList;
  11718. exports.getIndexData = getIndexData;
  11719. exports.getMyCoupons = getMyCoupons;
  11720. exports.getPhoneTc = getPhoneTc;
  11721. exports.getPointList = getPointList;
  11722. exports.getStoreList = getStoreList;
  11723. exports.groom1 = groom1;
  11724. exports.groom3 = groom3;
  11725. exports.groom4 = groom4;
  11726. exports.loadIndexs = loadIndexs;
  11727. exports.phonePay = phonePay;
  11728. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  11729. // 促销商品
  11730. function groom4(data) {
  11731. return (0, _request.default)({
  11732. url: '/api/groom/list/4',
  11733. method: 'get',
  11734. data: data
  11735. });
  11736. }
  11737. // 精品推荐
  11738. function groom1(data) {
  11739. return (0, _request.default)({
  11740. url: '/api/groom/list/1',
  11741. method: 'get',
  11742. data: data
  11743. });
  11744. }
  11745. // 新品首发
  11746. function groom3(data) {
  11747. return (0, _request.default)({
  11748. url: '/api/groom/list/3',
  11749. method: 'get',
  11750. data: data
  11751. });
  11752. }
  11753. // 获取首页信息
  11754. function loadIndexs(data) {
  11755. return (0, _request.default)({
  11756. url: '/api/index',
  11757. method: 'get',
  11758. data: data
  11759. });
  11760. }
  11761. /**
  11762. * 获取主页数据 无需授权
  11763. *
  11764. */
  11765. function getIndexData(data) {
  11766. return (0, _request.default)({
  11767. url: '/api/common/home',
  11768. method: 'get',
  11769. data: data
  11770. });
  11771. }
  11772. //获取商店列表
  11773. function getStoreList(data) {
  11774. return (0, _request.default)({
  11775. url: '/api/store_list',
  11776. method: 'get',
  11777. data: data
  11778. });
  11779. }
  11780. //获取自提点列表
  11781. function getPointList(data, id) {
  11782. return (0, _request.default)({
  11783. url: '/api/point_list/' + id,
  11784. method: 'get',
  11785. data: data
  11786. });
  11787. }
  11788. //文章详情
  11789. function getArticleDetail(data, id) {
  11790. return (0, _request.default)({
  11791. url: '/api/article/details/' + id,
  11792. method: 'get',
  11793. data: data
  11794. });
  11795. }
  11796. //优惠券列表 /api/coupons
  11797. function getCouponsList(data) {
  11798. return (0, _request.default)({
  11799. url: '/api/coupons',
  11800. method: 'get',
  11801. data: data
  11802. });
  11803. }
  11804. function getCoupon(data) {
  11805. return (0, _request.default)({
  11806. url: '/api/coupon/receive',
  11807. method: 'post',
  11808. data: data
  11809. });
  11810. }
  11811. //获取我的优惠券
  11812. function getMyCoupons(data, types) {
  11813. return (0, _request.default)({
  11814. url: '/api/coupons/user/' + types,
  11815. method: 'get',
  11816. data: data
  11817. });
  11818. }
  11819. //获取手机充值套餐
  11820. function getPhoneTc(data) {
  11821. return (0, _request.default)({
  11822. url: '/api/mobile_recharge/index',
  11823. method: 'get',
  11824. data: data
  11825. });
  11826. }
  11827. function phonePay(data) {
  11828. return (0, _request.default)({
  11829. url: '/api/mobile_recharge/routine',
  11830. method: 'post',
  11831. data: data
  11832. });
  11833. }
  11834. /***/ }),
  11835. /***/ 35:
  11836. /*!****************************************!*\
  11837. !*** D:/工作/项目2/生鲜/sx/utils/request.js ***!
  11838. \****************************************/
  11839. /*! no static exports found */
  11840. /***/ (function(module, exports, __webpack_require__) {
  11841. "use strict";
  11842. /* WEBPACK VAR INJECTION */(function(uni) {
  11843. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11844. Object.defineProperty(exports, "__esModule", {
  11845. value: true
  11846. });
  11847. exports.upFilse = exports.default = void 0;
  11848. var _newRequest = _interopRequireDefault(__webpack_require__(/*! ./newRequest.js */ 36));
  11849. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  11850. var _loginUtils = __webpack_require__(/*! @/utils/loginUtils.js */ 40);
  11851. // 请求完成后拦截
  11852. _newRequest.default.interceptors.response(function (response) {
  11853. try {
  11854. var res = response.data;
  11855. // 解析字符串为数字
  11856. if (res.status !== 200) {
  11857. console.log(res.status);
  11858. if (res.status == 410000) {
  11859. // 调用退出登录方法清空用户信息
  11860. _store.default.commit('user/logout');
  11861. // 判断是否开启强制登录
  11862. uni.showModal({
  11863. title: "登陆",
  11864. content: '您未登录!是否马上登录?',
  11865. success: function success(e) {
  11866. // 判断是否点击确认按钮
  11867. if (e.confirm) {
  11868. // 保存当前页面地址
  11869. (0, _loginUtils.saveUrl)();
  11870. // 跳转页面
  11871. (0, _loginUtils.interceptor)();
  11872. }
  11873. }
  11874. });
  11875. } else {
  11876. if (res.msg != '系统出现异常') {
  11877. uni.showToast({
  11878. title: res.msg,
  11879. duration: 1500,
  11880. mask: false,
  11881. icon: 'none'
  11882. });
  11883. }
  11884. }
  11885. return Promise.reject(res);
  11886. } else {
  11887. return res;
  11888. }
  11889. } catch (e) {
  11890. console.log(e);
  11891. }
  11892. }, function (error) {
  11893. uni.showToast({
  11894. title: "加载错误请重试",
  11895. duration: 1500,
  11896. mask: false,
  11897. icon: 'none'
  11898. });
  11899. return Promise.reject(error);
  11900. });
  11901. // 请求前拦截器
  11902. _newRequest.default.interceptors.request(function (config) {
  11903. var token = uni.getStorageSync('token') || '';
  11904. var latlon = uni.getStorageSync('latlon') || '';
  11905. var store = uni.getStorageSync('store') || '';
  11906. // console.log(config);
  11907. var storeid = '';
  11908. if (store) {
  11909. storeid = store.id;
  11910. }
  11911. if (!config.header) {
  11912. config.header = {
  11913. "Authori-zation": 'Bearer ' + token,
  11914. 'LatLon': latlon,
  11915. 'store-id': storeid
  11916. };
  11917. } else {
  11918. // 添加key请求头
  11919. config.header["Authori-zation"] = 'Bearer ' + token;
  11920. }
  11921. return config;
  11922. }, function (error) {
  11923. // 错误处理
  11924. console.log(error);
  11925. return Promise.reject(error);
  11926. });
  11927. var upFilse = _newRequest.default.upFilse;
  11928. exports.upFilse = upFilse;
  11929. var _default = _newRequest.default.open;
  11930. exports.default = _default;
  11931. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11932. /***/ }),
  11933. /***/ 36:
  11934. /*!*******************************************!*\
  11935. !*** D:/工作/项目2/生鲜/sx/utils/newRequest.js ***!
  11936. \*******************************************/
  11937. /*! no static exports found */
  11938. /***/ (function(module, exports, __webpack_require__) {
  11939. "use strict";
  11940. /* WEBPACK VAR INJECTION */(function(uni) {
  11941. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11942. Object.defineProperty(exports, "__esModule", {
  11943. value: true
  11944. });
  11945. exports.default = void 0;
  11946. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 37));
  11947. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 39));
  11948. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  11949. var service = {
  11950. baseURL: _store.default.state.baseURL,
  11951. // 请求头
  11952. header: {
  11953. 'Content-Type': "application/x-www-form-urlencoded"
  11954. },
  11955. // 请求拦截器
  11956. interceptors: {
  11957. // 安装请求前拦截
  11958. request: function request(success, iserror) {
  11959. service.request.success = success;
  11960. service.request.error = iserror;
  11961. },
  11962. // 安装请求完成后拦截
  11963. response: function response(success, iserror) {
  11964. service.response.success = success;
  11965. service.response.error = iserror;
  11966. }
  11967. },
  11968. // 请求前拦截
  11969. request: {
  11970. // 回调成功执行方法
  11971. success: function success(e) {
  11972. return e;
  11973. },
  11974. // 回调失败
  11975. error: function error(e) {
  11976. return e;
  11977. }
  11978. },
  11979. // 请求完成后拦截
  11980. response: {
  11981. // 回调成功执行方法
  11982. success: function success(e) {
  11983. return e;
  11984. },
  11985. // 回调失败
  11986. error: function error(e) {
  11987. return e;
  11988. }
  11989. },
  11990. // 开始请求
  11991. open: function () {
  11992. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {
  11993. return _regenerator.default.wrap(function _callee$(_context) {
  11994. while (1) {
  11995. switch (_context.prev = _context.next) {
  11996. case 0:
  11997. _context.next = 2;
  11998. return new Promise(function (resolve, reject) {
  11999. var requestData = ''; //保存处理完成后请求数据
  12000. var url = ''; //保存链接地址
  12001. //console.log(data);
  12002. // 请求前数据处理
  12003. requestData = service.request.success(data);
  12004. url = service.baseURL + requestData.url;
  12005. console.log(requestData.data);
  12006. requestData.data = requestData.data || {};
  12007. requestData.data.uptime = new Date().getTime();
  12008. // 数据复制用于请求
  12009. console.log(url);
  12010. uni.request({
  12011. url: url,
  12012. method: requestData.method || 'GET',
  12013. data: requestData.data,
  12014. header: data.header || service.header,
  12015. success: function success(res) {
  12016. if (res.statusCode == 200) {
  12017. try {
  12018. resolve(service.response.success(res));
  12019. } catch (e) {
  12020. service.response.error(e);
  12021. }
  12022. }
  12023. },
  12024. // 请求失败数据处理
  12025. fail: function fail(err) {
  12026. service.response.error(err);
  12027. }
  12028. });
  12029. });
  12030. case 2:
  12031. return _context.abrupt("return", _context.sent);
  12032. case 3:
  12033. case "end":
  12034. return _context.stop();
  12035. }
  12036. }
  12037. }, _callee);
  12038. }));
  12039. function open(_x) {
  12040. return _open.apply(this, arguments);
  12041. }
  12042. return open;
  12043. }(),
  12044. // 上传文件
  12045. upFilse: function () {
  12046. var _upFilse = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {
  12047. return _regenerator.default.wrap(function _callee4$(_context4) {
  12048. while (1) {
  12049. switch (_context4.prev = _context4.next) {
  12050. case 0:
  12051. _context4.next = 2;
  12052. return new Promise(function (resolve, reject) {
  12053. var requestData = ''; //保存处理完成后请求数据
  12054. var url = ''; //保存请求地址
  12055. try {
  12056. // 请求前数据处理
  12057. requestData = service.request.success(data);
  12058. } catch (e) {
  12059. // 请求报错拦截
  12060. service.request.error(e);
  12061. }
  12062. url = service.baseURL + requestData.url;
  12063. var config = {
  12064. // 上传图片的API
  12065. upload_img_url: url
  12066. };
  12067. var Uploader = {
  12068. // 选择图片
  12069. choose: function choose(num) {
  12070. return new Promise(function (resolve, reject) {
  12071. uni.chooseImage({
  12072. count: num,
  12073. success: function success(res) {
  12074. // console.log(res);
  12075. // 缓存文件路径
  12076. resolve(res.tempFilePaths);
  12077. },
  12078. fail: function fail(err) {
  12079. console.log(err);
  12080. reject(err);
  12081. }
  12082. });
  12083. });
  12084. },
  12085. // 上传图片
  12086. upload_one: function upload_one(path) {
  12087. return new Promise(function (resolve, reject) {
  12088. uni.showLoading({
  12089. title: '上传中'
  12090. });
  12091. uni.uploadFile({
  12092. url: config.upload_img_url,
  12093. //仅为示例,非真实的接口地址
  12094. filePath: path,
  12095. name: 'file',
  12096. header: {
  12097. "Authori-zation": 'Bearer ' + uni.getStorageSync('token')
  12098. },
  12099. success: function success(uploadFileRes) {
  12100. if ("string" === typeof uploadFileRes.data) {
  12101. resolve(JSON.parse(uploadFileRes.data).data);
  12102. } else {
  12103. resolve(uploadFileRes.data.data);
  12104. }
  12105. },
  12106. complete: function complete() {
  12107. uni.hideLoading();
  12108. }
  12109. });
  12110. });
  12111. },
  12112. // 上传多个图片
  12113. upload: function upload(path_arr) {
  12114. var _this = this;
  12115. var num = path_arr.length;
  12116. return new Promise( /*#__PURE__*/function () {
  12117. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
  12118. var img_urls, i, img_url;
  12119. return _regenerator.default.wrap(function _callee2$(_context2) {
  12120. while (1) {
  12121. switch (_context2.prev = _context2.next) {
  12122. case 0:
  12123. img_urls = [];
  12124. i = 0;
  12125. case 2:
  12126. if (!(i < num)) {
  12127. _context2.next = 10;
  12128. break;
  12129. }
  12130. _context2.next = 5;
  12131. return _this.upload_one(path_arr[i]);
  12132. case 5:
  12133. img_url = _context2.sent;
  12134. img_urls.push(img_url);
  12135. case 7:
  12136. i++;
  12137. _context2.next = 2;
  12138. break;
  12139. case 10:
  12140. ;
  12141. resolve(img_urls);
  12142. case 12:
  12143. case "end":
  12144. return _context2.stop();
  12145. }
  12146. }
  12147. }, _callee2);
  12148. }));
  12149. return function (_x3, _x4) {
  12150. return _ref.apply(this, arguments);
  12151. };
  12152. }());
  12153. },
  12154. // 触发上传图片事件
  12155. choose_and_upload: function choose_and_upload(num) {
  12156. var _this2 = this;
  12157. return new Promise( /*#__PURE__*/function () {
  12158. var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) {
  12159. var path_arr;
  12160. return _regenerator.default.wrap(function _callee3$(_context3) {
  12161. while (1) {
  12162. switch (_context3.prev = _context3.next) {
  12163. case 0:
  12164. _context3.next = 2;
  12165. return _this2.choose(num);
  12166. case 2:
  12167. path_arr = _context3.sent;
  12168. _context3.next = 5;
  12169. return _this2.upload(path_arr).then(function (e) {
  12170. resolve(e);
  12171. }).catch(function (e) {
  12172. reject(e);
  12173. });
  12174. case 5:
  12175. case "end":
  12176. return _context3.stop();
  12177. }
  12178. }
  12179. }, _callee3);
  12180. }));
  12181. return function (_x5, _x6) {
  12182. return _ref2.apply(this, arguments);
  12183. };
  12184. }());
  12185. }
  12186. };
  12187. Uploader.choose_and_upload(1).then(function (e) {
  12188. resolve(e);
  12189. }).catch(function (e) {
  12190. console.log(e);
  12191. });
  12192. });
  12193. case 2:
  12194. return _context4.abrupt("return", _context4.sent);
  12195. case 3:
  12196. case "end":
  12197. return _context4.stop();
  12198. }
  12199. }
  12200. }, _callee4);
  12201. }));
  12202. function upFilse(_x2) {
  12203. return _upFilse.apply(this, arguments);
  12204. }
  12205. return upFilse;
  12206. }()
  12207. };
  12208. var _default = service;
  12209. exports.default = _default;
  12210. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12211. /***/ }),
  12212. /***/ 37:
  12213. /*!************************************************************************************************!*\
  12214. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  12215. \************************************************************************************************/
  12216. /*! no static exports found */
  12217. /***/ (function(module, exports, __webpack_require__) {
  12218. // TODO(Babel 8): Remove this file.
  12219. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 38)();
  12220. module.exports = runtime;
  12221. /***/ }),
  12222. /***/ 38:
  12223. /*!*******************************************************************!*\
  12224. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  12225. \*******************************************************************/
  12226. /*! no static exports found */
  12227. /***/ (function(module, exports, __webpack_require__) {
  12228. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  12229. function _regeneratorRuntime() {
  12230. "use strict";
  12231. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  12232. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  12233. return exports;
  12234. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12235. var exports = {},
  12236. Op = Object.prototype,
  12237. hasOwn = Op.hasOwnProperty,
  12238. defineProperty = Object.defineProperty || function (obj, key, desc) {
  12239. obj[key] = desc.value;
  12240. },
  12241. $Symbol = "function" == typeof Symbol ? Symbol : {},
  12242. iteratorSymbol = $Symbol.iterator || "@@iterator",
  12243. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  12244. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  12245. function define(obj, key, value) {
  12246. return Object.defineProperty(obj, key, {
  12247. value: value,
  12248. enumerable: !0,
  12249. configurable: !0,
  12250. writable: !0
  12251. }), obj[key];
  12252. }
  12253. try {
  12254. define({}, "");
  12255. } catch (err) {
  12256. define = function define(obj, key, value) {
  12257. return obj[key] = value;
  12258. };
  12259. }
  12260. function wrap(innerFn, outerFn, self, tryLocsList) {
  12261. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  12262. generator = Object.create(protoGenerator.prototype),
  12263. context = new Context(tryLocsList || []);
  12264. return defineProperty(generator, "_invoke", {
  12265. value: makeInvokeMethod(innerFn, self, context)
  12266. }), generator;
  12267. }
  12268. function tryCatch(fn, obj, arg) {
  12269. try {
  12270. return {
  12271. type: "normal",
  12272. arg: fn.call(obj, arg)
  12273. };
  12274. } catch (err) {
  12275. return {
  12276. type: "throw",
  12277. arg: err
  12278. };
  12279. }
  12280. }
  12281. exports.wrap = wrap;
  12282. var ContinueSentinel = {};
  12283. function Generator() {}
  12284. function GeneratorFunction() {}
  12285. function GeneratorFunctionPrototype() {}
  12286. var IteratorPrototype = {};
  12287. define(IteratorPrototype, iteratorSymbol, function () {
  12288. return this;
  12289. });
  12290. var getProto = Object.getPrototypeOf,
  12291. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  12292. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  12293. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  12294. function defineIteratorMethods(prototype) {
  12295. ["next", "throw", "return"].forEach(function (method) {
  12296. define(prototype, method, function (arg) {
  12297. return this._invoke(method, arg);
  12298. });
  12299. });
  12300. }
  12301. function AsyncIterator(generator, PromiseImpl) {
  12302. function invoke(method, arg, resolve, reject) {
  12303. var record = tryCatch(generator[method], generator, arg);
  12304. if ("throw" !== record.type) {
  12305. var result = record.arg,
  12306. value = result.value;
  12307. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  12308. invoke("next", value, resolve, reject);
  12309. }, function (err) {
  12310. invoke("throw", err, resolve, reject);
  12311. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  12312. result.value = unwrapped, resolve(result);
  12313. }, function (error) {
  12314. return invoke("throw", error, resolve, reject);
  12315. });
  12316. }
  12317. reject(record.arg);
  12318. }
  12319. var previousPromise;
  12320. defineProperty(this, "_invoke", {
  12321. value: function value(method, arg) {
  12322. function callInvokeWithMethodAndArg() {
  12323. return new PromiseImpl(function (resolve, reject) {
  12324. invoke(method, arg, resolve, reject);
  12325. });
  12326. }
  12327. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  12328. }
  12329. });
  12330. }
  12331. function makeInvokeMethod(innerFn, self, context) {
  12332. var state = "suspendedStart";
  12333. return function (method, arg) {
  12334. if ("executing" === state) throw new Error("Generator is already running");
  12335. if ("completed" === state) {
  12336. if ("throw" === method) throw arg;
  12337. return doneResult();
  12338. }
  12339. for (context.method = method, context.arg = arg;;) {
  12340. var delegate = context.delegate;
  12341. if (delegate) {
  12342. var delegateResult = maybeInvokeDelegate(delegate, context);
  12343. if (delegateResult) {
  12344. if (delegateResult === ContinueSentinel) continue;
  12345. return delegateResult;
  12346. }
  12347. }
  12348. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  12349. if ("suspendedStart" === state) throw state = "completed", context.arg;
  12350. context.dispatchException(context.arg);
  12351. } else "return" === context.method && context.abrupt("return", context.arg);
  12352. state = "executing";
  12353. var record = tryCatch(innerFn, self, context);
  12354. if ("normal" === record.type) {
  12355. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  12356. return {
  12357. value: record.arg,
  12358. done: context.done
  12359. };
  12360. }
  12361. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  12362. }
  12363. };
  12364. }
  12365. function maybeInvokeDelegate(delegate, context) {
  12366. var methodName = context.method,
  12367. method = delegate.iterator[methodName];
  12368. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  12369. var record = tryCatch(method, delegate.iterator, context.arg);
  12370. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  12371. var info = record.arg;
  12372. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  12373. }
  12374. function pushTryEntry(locs) {
  12375. var entry = {
  12376. tryLoc: locs[0]
  12377. };
  12378. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  12379. }
  12380. function resetTryEntry(entry) {
  12381. var record = entry.completion || {};
  12382. record.type = "normal", delete record.arg, entry.completion = record;
  12383. }
  12384. function Context(tryLocsList) {
  12385. this.tryEntries = [{
  12386. tryLoc: "root"
  12387. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  12388. }
  12389. function values(iterable) {
  12390. if (iterable) {
  12391. var iteratorMethod = iterable[iteratorSymbol];
  12392. if (iteratorMethod) return iteratorMethod.call(iterable);
  12393. if ("function" == typeof iterable.next) return iterable;
  12394. if (!isNaN(iterable.length)) {
  12395. var i = -1,
  12396. next = function next() {
  12397. for (; ++i < iterable.length;) {
  12398. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  12399. }
  12400. return next.value = undefined, next.done = !0, next;
  12401. };
  12402. return next.next = next;
  12403. }
  12404. }
  12405. return {
  12406. next: doneResult
  12407. };
  12408. }
  12409. function doneResult() {
  12410. return {
  12411. value: undefined,
  12412. done: !0
  12413. };
  12414. }
  12415. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  12416. value: GeneratorFunctionPrototype,
  12417. configurable: !0
  12418. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  12419. value: GeneratorFunction,
  12420. configurable: !0
  12421. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  12422. var ctor = "function" == typeof genFun && genFun.constructor;
  12423. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  12424. }, exports.mark = function (genFun) {
  12425. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  12426. }, exports.awrap = function (arg) {
  12427. return {
  12428. __await: arg
  12429. };
  12430. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  12431. return this;
  12432. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  12433. void 0 === PromiseImpl && (PromiseImpl = Promise);
  12434. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  12435. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  12436. return result.done ? result.value : iter.next();
  12437. });
  12438. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  12439. return this;
  12440. }), define(Gp, "toString", function () {
  12441. return "[object Generator]";
  12442. }), exports.keys = function (val) {
  12443. var object = Object(val),
  12444. keys = [];
  12445. for (var key in object) {
  12446. keys.push(key);
  12447. }
  12448. return keys.reverse(), function next() {
  12449. for (; keys.length;) {
  12450. var key = keys.pop();
  12451. if (key in object) return next.value = key, next.done = !1, next;
  12452. }
  12453. return next.done = !0, next;
  12454. };
  12455. }, exports.values = values, Context.prototype = {
  12456. constructor: Context,
  12457. reset: function reset(skipTempReset) {
  12458. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  12459. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  12460. }
  12461. },
  12462. stop: function stop() {
  12463. this.done = !0;
  12464. var rootRecord = this.tryEntries[0].completion;
  12465. if ("throw" === rootRecord.type) throw rootRecord.arg;
  12466. return this.rval;
  12467. },
  12468. dispatchException: function dispatchException(exception) {
  12469. if (this.done) throw exception;
  12470. var context = this;
  12471. function handle(loc, caught) {
  12472. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  12473. }
  12474. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12475. var entry = this.tryEntries[i],
  12476. record = entry.completion;
  12477. if ("root" === entry.tryLoc) return handle("end");
  12478. if (entry.tryLoc <= this.prev) {
  12479. var hasCatch = hasOwn.call(entry, "catchLoc"),
  12480. hasFinally = hasOwn.call(entry, "finallyLoc");
  12481. if (hasCatch && hasFinally) {
  12482. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  12483. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  12484. } else if (hasCatch) {
  12485. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  12486. } else {
  12487. if (!hasFinally) throw new Error("try statement without catch or finally");
  12488. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  12489. }
  12490. }
  12491. }
  12492. },
  12493. abrupt: function abrupt(type, arg) {
  12494. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12495. var entry = this.tryEntries[i];
  12496. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  12497. var finallyEntry = entry;
  12498. break;
  12499. }
  12500. }
  12501. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  12502. var record = finallyEntry ? finallyEntry.completion : {};
  12503. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  12504. },
  12505. complete: function complete(record, afterLoc) {
  12506. if ("throw" === record.type) throw record.arg;
  12507. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  12508. },
  12509. finish: function finish(finallyLoc) {
  12510. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12511. var entry = this.tryEntries[i];
  12512. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  12513. }
  12514. },
  12515. "catch": function _catch(tryLoc) {
  12516. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  12517. var entry = this.tryEntries[i];
  12518. if (entry.tryLoc === tryLoc) {
  12519. var record = entry.completion;
  12520. if ("throw" === record.type) {
  12521. var thrown = record.arg;
  12522. resetTryEntry(entry);
  12523. }
  12524. return thrown;
  12525. }
  12526. }
  12527. throw new Error("illegal catch attempt");
  12528. },
  12529. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  12530. return this.delegate = {
  12531. iterator: values(iterable),
  12532. resultName: resultName,
  12533. nextLoc: nextLoc
  12534. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  12535. }
  12536. }, exports;
  12537. }
  12538. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12539. /***/ }),
  12540. /***/ 39:
  12541. /*!*****************************************************************!*\
  12542. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  12543. \*****************************************************************/
  12544. /*! no static exports found */
  12545. /***/ (function(module, exports) {
  12546. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  12547. try {
  12548. var info = gen[key](arg);
  12549. var value = info.value;
  12550. } catch (error) {
  12551. reject(error);
  12552. return;
  12553. }
  12554. if (info.done) {
  12555. resolve(value);
  12556. } else {
  12557. Promise.resolve(value).then(_next, _throw);
  12558. }
  12559. }
  12560. function _asyncToGenerator(fn) {
  12561. return function () {
  12562. var self = this,
  12563. args = arguments;
  12564. return new Promise(function (resolve, reject) {
  12565. var gen = fn.apply(self, args);
  12566. function _next(value) {
  12567. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  12568. }
  12569. function _throw(err) {
  12570. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  12571. }
  12572. _next(undefined);
  12573. });
  12574. };
  12575. }
  12576. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12577. /***/ }),
  12578. /***/ 4:
  12579. /*!**********************************************************************!*\
  12580. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  12581. \**********************************************************************/
  12582. /*! no static exports found */
  12583. /***/ (function(module, exports) {
  12584. function _interopRequireDefault(obj) {
  12585. return obj && obj.__esModule ? obj : {
  12586. "default": obj
  12587. };
  12588. }
  12589. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12590. /***/ }),
  12591. /***/ 40:
  12592. /*!*******************************************!*\
  12593. !*** D:/工作/项目2/生鲜/sx/utils/loginUtils.js ***!
  12594. \*******************************************/
  12595. /*! no static exports found */
  12596. /***/ (function(module, exports, __webpack_require__) {
  12597. "use strict";
  12598. /* WEBPACK VAR INJECTION */(function(uni) {
  12599. Object.defineProperty(exports, "__esModule", {
  12600. value: true
  12601. });
  12602. exports.getActionPage = getActionPage;
  12603. exports.getPageUrl = getPageUrl;
  12604. exports.interceptor = interceptor;
  12605. exports.saveUrl = saveUrl;
  12606. function getActionPage() {
  12607. var pages = getCurrentPages();
  12608. return pages[pages.length - 1];
  12609. }
  12610. //登录拦截
  12611. function interceptor() {
  12612. var pages = getActionPage();
  12613. // 获取当前页面
  12614. var pageUrl = '/' + pages.route;
  12615. var url = '/pages/public/login';
  12616. url = '/pages/public/wxLogin';
  12617. if (pageUrl != url) {
  12618. uni.navigateTo({
  12619. url: url
  12620. });
  12621. }
  12622. }
  12623. // 保存页面
  12624. function saveUrl() {
  12625. var path = getPageUrl(true);
  12626. uni.setStorageSync('present', path);
  12627. }
  12628. // 处理分享链接地址
  12629. function getPageUrl() {
  12630. var showSpeard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  12631. var page = getActionPage();
  12632. var path = '/' + page.route;
  12633. var url = '';
  12634. // 获取对象可枚举键值列表
  12635. var objKeys = Object.keys(page.options);
  12636. // 判断有无传值
  12637. if (objKeys.length > 0) {
  12638. // 循环赋值对象数据
  12639. for (var a in page.options) {
  12640. // 判断有无邀请人
  12641. if (a != 'speard') {
  12642. url += a + "=" + page.options[a] + "&";
  12643. } else {
  12644. // 判断是否需要存储邀请人
  12645. if (showSpeard) {
  12646. url += a + "=" + page.options[a] + "&";
  12647. }
  12648. }
  12649. }
  12650. path += '?' + url.substr(0, url.length - 1);
  12651. }
  12652. // 返回处理邀请人后的邀请地址
  12653. return path;
  12654. }
  12655. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12656. /***/ }),
  12657. /***/ 413:
  12658. /*!*****************************************************************!*\
  12659. !*** D:/工作/项目2/生鲜/sx/components/wangding-pickerAddress/data.js ***!
  12660. \*****************************************************************/
  12661. /*! no static exports found */
  12662. /***/ (function(module, exports, __webpack_require__) {
  12663. "use strict";
  12664. Object.defineProperty(exports, "__esModule", {
  12665. value: true
  12666. });
  12667. exports.default = void 0;
  12668. var _default = [{
  12669. "name": "北京市",
  12670. "city": [{
  12671. "name": "北京市",
  12672. "area": ["东城区", "西城区", "崇文区", "宣武区", "朝阳区", "丰台区", "石景山区", "海淀区", "门头沟区", "房山区", "通州区", "顺义区", "昌平区", "大兴区", "平谷区", "怀柔区", "密云县", "延庆县"]
  12673. }]
  12674. }, {
  12675. "name": "天津市",
  12676. "city": [{
  12677. "name": "天津市",
  12678. "area": ["和平区", "河东区", "河西区", "南开区", "河北区", "红桥区", "塘沽区", "汉沽区", "大港区", "东丽区", "西青区", "津南区", "北辰区", "武清区", "宝坻区", "宁河县", "静海县", "蓟 县"]
  12679. }]
  12680. }, {
  12681. "name": "河北省",
  12682. "city": [{
  12683. "name": "石家庄市",
  12684. "area": ["长安区", "桥东区", "桥西区", "新华区", "郊 区", "井陉矿区", "井陉县", "正定县", "栾城县", "行唐县", "灵寿县", "高邑县", "深泽县", "赞皇县", "无极县", "平山县", "元氏县", "赵 县", "辛集市", "藁", "晋州市", "新乐市", "鹿泉市"]
  12685. }, {
  12686. "name": "唐山市",
  12687. "area": ["路南区", "路北区", "古冶区", "开平区", "新 区", "丰润县", "滦 县", "滦南县", "乐亭县", "迁西县", "玉田县", "唐海县", "遵化市", "丰南市", "迁安市"]
  12688. }, {
  12689. "name": "秦皇岛市",
  12690. "area": ["海港区", "山海关区", "北戴河区", "青龙满族自治县", "昌黎县", "抚宁县", "卢龙县"]
  12691. }, {
  12692. "name": "邯郸市",
  12693. "area": ["邯山区", "丛台区", "复兴区", "峰峰矿区", "邯郸县", "临漳县", "成安县", "大名县", "涉 县", "磁 县", "肥乡县", "永年县", "邱 县", "鸡泽县", "广平县", "馆陶县", "魏 县", "曲周县", "武安市"]
  12694. }, {
  12695. "name": "邢台市",
  12696. "area": ["桥东区", "桥西区", "邢台县", "临城县", "内丘县", "柏乡县", "隆尧县", "任 县", "南和县", "宁晋县", "巨鹿县", "新河县", "广宗县", "平乡县", "威 县", "清河县", "临西县", "南宫市", "沙河市"]
  12697. }, {
  12698. "name": "保定市",
  12699. "area": ["新市区", "北市区", "南市区", "满城县", "清苑县", "涞水县", "阜平县", "徐水县", "定兴县", "唐 县", "高阳县", "容城县", "涞源县", "望都县", "安新县", "易 县", "曲阳县", "蠡 县", "顺平县", "博野", "雄县", "涿州市", "定州市", "安国市", "高碑店市"]
  12700. }, {
  12701. "name": "张家口",
  12702. "area": ["桥东区", "桥西区", "宣化区", "下花园区", "宣化县", "张北县", "康保县", "沽源县", "尚义县", "蔚 县", "阳原县", "怀安县", "万全县", "怀来县", "涿鹿县", "赤城县", "崇礼县"]
  12703. }, {
  12704. "name": "承德市",
  12705. "area": ["双桥区", "双滦区", "鹰手营子矿区", "承德县", "兴隆县", "平泉县", "滦平县", "隆化县", "丰宁满族自治县", "宽城满族自治县", "围场满族蒙古族自治县"]
  12706. }, {
  12707. "name": "沧州市",
  12708. "area": ["新华区", "运河区", "沧 县", "青 县", "东光县", "海兴县", "盐山县", "肃宁县", "南皮县", "吴桥县", "献 县", "孟村回族自治县", "泊头市", "任丘市", "黄骅市", "河间市"]
  12709. }, {
  12710. "name": "廊坊市",
  12711. "area": ["安次区", "固安县", "永清县", "香河县", "大城县", "文安县", "大厂回族自治县", "霸州市", "三河市"]
  12712. }, {
  12713. "name": "衡水市",
  12714. "area": ["桃城区", "枣强县", "武邑县", "武强县", "饶阳县", "安平县", "故城县", "景 县", "阜城县", "冀州市", "深州市"]
  12715. }]
  12716. }, {
  12717. "name": "山西省",
  12718. "city": [{
  12719. "name": "太原市",
  12720. "area": ["小店区", "迎泽区", "杏花岭区", "尖草坪区", "万柏林区", "晋源区", "清徐县", "阳曲县", "娄烦县", "古交市"]
  12721. }, {
  12722. "name": "大同市",
  12723. "area": ["城 区", "矿 区", "南郊区", "新荣区", "阳高县", "天镇县", "广灵县", "灵丘县", "浑源县", "左云县", "大同县"]
  12724. }, {
  12725. "name": "阳泉市",
  12726. "area": ["城 区", "矿 区", "郊 区", "平定县", "盂 县"]
  12727. }, {
  12728. "name": "长治市",
  12729. "area": ["城 区", "郊 区", "长治县", "襄垣县", "屯留县", "平顺县", "黎城县", "壶关县", "长子县", "武乡县", "沁 县", "沁源县", "潞城市"]
  12730. }, {
  12731. "name": "晋城市",
  12732. "area": ["城 区", "沁水县", "阳城县", "陵川县", "泽州县", "高平市"]
  12733. }, {
  12734. "name": "朔州市",
  12735. "area": ["朔城区", "平鲁区", "山阴县", "应 县", "右玉县", "怀仁县"]
  12736. }, {
  12737. "name": "忻州市",
  12738. "area": ["忻府区", "原平市", "定襄县", "五台县", "代 县", "繁峙县", "宁武县", "静乐县", "神池县", "五寨县", "岢岚县", "河曲县", "保德县", "偏关县"]
  12739. }, {
  12740. "name": "吕梁市",
  12741. "area": ["离石区", "孝义市", "汾阳市", "文水县", "交城县", "兴 县", "临 县", "柳林县", "石楼县", "岚 县", "方山县", "中阳县", "交口县"]
  12742. }, {
  12743. "name": "晋中市",
  12744. "area": ["榆次市", "介休市", "榆社县", "左权县", "和顺县", "昔阳县", "寿阳县", "太谷县", "祁 县", "平遥县", "灵石县"]
  12745. }, {
  12746. "name": "临汾市",
  12747. "area": ["临汾市", "侯马市", "霍州市", "曲沃县", "翼城县", "襄汾县", "洪洞县", "古 县", "安泽县", "浮山县", "吉 县", "乡宁县", "蒲 县", "大宁县", "永和县", "隰 县", "汾西县"]
  12748. }, {
  12749. "name": "运城市",
  12750. "area": ["运城市", "永济市", "河津市", "芮城县", "临猗县", "万荣县", "新绛县", "稷山县", "闻喜县", "夏 县", "绛 县", "平陆县", "垣曲县"]
  12751. }]
  12752. }, {
  12753. "name": "内蒙古",
  12754. "city": [{
  12755. "name": "呼和浩特市",
  12756. "area": ["新城区", "回民区", "玉泉区", "郊 区", "土默特左旗", "托克托县", "和林格尔县", "清水河县", "武川县"]
  12757. }, {
  12758. "name": "包头市",
  12759. "area": ["东河区", "昆都伦区", "青山区", "石拐矿区", "白云矿区", "郊 区", "土默特右旗", "固阳县", "达尔罕茂明安联合旗"]
  12760. }, {
  12761. "name": "乌海市",
  12762. "area": ["海勃湾区", "海南区", "乌达区"]
  12763. }, {
  12764. "name": "赤峰市",
  12765. "area": ["红山区", "元宝山区", "松山区", "阿鲁科尔沁旗", "巴林左旗", "巴林右旗", "林西县", "克什克腾旗", "翁牛特旗", "喀喇沁旗", "宁城县", "敖汉旗"]
  12766. }, {
  12767. "name": "呼伦贝尔市",
  12768. "area": ["海拉尔市", "满洲里市", "扎兰屯市", "牙克石市", "根河市", "额尔古纳市", "阿荣旗", "莫力达瓦达斡尔族自治旗", "鄂伦春自治旗", "鄂温克族自治旗", "新巴尔虎右旗", "新巴尔虎左旗", "陈巴尔虎旗"]
  12769. }, {
  12770. "name": "兴安盟",
  12771. "area": ["乌兰浩特市", "阿尔山市", "科尔沁右翼前旗", "科尔沁右翼中旗", "扎赉特旗", "突泉县"]
  12772. }, {
  12773. "name": "通辽市",
  12774. "area": ["科尔沁区", "霍林郭勒市", "科尔沁左翼中旗", "科尔沁左翼后旗", "开鲁县", "库伦旗", "奈曼旗", "扎鲁特旗"]
  12775. }, {
  12776. "name": "锡林郭勒盟",
  12777. "area": ["二连浩特市", "锡林浩特市", "阿巴嘎旗", "苏尼特左旗", "苏尼特右旗", "东乌珠穆沁旗", "西乌珠穆沁旗", "太仆寺旗", "镶黄旗", "正镶白旗", "正蓝旗", "多伦县"]
  12778. }, {
  12779. "name": "乌兰察布盟",
  12780. "area": ["集宁市", "丰镇市", "卓资县", "化德县", "商都县", "兴和县", "凉城县", "察哈尔右翼前旗", "察哈尔右翼中旗", "察哈尔右翼后旗", "四子王旗"]
  12781. }, {
  12782. "name": "伊克昭盟",
  12783. "area": ["东胜市", "达拉特旗", "准格尔旗", "鄂托克前旗", "鄂托克旗", "杭锦旗", "乌审旗", "伊金霍洛旗"]
  12784. }, {
  12785. "name": "巴彦淖尔盟",
  12786. "area": ["临河市", "五原县", "磴口县", "乌拉特前旗", "乌拉特中旗", "乌拉特后旗", "杭锦后旗"]
  12787. }, {
  12788. "name": "阿拉善盟",
  12789. "area": ["阿拉善左旗", "阿拉善右旗", "额济纳旗"]
  12790. }]
  12791. }, {
  12792. "name": "辽宁省",
  12793. "city": [{
  12794. "name": "沈阳市",
  12795. "area": ["沈河区", "皇姑区", "和平区", "大东区", "铁西区", "苏家屯区", "东陵区", "于洪区", "新民市", "法库县", "辽中县", "康平县", "新城子区"]
  12796. }, {
  12797. "name": "大连市",
  12798. "area": ["西岗区", "中山区", "沙河口区", "甘井子区", "旅顺口区", "金州区", "瓦房店市", "普兰店市", "庄河市", "长海县"]
  12799. }, {
  12800. "name": "鞍山市",
  12801. "area": ["铁东区", "铁西区", "立山区", "千山区", "海城市", "台安县", "岫岩满族自治县"]
  12802. }, {
  12803. "name": "抚顺市",
  12804. "area": ["顺城区", "新抚区", "东洲区", "望花区", "抚顺县", "清原满族自治县", "新宾满族自治县"]
  12805. }, {
  12806. "name": "本溪市",
  12807. "area": ["平山区", "明山区", "溪湖区", "南芬区", "本溪满族自治县", "桓仁满族自治县"]
  12808. }, {
  12809. "name": "丹东市",
  12810. "area": ["振兴区", "元宝区", "振安区", "东港市", "凤城市", "宽甸满族自治县"]
  12811. }, {
  12812. "name": "锦州市",
  12813. "area": ["太和区", "古塔区", "凌河区", "凌海市", "黑山县", "义县", "北宁市"]
  12814. }, {
  12815. "name": "营口市",
  12816. "area": ["站前区", "西市区", "鲅鱼圈区", "老边区", "大石桥市", "盖州市"]
  12817. }, {
  12818. "name": "阜新市",
  12819. "area": ["海州区", "新邱区", "太平区", "清河门区", "细河区", "彰武县", "阜新蒙古族自治县"]
  12820. }, {
  12821. "name": "辽阳市",
  12822. "area": ["白塔区", "文圣区", "宏伟区", "太子河区", "弓长岭区", "灯塔市", "辽阳县"]
  12823. }, {
  12824. "name": "盘锦",
  12825. "area": ["双台子区", "兴隆台区", "盘山县", "大洼县"]
  12826. }, {
  12827. "name": "铁岭市",
  12828. "area": ["银州区", "清河区", "调兵山市", "开原市", "铁岭县", "昌图县", "西丰县"]
  12829. }, {
  12830. "name": "朝阳市",
  12831. "area": ["双塔区", "龙城区", "凌源市", "北票市", "朝阳县", "建平县", "喀喇沁左翼蒙古族自治县"]
  12832. }, {
  12833. "name": "葫芦岛市",
  12834. "area": ["龙港区", "南票区", "连山区", "兴城市", "绥中县", "建昌县"]
  12835. }]
  12836. }, {
  12837. "name": "吉林省",
  12838. "city": [{
  12839. "name": "长春市",
  12840. "area": ["朝阳区", "宽城区", "二道区", "南关区", "绿园区", "双阳区", "九台市", "榆树市", "德惠市", "农安县"]
  12841. }, {
  12842. "name": "吉林市",
  12843. "area": ["船营区", "昌邑区", "龙潭区", "丰满区", "舒兰市", "桦甸市", "蛟河市", "磐石市", "永吉县"]
  12844. }, {
  12845. "name": "四平",
  12846. "area": ["铁西区", "铁东区", "公主岭市", "双辽市", "梨树县", "伊通满族自治县"]
  12847. }, {
  12848. "name": "辽源市",
  12849. "area": ["龙山区", "西安区", "东辽县", "东丰县"]
  12850. }, {
  12851. "name": "通化市",
  12852. "area": ["东昌区", "二道江区", "梅河口市", "集安市", "通化县", "辉南县", "柳河县"]
  12853. }, {
  12854. "name": "白山市",
  12855. "area": ["八道江区", "江源区", "临江市", "靖宇县", "抚松县", "长白朝鲜族自治县"]
  12856. }, {
  12857. "name": "松原市",
  12858. "area": ["宁江区", "乾安县", "长岭县", "扶余县", "前郭尔罗斯蒙古族自治县"]
  12859. }, {
  12860. "name": "白城市",
  12861. "area": ["洮北区", "大安市", "洮南市", "镇赉县", "通榆县"]
  12862. }, {
  12863. "name": "延边朝鲜族自治州",
  12864. "area": ["延吉市", "图们市", "敦化市", "龙井市", "珲春市", "和龙市", "安图县", "汪清县"]
  12865. }]
  12866. }, {
  12867. "name": "黑龙江省",
  12868. "city": [{
  12869. "name": "哈尔滨市",
  12870. "area": ["松北区", "道里区", "南岗区", "平房区", "香坊区", "道外区", "呼兰区", "阿城区", "双城市", "尚志市", "五常市", "宾县", "方正县", "通河县", "巴彦县", "延寿县", "木兰县", "依兰县"]
  12871. }, {
  12872. "name": "齐齐哈尔市",
  12873. "area": ["龙沙区", "昂昂溪区", "铁锋区", "建华区", "富拉尔基区", "碾子山区", "梅里斯达斡尔族区", "讷河市", "富裕县", "拜泉县", "甘南县", "依安县", "克山县", "泰来县", "克东县", "龙江县"]
  12874. }, {
  12875. "name": "鹤岗市",
  12876. "area": ["兴山区", "工农区", "南山区", "兴安区", "向阳区", "东山区", "萝北县", "绥滨县"]
  12877. }, {
  12878. "name": "双鸭山",
  12879. "area": ["尖山区", "岭东区", "四方台区", "宝山区", "集贤县", "宝清县", "友谊县", "饶河县"]
  12880. }, {
  12881. "name": "鸡西市",
  12882. "area": ["鸡冠区", "恒山区", "城子河区", "滴道区", "梨树区", "麻山区", "密山市", "虎林市", "鸡东县"]
  12883. }, {
  12884. "name": "大庆市",
  12885. "area": ["萨尔图区", "红岗区", "龙凤区", "让胡路区", "大同区", "林甸县", "肇州县", "肇源县", "杜尔伯特蒙古族自治县"]
  12886. }, {
  12887. "name": "伊春市",
  12888. "area": ["伊春区", "带岭区", "南岔区", "金山屯区", "西林区", "美溪区", "乌马河区", "翠峦区", "友好区", "上甘岭区", "五营区", "红星区", "新青区", "汤旺河区", "乌伊岭区", "铁力市", "嘉荫县"]
  12889. }, {
  12890. "name": "牡丹江市",
  12891. "area": ["爱民区", "东安区", "阳明区", "西安区", "绥芬河市", "宁安市", "海林市", "穆棱市", "林口县", "东宁县"]
  12892. }, {
  12893. "name": "佳木斯市",
  12894. "area": ["向阳区", "前进区", "东风区", "郊区", "同江市", "富锦市", "桦川县", "抚远县", "桦南县", "汤原县"]
  12895. }, {
  12896. "name": "七台河市",
  12897. "area": ["桃山区", "新兴区", "茄子河区", "勃利县"]
  12898. }, {
  12899. "name": "黑河市",
  12900. "area": ["爱辉区", "北安市", "五大连池市", "逊克县", "嫩江县", "孙吴县"]
  12901. }, {
  12902. "name": "绥化市",
  12903. "area": ["北林区", "安达市", "肇东市", "海伦市", "绥棱县", "兰西县", "明水县", "青冈县", "庆安县", "望奎县"]
  12904. }, {
  12905. "name": "大兴安岭地区",
  12906. "area": ["呼玛县", "塔河县", "漠河县", "大兴安岭辖区"]
  12907. }]
  12908. }, {
  12909. "name": "上海市",
  12910. "city": [{
  12911. "name": "上海市",
  12912. "area": ["黄浦区", "卢湾区", "徐汇区", "长宁区", "静安区", "普陀区", "闸北区", "虹口区", "杨浦区", "宝山区", "闵行区", "嘉定区", "松江区", "金山区", "青浦区", "南汇区", "奉贤区", "浦东新区", "崇明县"]
  12913. }]
  12914. }, {
  12915. "name": "江苏省",
  12916. "city": [{
  12917. "name": "南京市",
  12918. "area": ["玄武区", "白下区", "秦淮区", "建邺区", "鼓楼区", "下关区", "栖霞区", "雨花台区", "浦口区", "江宁区", "六合区", "溧水县", "高淳县"]
  12919. }, {
  12920. "name": "苏州市",
  12921. "area": ["金阊区", "平江区", "沧浪区", "虎丘区", "吴中区", "相城区", "常熟市", "张家港市", "昆山市", "吴江市", "太仓市"]
  12922. }, {
  12923. "name": "无锡市",
  12924. "area": ["崇安区", "南长区", "北塘区", "滨湖区", "锡山区", "惠山区", "江阴市", "宜兴市"]
  12925. }, {
  12926. "name": "常州市",
  12927. "area": ["钟楼区", "天宁区", "戚墅堰区", "新北区", "武进区", "金坛市", "溧阳市"]
  12928. }, {
  12929. "name": "镇江市",
  12930. "area": ["京口区", "润州区", "丹徒区", "丹阳市", "扬中市", "句容市"]
  12931. }, {
  12932. "name": "南通市",
  12933. "area": ["崇川区", "港闸区", "通州市", "如皋市", "海门市", "启东市", "海安县", "如东县"]
  12934. }, {
  12935. "name": "泰州市",
  12936. "area": ["海陵区", "高港区", "姜堰市", "泰兴市", "靖江市", "兴化市"]
  12937. }, {
  12938. "name": "扬州市",
  12939. "area": ["广陵区", "维扬区", "邗江区", "江都市", "仪征市", "高邮市", "宝应县"]
  12940. }, {
  12941. "name": "盐城市",
  12942. "area": ["亭湖区", "盐都区", "大丰市", "东台市", "建湖县", "射阳县", "阜宁县", "滨海县", "响水县"]
  12943. }, {
  12944. "name": "连云港市",
  12945. "area": ["新浦区", "海州区", "连云区", "东海县", "灌云县", "赣榆县", "灌南县"]
  12946. }, {
  12947. "name": "徐州市",
  12948. "area": ["云龙区", "鼓楼区", "九里区", "泉山区", "贾汪区", "邳州市", "新沂市", "铜山县", "睢宁县", "沛县", "丰县"]
  12949. }, {
  12950. "name": "淮安市",
  12951. "area": ["清河区", "清浦区", "楚州区", "淮阴区", "涟水县", "洪泽县", "金湖县", "盱眙县"]
  12952. }, {
  12953. "name": "宿迁市",
  12954. "area": ["宿城区", "宿豫区", "沭阳县", "泗阳县", "泗洪县"]
  12955. }]
  12956. }, {
  12957. "name": "浙江省",
  12958. "city": [{
  12959. "name": "杭州市",
  12960. "area": ["拱墅区", "临平区", "西湖区", "上城区", "钱塘区", "滨江区", "余杭区", "萧山区", "建德市", "富阳市", "临安市", "桐庐县", "淳安县"]
  12961. }, {
  12962. "name": "宁波市",
  12963. "area": ["海曙区", "江东区", "江北区", "镇海区", "北仑区", "鄞州区", "余姚市", "慈溪市", "奉化市", "宁海县", "象山县"]
  12964. }, {
  12965. "name": "温州市",
  12966. "area": ["鹿城区", "龙湾区", "瓯海区", "瑞安市", "乐清市", "永嘉县", "洞头县", "平阳县", "苍南县", "文成县", "泰顺县"]
  12967. }, {
  12968. "name": "嘉兴市",
  12969. "area": ["秀城区", "秀洲区", "海宁市", "平湖市", "桐乡市", "嘉善县", "海盐县"]
  12970. }, {
  12971. "name": "湖州市",
  12972. "area": ["吴兴区", "南浔区", "长兴县", "德清县", "安吉县"]
  12973. }, {
  12974. "name": "绍兴市",
  12975. "area": ["越城区", "诸暨市", "上虞市", "嵊州市", "绍兴县", "新昌县"]
  12976. }, {
  12977. "name": "金华市",
  12978. "area": ["婺城区", "金东区", "兰溪市", "义乌市", "东阳市", "永康市", "武义县", "浦江县", "磐安县"]
  12979. }, {
  12980. "name": "衢州市",
  12981. "area": ["柯城区", "衢江区", "江山市", "龙游县", "常山县", "开化县"]
  12982. }, {
  12983. "name": "舟山市",
  12984. "area": ["定海区", "普陀区", "岱山县", "嵊泗县"]
  12985. }, {
  12986. "name": "台州市",
  12987. "area": ["椒江区", "黄岩区", "路桥区", "临海市", "温岭市", "玉环县", "天台县", "仙居县", "三门县"]
  12988. }, {
  12989. "name": "丽水市",
  12990. "area": ["莲都区", "龙泉市", "缙云县", "青田县", "云和县", "遂昌县", "松阳县", "庆元县", "景宁畲族自治县"]
  12991. }]
  12992. }, {
  12993. "name": "安徽省",
  12994. "city": [{
  12995. "name": "合肥市",
  12996. "area": ["庐阳区", "瑶海区", "蜀山区", "包河区", "长丰县", "肥东县", "肥西县"]
  12997. }, {
  12998. "name": "芜湖市",
  12999. "area": ["镜湖区", "弋江区", "鸠江区", "三山区", "芜湖县", "南陵县", "繁昌县"]
  13000. }, {
  13001. "name": "蚌埠市",
  13002. "area": ["蚌山区", "龙子湖区", "禹会区", "淮上区", "怀远县", "固镇县", "五河县"]
  13003. }, {
  13004. "name": "淮南市",
  13005. "area": ["田家庵区", "大通区", "谢家集区", "八公山区", "潘集区", "凤台县"]
  13006. }, {
  13007. "name": "马鞍山市",
  13008. "area": ["雨山区", "花山区", "金家庄区", "当涂县"]
  13009. }, {
  13010. "name": "淮北市",
  13011. "area": ["相山区", "杜集区", "烈山区", "濉溪县"]
  13012. }, {
  13013. "name": "铜陵市",
  13014. "area": ["铜官山区", "狮子山区", "郊区", "铜陵县"]
  13015. }, {
  13016. "name": "安庆市",
  13017. "area": ["迎江区", "大观区", "宜秀区", "桐城市", "宿松县", "枞阳县", "太湖县", "怀宁县", "岳西县", "望江县", "潜山县"]
  13018. }, {
  13019. "name": "黄山市",
  13020. "area": ["屯溪区", "黄山区", "徽州区", "休宁县", "歙县", "祁门县", "黟县"]
  13021. }, {
  13022. "name": "滁州市",
  13023. "area": ["琅琊区", "南谯区", "天长市", "明光市", "全椒县", "来安县", "定远县", "凤阳县"]
  13024. }, {
  13025. "name": "阜阳市",
  13026. "area": ["颍州区", "颍东区", "颍泉区", "界首市", "临泉县", "颍上县", "阜南县", "太和县"]
  13027. }, {
  13028. "name": "宿州市",
  13029. "area": ["埇桥区", "萧县", "泗县", "砀山县", "灵璧县"]
  13030. }, {
  13031. "name": "巢湖市",
  13032. "area": ["居巢区", "含山县", "无为县", "庐江县", "和县"]
  13033. }, {
  13034. "name": "六安市",
  13035. "area": ["金安区", "裕安区", "寿县", "霍山县", "霍邱县", "舒城县", "金寨县"]
  13036. }, {
  13037. "name": "亳州市",
  13038. "area": ["谯城区", "利辛县", "涡阳县", "蒙城县"]
  13039. }, {
  13040. "name": "池州市",
  13041. "area": ["贵池区", "东至县", "石台县", "青阳县"]
  13042. }, {
  13043. "name": "宣城市",
  13044. "area": ["宣州区", "宁国市", "广德县", "郎溪县", "泾县", "旌德县", "绩溪县"]
  13045. }]
  13046. }, {
  13047. "name": "福建省",
  13048. "city": [{
  13049. "name": "福州市",
  13050. "area": ["鼓楼区", "台江区", "仓山区", "马尾区", "晋安区", "福清市", "长乐市", "闽侯县", "闽清县", "永泰县", "连江县", "罗源县", "平潭县"]
  13051. }, {
  13052. "name": "厦门市",
  13053. "area": ["思明区", "海沧区", "湖里区", "集美区", "同安区", "翔安区"]
  13054. }, {
  13055. "name": "莆田市",
  13056. "area": ["城厢区", "涵江区", "荔城区", "秀屿区", "仙游县"]
  13057. }, {
  13058. "name": "三明市",
  13059. "area": ["梅列区", "三元区", "永安市", "明溪县", "将乐县", "大田县", "宁化县", "建宁县", "沙县", "尤溪县", "清流县", "泰宁县"]
  13060. }, {
  13061. "name": "泉州市",
  13062. "area": ["鲤城区", "丰泽区", "洛江区", "泉港区", "石狮市", "晋江市", "南安市", "惠安县", "永春县", "安溪县", "德化县", "金门县"]
  13063. }, {
  13064. "name": "漳州市",
  13065. "area": ["芗城区", "龙文区", "龙海市", "平和县", "南靖县", "诏安县", "漳浦县", "华安县", "东山县", "长泰县", "云霄县"]
  13066. }, {
  13067. "name": "南平市",
  13068. "area": ["延平区", "建瓯市", "邵武市", "武夷山市", "建阳市", "松溪县", "光泽县", "顺昌县", "浦城县", "政和县"]
  13069. }, {
  13070. "name": "龙岩市",
  13071. "area": ["新罗区", "漳平市", "长汀县", "武平县", "上杭县", "永定县", "连城县"]
  13072. }, {
  13073. "name": "宁德市",
  13074. "area": ["蕉城区", "福安市", "福鼎市", "寿宁县", "霞浦县", "柘荣县", "屏南县", "古田县", "周宁县"]
  13075. }]
  13076. }, {
  13077. "name": "江西省",
  13078. "city": [{
  13079. "name": "南昌市",
  13080. "area": ["东湖区", "西湖区", "青云谱区", "湾里区", "青山湖区", "新建县", "南昌县", "进贤县", "安义县"]
  13081. }, {
  13082. "name": "景德镇市",
  13083. "area": ["珠山区", "昌江区", "乐平市", "浮梁县"]
  13084. }, {
  13085. "name": "萍乡市",
  13086. "area": ["安源区", "湘东区", "莲花县", "上栗县", "芦溪县"]
  13087. }, {
  13088. "name": "九江市",
  13089. "area": ["浔阳区", "庐山区", "瑞昌市", "九江县", "星子县", "武宁县", "彭泽县", "永修县", "修水县", "湖口县", "德安县", "都昌县"]
  13090. }, {
  13091. "name": "新余市",
  13092. "area": ["渝水区", "分宜县"]
  13093. }, {
  13094. "name": "鹰潭市",
  13095. "area": ["月湖区", "贵溪市", "余江县"]
  13096. }, {
  13097. "name": "赣州市",
  13098. "area": ["章贡区", "瑞金市", "南康市", "石城县", "安远县", "赣县", "宁都县", "寻乌县", "兴国县", "定南县", "上犹县", "于都县", "龙南县", "崇义县", "信丰县", "全南县", "大余县", "会昌县"]
  13099. }, {
  13100. "name": "吉安市",
  13101. "area": ["吉州区", "青原区", "井冈山市", "吉安县", "永丰县", "永新县", "新干县", "泰和县", "峡江县", "遂川县", "安福县", "吉水县", "万安县"]
  13102. }, {
  13103. "name": "宜春市",
  13104. "area": ["袁州区", "丰城市", "樟树市", "高安市", "铜鼓县", "靖安县", "宜丰县", "奉新县", "万载县", "上高县"]
  13105. }, {
  13106. "name": "抚州市",
  13107. "area": ["临川区", "南丰县", "乐安县", "金溪县", "南城县", "东乡县", "资溪县", "宜黄县", "广昌县", "黎川县", "崇仁县"]
  13108. }, {
  13109. "name": "上饶市",
  13110. "area": ["信州区", "德兴市", "上饶县", "广丰县", "鄱阳县", "婺源县", "铅山县", "余干县", "横峰县", "弋阳县", "玉山县", "万年县"]
  13111. }]
  13112. }, {
  13113. "name": "山东省",
  13114. "city": [{
  13115. "name": "济南市",
  13116. "area": ["市中区", "历下区", "天桥区", "槐荫区", "历城区", "长清区", "章丘市", "平阴县", "济阳县", "商河县"]
  13117. }, {
  13118. "name": "青岛市",
  13119. "area": ["市南区", "市北区", "城阳区", "四方区", "李沧区", "黄岛区", "崂山区", "胶南市", "胶州市", "平度市", "莱西市", "即墨市"]
  13120. }, {
  13121. "name": "淄博市",
  13122. "area": ["张店区", "临淄区", "淄川区", "博山区", "周村区", "桓台县", "高青县", "沂源县"]
  13123. }, {
  13124. "name": "枣庄市",
  13125. "area": ["市中区", "山亭区", "峄城区", "台儿庄区", "薛城区", "滕州市"]
  13126. }, {
  13127. "name": "东营市",
  13128. "area": ["东营区", "河口区", "垦利县", "广饶县", "利津县"]
  13129. }, {
  13130. "name": "烟台市",
  13131. "area": ["芝罘区", "福山区", "牟平区", "莱山区", "龙口市", "莱阳市", "莱州市", "招远市", "蓬莱市", "栖霞市", "海阳市", "长岛县"]
  13132. }, {
  13133. "name": "潍坊市",
  13134. "area": ["潍城区", "寒亭区", "坊子区", "奎文区", "青州市", "诸城市", "寿光市", "安丘市", "高密市", "昌邑市", "昌乐县", "临朐县"]
  13135. }, {
  13136. "name": "济宁市",
  13137. "area": ["市中区", "任城区", "曲阜市", "兖州市", "邹城市", "鱼台县", "金乡县", "嘉祥县", "微山县", "汶上县", "泗水县", "梁山县"]
  13138. }, {
  13139. "name": "泰安市",
  13140. "area": ["泰山区", "岱岳区", "新泰市", "肥城市", "宁阳县", "东平县"]
  13141. }, {
  13142. "name": "威海市",
  13143. "area": ["环翠区", "乳山市", "文登市", "荣成市"]
  13144. }, {
  13145. "name": "日照市",
  13146. "area": ["东港区", "岚山区", "五莲县", "莒县"]
  13147. }, {
  13148. "name": "莱芜市",
  13149. "area": ["莱城区", "钢城区"]
  13150. }, {
  13151. "name": "临沂市",
  13152. "area": ["兰山区", "罗庄区", "河东区", "沂南县", "郯城县", "沂水县", "苍山县", "费县", "平邑县", "莒南县", "蒙阴县", "临沭县"]
  13153. }, {
  13154. "name": "德州市",
  13155. "area": ["德城区", "乐陵市", "禹城市", "陵县", "宁津县", "齐河县", "武城县", "庆云县", "平原县", "夏津县", "临邑县"]
  13156. }, {
  13157. "name": "聊城市",
  13158. "area": ["东昌府区", "临清市", "高唐县", "阳谷县", "茌平县", "莘县", "东阿县", "冠县"]
  13159. }, {
  13160. "name": "滨州市",
  13161. "area": ["滨城区", "邹平县", "沾化县", "惠民县", "博兴县", "阳信县", "无棣县"]
  13162. }, {
  13163. "name": "菏泽市",
  13164. "area": ["牡丹区", "鄄城县", "单县", "郓城县", "曹县", "定陶县", "巨野县", "东明县", "成武县"]
  13165. }]
  13166. }, {
  13167. "name": "河南省",
  13168. "city": [{
  13169. "name": "郑州市",
  13170. "area": ["中原区", "金水区", "二七区", "管城回族区", "上街区", "惠济区", "巩义市", "新郑市", "新密市", "登封市", "荥阳市", "中牟县"]
  13171. }, {
  13172. "name": "开封市",
  13173. "area": ["鼓楼区", "龙亭区", "顺河回族区", "禹王台区", "金明区", "开封县", "尉氏县", "兰考县", "杞县", "通许县"]
  13174. }, {
  13175. "name": "洛阳市",
  13176. "area": ["西工区", "老城区", "涧西区", "瀍河回族区", "洛龙区", "吉利区", "偃师市", "孟津县", "汝阳县", "伊川县", "洛宁县", "嵩县", "宜阳县", "新安县", "栾川县"]
  13177. }, {
  13178. "name": "平顶山市",
  13179. "area": ["新华区", "卫东区", "湛河区", "石龙区", "汝州市", "舞钢市", "宝丰县", "叶县", "郏县", "鲁山县"]
  13180. }, {
  13181. "name": "安阳市",
  13182. "area": ["北关区", "文峰区", "殷都区", "龙安区", "林州市", "安阳县", "滑县", "内黄县", "汤阴县"]
  13183. }, {
  13184. "name": "鹤壁市",
  13185. "area": ["淇滨区", "山城区", "鹤山区", "浚县", "淇县"]
  13186. }, {
  13187. "name": "新乡市",
  13188. "area": ["卫滨区", "红旗区", "凤泉区", "牧野区", "卫辉市", "辉县市", "新乡县", "获嘉县", "原阳县", "长垣县", "封丘县", "延津县"]
  13189. }, {
  13190. "name": "焦作市",
  13191. "area": ["解放区", "中站区", "马村区", "山阳区", "沁阳市", "孟州市", "修武县", "温县", "武陟县", "博爱县"]
  13192. }, {
  13193. "name": "濮阳市",
  13194. "area": ["华龙区", "濮阳县", "南乐县", "台前县", "清丰县", "范县"]
  13195. }, {
  13196. "name": "许昌市",
  13197. "area": ["魏都区", "禹州市", "长葛市", "许昌县", "鄢陵县", "襄城县"]
  13198. }, {
  13199. "name": "漯河市",
  13200. "area": ["源汇区", "郾城区", "召陵区", "临颍县", "舞阳县"]
  13201. }, {
  13202. "name": "三门峡市",
  13203. "area": ["湖滨区", "义马市", "灵宝市", "渑池县", "卢氏县", "陕县"]
  13204. }, {
  13205. "name": "南阳市",
  13206. "area": ["卧龙区", "宛城区", "邓州市", "桐柏县", "方城县", "淅川县", "镇平县", "唐河县", "南召县", "内乡县", "新野县", "社旗县", "西峡县"]
  13207. }, {
  13208. "name": "商丘市",
  13209. "area": ["梁园区", "睢阳区", "永城市", "宁陵县", "虞城县", "民权县", "夏邑县", "柘城县", "睢县"]
  13210. }, {
  13211. "name": "信阳市",
  13212. "area": ["浉河区", "平桥区", "潢川县", "淮滨县", "息县", "新县", "商城县", "固始县", "罗山县", "光山县"]
  13213. }, {
  13214. "name": "周口市",
  13215. "area": ["川汇区", "项城市", "商水县", "淮阳县", "太康县", "鹿邑县", "西华县", "扶沟县", "沈丘县", "郸城县"]
  13216. }, {
  13217. "name": "驻马店市",
  13218. "area": ["驿城区", "确山县", "新蔡县", "上蔡县", "西平县", "泌阳县", "平舆县", "汝南县", "遂平县", "正阳县"]
  13219. }, {
  13220. "name": "焦作市",
  13221. "area": ["济源市"]
  13222. }]
  13223. }, {
  13224. "name": "湖北省",
  13225. "city": [{
  13226. "name": "武汉市",
  13227. "area": ["江岸区", "武昌区", "江汉区", "硚口区", "汉阳区", "青山区", "洪山区", "东西湖区", "汉南区", "蔡甸区", "江夏区", "黄陂区", "新洲区"]
  13228. }, {
  13229. "name": "黄石市",
  13230. "area": ["黄石港区", "西塞山区", "下陆区", "铁山区", "大冶市", "阳新县"]
  13231. }, {
  13232. "name": "十堰市",
  13233. "area": ["张湾区", "茅箭区", "丹江口市", "郧县", "竹山县", "房县", "郧西县", "竹溪县"]
  13234. }, {
  13235. "name": "荆州市",
  13236. "area": ["沙市区", "荆州区", "洪湖市", "石首市", "松滋市", "监利县", "公安县", "江陵县"]
  13237. }, {
  13238. "name": "宜昌市",
  13239. "area": ["西陵区", "伍家岗区", "点军区", "猇亭区", "夷陵区", "宜都市", "当阳市", "枝江市", "秭归县", "远安县", "兴山县", "五峰土家族自治县", "长阳土家族自治县"]
  13240. }, {
  13241. "name": "襄樊市",
  13242. "area": ["襄城区", "樊城区", "襄阳区", "老河口市", "枣阳市", "宜城市", "南漳县", "谷城县", "保康县"]
  13243. }, {
  13244. "name": "鄂州市",
  13245. "area": ["鄂城区", "华容区", "梁子湖区"]
  13246. }, {
  13247. "name": "荆门市",
  13248. "area": ["东宝区", "掇刀区", "钟祥市", "京山县", "沙洋县"]
  13249. }, {
  13250. "name": "孝感市",
  13251. "area": ["孝南区", "应城市", "安陆市", "汉川市", "云梦县", "大悟县", "孝昌县"]
  13252. }, {
  13253. "name": "黄冈市",
  13254. "area": ["黄州区", "麻城市", "武穴市", "红安县", "罗田县", "浠水县", "蕲春县", "黄梅县", "英山县", "团风县"]
  13255. }, {
  13256. "name": "咸宁市",
  13257. "area": ["咸安区", "赤壁市", "嘉鱼县", "通山县", "崇阳县", "通城县"]
  13258. }, {
  13259. "name": "随州市",
  13260. "area": ["曾都区", "广水市"]
  13261. }, {
  13262. "name": "恩施土家族苗族自治州",
  13263. "area": ["恩施市", "利川市", "建始县", "来凤县", "巴东县", "鹤峰县", "宣恩县", "咸丰县"]
  13264. }, {
  13265. "name": "仙桃市",
  13266. "area": ["仙桃"]
  13267. }, {
  13268. "name": "天门市",
  13269. "area": ["天门"]
  13270. }, {
  13271. "name": "潜江市",
  13272. "area": ["潜江"]
  13273. }, {
  13274. "name": "神农架林区",
  13275. "area": ["神农架林区"]
  13276. }]
  13277. }, {
  13278. "name": "湖南省",
  13279. "city": [{
  13280. "name": "长沙市",
  13281. "area": ["岳麓区", "芙蓉区", "天心区", "开福区", "雨花区", "浏阳市", "长沙县", "望城县", "宁乡县"]
  13282. }, {
  13283. "name": "株洲市",
  13284. "area": ["天元区", "荷塘区", "芦淞区", "石峰区", "醴陵市", "株洲县", "炎陵县", "茶陵县", "攸县"]
  13285. }, {
  13286. "name": "湘潭市",
  13287. "area": ["岳塘区", "雨湖区", "湘乡市", "韶山市", "湘潭县"]
  13288. }, {
  13289. "name": "衡阳市",
  13290. "area": ["雁峰区", "珠晖区", "石鼓区", "蒸湘区", "南岳区", "耒阳市", "常宁市", "衡阳县", "衡东县", "衡山县", "衡南县", "祁东县"]
  13291. }, {
  13292. "name": "邵阳市",
  13293. "area": ["双清区", "大祥区", "北塔区", "武冈市", "邵东县", "洞口县", "新邵县", "绥宁县", "新宁县", "邵阳县", "隆回县", "城步苗族自治县"]
  13294. }, {
  13295. "name": "岳阳市",
  13296. "area": ["岳阳楼区", "云溪区", "君山区", "临湘市", "汨罗市", "岳阳县", "湘阴县", "平江县", "华容县"]
  13297. }, {
  13298. "name": "常德市",
  13299. "area": ["武陵区", "鼎城区", "津市市", "澧县", "临澧县", "桃源县", "汉寿县", "安乡县", "石门县"]
  13300. }, {
  13301. "name": "张家界市",
  13302. "area": ["永定区", "武陵源区", "慈利县", "桑植县"]
  13303. }, {
  13304. "name": "益阳市",
  13305. "area": ["赫山区", "资阳区", "沅江市", "桃江县", "南县", "安化县"]
  13306. }, {
  13307. "name": "郴州市",
  13308. "area": ["北湖区", "苏仙区", "资兴市", "宜章县", "汝城县", "安仁县", "嘉禾县", "临武县", "桂东县", "永兴县", "桂阳县"]
  13309. }, {
  13310. "name": "永州市",
  13311. "area": ["冷水滩区", "零陵区", "祁阳县", "蓝山县", "宁远县", "新田县", "东安县", "江永县", "道县", "双牌县", "江华瑶族自治县"]
  13312. }, {
  13313. "name": "怀化市",
  13314. "area": ["鹤城区", "洪江市", "会同县", "沅陵县", "辰溪县", "溆浦县", "中方县", "新晃侗族自治县", "芷江侗族自治县", "通道侗族自治县", "靖州苗族侗族自治县", "麻阳苗族自治县"]
  13315. }, {
  13316. "name": "娄底市",
  13317. "area": ["娄星区", "冷水江市", "涟源市", "新化县", "双峰县"]
  13318. }, {
  13319. "name": "湘西土家族苗族自治州",
  13320. "area": ["吉首市", "古丈县", "龙山县", "永顺县", "凤凰县", "泸溪县", "保靖县", "花垣县"]
  13321. }]
  13322. }, {
  13323. "name": "广东省",
  13324. "city": [{
  13325. "name": "广州市",
  13326. "area": ["越秀区", "荔湾区", "海珠区", "天河区", "白云区", "黄埔区", "番禺区", "花都区", "南沙区", "萝岗区", "增城市", "从化市"]
  13327. }, {
  13328. "name": "深圳市",
  13329. "area": ["福田区", "罗湖区", "南山区", "宝安区", "龙岗区", "盐田区"]
  13330. }, {
  13331. "name": "东莞市",
  13332. "area": ["莞城", "常平", "塘厦", "塘厦", "塘厦"]
  13333. }, {
  13334. "name": "中山市",
  13335. "area": ["中山"]
  13336. }, {
  13337. "name": "潮州市",
  13338. "area": ["湘桥区", "潮安县", "饶平县"]
  13339. }, {
  13340. "name": "揭阳市",
  13341. "area": ["榕城区", "揭东县", "揭西县", "惠来县", "普宁市"]
  13342. }, {
  13343. "name": "云浮市",
  13344. "area": ["云城区", "新兴县", "郁南县", "云安县", "罗定市"]
  13345. }, {
  13346. "name": "珠海市",
  13347. "area": ["香洲区", "斗门区", "金湾区"]
  13348. }, {
  13349. "name": "汕头市",
  13350. "area": ["金平区", "濠江区", "龙湖区", "潮阳区", "潮南区", "澄海区", "南澳县"]
  13351. }, {
  13352. "name": "韶关市",
  13353. "area": ["浈江区", "武江区", "曲江区", "乐昌市", "南雄市", "始兴县", "仁化县", "翁源县", "新丰县", "乳源瑶族自治县"]
  13354. }, {
  13355. "name": "佛山市",
  13356. "area": ["禅城区", "南海区", "顺德区", "三水区", "高明区"]
  13357. }, {
  13358. "name": "江门市",
  13359. "area": ["蓬江区", "江海区", "新会区", "恩平市", "台山市", "开平市", "鹤山市"]
  13360. }, {
  13361. "name": "湛江市",
  13362. "area": ["赤坎区", "霞山区", "坡头区", "麻章区", "吴川市", "廉江市", "雷州市", "遂溪县", "徐闻县"]
  13363. }, {
  13364. "name": "茂名市",
  13365. "area": ["茂南区", "茂港区", "化州市", "信宜市", "高州市", "电白县"]
  13366. }, {
  13367. "name": "肇庆市",
  13368. "area": ["端州区", "鼎湖区", "高要市", "四会市", "广宁县", "怀集县", "封开县", "德庆县"]
  13369. }, {
  13370. "name": "惠州市",
  13371. "area": ["惠城区", "惠阳区", "博罗县", "惠东县", "龙门县"]
  13372. }, {
  13373. "name": "梅州市",
  13374. "area": ["梅江区", "兴宁市", "梅县", "大埔县", "丰顺县", "五华县", "平远县", "蕉岭县"]
  13375. }, {
  13376. "name": "汕尾市",
  13377. "area": ["城区", "陆丰市", "海丰县", "陆河县"]
  13378. }, {
  13379. "name": "河源市",
  13380. "area": ["源城区", "紫金县", "龙川县", "连平县", "和平县", "东源县"]
  13381. }, {
  13382. "name": "阳江市",
  13383. "area": ["江城区", "阳春市", "阳西县", "阳东县"]
  13384. }, {
  13385. "name": "清远市",
  13386. "area": ["清城区", "英德市", "连州市", "佛冈县", "阳山县", "清新县", "连山壮族瑶族自治县", "连南瑶族自治县"]
  13387. }]
  13388. }, {
  13389. "name": "广西",
  13390. "city": [{
  13391. "name": "南宁市",
  13392. "area": ["青秀区", "兴宁区", "西乡塘区", "良庆区", "江南区", "邕宁区", "武鸣县", "隆安县", "马山县", "上林县", "宾阳县", "横县"]
  13393. }, {
  13394. "name": "柳州市",
  13395. "area": ["城中区", "鱼峰区", "柳北区", "柳南区", "柳江县", "柳城县", "鹿寨县", "融安县", "融水苗族自治县", "三江侗族自治县"]
  13396. }, {
  13397. "name": "桂林市",
  13398. "area": ["象山区", "秀峰区", "叠彩区", "七星区", "雁山区", "阳朔县", "临桂县", "灵川县", "全州县", "平乐县", "兴安县", "灌阳县", "荔浦县", "资源县", "永福县", "龙胜各族自治县", "恭城瑶族自治县"]
  13399. }, {
  13400. "name": "梧州市",
  13401. "area": ["万秀区", "蝶山区", "长洲区", "岑溪市", "苍梧县", "藤县", "蒙山县"]
  13402. }, {
  13403. "name": "北海市",
  13404. "area": ["海城区", "银海区", "铁山港区", "合浦县"]
  13405. }, {
  13406. "name": "防城港市",
  13407. "area": ["港口区", "防城区", "东兴市", "上思县"]
  13408. }, {
  13409. "name": "钦州市",
  13410. "area": ["钦南区", "钦北区", "灵山县", "浦北县"]
  13411. }, {
  13412. "name": "贵港市",
  13413. "area": ["港北区", "港南区", "覃塘区", "桂平市", "平南县"]
  13414. }, {
  13415. "name": "玉林市",
  13416. "area": ["玉州区", "北流市", "容县", "陆川县", "博白县", "兴业县"]
  13417. }, {
  13418. "name": "百色市",
  13419. "area": ["右江区", "凌云县", "平果县", "西林县", "乐业县", "德保县", "田林县", "田阳县", "靖西县", "田东县", "那坡县", "隆林各族自治县"]
  13420. }, {
  13421. "name": "贺州市",
  13422. "area": ["八步区", "钟山县", "昭平县", "富川瑶族自治县"]
  13423. }, {
  13424. "name": "河池市",
  13425. "area": ["金城江区", "宜州市", "天峨县", "凤山县", "南丹县", "东兰县", "都安瑶族自治县", "罗城仫佬族自治县", "巴马瑶族自治县", "环江毛南族自治县", "大化瑶族自治县"]
  13426. }, {
  13427. "name": "来宾市",
  13428. "area": ["兴宾区", "合山市", "象州县", "武宣县", "忻城县", "金秀瑶族自治县"]
  13429. }, {
  13430. "name": "崇左市",
  13431. "area": ["江州区", "凭祥市", "宁明县", "扶绥县", "龙州县", "大新县", "天等县"]
  13432. }]
  13433. }, {
  13434. "name": "海南省",
  13435. "city": [{
  13436. "name": "海口市",
  13437. "area": ["龙华区", "秀英区", "琼山区", "美兰区"]
  13438. }, {
  13439. "name": "三亚市",
  13440. "area": ["三亚市"]
  13441. }, {
  13442. "name": "五指山市",
  13443. "area": ["五指山"]
  13444. }, {
  13445. "name": "琼海市",
  13446. "area": ["琼海"]
  13447. }, {
  13448. "name": "儋州市",
  13449. "area": ["儋州"]
  13450. }, {
  13451. "name": "文昌市",
  13452. "area": ["文昌"]
  13453. }, {
  13454. "name": "万宁市",
  13455. "area": ["万宁"]
  13456. }, {
  13457. "name": "东方市",
  13458. "area": ["东方"]
  13459. }, {
  13460. "name": "澄迈县",
  13461. "area": ["澄迈县"]
  13462. }, {
  13463. "name": "定安县",
  13464. "area": ["定安县"]
  13465. }, {
  13466. "name": "屯昌县",
  13467. "area": ["屯昌县"]
  13468. }, {
  13469. "name": "临高县",
  13470. "area": ["临高县"]
  13471. }, {
  13472. "name": "白沙黎族自治县",
  13473. "area": ["白沙黎族自治县"]
  13474. }, {
  13475. "name": "昌江黎族自治县",
  13476. "area": ["昌江黎族自治县"]
  13477. }, {
  13478. "name": "乐东黎族自治县",
  13479. "area": ["乐东黎族自治县"]
  13480. }, {
  13481. "name": "陵水黎族自治县",
  13482. "area": ["陵水黎族自治县"]
  13483. }, {
  13484. "name": "保亭黎族苗族自治县",
  13485. "area": ["保亭黎族苗族自治县"]
  13486. }, {
  13487. "name": "琼中黎族苗族自治县",
  13488. "area": ["琼中黎族苗族自治县"]
  13489. }]
  13490. }, {
  13491. "name": "重庆市",
  13492. "city": [{
  13493. "name": "重庆市",
  13494. "area": ["渝中区", "大渡口区", "江北区", "南岸区", "北碚区", "渝北区", "巴南区", "长寿区", "双桥区", "沙坪坝区", "万盛区", "万州区", "涪陵区", "黔江区", "永川区", "合川区", "江津区", "九龙坡区", "南川区", "綦江县", "潼南县", "荣昌县", "璧山县", "大足县", "铜梁县", "梁平县", "开县", "忠县", "城口县", "垫江县", "武隆县", "丰都县", "奉节县", "云阳县", "巫溪县", "巫山县", "石柱土家族自治县", "秀山土家族苗族自治县", "酉阳土家族苗族自治县", "彭水苗族土家族自治县"]
  13495. }]
  13496. }, {
  13497. "name": "四川省",
  13498. "city": [{
  13499. "name": "成都市",
  13500. "area": ["青羊区", "锦江区", "金牛区", "武侯区", "成华区", "龙泉驿区", "青白江区", "新都区", "温江区", "都江堰市", "彭州市", "邛崃市", "崇州市", "金堂县", "郫县", "新津县", "双流县", "蒲江县", "大邑县"]
  13501. }, {
  13502. "name": "自贡市",
  13503. "area": ["大安区", "自流井区", "贡井区", "沿滩区", "荣县", "富顺县"]
  13504. }, {
  13505. "name": "攀枝花市",
  13506. "area": ["仁和区", "米易县", "盐边县", "东区", "西区"]
  13507. }, {
  13508. "name": "泸州市",
  13509. "area": ["江阳区", "纳溪区", "龙马潭区", "泸县", "合江县", "叙永县", "古蔺县"]
  13510. }, {
  13511. "name": "德阳市",
  13512. "area": ["旌阳区", "广汉市", "什邡市", "绵竹市", "罗江县", "中江县"]
  13513. }, {
  13514. "name": "绵阳市",
  13515. "area": ["涪城区", "游仙区", "江油市", "盐亭县", "三台县", "平武县", "安县", "梓潼县", "北川羌族自治县"]
  13516. }, {
  13517. "name": "广元市",
  13518. "area": ["元坝区", "朝天区", "青川县", "旺苍县", "剑阁县", "苍溪县", "市中区"]
  13519. }, {
  13520. "name": "遂宁市",
  13521. "area": ["船山区", "安居区", "射洪县", "蓬溪县", "大英县"]
  13522. }, {
  13523. "name": "内江市",
  13524. "area": ["市中区", "东兴区", "资中县", "隆昌县", "威远县"]
  13525. }, {
  13526. "name": "乐山市",
  13527. "area": ["市中区", "五通桥区", "沙湾区", "金口河区", "峨眉山市", "夹江县", "井研县", "犍为县", "沐川县", "马边彝族自治县", "峨边彝族自治县"]
  13528. }, {
  13529. "name": "南充",
  13530. "area": ["顺庆区", "高坪区", "嘉陵区", "阆中市", "营山县", "蓬安县", "仪陇县", "南部县", "西充县"]
  13531. }, {
  13532. "name": "眉山市",
  13533. "area": ["东坡区", "仁寿县", "彭山县", "洪雅县", "丹棱县", "青神县"]
  13534. }, {
  13535. "name": "宜宾市",
  13536. "area": ["翠屏区", "宜宾县", "兴文县", "南溪县", "珙县", "长宁县", "高县", "江安县", "筠连县", "屏山县"]
  13537. }, {
  13538. "name": "广安市",
  13539. "area": ["广安区", "华蓥市", "岳池县", "邻水县", "武胜县"]
  13540. }, {
  13541. "name": "达州市",
  13542. "area": ["通川区", "万源市", "达县", "渠县", "宣汉县", "开江县", "大竹县"]
  13543. }, {
  13544. "name": "雅安市",
  13545. "area": ["雨城区", "芦山县", "石棉县", "名山县", "天全县", "荥经县", "宝兴县", "汉源县"]
  13546. }, {
  13547. "name": "巴中市",
  13548. "area": ["巴州区", "南江县", "平昌县", "通江县"]
  13549. }, {
  13550. "name": "资阳市",
  13551. "area": ["雁江区", "简阳市", "安岳县", "乐至县"]
  13552. }, {
  13553. "name": "阿坝藏族羌族自治州",
  13554. "area": ["马尔康县", "九寨沟县", "红原县", "汶川县", "阿坝县", "理县", "若尔盖县", "小金县", "黑水县", "金川县", "松潘县", "壤塘县", "茂县"]
  13555. }, {
  13556. "name": "甘孜藏族自治州",
  13557. "area": ["康定县", "丹巴县", "炉霍县", "九龙县", "甘孜县", "雅江县", "新龙县", "道孚县", "白玉县", "理塘县", "德格县", "乡城县", "石渠县", "稻城县", "色达县", "巴塘县", "泸定县", "得荣县"]
  13558. }, {
  13559. "name": "凉山彝族自治州",
  13560. "area": ["西昌市", "美姑县", "昭觉县", "金阳县", "甘洛县", "布拖县", "雷波县", "普格县", "宁南县", "喜德县", "会东县", "越西县", "会理县", "盐源县", "德昌县", "冕宁县", "木里藏族自治县"]
  13561. }]
  13562. }, {
  13563. "name": "贵州省",
  13564. "city": [{
  13565. "name": "贵阳市",
  13566. "area": ["南明区", "云岩区", "花溪区", "乌当区", "白云区", "小河区", "清镇市", "开阳县", "修文县", "息烽县"]
  13567. }, {
  13568. "name": "六盘水市",
  13569. "area": ["钟山区", "水城县", "盘县", "六枝特区"]
  13570. }, {
  13571. "name": "遵义市",
  13572. "area": ["红花岗区", "汇川区", "赤水市", "仁怀市", "遵义县", "绥阳县", "桐梓县", "习水县", "凤冈县", "正安县", "余庆县", "湄潭县", "道真仡佬族苗族自治县", "务川仡佬族苗族自治县"]
  13573. }, {
  13574. "name": "安顺市",
  13575. "area": ["西秀区", "普定县", "平坝县", "镇宁布依族苗族自治县", "紫云苗族布依族自治县", "关岭布依族苗族自治县"]
  13576. }, {
  13577. "name": "铜仁地区",
  13578. "area": ["铜仁市", "德江县", "江口县", "思南县", "石阡县", "玉屏侗族自治县", "松桃苗族自治县", "印江土家族苗族自治县", "沿河土家族自治县", "万山特区"]
  13579. }, {
  13580. "name": "毕节地区",
  13581. "area": ["毕节市", "黔西县", "大方县", "织金县", "金沙县", "赫章县", "纳雍县", "威宁彝族回族苗族自治县"]
  13582. }, {
  13583. "name": "黔西南布依族苗族自治州",
  13584. "area": ["兴义市", "望谟县", "兴仁县", "普安县", "册亨县", "晴隆县", "贞丰县", "安龙县"]
  13585. }, {
  13586. "name": "黔东南苗族侗族自治州",
  13587. "area": ["凯里市", "施秉县", "从江县", "锦屏县", "镇远县", "麻江县", "台江县", "天柱县", "黄平县", "榕江县", "剑河县", "三穗县", "雷山县", "黎平县", "岑巩县", "丹寨县"]
  13588. }, {
  13589. "name": "黔南布依族苗族自治州",
  13590. "area": ["都匀市", "福泉市", "贵定县", "惠水县", "罗甸县", "瓮安县", "荔波县", "龙里县", "平塘县", "长顺县", "独山县", "三都水族自治县"]
  13591. }]
  13592. }, {
  13593. "name": "云南省",
  13594. "city": [{
  13595. "name": "昆明市",
  13596. "area": ["盘龙区", "五华区", "官渡区", "西山区", "东川区", "安宁市", "呈贡县", "晋宁县", "富民县", "宜良县", "嵩明县", "石林彝族自治县", "禄劝彝族苗族自治县", "寻甸回族彝族自治县"]
  13597. }, {
  13598. "name": "曲靖市",
  13599. "area": ["麒麟区", "宣威市", "马龙县", "沾益县", "富源县", "罗平县", "师宗县", "陆良县", "会泽县"]
  13600. }, {
  13601. "name": "玉溪市",
  13602. "area": ["红塔区", "江川县", "澄江县", "通海县", "华宁县", "易门县", "峨山彝族自治县", "新平彝族傣族自治县", "元江哈尼族彝族傣族自治县"]
  13603. }, {
  13604. "name": "保山市",
  13605. "area": ["隆阳区", "施甸县", "腾冲县", "龙陵县", "昌宁县"]
  13606. }, {
  13607. "name": "昭通市",
  13608. "area": ["昭阳区", "鲁甸县", "巧家县", "盐津县", "大关县", "永善县", "绥江县", "镇雄县", "彝良县", "威信县", "水富县"]
  13609. }, {
  13610. "name": "丽江市",
  13611. "area": ["古城区", "永胜县", "华坪县", "玉龙纳西族自治县", "宁蒗彝族自治县"]
  13612. }, {
  13613. "name": "普洱市",
  13614. "area": ["思茅区", "普洱哈尼族彝族自治县", "墨江哈尼族自治县", "景东彝族自治县", "景谷傣族彝族自治县", "镇沅彝族哈尼族拉祜族自治县", "江城哈尼族彝族自治县", "孟连傣族拉祜族佤族自治县", "澜沧拉祜族自治县", "西盟佤族自治县"]
  13615. }, {
  13616. "name": "临沧市",
  13617. "area": ["临翔区", "凤庆县", "云县", "永德县", "镇康县", "双江拉祜族佤族布朗族傣族自治县", "耿马傣族佤族自治县", "沧源佤族自治县"]
  13618. }, {
  13619. "name": "德宏傣族景颇族自治州",
  13620. "area": ["潞西市", "瑞丽市", "梁河县", "盈江县", "陇川县"]
  13621. }, {
  13622. "name": "怒江傈僳族自治州",
  13623. "area": ["泸水县", "福贡县", "贡山独龙族怒族自治县", "兰坪白族普米族自治县"]
  13624. }, {
  13625. "name": "迪庆藏族自治州",
  13626. "area": ["香格里拉县", "德钦县", "维西傈僳族自治县"]
  13627. }, {
  13628. "name": "大理白族自治州",
  13629. "area": ["大理市", "祥云县", "宾川县", "弥渡县", "永平县", "云龙县", "洱源县", "剑川县", "鹤庆县", "漾濞彝族自治县", "南涧彝族自治县", "巍山彝族回族自治县"]
  13630. }, {
  13631. "name": "楚雄彝族自治州",
  13632. "area": ["楚雄市", "双柏县", "牟定县", "南华县", "姚安县", "大姚县", "永仁县", "元谋县", "武定县", "禄丰县"]
  13633. }, {
  13634. "name": "红河哈尼族彝族自治州",
  13635. "area": ["蒙自县", "个旧市", "开远市", "绿春县", "建水县", "石屏县", "弥勒县", "泸西县", "元阳县", "红河县", "金平苗族瑶族傣族自治县", "河口瑶族自治县", "屏边苗族自治县"]
  13636. }, {
  13637. "name": "文山壮族苗族自治州",
  13638. "area": ["文山县", "砚山县", "西畴县", "麻栗坡县", "马关县", "丘北县", "广南县", "富宁县"]
  13639. }, {
  13640. "name": "西双版纳傣族自治州",
  13641. "area": ["景洪市", "勐海县", "勐腊县"]
  13642. }]
  13643. }, {
  13644. "name": "西藏",
  13645. "city": [{
  13646. "name": "拉萨市",
  13647. "area": ["城关区", "林周县", "当雄县", "尼木县", "曲水县", "堆龙德庆县", "达孜县", "墨竹工卡县"]
  13648. }, {
  13649. "name": "那曲地区",
  13650. "area": ["那曲县", "嘉黎县", "比如县", "聂荣县", "安多县", "申扎县", "索县", "班戈县", "巴青县", "尼玛县"]
  13651. }, {
  13652. "name": "昌都地区",
  13653. "area": ["昌都县", "江达县", "贡觉县", "类乌齐县", "丁青县", "察雅县", "八宿县", "左贡县", "芒康县", "洛隆县", "边坝县"]
  13654. }, {
  13655. "name": "林芝地区",
  13656. "area": ["林芝县", "工布江达县", "米林县", "墨脱县", "波密县", "察隅县", "朗县"]
  13657. }, {
  13658. "name": "山南地区",
  13659. "area": ["乃东县", "扎囊县", "贡嘎县", "桑日县", "琼结县", "曲松县", "措美县", "洛扎县", "加查县", "隆子县", "错那县", "浪卡子县"]
  13660. }, {
  13661. "name": "日喀则地区",
  13662. "area": ["日喀则市", "南木林县", "江孜县", "定日县", "萨迦县", "拉孜县", "昂仁县", "谢通门县", "白朗县", "仁布县", "康马县", "定结县", "仲巴县", "亚东县", "吉隆县", "聂拉木县", "萨嘎县", "岗巴县"]
  13663. }, {
  13664. "name": "阿里地区",
  13665. "area": ["噶尔县", "普兰县", "札达县", "日土县", "革吉县", "改则县", "措勤县"]
  13666. }]
  13667. }, {
  13668. "name": "陕西省",
  13669. "city": [{
  13670. "name": "西安市",
  13671. "area": ["莲湖区", "新城区", "碑林区", "雁塔区", "灞桥区", "未央区", "阎良区", "临潼区", "长安区", "高陵县", "蓝田县", "户县", "周至县"]
  13672. }, {
  13673. "name": "铜川市",
  13674. "area": ["耀州区", "王益区", "印台区", "宜君县"]
  13675. }, {
  13676. "name": "宝鸡市",
  13677. "area": ["渭滨区", "金台区", "陈仓区", "岐山县", "凤翔县", "陇县", "太白县", "麟游县", "扶风县", "千阳县", "眉县", "凤县"]
  13678. }, {
  13679. "name": "咸阳市",
  13680. "area": ["秦都区", "渭城区", "杨陵区", "兴平市", "礼泉县", "泾阳县", "永寿县", "三原县", "彬县", "旬邑县", "长武县", "乾县", "武功县", "淳化县"]
  13681. }, {
  13682. "name": "渭南市",
  13683. "area": ["临渭区", "韩城市", "华阴市", "蒲城县", "潼关县", "白水县", "澄城县", "华县", "合阳县", "富平县", "大荔县"]
  13684. }, {
  13685. "name": "延安市",
  13686. "area": ["宝塔区", "安塞县", "洛川县", "子长县", "黄陵县", "延川县", "富县", "延长县", "甘泉县", "宜川县", "志丹县", "黄龙县", "吴起县"]
  13687. }, {
  13688. "name": "汉中市",
  13689. "area": ["汉台区", "留坝县", "镇巴县", "城固县", "南郑县", "洋县", "宁强县", "佛坪县", "勉县", "西乡县", "略阳县"]
  13690. }, {
  13691. "name": "榆林市",
  13692. "area": ["榆阳区", "清涧县", "绥德县", "神木县", "佳县", "府谷县", "子洲县", "靖边县", "横山县", "米脂县", "吴堡县", "定边县"]
  13693. }, {
  13694. "name": "安康市",
  13695. "area": ["汉滨区", "紫阳县", "岚皋县", "旬阳县", "镇坪县", "平利县", "石泉县", "宁陕县", "白河县", "汉阴县"]
  13696. }, {
  13697. "name": "商洛市",
  13698. "area": ["商州区", "镇安县", "山阳县", "洛南县", "商南县", "丹凤县", "柞水县"]
  13699. }]
  13700. }, {
  13701. "name": "甘肃省",
  13702. "city": [{
  13703. "name": "兰州市",
  13704. "area": ["城关区", "七里河区", "西固区", "安宁区", "红古区", "永登县", "皋兰县", "榆中县"]
  13705. }, {
  13706. "name": "嘉峪关市",
  13707. "area": ["嘉峪关市"]
  13708. }, {
  13709. "name": "金昌市",
  13710. "area": ["金川区", "永昌县"]
  13711. }, {
  13712. "name": "白银市",
  13713. "area": ["白银区", "平川区", "靖远县", "会宁县", "景泰县"]
  13714. }, {
  13715. "name": "天水市",
  13716. "area": ["清水县", "秦安县", "甘谷县", "武山县", "张家川回族自治县", "北道区", "秦城区"]
  13717. }, {
  13718. "name": "武威市",
  13719. "area": ["凉州区", "民勤县", "古浪县", "天祝藏族自治县"]
  13720. }, {
  13721. "name": "酒泉市",
  13722. "area": ["肃州区", "玉门市", "敦煌市", "金塔县", "肃北蒙古族自治县", "阿克塞哈萨克族自治县", "安西县"]
  13723. }, {
  13724. "name": "张掖市",
  13725. "area": ["甘州区", "民乐县", "临泽县", "高台县", "山丹县", "肃南裕固族自治县"]
  13726. }, {
  13727. "name": "庆阳市",
  13728. "area": ["西峰区", "庆城县", "环县", "华池县", "合水县", "正宁县", "宁县", "镇原县"]
  13729. }, {
  13730. "name": "平凉市",
  13731. "area": ["崆峒区", "泾川县", "灵台县", "崇信县", "华亭县", "庄浪县", "静宁县"]
  13732. }, {
  13733. "name": "定西市",
  13734. "area": ["安定区", "通渭县", "临洮县", "漳县", "岷县", "渭源县", "陇西县"]
  13735. }, {
  13736. "name": "陇南市",
  13737. "area": ["武都区", "成县", "宕昌县", "康县", "文县", "西和县", "礼县", "两当县", "徽县"]
  13738. }, {
  13739. "name": "临夏回族自治州",
  13740. "area": ["临夏市", "临夏县", "康乐县", "永靖县", "广河县", "和政县", "东乡族自治县", "积石山保安族东乡族撒拉族自治县"]
  13741. }, {
  13742. "name": "甘南藏族自治州",
  13743. "area": ["合作市", "临潭县", "卓尼县", "舟曲县", "迭部县", "玛曲县", "碌曲县", "夏河县"]
  13744. }]
  13745. }, {
  13746. "name": "青海省",
  13747. "city": [{
  13748. "name": "西宁市",
  13749. "area": ["城中区", "城东区", "城西区", "城北区", "湟源县", "湟中县", "大通回族土族自治县"]
  13750. }, {
  13751. "name": "海东地区",
  13752. "area": ["平安县", "乐都县", "民和回族土族自治县", "互助土族自治县", "化隆回族自治县", "循化撒拉族自治县"]
  13753. }, {
  13754. "name": "海北藏族自治州",
  13755. "area": ["海晏县", "祁连县", "刚察县", "门源回族自治县"]
  13756. }, {
  13757. "name": "海南藏族自治州",
  13758. "area": ["共和县", "同德县", "贵德县", "兴海县", "贵南县"]
  13759. }, {
  13760. "name": "黄南藏族自治州",
  13761. "area": ["同仁县", "尖扎县", "泽库县", "河南蒙古族自治县"]
  13762. }, {
  13763. "name": "果洛藏族自治州",
  13764. "area": ["玛沁县", "班玛县", "甘德县", "达日县", "久治县", "玛多县"]
  13765. }, {
  13766. "name": "玉树藏族自治州",
  13767. "area": ["玉树县", "杂多县", "称多县", "治多县", "囊谦县", "曲麻莱县"]
  13768. }, {
  13769. "name": "海西蒙古族藏族自治州",
  13770. "area": ["德令哈市", "格尔木市", "乌兰县", "都兰县", "天峻县"]
  13771. }]
  13772. }, {
  13773. "name": "宁夏",
  13774. "city": [{
  13775. "name": "银川市",
  13776. "area": ["兴庆区", "西夏区", "金凤区", "灵武市", "永宁县", "贺兰县"]
  13777. }, {
  13778. "name": "石嘴山市",
  13779. "area": ["大武口区", "惠农区", "平罗县"]
  13780. }, {
  13781. "name": "吴忠市",
  13782. "area": ["利通区", "青铜峡市", "盐池县", "同心县"]
  13783. }, {
  13784. "name": "固原市",
  13785. "area": ["原州区", "西吉县", "隆德县", "泾源县", "彭阳县"]
  13786. }, {
  13787. "name": "中卫市",
  13788. "area": ["沙坡头区", "中宁县", "海原县"]
  13789. }]
  13790. }, {
  13791. "name": "新疆",
  13792. "city": [{
  13793. "name": "乌鲁木齐市",
  13794. "area": ["天山区", "沙依巴克区", "新市区", "水磨沟区", "头屯河区", "达坂城区", "东山区", "乌鲁木齐县"]
  13795. }, {
  13796. "name": "克拉玛依市",
  13797. "area": ["克拉玛依区", "独山子区", "白碱滩区", "乌尔禾区"]
  13798. }, {
  13799. "name": "吐鲁番地区",
  13800. "area": ["吐鲁番市", "托克逊县", "鄯善县"]
  13801. }, {
  13802. "name": "哈密地区",
  13803. "area": ["哈密市", "伊吾县", "巴里坤哈萨克自治县"]
  13804. }, {
  13805. "name": "和田地区",
  13806. "area": ["和田市", "和田县", "洛浦县", "民丰县", "皮山县", "策勒县", "于田县", "墨玉县"]
  13807. }, {
  13808. "name": "阿克苏地区",
  13809. "area": ["阿克苏市", "温宿县", "沙雅县", "拜城县", "阿瓦提县", "库车县", "柯坪县", "新和县", "乌什县"]
  13810. }, {
  13811. "name": "喀什地区",
  13812. "area": ["喀什市", "巴楚县", "泽普县", "伽师县", "叶城县", "岳普湖县", "疏勒县", "麦盖提县", "英吉沙县", "莎车县", "疏附县", "塔什库尔干塔吉克自治县"]
  13813. }, {
  13814. "name": "克孜勒苏柯尔克孜自治州",
  13815. "area": ["阿图什市", "阿合奇县", "乌恰县", "阿克陶县"]
  13816. }, {
  13817. "name": "巴音郭楞蒙古自治州",
  13818. "area": ["库尔勒市", "和静县", "尉犁县", "和硕县", "且末县", "博湖县", "轮台县", "若羌县", "焉耆回族自治县"]
  13819. }, {
  13820. "name": "昌吉回族自治州",
  13821. "area": ["昌吉市", "阜康市", "奇台县", "玛纳斯县", "吉木萨尔县", "呼图壁县", "木垒哈萨克自治县", "米泉市"]
  13822. }, {
  13823. "name": "博尔塔拉蒙古自治州",
  13824. "area": ["博乐市", "精河县", "温泉县"]
  13825. }, {
  13826. "name": "石河子",
  13827. "area": ["石河子"]
  13828. }, {
  13829. "name": "阿拉尔",
  13830. "area": ["阿拉尔"]
  13831. }, {
  13832. "name": "图木舒克",
  13833. "area": ["图木舒克"]
  13834. }, {
  13835. "name": "五家渠",
  13836. "area": ["五家渠"]
  13837. }, {
  13838. "name": "伊犁哈萨克自治州",
  13839. "area": ["伊宁市", "奎屯市", "伊宁县", "特克斯县", "尼勒克县", "昭苏县", "新源县", "霍城县", "巩留县", "察布查尔锡伯自治县", "塔城地区", "阿勒泰地区"]
  13840. }]
  13841. }, {
  13842. "name": "台湾省",
  13843. "city": [{
  13844. "name": "台北市",
  13845. "area": ["内湖区", "南港区", "中正区", "万华区", "大同区", "中山区", "松山区", "大安区", "信义区", "文山区", "士林区", "北投区"]
  13846. }, {
  13847. "name": "新北市",
  13848. "area": ["板桥区", "汐止区", "新店区"]
  13849. }, {
  13850. "name": "桃园市",
  13851. "area": ["其他"]
  13852. }, {
  13853. "name": "台中市",
  13854. "area": ["其他"]
  13855. }, {
  13856. "name": "台南市",
  13857. "area": ["其他"]
  13858. }, {
  13859. "name": "高雄市",
  13860. "area": ["其他"]
  13861. }]
  13862. }, {
  13863. "name": "澳门",
  13864. "city": [{
  13865. "name": "澳门",
  13866. "area": ["花地玛堂区", "圣安多尼堂区", "大堂区", "望德堂区", "风顺堂区", "嘉模堂区", "圣方济各堂区", "路凼"]
  13867. }]
  13868. }, {
  13869. "name": "香港",
  13870. "city": [{
  13871. "name": "香港",
  13872. "area": ["深水埗区", "油尖旺区", "九龙城区", "黄大仙区", "观塘区", "北区", "大埔区", "沙田区", "西贡区", "元朗区", "屯门区", "荃湾区", "葵青区", "离岛区", "中西区", "湾仔区", "东区", "南区"]
  13873. }]
  13874. }];
  13875. exports.default = _default;
  13876. /***/ }),
  13877. /***/ 43:
  13878. /*!**********************************************************************************************************!*\
  13879. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  13880. \**********************************************************************************************************/
  13881. /*! exports provided: default */
  13882. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13883. "use strict";
  13884. __webpack_require__.r(__webpack_exports__);
  13885. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  13886. /* globals __VUE_SSR_CONTEXT__ */
  13887. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  13888. // This module is a runtime utility for cleaner component module output and will
  13889. // be included in the final webpack user bundle.
  13890. function normalizeComponent (
  13891. scriptExports,
  13892. render,
  13893. staticRenderFns,
  13894. functionalTemplate,
  13895. injectStyles,
  13896. scopeId,
  13897. moduleIdentifier, /* server only */
  13898. shadowMode, /* vue-cli only */
  13899. components, // fixed by xxxxxx auto components
  13900. renderjs // fixed by xxxxxx renderjs
  13901. ) {
  13902. // Vue.extend constructor export interop
  13903. var options = typeof scriptExports === 'function'
  13904. ? scriptExports.options
  13905. : scriptExports
  13906. // fixed by xxxxxx auto components
  13907. if (components) {
  13908. if (!options.components) {
  13909. options.components = {}
  13910. }
  13911. var hasOwn = Object.prototype.hasOwnProperty
  13912. for (var name in components) {
  13913. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  13914. options.components[name] = components[name]
  13915. }
  13916. }
  13917. }
  13918. // fixed by xxxxxx renderjs
  13919. if (renderjs) {
  13920. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  13921. this[renderjs.__module] = this
  13922. });
  13923. (options.mixins || (options.mixins = [])).push(renderjs)
  13924. }
  13925. // render functions
  13926. if (render) {
  13927. options.render = render
  13928. options.staticRenderFns = staticRenderFns
  13929. options._compiled = true
  13930. }
  13931. // functional template
  13932. if (functionalTemplate) {
  13933. options.functional = true
  13934. }
  13935. // scopedId
  13936. if (scopeId) {
  13937. options._scopeId = 'data-v-' + scopeId
  13938. }
  13939. var hook
  13940. if (moduleIdentifier) { // server build
  13941. hook = function (context) {
  13942. // 2.3 injection
  13943. context =
  13944. context || // cached call
  13945. (this.$vnode && this.$vnode.ssrContext) || // stateful
  13946. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  13947. // 2.2 with runInNewContext: true
  13948. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  13949. context = __VUE_SSR_CONTEXT__
  13950. }
  13951. // inject component styles
  13952. if (injectStyles) {
  13953. injectStyles.call(this, context)
  13954. }
  13955. // register component module identifier for async chunk inferrence
  13956. if (context && context._registeredComponents) {
  13957. context._registeredComponents.add(moduleIdentifier)
  13958. }
  13959. }
  13960. // used by ssr in case component is cached and beforeCreate
  13961. // never gets called
  13962. options._ssrRegister = hook
  13963. } else if (injectStyles) {
  13964. hook = shadowMode
  13965. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  13966. : injectStyles
  13967. }
  13968. if (hook) {
  13969. if (options.functional) {
  13970. // for template-only hot-reload because in that case the render fn doesn't
  13971. // go through the normalizer
  13972. options._injectStyles = hook
  13973. // register for functioal component in vue file
  13974. var originalRender = options.render
  13975. options.render = function renderWithStyleInjection (h, context) {
  13976. hook.call(context)
  13977. return originalRender(h, context)
  13978. }
  13979. } else {
  13980. // inject component registration as beforeCreate hook
  13981. var existing = options.beforeCreate
  13982. options.beforeCreate = existing
  13983. ? [].concat(existing, hook)
  13984. : [hook]
  13985. }
  13986. }
  13987. return {
  13988. exports: scriptExports,
  13989. options: options
  13990. }
  13991. }
  13992. /***/ }),
  13993. /***/ 433:
  13994. /*!*****************************************************!*\
  13995. !*** D:/工作/项目2/生鲜/sx/components/uni-icons/icons.js ***!
  13996. \*****************************************************/
  13997. /*! no static exports found */
  13998. /***/ (function(module, exports, __webpack_require__) {
  13999. "use strict";
  14000. Object.defineProperty(exports, "__esModule", {
  14001. value: true
  14002. });
  14003. exports.default = void 0;
  14004. var _default = {
  14005. 'contact': "\uE100",
  14006. 'person': "\uE101",
  14007. 'personadd': "\uE102",
  14008. 'contact-filled': "\uE130",
  14009. 'person-filled': "\uE131",
  14010. 'personadd-filled': "\uE132",
  14011. 'phone': "\uE200",
  14012. 'email': "\uE201",
  14013. 'chatbubble': "\uE202",
  14014. 'chatboxes': "\uE203",
  14015. 'phone-filled': "\uE230",
  14016. 'email-filled': "\uE231",
  14017. 'chatbubble-filled': "\uE232",
  14018. 'chatboxes-filled': "\uE233",
  14019. 'weibo': "\uE260",
  14020. 'weixin': "\uE261",
  14021. 'pengyouquan': "\uE262",
  14022. 'chat': "\uE263",
  14023. 'qq': "\uE264",
  14024. 'videocam': "\uE300",
  14025. 'camera': "\uE301",
  14026. 'mic': "\uE302",
  14027. 'location': "\uE303",
  14028. 'mic-filled': "\uE332",
  14029. 'speech': "\uE332",
  14030. 'location-filled': "\uE333",
  14031. 'micoff': "\uE360",
  14032. 'image': "\uE363",
  14033. 'map': "\uE364",
  14034. 'compose': "\uE400",
  14035. 'trash': "\uE401",
  14036. 'upload': "\uE402",
  14037. 'download': "\uE403",
  14038. 'close': "\uE404",
  14039. 'redo': "\uE405",
  14040. 'undo': "\uE406",
  14041. 'refresh': "\uE407",
  14042. 'star': "\uE408",
  14043. 'plus': "\uE409",
  14044. 'minus': "\uE410",
  14045. 'circle': "\uE411",
  14046. 'checkbox': "\uE411",
  14047. 'close-filled': "\uE434",
  14048. 'clear': "\uE434",
  14049. 'refresh-filled': "\uE437",
  14050. 'star-filled': "\uE438",
  14051. 'plus-filled': "\uE439",
  14052. 'minus-filled': "\uE440",
  14053. 'circle-filled': "\uE441",
  14054. 'checkbox-filled': "\uE442",
  14055. 'closeempty': "\uE460",
  14056. 'refreshempty': "\uE461",
  14057. 'reload': "\uE462",
  14058. 'starhalf': "\uE463",
  14059. 'spinner': "\uE464",
  14060. 'spinner-cycle': "\uE465",
  14061. 'search': "\uE466",
  14062. 'plusempty': "\uE468",
  14063. 'forward': "\uE470",
  14064. 'back': "\uE471",
  14065. 'left-nav': "\uE471",
  14066. 'checkmarkempty': "\uE472",
  14067. 'home': "\uE500",
  14068. 'navigate': "\uE501",
  14069. 'gear': "\uE502",
  14070. 'paperplane': "\uE503",
  14071. 'info': "\uE504",
  14072. 'help': "\uE505",
  14073. 'locked': "\uE506",
  14074. 'more': "\uE507",
  14075. 'flag': "\uE508",
  14076. 'home-filled': "\uE530",
  14077. 'gear-filled': "\uE532",
  14078. 'info-filled': "\uE534",
  14079. 'help-filled': "\uE535",
  14080. 'more-filled': "\uE537",
  14081. 'settings': "\uE560",
  14082. 'list': "\uE562",
  14083. 'bars': "\uE563",
  14084. 'loop': "\uE565",
  14085. 'paperclip': "\uE567",
  14086. 'eye': "\uE568",
  14087. 'arrowup': "\uE580",
  14088. 'arrowdown': "\uE581",
  14089. 'arrowleft': "\uE582",
  14090. 'arrowright': "\uE583",
  14091. 'arrowthinup': "\uE584",
  14092. 'arrowthindown': "\uE585",
  14093. 'arrowthinleft': "\uE586",
  14094. 'arrowthinright': "\uE587",
  14095. 'pulldown': "\uE588",
  14096. 'closefill': "\uE589",
  14097. 'sound': "\uE590",
  14098. 'scan': "\uE612"
  14099. };
  14100. exports.default = _default;
  14101. /***/ }),
  14102. /***/ 44:
  14103. /*!*************************************!*\
  14104. !*** D:/工作/项目2/生鲜/sx/utils/util.js ***!
  14105. \*************************************/
  14106. /*! no static exports found */
  14107. /***/ (function(module, exports, __webpack_require__) {
  14108. "use strict";
  14109. /* WEBPACK VAR INJECTION */(function(uni) {
  14110. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14111. Object.defineProperty(exports, "__esModule", {
  14112. value: true
  14113. });
  14114. exports.default = void 0;
  14115. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 37));
  14116. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 39));
  14117. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  14118. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  14119. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14120. var _app = __webpack_require__(/*! ../config/app.js */ 45);
  14121. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  14122. var _index = __webpack_require__(/*! @/plugin/image-tools/index.js */ 46);
  14123. var _default = {
  14124. /**
  14125. * opt object | string
  14126. * to_url object | string
  14127. * 例:
  14128. * this.Tips('/pages/test/test'); 跳转不提示
  14129. * this.Tips({title:'提示'},'/pages/test/test'); 提示并跳转
  14130. * this.Tips({title:'提示'},{tab:1,url:'/pages/index/index'}); 提示并跳转值table上
  14131. * tab=1 一定时间后跳转至 table上
  14132. * tab=2 一定时间后跳转至非 table上
  14133. * tab=3 一定时间后返回上页面
  14134. * tab=4 关闭所有页面跳转至非table上
  14135. * tab=5 关闭当前页面跳转至table上
  14136. */
  14137. Tips: function Tips(opt, to_url) {
  14138. if (typeof opt == 'string') {
  14139. to_url = opt;
  14140. opt = {};
  14141. }
  14142. var title = opt.title || '',
  14143. icon = opt.icon || 'none',
  14144. endtime = opt.endtime || 2000,
  14145. success = opt.success;
  14146. if (title) uni.showToast({
  14147. title: title,
  14148. icon: icon,
  14149. duration: endtime,
  14150. success: success
  14151. });
  14152. if (to_url != undefined) {
  14153. if ((0, _typeof2.default)(to_url) == 'object') {
  14154. var tab = to_url.tab || 1,
  14155. url = to_url.url || '';
  14156. switch (tab) {
  14157. case 1:
  14158. //一定时间后跳转至 table
  14159. setTimeout(function () {
  14160. uni.switchTab({
  14161. url: url
  14162. });
  14163. }, endtime);
  14164. break;
  14165. case 2:
  14166. //跳转至非table页面
  14167. setTimeout(function () {
  14168. uni.navigateTo({
  14169. url: url
  14170. });
  14171. }, endtime);
  14172. break;
  14173. case 3:
  14174. //返回上页面
  14175. setTimeout(function () {
  14176. uni.navigateBack({
  14177. delta: parseInt(url)
  14178. });
  14179. }, endtime);
  14180. break;
  14181. case 4:
  14182. //关闭当前所有页面跳转至非table页面
  14183. setTimeout(function () {
  14184. uni.reLaunch({
  14185. url: url
  14186. });
  14187. }, endtime);
  14188. break;
  14189. case 5:
  14190. //关闭当前页面跳转至非table页面
  14191. setTimeout(function () {
  14192. uni.redirectTo({
  14193. url: url
  14194. });
  14195. }, endtime);
  14196. break;
  14197. }
  14198. } else if (typeof to_url == 'function') {
  14199. setTimeout(function () {
  14200. to_url && to_url();
  14201. }, endtime);
  14202. } else {
  14203. //没有提示时跳转不延迟
  14204. setTimeout(function () {
  14205. uni.navigateTo({
  14206. url: to_url
  14207. });
  14208. }, title ? endtime : 0);
  14209. }
  14210. }
  14211. },
  14212. /**
  14213. * 移除数组中的某个数组并组成新的数组返回
  14214. * @param array array 需要移除的数组
  14215. * @param int index 需要移除的数组的键值
  14216. * @param string | int 值
  14217. * @return array
  14218. *
  14219. */
  14220. ArrayRemove: function ArrayRemove(array, index, value) {
  14221. var valueArray = [];
  14222. if (array instanceof Array) {
  14223. for (var i = 0; i < array.length; i++) {
  14224. if (typeof index == 'number' && array[index] != i) {
  14225. valueArray.push(array[i]);
  14226. } else if (typeof index == 'string' && array[i][index] != value) {
  14227. valueArray.push(array[i]);
  14228. }
  14229. }
  14230. }
  14231. return valueArray;
  14232. },
  14233. /**
  14234. * 生成海报获取文字
  14235. * @param string text 为传入的文本
  14236. * @param int num 为单行显示的字节长度
  14237. * @return array
  14238. */
  14239. textByteLength: function textByteLength(text, num) {
  14240. var strLength = 0;
  14241. var rows = 1;
  14242. var str = 0;
  14243. var arr = [];
  14244. for (var j = 0; j < text.length; j++) {
  14245. if (text.charCodeAt(j) > 255) {
  14246. strLength += 2;
  14247. if (strLength > rows * num) {
  14248. strLength++;
  14249. arr.push(text.slice(str, j));
  14250. str = j;
  14251. rows++;
  14252. }
  14253. } else {
  14254. strLength++;
  14255. if (strLength > rows * num) {
  14256. arr.push(text.slice(str, j));
  14257. str = j;
  14258. rows++;
  14259. }
  14260. }
  14261. }
  14262. arr.push(text.slice(str, text.length));
  14263. return [strLength, arr, rows]; // [处理文字的总字节长度,每行显示内容的数组,行数]
  14264. },
  14265. /**
  14266. * 获取分享海报
  14267. * @param array arr2 海报素材
  14268. * @param string store_name 素材文字
  14269. * @param string price 价格
  14270. * @param function successFn 回调函数
  14271. *
  14272. *
  14273. */
  14274. PosterCanvas: function PosterCanvas(arr2, store_name, price, successFn) {
  14275. var that = this;
  14276. uni.showLoading({
  14277. title: '海报生成中',
  14278. mask: true
  14279. });
  14280. var ctx = uni.createCanvasContext('myCanvas');
  14281. ctx.clearRect(0, 0, 0, 0);
  14282. /**
  14283. * 只能获取合法域名下的图片信息,本地调试无法获取
  14284. *
  14285. */
  14286. uni.getImageInfo({
  14287. src: arr2[0],
  14288. success: function success(res) {
  14289. console.log(res, 'getImageInfo');
  14290. var WIDTH = res.width;
  14291. var HEIGHT = res.height;
  14292. ctx.drawImage(arr2[0], 0, 0, WIDTH, HEIGHT);
  14293. ctx.drawImage(arr2[1], 0, 0, WIDTH, WIDTH);
  14294. ctx.save();
  14295. var r = 90;
  14296. var d = r * 2;
  14297. var cx = 40;
  14298. var cy = 990;
  14299. ctx.arc(cx + r, cy + r, r, 0, 2 * Math.PI);
  14300. // ctx.clip();
  14301. ctx.drawImage(arr2[2], cx, cy, d, d);
  14302. ctx.restore();
  14303. var CONTENT_ROW_LENGTH = 40;
  14304. var _that$textByteLength = that.textByteLength(store_name, CONTENT_ROW_LENGTH),
  14305. _that$textByteLength2 = (0, _slicedToArray2.default)(_that$textByteLength, 3),
  14306. contentLeng = _that$textByteLength2[0],
  14307. contentArray = _that$textByteLength2[1],
  14308. contentRows = _that$textByteLength2[2];
  14309. if (contentRows > 2) {
  14310. contentRows = 2;
  14311. var textArray = contentArray.slice(0, 2);
  14312. textArray[textArray.length - 1] += '……';
  14313. contentArray = textArray;
  14314. }
  14315. ctx.setTextAlign('center');
  14316. ctx.setFontSize(32);
  14317. var contentHh = 32 * 1.3;
  14318. for (var m = 0; m < contentArray.length; m++) {
  14319. ctx.fillText(contentArray[m], WIDTH / 2, 820 + contentHh * m);
  14320. }
  14321. ctx.setTextAlign('center');
  14322. ctx.setFontSize(48);
  14323. ctx.setFillStyle('red');
  14324. ctx.fillText('¥' + price, WIDTH / 2, 880 + contentHh);
  14325. ctx.draw(true, function () {
  14326. uni.canvasToTempFilePath({
  14327. canvasId: 'myCanvas',
  14328. fileType: 'png',
  14329. destWidth: WIDTH,
  14330. destHeight: HEIGHT,
  14331. success: function success(res) {
  14332. uni.hideLoading();
  14333. successFn && successFn(res.tempFilePath);
  14334. }
  14335. });
  14336. });
  14337. },
  14338. fail: function fail(err) {
  14339. uni.hideLoading();
  14340. that.Tips({
  14341. title: '无法获取图片信息'
  14342. });
  14343. }
  14344. });
  14345. },
  14346. /*
  14347. * 单图上传
  14348. * @param object opt
  14349. * @param callable successCallback 成功执行方法 data
  14350. * @param callable errorCallback 失败执行方法
  14351. */
  14352. uploadImageOne: function uploadImageOne(opt, successCallback, errorCallback) {
  14353. var that = this;
  14354. if (typeof opt === 'string') {
  14355. var url = opt;
  14356. opt = {};
  14357. opt.url = url;
  14358. }
  14359. var count = opt.count || 1,
  14360. sizeType = opt.sizeType || ['compressed'],
  14361. sourceType = opt.sourceType || ['album', 'camera'],
  14362. is_load = opt.is_load || true,
  14363. uploadUrl = opt.url || '',
  14364. inputName = opt.name || 'pics';
  14365. uni.chooseImage({
  14366. count: count,
  14367. //最多可以选择的图片总数
  14368. sizeType: sizeType,
  14369. // 可以指定是原图还是压缩图,默认二者都有
  14370. sourceType: sourceType,
  14371. // 可以指定来源是相册还是相机,默认二者都有
  14372. success: function success(res) {
  14373. console.log();
  14374. //启动上传等待中...
  14375. uni.showLoading({
  14376. title: '图片上传中'
  14377. });
  14378. uni.uploadFile({
  14379. url: _app.HTTP_REQUEST_URL + '/api/' + uploadUrl,
  14380. filePath: res.tempFilePaths[0],
  14381. name: inputName,
  14382. formData: {
  14383. 'filename': inputName
  14384. },
  14385. header: (0, _defineProperty2.default)({
  14386. "Content-Type": "multipart/form-data"
  14387. }, _app.TOKENNAME, 'Bearer ' + _store.default.state.app.token),
  14388. success: function success(res) {
  14389. uni.hideLoading();
  14390. if (res.statusCode == 403) {
  14391. that.Tips({
  14392. title: res.data
  14393. });
  14394. } else {
  14395. var data = res.data ? JSON.parse(res.data) : {};
  14396. if (data.status == 200) {
  14397. successCallback && successCallback(data);
  14398. } else {
  14399. errorCallback && errorCallback(data);
  14400. that.Tips({
  14401. title: data.msg
  14402. });
  14403. }
  14404. }
  14405. },
  14406. fail: function fail(res) {
  14407. uni.hideLoading();
  14408. that.Tips({
  14409. title: '上传图片失败'
  14410. });
  14411. }
  14412. });
  14413. // pathToBase64(res.tempFilePaths[0])
  14414. // .then(imgBase64 => {
  14415. // console.log(imgBase64);
  14416. // })
  14417. // .catch(error => {
  14418. // console.error(error)
  14419. // })
  14420. }
  14421. });
  14422. },
  14423. /**
  14424. * 处理服务器扫码带进来的参数
  14425. * @param string param 扫码携带参数
  14426. * @param string k 整体分割符 默认为:&
  14427. * @param string p 单个分隔符 默认为:=
  14428. * @return object
  14429. *
  14430. */
  14431. getUrlParams: function getUrlParams(param, k, p) {
  14432. if (typeof param != 'string') return {};
  14433. k = k ? k : '&'; //整体参数分隔符
  14434. p = p ? p : '='; //单个参数分隔符
  14435. var value = {};
  14436. if (param.indexOf(k) !== -1) {
  14437. param = param.split(k);
  14438. for (var val in param) {
  14439. if (param[val].indexOf(p) !== -1) {
  14440. var item = param[val].split(p);
  14441. value[item[0]] = item[1];
  14442. }
  14443. }
  14444. } else if (param.indexOf(p) !== -1) {
  14445. var item = param.split(p);
  14446. value[item[0]] = item[1];
  14447. } else {
  14448. return param;
  14449. }
  14450. return value;
  14451. },
  14452. /*
  14453. * 合并数组
  14454. */
  14455. SplitArray: function SplitArray(list, sp) {
  14456. if ((0, _typeof2.default)(list) != 'object') return [];
  14457. if (sp === undefined) sp = [];
  14458. for (var i = 0; i < list.length; i++) {
  14459. sp.push(list[i]);
  14460. }
  14461. return sp;
  14462. },
  14463. trim: function trim(str) {
  14464. return String.prototype.trim.call(str);
  14465. },
  14466. $h: {
  14467. //除法函数,用来得到精确的除法结果
  14468. //说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
  14469. //调用:$h.Div(arg1,arg2)
  14470. //返回值:arg1除以arg2的精确结果
  14471. Div: function Div(arg1, arg2) {
  14472. arg1 = parseFloat(arg1);
  14473. arg2 = parseFloat(arg2);
  14474. var t1 = 0,
  14475. t2 = 0,
  14476. r1,
  14477. r2;
  14478. try {
  14479. t1 = arg1.toString().split(".")[1].length;
  14480. } catch (e) {}
  14481. try {
  14482. t2 = arg2.toString().split(".")[1].length;
  14483. } catch (e) {}
  14484. r1 = Number(arg1.toString().replace(".", ""));
  14485. r2 = Number(arg2.toString().replace(".", ""));
  14486. return this.Mul(r1 / r2, Math.pow(10, t2 - t1));
  14487. },
  14488. //加法函数,用来得到精确的加法结果
  14489. //说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
  14490. //调用:$h.Add(arg1,arg2)
  14491. //返回值:arg1加上arg2的精确结果
  14492. Add: function Add(arg1, arg2) {
  14493. arg2 = parseFloat(arg2);
  14494. var r1, r2, m;
  14495. try {
  14496. r1 = arg1.toString().split(".")[1].length;
  14497. } catch (e) {
  14498. r1 = 0;
  14499. }
  14500. try {
  14501. r2 = arg2.toString().split(".")[1].length;
  14502. } catch (e) {
  14503. r2 = 0;
  14504. }
  14505. m = Math.pow(100, Math.max(r1, r2));
  14506. return (this.Mul(arg1, m) + this.Mul(arg2, m)) / m;
  14507. },
  14508. //减法函数,用来得到精确的减法结果
  14509. //说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的减法结果。
  14510. //调用:$h.Sub(arg1,arg2)
  14511. //返回值:arg1减去arg2的精确结果
  14512. Sub: function Sub(arg1, arg2) {
  14513. arg1 = parseFloat(arg1);
  14514. arg2 = parseFloat(arg2);
  14515. var r1, r2, m, n;
  14516. try {
  14517. r1 = arg1.toString().split(".")[1].length;
  14518. } catch (e) {
  14519. r1 = 0;
  14520. }
  14521. try {
  14522. r2 = arg2.toString().split(".")[1].length;
  14523. } catch (e) {
  14524. r2 = 0;
  14525. }
  14526. m = Math.pow(10, Math.max(r1, r2));
  14527. //动态控制精度长度
  14528. n = r1 >= r2 ? r1 : r2;
  14529. return ((this.Mul(arg1, m) - this.Mul(arg2, m)) / m).toFixed(n);
  14530. },
  14531. //乘法函数,用来得到精确的乘法结果
  14532. //说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
  14533. //调用:$h.Mul(arg1,arg2)
  14534. //返回值:arg1乘以arg2的精确结果
  14535. Mul: function Mul(arg1, arg2) {
  14536. arg1 = parseFloat(arg1);
  14537. arg2 = parseFloat(arg2);
  14538. var m = 0,
  14539. s1 = arg1.toString(),
  14540. s2 = arg2.toString();
  14541. try {
  14542. m += s1.split(".")[1].length;
  14543. } catch (e) {}
  14544. try {
  14545. m += s2.split(".")[1].length;
  14546. } catch (e) {}
  14547. return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
  14548. }
  14549. },
  14550. // 获取地理位置;
  14551. $L: {
  14552. getLocation: function getLocation() {
  14553. var _this = this;
  14554. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  14555. var status;
  14556. return _regenerator.default.wrap(function _callee$(_context) {
  14557. while (1) {
  14558. switch (_context.prev = _context.next) {
  14559. case 0:
  14560. _context.next = 2;
  14561. return _this.getSetting();
  14562. case 2:
  14563. status = _context.sent;
  14564. if (!(status === 2)) {
  14565. _context.next = 6;
  14566. break;
  14567. }
  14568. _this.openSetting();
  14569. return _context.abrupt("return");
  14570. case 6:
  14571. _this.doGetLocation();
  14572. case 7:
  14573. case "end":
  14574. return _context.stop();
  14575. }
  14576. }
  14577. }, _callee);
  14578. }))();
  14579. },
  14580. doGetLocation: function doGetLocation() {
  14581. uni.getLocation({
  14582. type: 'gcj02',
  14583. success: function success(res) {
  14584. uni.removeStorageSync('CACHE_LONGITUDE');
  14585. uni.removeStorageSync('CACHE_LATITUDE');
  14586. uni.setStorageSync('CACHE_LONGITUDE', res.longitude);
  14587. uni.setStorageSync('CACHE_LATITUDE', res.latitude);
  14588. },
  14589. fail: function fail(err) {
  14590. if (err.errMsg.indexOf("auth deny") >= 0) {
  14591. uni.showToast({
  14592. title: "访问位置被拒绝"
  14593. });
  14594. } else {
  14595. uni.showToast({
  14596. title: err.errMsg
  14597. });
  14598. }
  14599. }
  14600. });
  14601. },
  14602. getSetting: function getSetting() {
  14603. return new Promise(function (resolve, reject) {
  14604. uni.getSetting({
  14605. success: function success(res) {
  14606. if (res.authSetting['scope.userLocation'] === undefined) {
  14607. resolve(0);
  14608. return;
  14609. }
  14610. if (res.authSetting['scope.userLocation']) {
  14611. resolve(1);
  14612. } else {
  14613. resolve(2);
  14614. }
  14615. }
  14616. });
  14617. });
  14618. },
  14619. openSetting: function openSetting() {
  14620. var _this2 = this;
  14621. uni.openSetting({
  14622. success: function success(res) {
  14623. if (res.authSetting && res.authSetting['scope.userLocation']) {
  14624. _this2.doGetLocation();
  14625. }
  14626. },
  14627. fail: function fail(err) {}
  14628. });
  14629. }
  14630. // async checkPermission() {
  14631. // let status = permision.isIOS ? await permision.requestIOS('location') :
  14632. // await permision.requestAndroid('android.permission.ACCESS_FINE_LOCATION');
  14633. // if (status === null || status === 1) {
  14634. // status = 1;
  14635. // } else if (status === 2) {
  14636. // uni.showModal({
  14637. // content: "系统定位已关闭",
  14638. // confirmText: "确定",
  14639. // showCancel: false,
  14640. // success: function(res) {}
  14641. // })
  14642. // } else if (status.code) {
  14643. // uni.showModal({
  14644. // content: status.message
  14645. // })
  14646. // } else {
  14647. // uni.showModal({
  14648. // content: "需要定位权限",
  14649. // confirmText: "设置",
  14650. // success: function(res) {
  14651. // if (res.confirm) {
  14652. // permision.gotoAppSetting();
  14653. // }
  14654. // }
  14655. // })
  14656. // }
  14657. // return status;
  14658. // },
  14659. }
  14660. };
  14661. exports.default = _default;
  14662. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14663. /***/ }),
  14664. /***/ 45:
  14665. /*!*************************************!*\
  14666. !*** D:/工作/项目2/生鲜/sx/config/app.js ***!
  14667. \*************************************/
  14668. /*! no static exports found */
  14669. /***/ (function(module, exports) {
  14670. // 网络接口修改此字符 小程序域名要求https
  14671. var httpApi = ''; //测试站
  14672. // let httpApi = 'http://192.168.31.50:8324' //本地
  14673. // let httpApi = 'https://mer.crmeb.net'
  14674. // let httpApi = ''
  14675. // 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
  14676. var wsApi = '';
  14677. // let wsApi = 'wss://192.168.31.50:8324'
  14678. module.exports = {
  14679. // 请求域名 格式: https://您的域名
  14680. // HTTP_REQUEST_URL: httpApi,
  14681. HTTP_REQUEST_URL: httpApi,
  14682. VUE_APP_WS_URL: "".concat(wsApi, "?type=user"),
  14683. HEADER: {
  14684. 'content-type': 'application/json'
  14685. },
  14686. // 回话密钥名称 请勿修改此配置
  14687. TOKENNAME: 'X-Token',
  14688. // 缓存时间 0 永久
  14689. EXPIRE: 0
  14690. };
  14691. /***/ }),
  14692. /***/ 46:
  14693. /*!***************************************************!*\
  14694. !*** D:/工作/项目2/生鲜/sx/plugin/image-tools/index.js ***!
  14695. \***************************************************/
  14696. /*! no static exports found */
  14697. /***/ (function(module, exports, __webpack_require__) {
  14698. "use strict";
  14699. /* WEBPACK VAR INJECTION */(function(wx) {
  14700. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14701. Object.defineProperty(exports, "__esModule", {
  14702. value: true
  14703. });
  14704. exports.base64ToPath = base64ToPath;
  14705. exports.pathToBase64 = pathToBase64;
  14706. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14707. function getLocalFilePath(path) {
  14708. if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) {
  14709. return path;
  14710. }
  14711. if (path.indexOf('file://') === 0) {
  14712. return path;
  14713. }
  14714. if (path.indexOf('/storage/emulated/0/') === 0) {
  14715. return path;
  14716. }
  14717. if (path.indexOf('/') === 0) {
  14718. var localFilePath = plus.io.convertAbsoluteFileSystem(path);
  14719. if (localFilePath !== path) {
  14720. return localFilePath;
  14721. } else {
  14722. path = path.substr(1);
  14723. }
  14724. }
  14725. return '_www/' + path;
  14726. }
  14727. function pathToBase64(path) {
  14728. return new Promise(function (resolve, reject) {
  14729. if ((typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) === 'object' && 'document' in window) {
  14730. if (typeof FileReader === 'function') {
  14731. var xhr = new XMLHttpRequest();
  14732. xhr.open('GET', path, true);
  14733. xhr.responseType = 'blob';
  14734. xhr.onload = function () {
  14735. if (this.status === 200) {
  14736. var fileReader = new FileReader();
  14737. fileReader.onload = function (e) {
  14738. resolve(e.target.result);
  14739. };
  14740. fileReader.onerror = reject;
  14741. fileReader.readAsDataURL(this.response);
  14742. }
  14743. };
  14744. xhr.onerror = reject;
  14745. xhr.send();
  14746. return;
  14747. }
  14748. var canvas = document.createElement('canvas');
  14749. var c2x = canvas.getContext('2d');
  14750. var img = new Image();
  14751. img.onload = function () {
  14752. canvas.width = img.width;
  14753. canvas.height = img.height;
  14754. c2x.drawImage(img, 0, 0);
  14755. resolve(canvas.toDataURL());
  14756. canvas.height = canvas.width = 0;
  14757. };
  14758. img.onerror = reject;
  14759. img.src = path;
  14760. return;
  14761. }
  14762. if ((typeof plus === "undefined" ? "undefined" : (0, _typeof2.default)(plus)) === 'object') {
  14763. plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function (entry) {
  14764. entry.file(function (file) {
  14765. var fileReader = new plus.io.FileReader();
  14766. fileReader.onload = function (data) {
  14767. resolve(data.target.result);
  14768. };
  14769. fileReader.onerror = function (error) {
  14770. reject(error);
  14771. };
  14772. fileReader.readAsDataURL(file);
  14773. }, function (error) {
  14774. reject(error);
  14775. });
  14776. }, function (error) {
  14777. reject(error);
  14778. });
  14779. return;
  14780. }
  14781. if ((typeof wx === "undefined" ? "undefined" : (0, _typeof2.default)(wx)) === 'object' && wx.canIUse('getFileSystemManager')) {
  14782. wx.getFileSystemManager().readFile({
  14783. filePath: path,
  14784. encoding: 'base64',
  14785. success: function success(res) {
  14786. resolve('data:image/png;base64,' + res.data);
  14787. },
  14788. fail: function fail(error) {
  14789. reject(error);
  14790. }
  14791. });
  14792. return;
  14793. }
  14794. reject(new Error('not support'));
  14795. });
  14796. }
  14797. function base64ToPath(base64) {
  14798. return new Promise(function (resolve, reject) {
  14799. if ((typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) === 'object' && 'document' in window) {
  14800. base64 = base64.split(',');
  14801. var type = base64[0].match(/:(.*?);/)[1];
  14802. var str = atob(base64[1]);
  14803. var n = str.length;
  14804. var array = new Uint8Array(n);
  14805. while (n--) {
  14806. array[n] = str.charCodeAt(n);
  14807. }
  14808. return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
  14809. type: type
  14810. })));
  14811. }
  14812. var extName = base64.match(/data\:\S+\/(\S+);/);
  14813. if (extName) {
  14814. extName = extName[1];
  14815. } else {
  14816. reject(new Error('base64 error'));
  14817. }
  14818. var fileName = Date.now() + '.' + extName;
  14819. if ((typeof plus === "undefined" ? "undefined" : (0, _typeof2.default)(plus)) === 'object') {
  14820. var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now());
  14821. bitmap.loadBase64Data(base64, function () {
  14822. var filePath = '_doc/uniapp_temp/' + fileName;
  14823. bitmap.save(filePath, {}, function () {
  14824. bitmap.clear();
  14825. resolve(filePath);
  14826. }, function (error) {
  14827. bitmap.clear();
  14828. reject(error);
  14829. });
  14830. }, function (error) {
  14831. bitmap.clear();
  14832. reject(error);
  14833. });
  14834. return;
  14835. }
  14836. if ((typeof wx === "undefined" ? "undefined" : (0, _typeof2.default)(wx)) === 'object' && wx.canIUse('getFileSystemManager')) {
  14837. var filePath = wx.env.USER_DATA_PATH + '/' + fileName;
  14838. wx.getFileSystemManager().writeFile({
  14839. filePath: filePath,
  14840. data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
  14841. encoding: 'base64',
  14842. success: function success() {
  14843. resolve(filePath);
  14844. },
  14845. fail: function fail(error) {
  14846. reject(error);
  14847. }
  14848. });
  14849. return;
  14850. }
  14851. reject(new Error('not support'));
  14852. });
  14853. }
  14854. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  14855. /***/ }),
  14856. /***/ 5:
  14857. /*!**************************************************************!*\
  14858. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  14859. \**************************************************************/
  14860. /*! no static exports found */
  14861. /***/ (function(module, exports, __webpack_require__) {
  14862. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  14863. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  14864. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  14865. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  14866. function _slicedToArray(arr, i) {
  14867. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  14868. }
  14869. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14870. /***/ }),
  14871. /***/ 53:
  14872. /*!***********************************!*\
  14873. !*** D:/工作/项目2/生鲜/sx/api/user.js ***!
  14874. \***********************************/
  14875. /*! no static exports found */
  14876. /***/ (function(module, exports, __webpack_require__) {
  14877. "use strict";
  14878. var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  14879. Object.defineProperty(exports, "__esModule", {
  14880. value: true
  14881. });
  14882. exports.addressDel = addressDel;
  14883. exports.addressEdit = addressEdit;
  14884. exports.bindAdmin = bindAdmin;
  14885. exports.cartDel = cartDel;
  14886. exports.cash = cash;
  14887. exports.checkStk = checkStk;
  14888. exports.delPoint = delPoint;
  14889. exports.delcollect = delcollect;
  14890. exports.edit = edit;
  14891. exports.editPoint = editPoint;
  14892. exports.exchangeOrderVerific = exchangeOrderVerific;
  14893. exports.getAddress = getAddress;
  14894. exports.getAddressDefault = getAddressDefault;
  14895. exports.getAddressList = getAddressList;
  14896. exports.getAllList = getAllList;
  14897. exports.getCartList = getCartList;
  14898. exports.getCartNum = getCartNum;
  14899. exports.getOrderList = getOrderList;
  14900. exports.getPoint = getPoint;
  14901. exports.getSHY = getSHY;
  14902. exports.getSpreadCount = getSpreadCount;
  14903. exports.getSpreadPeople = getSpreadPeople;
  14904. exports.getStk = getStk;
  14905. exports.getStoreCms = getStoreCms;
  14906. exports.getUser = getUser;
  14907. exports.getUserInfo = getUserInfo;
  14908. exports.getcollectList = getcollectList;
  14909. exports.getredbag = getredbag;
  14910. exports.orderData = orderData;
  14911. exports.orderVerific = orderVerific;
  14912. exports.redbag = redbag;
  14913. exports.sendStk = sendStk;
  14914. exports.setAddressDefault = setAddressDefault;
  14915. exports.spreadBanner = spreadBanner;
  14916. exports.upload = upload;
  14917. var _request = _interopRequireWildcard(__webpack_require__(/*! @/utils/request */ 35));
  14918. function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  14919. function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  14920. //用户修改信息
  14921. function edit(data) {
  14922. return (0, _request.default)({
  14923. url: '/api/user/edit',
  14924. method: 'post',
  14925. data: data
  14926. });
  14927. }
  14928. // 订单统计信息
  14929. function orderData(data) {
  14930. return (0, _request.default)({
  14931. url: '/api/order/data',
  14932. method: 'get',
  14933. data: data
  14934. });
  14935. }
  14936. // 获取用户信息
  14937. function getUserInfo(data) {
  14938. return (0, _request.default)({
  14939. url: '/api/userinfo',
  14940. method: 'get',
  14941. data: data
  14942. });
  14943. }
  14944. // 获取用户信息
  14945. function getUser(data) {
  14946. return (0, _request.default)({
  14947. url: '/api/user',
  14948. method: 'get',
  14949. data: data
  14950. });
  14951. }
  14952. // 用户分享图
  14953. function spreadBanner(data) {
  14954. return (0, _request.default)({
  14955. url: '/api/spread/banner',
  14956. method: 'get',
  14957. data: data
  14958. });
  14959. }
  14960. // 获取地址列表
  14961. function getAddressList(data) {
  14962. return (0, _request.default)({
  14963. url: '/api/address/list',
  14964. method: 'get',
  14965. data: data
  14966. });
  14967. }
  14968. // 获取单个地址
  14969. function getAddress(data, id) {
  14970. return (0, _request.default)({
  14971. url: '/api/address/detail/' + id,
  14972. method: 'get',
  14973. data: data
  14974. });
  14975. }
  14976. // 修改地址
  14977. function addressEdit(data) {
  14978. return (0, _request.default)({
  14979. url: '/api/address/edit',
  14980. method: 'post',
  14981. data: data
  14982. });
  14983. }
  14984. // 删除地址
  14985. function addressDel(data) {
  14986. return (0, _request.default)({
  14987. url: '/api/address/del',
  14988. method: 'post',
  14989. data: data
  14990. });
  14991. }
  14992. // 设为默认地址
  14993. function setAddressDefault(data) {
  14994. return (0, _request.default)({
  14995. url: '/api/address/default/set',
  14996. method: 'post',
  14997. data: data
  14998. });
  14999. }
  15000. //获取默认地址
  15001. function getAddressDefault(data) {
  15002. return (0, _request.default)({
  15003. url: '/api/address/default',
  15004. method: 'get',
  15005. data: data
  15006. });
  15007. }
  15008. // 购物车列表
  15009. function getCartList(data) {
  15010. return (0, _request.default)({
  15011. url: '/api/cart/list',
  15012. method: 'get',
  15013. data: data
  15014. });
  15015. }
  15016. // 修改购物车数量
  15017. function getCartNum(data) {
  15018. return (0, _request.default)({
  15019. url: '/api/cart/num',
  15020. method: 'post',
  15021. data: data
  15022. });
  15023. }
  15024. //删除购物车
  15025. function cartDel(data) {
  15026. return (0, _request.default)({
  15027. url: '/api/cart/del',
  15028. method: 'post',
  15029. data: data
  15030. });
  15031. }
  15032. //获取收藏夹列表
  15033. function getcollectList(data) {
  15034. return (0, _request.default)({
  15035. url: '/api/collect/user',
  15036. method: 'get',
  15037. data: data
  15038. });
  15039. }
  15040. // 取消收藏
  15041. function delcollect(data) {
  15042. return (0, _request.default)({
  15043. url: '/api/collect/del',
  15044. method: 'post',
  15045. data: data
  15046. });
  15047. }
  15048. //上传图片
  15049. function upload(data) {
  15050. return (0, _request.upFilse)({
  15051. url: '/api/upload/image',
  15052. method: 'post',
  15053. data: data
  15054. });
  15055. }
  15056. // 推广的人数
  15057. function getSpreadPeople(data) {
  15058. return (0, _request.default)({
  15059. url: '/api/spread/people',
  15060. method: 'post',
  15061. data: data
  15062. });
  15063. }
  15064. //推广佣金/提现总和
  15065. //3=佣金,4=提现
  15066. function getSpreadCount(data, type) {
  15067. return (0, _request.default)({
  15068. url: '/api/spread/count/' + type,
  15069. method: 'get',
  15070. data: data
  15071. });
  15072. }
  15073. //bind_admin
  15074. function bindAdmin(data) {
  15075. return (0, _request.default)({
  15076. url: '/api/bind_admin',
  15077. method: 'post',
  15078. data: data
  15079. });
  15080. }
  15081. // 订单核销
  15082. function orderVerific(data) {
  15083. return (0, _request.default)({
  15084. url: '/api/order/order_verific',
  15085. method: 'post',
  15086. data: data
  15087. });
  15088. }
  15089. //核销列表
  15090. function getOrderList(data) {
  15091. return (0, _request.default)({
  15092. url: '/api/order/order_verific',
  15093. method: 'post',
  15094. data: data
  15095. });
  15096. }
  15097. //获取管理商品列表
  15098. function getAllList(data) {
  15099. return (0, _request.default)({
  15100. url: '/api/admin/order/list',
  15101. method: 'get',
  15102. data: data
  15103. });
  15104. }
  15105. //admin/point自提点列表
  15106. function getPoint(data) {
  15107. return (0, _request.default)({
  15108. url: '/api/admin/point',
  15109. method: 'get',
  15110. data: data
  15111. });
  15112. }
  15113. //admin/point/5删除自提点
  15114. function delPoint(data, id) {
  15115. return (0, _request.default)({
  15116. url: '/api/admin/point/' + id,
  15117. method: 'delete',
  15118. data: data
  15119. });
  15120. }
  15121. //admin/point/1
  15122. function editPoint(data, id) {
  15123. return (0, _request.default)({
  15124. url: '/api/admin/point/' + id,
  15125. method: 'post',
  15126. data: data
  15127. });
  15128. }
  15129. // 核销兑换券
  15130. function exchangeOrderVerific(data) {
  15131. return (0, _request.default)({
  15132. url: '/api/order/exchange_order_verific',
  15133. method: 'post',
  15134. data: data
  15135. });
  15136. }
  15137. //获取送货员列表
  15138. function getSHY(data) {
  15139. return (0, _request.default)({
  15140. url: '/api/admin/sender',
  15141. method: 'get',
  15142. data: data
  15143. });
  15144. }
  15145. //佣金明细
  15146. function getStoreCms(data) {
  15147. return (0, _request.default)({
  15148. url: '/api/order/bill',
  15149. method: 'get',
  15150. data: data
  15151. });
  15152. }
  15153. // 佣金提现
  15154. function cash(data) {
  15155. return (0, _request.default)({
  15156. url: '/api/order/cash',
  15157. method: 'post',
  15158. data: data
  15159. });
  15160. }
  15161. // 发放实体卡
  15162. function sendStk(data) {
  15163. return (0, _request.default)({
  15164. url: '/api/admin/card/send',
  15165. method: 'post',
  15166. data: data
  15167. });
  15168. }
  15169. // 核销实体卡
  15170. function checkStk(data) {
  15171. return (0, _request.default)({
  15172. url: '/api/admin/card/check',
  15173. method: 'post',
  15174. data: data
  15175. });
  15176. }
  15177. // 实体卡列表
  15178. function getStk(data) {
  15179. return (0, _request.default)({
  15180. url: '/api/admin/card/send',
  15181. method: 'get',
  15182. data: data
  15183. });
  15184. }
  15185. // 发红包
  15186. function redbag(data) {
  15187. return (0, _request.default)({
  15188. url: '/api/red_bag/send',
  15189. method: 'post',
  15190. data: data
  15191. });
  15192. }
  15193. // 收红包
  15194. function getredbag(data, id) {
  15195. return (0, _request.default)({
  15196. url: '/api/red_bag/get/' + id,
  15197. method: 'post',
  15198. data: data
  15199. });
  15200. }
  15201. /***/ }),
  15202. /***/ 6:
  15203. /*!***************************************************************!*\
  15204. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  15205. \***************************************************************/
  15206. /*! no static exports found */
  15207. /***/ (function(module, exports) {
  15208. function _arrayWithHoles(arr) {
  15209. if (Array.isArray(arr)) return arr;
  15210. }
  15211. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15212. /***/ }),
  15213. /***/ 62:
  15214. /*!**************************************!*\
  15215. !*** D:/工作/项目2/生鲜/sx/api/product.js ***!
  15216. \**************************************/
  15217. /*! no static exports found */
  15218. /***/ (function(module, exports, __webpack_require__) {
  15219. "use strict";
  15220. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15221. Object.defineProperty(exports, "__esModule", {
  15222. value: true
  15223. });
  15224. exports.cartAdd = cartAdd;
  15225. exports.cartCount = cartCount;
  15226. exports.collectAdd = collectAdd;
  15227. exports.collectDel = collectDel;
  15228. exports.getBargainList = getBargainList;
  15229. exports.getCategoryList = getCategoryList;
  15230. exports.getCombinationLisPink = getCombinationLisPink;
  15231. exports.getCombinationLisRemove = getCombinationLisRemove;
  15232. exports.getCombinationList = getCombinationList;
  15233. exports.getCombinationPoster = getCombinationPoster;
  15234. exports.getExchangeDetail = getExchangeDetail;
  15235. exports.getExchangeList = getExchangeList;
  15236. exports.getExchangeLists = getExchangeLists;
  15237. exports.getIntegraDetail = getIntegraDetail;
  15238. exports.getIntegralList = getIntegralList;
  15239. exports.getOrderStock = getOrderStock;
  15240. exports.getProductList = getProductList;
  15241. exports.getProducts = getProducts;
  15242. exports.getSeckillClass = getSeckillClass;
  15243. exports.getSeckillIndexTime = getSeckillIndexTime;
  15244. exports.getSeckillList = getSeckillList;
  15245. exports.goodsDetail = goodsDetail;
  15246. exports.groomList = groomList;
  15247. exports.groupGoods = groupGoods;
  15248. exports.reply_config = reply_config;
  15249. exports.reply_list = reply_list;
  15250. exports.searchKeyword = searchKeyword;
  15251. exports.seckillGoods = seckillGoods;
  15252. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  15253. // 获取商品列表
  15254. function getProducts(data) {
  15255. // {
  15256. // 参数名称 是否必须 示例 备注
  15257. // sid 否 二级分类编号
  15258. // cid 否 一级分类编号(!)
  15259. // keyword 否 搜索
  15260. // priceOrder 否 价格排序
  15261. // salesOrder 否 销量排序
  15262. // news 否 是否新品
  15263. // page 否 分页参数起始值
  15264. // limit 否 分页数步长值
  15265. // }
  15266. return (0, _request.default)({
  15267. url: '/api/products',
  15268. method: 'get',
  15269. data: data
  15270. });
  15271. }
  15272. // 获取商品详情
  15273. function goodsDetail(data, id) {
  15274. return (0, _request.default)({
  15275. url: '/api/product/detail/' + id,
  15276. method: 'get',
  15277. data: data
  15278. });
  15279. }
  15280. // 砍价列表
  15281. function getBargainList(data) {
  15282. return (0, _request.default)({
  15283. url: '/api/bargain/list',
  15284. method: 'get',
  15285. data: data
  15286. });
  15287. }
  15288. // 加入购物车
  15289. function cartAdd(data) {
  15290. return (0, _request.default)({
  15291. url: '/api/cart/add',
  15292. method: 'post',
  15293. data: data
  15294. });
  15295. }
  15296. // 收藏商品
  15297. function collectAdd(data) {
  15298. return (0, _request.default)({
  15299. url: '/api/collect/add',
  15300. method: 'post',
  15301. data: data
  15302. });
  15303. }
  15304. // 取消收藏商品
  15305. function collectDel(data) {
  15306. return (0, _request.default)({
  15307. url: '/api/collect/del',
  15308. method: 'post',
  15309. data: data
  15310. });
  15311. }
  15312. // 获取搜搜关键字
  15313. function searchKeyword(data) {
  15314. return (0, _request.default)({
  15315. url: '/api/search/keyword',
  15316. method: 'get',
  15317. data: data
  15318. });
  15319. }
  15320. // 获取热门分类信息
  15321. function groomList(data, type) {
  15322. // 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
  15323. return (0, _request.default)({
  15324. url: '/api/groom/list/' + type,
  15325. method: 'get',
  15326. data: data
  15327. });
  15328. }
  15329. // 获取秒杀商品详细
  15330. function seckillGoods(data, id) {
  15331. return (0, _request.default)({
  15332. url: '/api/seckill/detail/' + id,
  15333. method: 'get',
  15334. data: data
  15335. });
  15336. }
  15337. // 获取拼团商品详细
  15338. function groupGoods(data, id) {
  15339. return (0, _request.default)({
  15340. url: '/api/combination/detail/' + id,
  15341. method: 'get',
  15342. data: data
  15343. });
  15344. }
  15345. // 获取商品分类
  15346. function getCategoryList(data) {
  15347. return (0, _request.default)({
  15348. url: '/api/category',
  15349. method: 'get',
  15350. data: data
  15351. });
  15352. }
  15353. // 获取拼团列表
  15354. function getCombinationList(data) {
  15355. return (0, _request.default)({
  15356. url: '/api/combination/list',
  15357. method: 'get',
  15358. data: data
  15359. });
  15360. }
  15361. //取消拼团
  15362. function getCombinationLisRemove(data, id) {
  15363. return (0, _request.default)({
  15364. url: '/api/combination/remove' + id,
  15365. method: 'get',
  15366. data: data
  15367. });
  15368. }
  15369. //拼团开团页面数据
  15370. function getCombinationLisPink(data, id) {
  15371. return (0, _request.default)({
  15372. url: '/api/combination/pink/' + id,
  15373. method: 'get',
  15374. data: data
  15375. });
  15376. }
  15377. // 获取拼团海报
  15378. function getCombinationPoster(data) {
  15379. return (0, _request.default)({
  15380. url: '/api/combination/poster',
  15381. method: 'post',
  15382. data: data
  15383. });
  15384. }
  15385. // 获取秒杀分类
  15386. function getSeckillClass(data) {
  15387. return (0, _request.default)({
  15388. url: '/api/seckill/index',
  15389. method: 'get',
  15390. data: data
  15391. });
  15392. }
  15393. // 获取秒杀列表
  15394. function getSeckillList(data, id) {
  15395. return (0, _request.default)({
  15396. url: '/api/seckill/list/' + id,
  15397. method: 'get',
  15398. data: data
  15399. });
  15400. }
  15401. //获取兑换券
  15402. function getExchangeList(data, id) {
  15403. return (0, _request.default)({
  15404. url: '/api/seckill/list/' + id,
  15405. method: 'get',
  15406. data: data
  15407. });
  15408. }
  15409. // 产品评价数量和好评度
  15410. function reply_config(data, id) {
  15411. return (0, _request.default)({
  15412. url: '/api/reply/config/' + id,
  15413. method: 'get',
  15414. data: data
  15415. });
  15416. }
  15417. // 获取产品评论
  15418. function reply_list(data, id) {
  15419. return (0, _request.default)({
  15420. url: '/api/reply/list/' + id,
  15421. method: 'get',
  15422. data: data
  15423. });
  15424. }
  15425. function getSeckillIndexTime(data) {
  15426. return (0, _request.default)({
  15427. url: ' /api/seckill/index',
  15428. method: 'get',
  15429. data: data
  15430. });
  15431. }
  15432. //获取积分商品列表
  15433. function getIntegralList(data) {
  15434. return (0, _request.default)({
  15435. url: '/api/store_integral/list',
  15436. method: 'get',
  15437. data: data
  15438. });
  15439. }
  15440. //获取积分商品详情
  15441. function getIntegraDetail(data, id) {
  15442. return (0, _request.default)({
  15443. url: '/api/store_integral/detail/' + id,
  15444. method: 'get',
  15445. data: data
  15446. });
  15447. }
  15448. //获取商品列表order/stock
  15449. function getOrderStock(data) {
  15450. return (0, _request.default)({
  15451. url: '/api/order/stock',
  15452. method: 'get',
  15453. data: data
  15454. });
  15455. }
  15456. //普通用户获取商品列表
  15457. function getProductList(data) {
  15458. return (0, _request.default)({
  15459. url: '/api/products',
  15460. method: 'get',
  15461. data: data
  15462. });
  15463. }
  15464. //购物车数量
  15465. function cartCount(data) {
  15466. return (0, _request.default)({
  15467. url: '/api/cart/count',
  15468. method: 'get',
  15469. data: data
  15470. });
  15471. }
  15472. //兑换券列表
  15473. function getExchangeLists(data) {
  15474. return (0, _request.default)({
  15475. url: '/api/exchange/list',
  15476. method: 'get',
  15477. data: data
  15478. });
  15479. }
  15480. // 获取兑换券详情
  15481. function getExchangeDetail(data, id) {
  15482. return (0, _request.default)({
  15483. url: '/api/exchange/detail/' + id,
  15484. method: 'get',
  15485. data: data
  15486. });
  15487. }
  15488. /***/ }),
  15489. /***/ 7:
  15490. /*!*********************************************************************!*\
  15491. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  15492. \*********************************************************************/
  15493. /*! no static exports found */
  15494. /***/ (function(module, exports) {
  15495. function _iterableToArrayLimit(arr, i) {
  15496. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  15497. if (null != _i) {
  15498. var _s,
  15499. _e,
  15500. _x,
  15501. _r,
  15502. _arr = [],
  15503. _n = !0,
  15504. _d = !1;
  15505. try {
  15506. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  15507. if (Object(_i) !== _i) return;
  15508. _n = !1;
  15509. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  15510. ;
  15511. }
  15512. } catch (err) {
  15513. _d = !0, _e = err;
  15514. } finally {
  15515. try {
  15516. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  15517. } finally {
  15518. if (_d) throw _e;
  15519. }
  15520. }
  15521. return _arr;
  15522. }
  15523. }
  15524. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15525. /***/ }),
  15526. /***/ 79:
  15527. /*!************************************!*\
  15528. !*** D:/工作/项目2/生鲜/sx/api/login.js ***!
  15529. \************************************/
  15530. /*! no static exports found */
  15531. /***/ (function(module, exports, __webpack_require__) {
  15532. "use strict";
  15533. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15534. Object.defineProperty(exports, "__esModule", {
  15535. value: true
  15536. });
  15537. exports.getUserInfo = getUserInfo;
  15538. exports.jiaMobile = jiaMobile;
  15539. exports.login = login;
  15540. exports.loginMobile = loginMobile;
  15541. exports.register = register;
  15542. exports.registerVerify = registerVerify;
  15543. exports.verify = verify;
  15544. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  15545. // 登录
  15546. function login(data) {
  15547. return (0, _request.default)({
  15548. url: '/api/login',
  15549. method: 'post',
  15550. data: data
  15551. });
  15552. }
  15553. // 注册
  15554. // export function register(data) {
  15555. // return request({
  15556. // url: '/api/register',
  15557. // method: 'post',
  15558. // data
  15559. // });
  15560. // }
  15561. // 验证码
  15562. function verify(data) {
  15563. // type=register为注册
  15564. // type=login为登录
  15565. return (0, _request.default)({
  15566. // url: '/api/register/verify',
  15567. // url:'/api/auth/verify',
  15568. url: '/api/verify_code',
  15569. method: 'post',
  15570. data: data
  15571. });
  15572. }
  15573. // 获取用户信息
  15574. function getUserInfo(data) {
  15575. return (0, _request.default)({
  15576. url: '/api/userinfo',
  15577. method: 'get',
  15578. data: data
  15579. });
  15580. }
  15581. // 短信登录
  15582. function loginMobile(data) {
  15583. return (0, _request.default)({
  15584. url: '/api/login/mobile',
  15585. method: 'post',
  15586. data: data
  15587. });
  15588. }
  15589. /**
  15590. * h5用户手机号注册
  15591. * @param data object 用户手机号 验证码 密码
  15592. */
  15593. function register(data) {
  15594. return (0, _request.default)({
  15595. url: '/api/register',
  15596. method: 'post',
  15597. data: data
  15598. });
  15599. }
  15600. /**
  15601. * h5用户发送验证码
  15602. * @param data object 用户手机号
  15603. */
  15604. function registerVerify(data) {
  15605. return (0, _request.default)({
  15606. url: '/api/auth/verify',
  15607. data: data
  15608. });
  15609. }
  15610. function jiaMobile(data) {
  15611. // return request.post("/api/auth/smslogin", data, {
  15612. // noAuth: true
  15613. // });
  15614. return (0, _request.default)({
  15615. url: '/api/register',
  15616. method: 'post',
  15617. data: data
  15618. });
  15619. }
  15620. /***/ }),
  15621. /***/ 8:
  15622. /*!***************************************************************************!*\
  15623. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  15624. \***************************************************************************/
  15625. /*! no static exports found */
  15626. /***/ (function(module, exports, __webpack_require__) {
  15627. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  15628. function _unsupportedIterableToArray(o, minLen) {
  15629. if (!o) return;
  15630. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  15631. var n = Object.prototype.toString.call(o).slice(8, -1);
  15632. if (n === "Object" && o.constructor) n = o.constructor.name;
  15633. if (n === "Map" || n === "Set") return Array.from(o);
  15634. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  15635. }
  15636. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15637. /***/ }),
  15638. /***/ 80:
  15639. /*!*********************************************!*\
  15640. !*** D:/工作/项目2/生鲜/sx/utils/wxMinProgram.js ***!
  15641. \*********************************************/
  15642. /*! no static exports found */
  15643. /***/ (function(module, exports, __webpack_require__) {
  15644. "use strict";
  15645. /* WEBPACK VAR INJECTION */(function(uni, wx) {
  15646. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15647. Object.defineProperty(exports, "__esModule", {
  15648. value: true
  15649. });
  15650. exports.loginWinxinMp = loginWinxinMp;
  15651. var _store = _interopRequireDefault(__webpack_require__(/*! ../store */ 27));
  15652. //微信登录
  15653. /**
  15654. * @param {string} 当前页面地址信息
  15655. */
  15656. function loginWinxinMp() {
  15657. var pages = getCurrentPages();
  15658. // 获取跳转前页面
  15659. var page = pages[pages.length - 2];
  15660. var queryUrl = '';
  15661. for (var key in page.options) {
  15662. queryUrl += key + '=' + page.options[key] + "&";
  15663. }
  15664. // 获取当页面路由地址
  15665. var path = '/' + page.route + '?' + queryUrl;
  15666. // 保存跳转前页面
  15667. uni.setStorageSync('present', path);
  15668. return new Promise(function (resolve, reject) {
  15669. wx.login({
  15670. success: function success(e) {
  15671. // uni.showModal({
  15672. // title:'zhi1',
  15673. // content:JSON.stringify(e)
  15674. // })
  15675. console.log(e);
  15676. resolve(e);
  15677. },
  15678. fill: function fill(e) {
  15679. reject(e);
  15680. }
  15681. });
  15682. });
  15683. }
  15684. ;
  15685. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  15686. /***/ }),
  15687. /***/ 81:
  15688. /*!*********************************!*\
  15689. !*** D:/工作/项目2/生鲜/sx/api/wx.js ***!
  15690. \*********************************/
  15691. /*! no static exports found */
  15692. /***/ (function(module, exports, __webpack_require__) {
  15693. "use strict";
  15694. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  15695. Object.defineProperty(exports, "__esModule", {
  15696. value: true
  15697. });
  15698. exports.wechatMpAuth = wechatMpAuth;
  15699. var _request = _interopRequireDefault(__webpack_require__(/*! @/utils/request */ 35));
  15700. // 微信code地址
  15701. function wechatMpAuth(data) {
  15702. return (0, _request.default)({
  15703. url: '/api/wechat/mp_auth',
  15704. method: 'post',
  15705. data: data
  15706. });
  15707. }
  15708. /***/ }),
  15709. /***/ 9:
  15710. /*!*****************************************************************!*\
  15711. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  15712. \*****************************************************************/
  15713. /*! no static exports found */
  15714. /***/ (function(module, exports) {
  15715. function _arrayLikeToArray(arr, len) {
  15716. if (len == null || len > arr.length) len = arr.length;
  15717. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  15718. arr2[i] = arr[i];
  15719. }
  15720. return arr2;
  15721. }
  15722. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15723. /***/ })
  15724. }]);
  15725. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map