vant.js 302 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("vue"));
  4. else if(typeof define === 'function' && define.amd)
  5. define("vant", ["vue"], factory);
  6. else if(typeof exports === 'object')
  7. exports["vant"] = factory(require("vue"));
  8. else
  9. root["vant"] = factory(root["Vue"]);
  10. })(this, function(__WEBPACK_EXTERNAL_MODULE__2__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 8);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ([
  98. /* 0 */
  99. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100. "use strict";
  101. // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
  102. var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(2);
  103. var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
  104. // CONCATENATED MODULE: ./es/utils/use/bem.js
  105. /**
  106. * bem helper
  107. * b() // 'button'
  108. * b('text') // 'button__text'
  109. * b({ disabled }) // 'button button--disabled'
  110. * b('text', { disabled }) // 'button__text button__text--disabled'
  111. * b(['disabled', 'primary']) // 'button button--disabled button--primary'
  112. */
  113. var ELEMENT = '__';
  114. var MODS = '--';
  115. function join(name, el, symbol) {
  116. return el ? name + symbol + el : name;
  117. }
  118. function bem_prefix(name, mods) {
  119. if (typeof mods === 'string') {
  120. return join(name, mods, MODS);
  121. }
  122. if (Array.isArray(mods)) {
  123. return mods.map(function (item) {
  124. return bem_prefix(name, item);
  125. });
  126. }
  127. var ret = {};
  128. if (mods) {
  129. Object.keys(mods).forEach(function (key) {
  130. ret[name + MODS + key] = mods[key];
  131. });
  132. }
  133. return ret;
  134. }
  135. var useBEM = function useBEM(name) {
  136. return function (el, mods) {
  137. if (el && typeof el !== 'string') {
  138. mods = el;
  139. el = '';
  140. }
  141. el = join(name, el, ELEMENT);
  142. return mods ? [el, bem_prefix(el, mods)] : el;
  143. };
  144. };
  145. // EXTERNAL MODULE: ./es/locale/index.js + 1 modules
  146. var locale = __webpack_require__(4);
  147. // CONCATENATED MODULE: ./es/mixins/slots.js
  148. /**
  149. * Use scopedSlots in Vue 2.6+
  150. * downgrade to slots in lower version
  151. */
  152. var SlotsMixin = {
  153. methods: {
  154. slots: function slots(name, props) {
  155. if (name === void 0) {
  156. name = 'default';
  157. }
  158. var $slots = this.$slots,
  159. $scopedSlots = this.$scopedSlots;
  160. if ($scopedSlots[name]) {
  161. return $scopedSlots[name](props);
  162. }
  163. return $slots[name];
  164. }
  165. }
  166. };
  167. // CONCATENATED MODULE: ./es/utils/use/sfc.js
  168. /**
  169. * Create a basic component with common options
  170. */
  171. var arrayProp = {
  172. type: Array,
  173. "default": function _default() {
  174. return [];
  175. }
  176. };
  177. var numberProp = {
  178. type: Number,
  179. "default": 0
  180. };
  181. function defaultProps(props) {
  182. Object.keys(props).forEach(function (key) {
  183. if (props[key] === Array) {
  184. props[key] = arrayProp;
  185. } else if (props[key] === Number) {
  186. props[key] = numberProp;
  187. }
  188. });
  189. }
  190. function install(Vue) {
  191. var name = this.name;
  192. Vue.component(name, this);
  193. Vue.component(camelize("-" + name), this);
  194. } // unify slots & scopedSlots
  195. function unifySlots(context) {
  196. // use data.scopedSlots in lower Vue version
  197. var scopedSlots = context.scopedSlots || context.data.scopedSlots || {};
  198. var slots = context.slots();
  199. Object.keys(slots).forEach(function (key) {
  200. if (!scopedSlots[key]) {
  201. scopedSlots[key] = function () {
  202. return slots[key];
  203. };
  204. }
  205. });
  206. return scopedSlots;
  207. } // should be removed after Vue 3
  208. function transformFunctionComponent(pure) {
  209. return {
  210. functional: true,
  211. props: pure.props,
  212. model: pure.model,
  213. render: function render(h, context) {
  214. return pure(h, context.props, unifySlots(context), context);
  215. }
  216. };
  217. }
  218. var sfc_useSFC = function useSFC(name) {
  219. return function (sfc) {
  220. if (typeof sfc === 'function') {
  221. sfc = transformFunctionComponent(sfc);
  222. }
  223. if (!sfc.functional) {
  224. sfc.mixins = sfc.mixins || [];
  225. sfc.mixins.push(SlotsMixin);
  226. }
  227. if (sfc.props) {
  228. defaultProps(sfc.props);
  229. }
  230. sfc.name = name;
  231. sfc.install = install;
  232. return sfc;
  233. };
  234. };
  235. // CONCATENATED MODULE: ./es/utils/use/i18n.js
  236. var i18n_useI18N = function useI18N(name) {
  237. var prefix = camelize(name) + '.';
  238. return function (path) {
  239. var message = get(locale["a" /* default */].messages(), prefix + path) || get(locale["a" /* default */].messages(), path);
  240. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  241. args[_key - 1] = arguments[_key];
  242. }
  243. return typeof message === 'function' ? message.apply(void 0, args) : message;
  244. };
  245. };
  246. // CONCATENATED MODULE: ./es/utils/use/index.js
  247. function use(name) {
  248. name = 'van-' + name;
  249. return [sfc_useSFC(name), useBEM(name), i18n_useI18N(name)];
  250. }
  251. // CONCATENATED MODULE: ./es/utils/index.js
  252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isServer; });
  253. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return noop; });
  254. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isDef; });
  255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isObj; });
  256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return get; });
  257. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return camelize; });
  258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isAndroid; });
  259. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isIOS; });
  260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return range; });
  261. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isInDocument; });
  262. /* concated harmony reexport use */__webpack_require__.d(__webpack_exports__, "k", function() { return use; });
  263. var isServer = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype.$isServer;
  264. function noop() {}
  265. function isDef(value) {
  266. return value !== undefined && value !== null;
  267. }
  268. function isObj(x) {
  269. var type = typeof x;
  270. return x !== null && (type === 'object' || type === 'function');
  271. }
  272. function get(object, path) {
  273. var keys = path.split('.');
  274. var result = object;
  275. keys.forEach(function (key) {
  276. result = isDef(result[key]) ? result[key] : '';
  277. });
  278. return result;
  279. }
  280. var camelizeRE = /-(\w)/g;
  281. function camelize(str) {
  282. return str.replace(camelizeRE, function (_, c) {
  283. return c.toUpperCase();
  284. });
  285. }
  286. function isAndroid() {
  287. /* istanbul ignore next */
  288. return isServer ? false : /android/.test(navigator.userAgent.toLowerCase());
  289. }
  290. function isIOS() {
  291. /* istanbul ignore next */
  292. return isServer ? false : /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase());
  293. }
  294. function range(num, min, max) {
  295. return Math.min(Math.max(num, min), max);
  296. }
  297. function isInDocument(element) {
  298. return document.body.contains(element);
  299. }
  300. /***/ }),
  301. /* 1 */
  302. /***/ (function(module, exports, __webpack_require__) {
  303. "use strict";
  304. function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(a){return a.reduce(function(c,a){for(var b in a)if(!c[b])c[b]=a[b];else if(-1!==normalMerge.indexOf(b))c[b]=_extends({},c[b],a[b]);else if(-1!==toArrayMerge.indexOf(b)){var d=c[b]instanceof Array?c[b]:[c[b]],e=a[b]instanceof Array?a[b]:[a[b]];c[b]=d.concat(e)}else if(-1!==functionalMerge.indexOf(b)){for(var f in a[b])if(c[b][f]){var g=c[b][f]instanceof Array?c[b][f]:[c[b][f]],h=a[b][f]instanceof Array?a[b][f]:[a[b][f]];c[b][f]=g.concat(h)}else c[b][f]=a[b][f];}else if("hook"==b)for(var i in a[b])c[b][i]=c[b][i]?mergeFn(c[b][i],a[b][i]):a[b][i];else c[b]=a[b];return c},{})},mergeFn=function(a,b){return function(){a&&a.apply(this,arguments),b&&b.apply(this,arguments)}};module.exports=mergeJsxProps;
  305. /***/ }),
  306. /* 2 */
  307. /***/ (function(module, exports) {
  308. module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
  309. /***/ }),
  310. /* 3 */
  311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  312. "use strict";
  313. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return raf; });
  314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cancel; });
  315. /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  316. /**
  317. * requestAnimationFrame polyfill
  318. */
  319. var prev = Date.now();
  320. /* istanbul ignore next */
  321. function fallback(fn) {
  322. var curr = Date.now();
  323. var ms = Math.max(0, 16 - (curr - prev));
  324. var id = setTimeout(fn, ms);
  325. prev = curr + ms;
  326. return id;
  327. }
  328. /* istanbul ignore next */
  329. var root = _index__WEBPACK_IMPORTED_MODULE_0__[/* isServer */ "h"] ? global : window;
  330. /* istanbul ignore next */
  331. var iRaf = root.requestAnimationFrame || fallback;
  332. /* istanbul ignore next */
  333. var iCancel = root.cancelAnimationFrame || root.clearTimeout;
  334. function raf(fn) {
  335. return iRaf.call(root, fn);
  336. }
  337. function cancel(id) {
  338. iCancel.call(root, id);
  339. }
  340. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(7)))
  341. /***/ }),
  342. /* 4 */
  343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  344. "use strict";
  345. // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
  346. var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(2);
  347. var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
  348. // EXTERNAL MODULE: ./es/utils/deep-assign.js
  349. var deep_assign = __webpack_require__(5);
  350. // CONCATENATED MODULE: ./es/locale/lang/zh-CN.js
  351. /* harmony default export */ var zh_CN = ({
  352. name: '姓名',
  353. tel: '电话',
  354. save: '保存',
  355. confirm: '确认',
  356. cancel: '取消',
  357. "delete": '删除',
  358. complete: '完成',
  359. loading: '加载中...',
  360. telEmpty: '请填写电话',
  361. nameEmpty: '请填写姓名',
  362. confirmDelete: '确定要删除么',
  363. telInvalid: '请填写正确的电话',
  364. vanContactCard: {
  365. addText: '添加联系人'
  366. },
  367. vanContactList: {
  368. addText: '新建联系人'
  369. },
  370. vanPagination: {
  371. prev: '上一页',
  372. next: '下一页'
  373. },
  374. vanPullRefresh: {
  375. pulling: '下拉即可刷新...',
  376. loosing: '释放即可刷新...'
  377. },
  378. vanSubmitBar: {
  379. label: '合计:'
  380. },
  381. vanCoupon: {
  382. valid: '有效期',
  383. unlimited: '无使用门槛',
  384. discount: function discount(_discount) {
  385. return _discount + "\u6298";
  386. },
  387. condition: function condition(_condition) {
  388. return "\u6EE1" + _condition + "\u5143\u53EF\u7528";
  389. }
  390. },
  391. vanCouponCell: {
  392. title: '优惠券',
  393. tips: '使用优惠',
  394. count: function count(_count) {
  395. return _count + "\u5F20\u53EF\u7528";
  396. }
  397. },
  398. vanCouponList: {
  399. empty: '暂无优惠券',
  400. exchange: '兑换',
  401. close: '不使用优惠',
  402. enable: '可使用优惠券',
  403. disabled: '不可使用优惠券',
  404. placeholder: '请输入优惠码'
  405. },
  406. vanAddressEdit: {
  407. area: '地区',
  408. postal: '邮政编码',
  409. areaEmpty: '请选择地区',
  410. addressEmpty: '请填写详细地址',
  411. postalEmpty: '邮政编码格式不正确',
  412. defaultAddress: '设为默认收货地址',
  413. telPlaceholder: '收货人手机号',
  414. namePlaceholder: '收货人姓名',
  415. areaPlaceholder: '选择省 / 市 / 区'
  416. },
  417. vanAddressEditDetail: {
  418. label: '详细地址',
  419. placeholder: '街道门牌、楼层房间号等信息'
  420. },
  421. vanAddressList: {
  422. add: '新增地址'
  423. }
  424. });
  425. // CONCATENATED MODULE: ./es/locale/index.js
  426. var proto = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype;
  427. var defineReactive = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.util.defineReactive;
  428. defineReactive(proto, '$vantLang', 'zh-CN');
  429. defineReactive(proto, '$vantMessages', {
  430. 'zh-CN': zh_CN
  431. });
  432. /* harmony default export */ var locale = __webpack_exports__["a"] = ({
  433. messages: function messages() {
  434. return proto.$vantMessages[proto.$vantLang];
  435. },
  436. use: function use(lang, messages) {
  437. var _this$add;
  438. proto.$vantLang = lang;
  439. this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
  440. },
  441. add: function add(messages) {
  442. if (messages === void 0) {
  443. messages = {};
  444. }
  445. Object(deep_assign["a" /* deepAssign */])(proto.$vantMessages, messages);
  446. }
  447. });
  448. /***/ }),
  449. /* 5 */
  450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  451. "use strict";
  452. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return deepAssign; });
  453. /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  454. /* eslint-disable no-use-before-define */
  455. var hasOwnProperty = Object.prototype.hasOwnProperty;
  456. function assignKey(to, from, key) {
  457. var val = from[key];
  458. if (!Object(___WEBPACK_IMPORTED_MODULE_0__[/* isDef */ "d"])(val)) {
  459. return;
  460. }
  461. if (!hasOwnProperty.call(to, key) || !Object(___WEBPACK_IMPORTED_MODULE_0__[/* isObj */ "g"])(val)) {
  462. to[key] = val;
  463. } else {
  464. to[key] = deepAssign(Object(to[key]), from[key]);
  465. }
  466. }
  467. function deepAssign(to, from) {
  468. Object.keys(from).forEach(function (key) {
  469. assignKey(to, from, key);
  470. });
  471. return to;
  472. }
  473. /***/ }),
  474. /* 6 */
  475. /***/ (function(module, exports, __webpack_require__) {
  476. /*!
  477. * Vue-Lazyload.js v1.2.3
  478. * (c) 2018 Awe <hilongjw@gmail.com>
  479. * Released under the MIT License.
  480. */
  481. !function(e,t){ true?module.exports=t():undefined}(this,function(){"use strict";function e(e){return e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function t(e){e=e||{};var t=arguments.length,i=0;if(1===t)return e;for(;++i<t;){var o=arguments[i];g(e)&&(e=o),r(o)&&n(e,o)}return e}function n(e,n){m(e,n);for(var o in n)if("__proto__"!==o&&i(n,o)){var a=n[o];r(a)?("undefined"===L(e[o])&&"function"===L(a)&&(e[o]=a),e[o]=t(e[o]||{},a)):e[o]=a}return e}function r(e){return"object"===L(e)||"function"===L(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e,t){if(e.length){var n=e.indexOf(t);return n>-1?e.splice(n,1):void 0}}function a(e,t){for(var n=!1,r=0,i=e.length;r<i;r++)if(t(e[r])){n=!0;break}return n}function s(e,t){if("IMG"===e.tagName&&e.getAttribute("data-srcset")){var n=e.getAttribute("data-srcset"),r=[],i=e.parentNode,o=i.offsetWidth*t,a=void 0,s=void 0,u=void 0;n=n.trim().split(","),n.map(function(e){e=e.trim(),a=e.lastIndexOf(" "),-1===a?(s=e,u=999998):(s=e.substr(0,a),u=parseInt(e.substr(a+1,e.length-a-2),10)),r.push([u,s])}),r.sort(function(e,t){if(e[0]<t[0])return-1;if(e[0]>t[0])return 1;if(e[0]===t[0]){if(-1!==t[1].indexOf(".webp",t[1].length-5))return 1;if(-1!==e[1].indexOf(".webp",e[1].length-5))return-1}return 0});for(var l="",d=void 0,c=r.length,h=0;h<c;h++)if(d=r[h],d[0]>=o){l=d[1];break}return l}}function u(e,t){for(var n=void 0,r=0,i=e.length;r<i;r++)if(t(e[r])){n=e[r];break}return n}function l(){if(!k)return!1;var e=!0,t=document;try{var n=t.createElement("object");n.type="image/webp",n.style.visibility="hidden",n.innerHTML="!",t.body.appendChild(n),e=!n.offsetWidth,t.body.removeChild(n)}catch(t){e=!1}return e}function d(e,t){var n=null,r=0;return function(){if(!n){var i=Date.now()-r,o=this,a=arguments,s=function(){r=Date.now(),n=!1,e.apply(o,a)};i>=t?s():n=setTimeout(s,t)}}}function c(e){return null!==e&&"object"===(void 0===e?"undefined":p(e))}function h(e){if(!(e instanceof Object))return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function f(e){for(var t=e.length,n=[],r=0;r<t;r++)n.push(e[r]);return n}function v(){}var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),g=function(e){return null==e||"function"!=typeof e&&"object"!==(void 0===e?"undefined":p(e))},m=function(e,t){if(null===e||void 0===e)throw new TypeError("expected first argument to be an object.");if(void 0===t||"undefined"==typeof Symbol)return e;if("function"!=typeof Object.getOwnPropertySymbols)return e;for(var n=Object.prototype.propertyIsEnumerable,r=Object(e),i=arguments.length,o=0;++o<i;)for(var a=Object(arguments[o]),s=Object.getOwnPropertySymbols(a),u=0;u<s.length;u++){var l=s[u];n.call(a,l)&&(r[l]=a[l])}return r},w=Object.prototype.toString,L=function(t){var n=void 0===t?"undefined":p(t);return"undefined"===n?"undefined":null===t?"null":!0===t||!1===t||t instanceof Boolean?"boolean":"string"===n||t instanceof String?"string":"number"===n||t instanceof Number?"number":"function"===n||t instanceof Function?void 0!==t.constructor.name&&"Generator"===t.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(t)?"array":t instanceof RegExp?"regexp":t instanceof Date?"date":(n=w.call(t),"[object RegExp]"===n?"regexp":"[object Date]"===n?"date":"[object Arguments]"===n?"arguments":"[object Error]"===n?"error":"[object Promise]"===n?"promise":e(t)?"buffer":"[object Set]"===n?"set":"[object WeakSet]"===n?"weakset":"[object Map]"===n?"map":"[object WeakMap]"===n?"weakmap":"[object Symbol]"===n?"symbol":"[object Map Iterator]"===n?"mapiterator":"[object Set Iterator]"===n?"setiterator":"[object String Iterator]"===n?"stringiterator":"[object Array Iterator]"===n?"arrayiterator":"[object Int8Array]"===n?"int8array":"[object Uint8Array]"===n?"uint8array":"[object Uint8ClampedArray]"===n?"uint8clampedarray":"[object Int16Array]"===n?"int16array":"[object Uint16Array]"===n?"uint16array":"[object Int32Array]"===n?"int32array":"[object Uint32Array]"===n?"uint32array":"[object Float32Array]"===n?"float32array":"[object Float64Array]"===n?"float64array":"object")},_=t,k="undefined"!=typeof window,E=k&&"IntersectionObserver"in window,A={event:"event",observer:"observer"},j=function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if(k)return"function"==typeof window.CustomEvent?window.CustomEvent:(e.prototype=window.Event.prototype,e)}(),z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return k?window.devicePixelRatio||e:e},T=function(){if(k){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}}(),O={on:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];T?e.addEventListener(t,n,{capture:r,passive:!0}):e.addEventListener(t,n,r)},off:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,n,r)}},I=function(e,t,n){var r=new Image;r.src=e.src,r.onload=function(){t({naturalHeight:r.naturalHeight,naturalWidth:r.naturalWidth,src:r.src})},r.onerror=function(e){n(e)}},x=function(e,t){return"undefined"!=typeof getComputedStyle?getComputedStyle(e,null).getPropertyValue(t):e.style[t]},S=function(e){return x(e,"overflow")+x(e,"overflow-y")+x(e,"overflow-x")},$=function(e){if(k){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t!==document.body&&t!==document.documentElement&&t.parentNode;){if(/(scroll|auto)/.test(S(t)))return t;t=t.parentNode}return window}},H={},Q=function(){function e(t){var n=t.el,r=t.src,i=t.error,o=t.loading,a=t.bindType,s=t.$parent,u=t.options,l=t.elRenderer;b(this,e),this.el=n,this.src=r,this.error=i,this.loading=o,this.bindType=a,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=u,this.rect=null,this.$parent=s,this.elRenderer=l,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}return y(e,[{key:"initState",value:function(){this.el.dataset.src=this.src,this.state={error:!1,loaded:!1,rendered:!1}}},{key:"record",value:function(e){this.performanceData[e]=Date.now()}},{key:"update",value:function(e){var t=e.src,n=e.loading,r=e.error,i=this.src;this.src=t,this.loading=n,this.error=r,this.filter(),i!==this.src&&(this.attempt=0,this.initState())}},{key:"getRect",value:function(){this.rect=this.el.getBoundingClientRect()}},{key:"checkInView",value:function(){return this.getRect(),this.rect.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}},{key:"filter",value:function(){var e=this;h(this.options.filter).map(function(t){e.options.filter[t](e,e.options)})}},{key:"renderLoading",value:function(e){var t=this;I({src:this.loading},function(n){t.render("loading",!1),e()},function(){e(),t.options.silent||console.warn("VueLazyload log: load failed with loading image("+t.loading+")")})}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log("VueLazyload log: "+this.src+" tried too more than "+this.options.attempt+" times"),void t()):this.state.loaded||H[this.src]?(this.state.loaded=!0,t(),this.render("loaded",!0)):void this.renderLoading(function(){e.attempt++,e.record("loadStart"),I({src:e.src},function(n){e.naturalHeight=n.naturalHeight,e.naturalWidth=n.naturalWidth,e.state.loaded=!0,e.state.error=!1,e.record("loadEnd"),e.render("loaded",!1),H[e.src]=1,t()},function(t){!e.options.silent&&console.error(t),e.state.error=!0,e.state.loaded=!1,e.render("error",!1)})})}},{key:"render",value:function(e,t){this.elRenderer(this,e,t)}},{key:"performance",value:function(){var e="loading",t=0;return this.state.loaded&&(e="loaded",t=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(e="error"),{src:this.src,state:e,time:t}}},{key:"destroy",value:function(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}]),e}(),C="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",R=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],W={rootMargin:"0px",threshold:0},D=function(e){return function(){function t(e){var n=e.preLoad,r=e.error,i=e.throttleWait,o=e.preLoadTop,a=e.dispatchEvent,s=e.loading,u=e.attempt,c=e.silent,h=void 0===c||c,f=e.scale,v=e.listenEvents,p=(e.hasbind,e.filter),y=e.adapter,g=e.observer,m=e.observerOptions;b(this,t),this.version="1.2.3",this.mode=A.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:h,dispatchEvent:!!a,throttleWait:i||200,preLoad:n||1.3,preLoadTop:o||0,error:r||C,loading:s||C,attempt:u||3,scale:f||z(f),ListenEvents:v||R,hasbind:!1,supportWebp:l(),filter:p||{},adapter:y||{},observer:!!g,observerOptions:m||W},this._initEvent(),this.lazyLoadHandler=d(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?A.observer:A.event)}return y(t,[{key:"config",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_(this.options,e)}},{key:"performance",value:function(){var e=[];return this.ListenerQueue.map(function(t){e.push(t.performance())}),e}},{key:"addLazyBox",value:function(e){this.ListenerQueue.push(e),k&&(this._addListenerTarget(window),this._observer&&this._observer.observe(e.el),e.$el&&e.$el.parentNode&&this._addListenerTarget(e.$el.parentNode))}},{key:"add",value:function(t,n,r){var i=this;if(a(this.ListenerQueue,function(e){return e.el===t}))return this.update(t,n),e.nextTick(this.lazyLoadHandler);var o=this._valueFormatter(n.value),u=o.src,l=o.loading,d=o.error;e.nextTick(function(){u=s(t,i.options.scale)||u,i._observer&&i._observer.observe(t);var o=Object.keys(n.modifiers)[0],a=void 0;o&&(a=r.context.$refs[o],a=a?a.$el||a:document.getElementById(o)),a||(a=$(t));var c=new Q({bindType:n.arg,$parent:a,el:t,loading:l,error:d,src:u,elRenderer:i._elRenderer.bind(i),options:i.options});i.ListenerQueue.push(c),k&&(i._addListenerTarget(window),i._addListenerTarget(a)),i.lazyLoadHandler(),e.nextTick(function(){return i.lazyLoadHandler()})})}},{key:"update",value:function(t,n){var r=this,i=this._valueFormatter(n.value),o=i.src,a=i.loading,l=i.error;o=s(t,this.options.scale)||o;var d=u(this.ListenerQueue,function(e){return e.el===t});d&&d.update({src:o,loading:a,error:l}),this._observer&&(this._observer.unobserve(t),this._observer.observe(t)),this.lazyLoadHandler(),e.nextTick(function(){return r.lazyLoadHandler()})}},{key:"remove",value:function(e){if(e){this._observer&&this._observer.unobserve(e);var t=u(this.ListenerQueue,function(t){return t.el===e});t&&(this._removeListenerTarget(t.$parent),this._removeListenerTarget(window),o(this.ListenerQueue,t)&&t.destroy())}}},{key:"removeComponent",value:function(e){e&&(o(this.ListenerQueue,e),this._observer&&this._observer.unobserve(e.el),e.$parent&&e.$el.parentNode&&this._removeListenerTarget(e.$el.parentNode),this._removeListenerTarget(window))}},{key:"setMode",value:function(e){var t=this;E||e!==A.observer||(e=A.event),this.mode=e,e===A.event?(this._observer&&(this.ListenerQueue.forEach(function(e){t._observer.unobserve(e.el)}),this._observer=null),this.TargetQueue.forEach(function(e){t._initListen(e.el,!0)})):(this.TargetQueue.forEach(function(e){t._initListen(e.el,!1)}),this._initIntersectionObserver())}},{key:"_addListenerTarget",value:function(e){if(e){var t=u(this.TargetQueue,function(t){return t.el===e});return t?t.childrenCount++:(t={el:e,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===A.event&&this._initListen(t.el,!0),this.TargetQueue.push(t)),this.TargetIndex}}},{key:"_removeListenerTarget",value:function(e){var t=this;this.TargetQueue.forEach(function(n,r){n.el===e&&(--n.childrenCount||(t._initListen(n.el,!1),t.TargetQueue.splice(r,1),n=null))})}},{key:"_initListen",value:function(e,t){var n=this;this.options.ListenEvents.forEach(function(r){return O[t?"on":"off"](e,r,n.lazyLoadHandler)})}},{key:"_initEvent",value:function(){var e=this;this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=function(t,n){e.Event.listeners[t].push(n)},this.$once=function(t,n){function r(){i.$off(t,r),n.apply(i,arguments)}var i=e;e.$on(t,r)},this.$off=function(t,n){if(!n)return void(e.Event.listeners[t]=[]);o(e.Event.listeners[t],n)},this.$emit=function(t,n,r){e.Event.listeners[t].forEach(function(e){return e(n,r)})}}},{key:"_lazyLoadHandler",value:function(){var e=this,t=!1;this.ListenerQueue.forEach(function(n,r){n.state.loaded||(t=n.checkInView())&&n.load(function(){!n.error&&n.loaded&&e.ListenerQueue.splice(r,1)})})}},{key:"_initIntersectionObserver",value:function(){var e=this;E&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(function(t){e._observer.observe(t.el)}))}},{key:"_observerHandler",value:function(e,t){var n=this;e.forEach(function(e){e.isIntersecting&&n.ListenerQueue.forEach(function(t){if(t.el===e.target){if(t.state.loaded)return n._observer.unobserve(t.el);t.load()}})})}},{key:"_elRenderer",value:function(e,t,n){if(e.el){var r=e.el,i=e.bindType,o=void 0;switch(t){case"loading":o=e.loading;break;case"error":o=e.error;break;default:o=e.src}if(i?r.style[i]='url("'+o+'")':r.getAttribute("src")!==o&&r.setAttribute("src",o),r.setAttribute("lazy",t),this.$emit(t,e,n),this.options.adapter[t]&&this.options.adapter[t](e,this.options),this.options.dispatchEvent){var a=new j(t,{detail:e});r.dispatchEvent(a)}}}},{key:"_valueFormatter",value:function(e){var t=e,n=this.options.loading,r=this.options.error;return c(e)&&(e.src||this.options.silent||console.error("Vue Lazyload warning: miss src with "+e),t=e.src,n=e.loading||this.options.loading,r=e.error||this.options.error),{src:t,loading:n,error:r}}}]),t}()},B=function(e){return{props:{tag:{type:String,default:"div"}},render:function(e){return!1===this.show?e(this.tag):e(this.tag,null,this.$slots.default)},data:function(){return{el:null,state:{loaded:!1},rect:{},show:!1}},mounted:function(){this.el=this.$el,e.addLazyBox(this),e.lazyLoadHandler()},beforeDestroy:function(){e.removeComponent(this)},methods:{getRect:function(){this.rect=this.$el.getBoundingClientRect()},checkInView:function(){return this.getRect(),k&&this.rect.top<window.innerHeight*e.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*e.options.preLoad&&this.rect.right>0},load:function(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)}}}},V=function(){function e(t){var n=t.lazy;b(this,e),this.lazy=n,n.lazyContainerMananger=this,this._queue=[]}return y(e,[{key:"bind",value:function(e,t,n){var r=new N({el:e,binding:t,vnode:n,lazy:this.lazy});this._queue.push(r)}},{key:"update",value:function(e,t,n){var r=u(this._queue,function(t){return t.el===e});r&&r.update({el:e,binding:t,vnode:n})}},{key:"unbind",value:function(e,t,n){var r=u(this._queue,function(t){return t.el===e});r&&(r.clear(),o(this._queue,r))}}]),e}(),M={selector:"img"},N=function(){function e(t){var n=t.el,r=t.binding,i=t.vnode,o=t.lazy;b(this,e),this.el=null,this.vnode=i,this.binding=r,this.options={},this.lazy=o,this._queue=[],this.update({el:n,binding:r})}return y(e,[{key:"update",value:function(e){var t=this,n=e.el,r=e.binding;this.el=n,this.options=_({},M,r.value),this.getImgs().forEach(function(e){t.lazy.add(e,_({},t.binding,{value:{src:e.dataset.src,error:e.dataset.error,loading:e.dataset.loading}}),t.vnode)})}},{key:"getImgs",value:function(){return f(this.el.querySelectorAll(this.options.selector))}},{key:"clear",value:function(){var e=this;this.getImgs().forEach(function(t){return e.lazy.remove(t)}),this.vnode=null,this.binding=null,this.lazy=null}}]),e}();return{install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=D(e),r=new n(t),i=new V({lazy:r}),o="2"===e.version.split(".")[0];e.prototype.$Lazyload=r,t.lazyComponent&&e.component("lazy-component",B(r)),o?(e.directive("lazy",{bind:r.add.bind(r),update:r.update.bind(r),componentUpdated:r.lazyLoadHandler.bind(r),unbind:r.remove.bind(r)}),e.directive("lazy-container",{bind:i.bind.bind(i),update:i.update.bind(i),unbind:i.unbind.bind(i)})):(e.directive("lazy",{bind:r.lazyLoadHandler.bind(r),update:function(e,t){_(this.vm.$refs,this.vm.$els),r.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:e,oldValue:t},{context:this.vm})},unbind:function(){r.remove(this.el)}}),e.directive("lazy-container",{update:function(e,t){i.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:e,oldValue:t},{context:this.vm})},unbind:function(){i.unbind(this.el)}}))}}});
  482. /***/ }),
  483. /* 7 */
  484. /***/ (function(module, exports) {
  485. var g;
  486. // This works in non-strict mode
  487. g = (function() {
  488. return this;
  489. })();
  490. try {
  491. // This works if eval is allowed (see CSP)
  492. g = g || new Function("return this")();
  493. } catch (e) {
  494. // This works if the window reference is available
  495. if (typeof window === "object") g = window;
  496. }
  497. // g can still be undefined, but nothing to do about it...
  498. // We return undefined, instead of nothing here, so it's
  499. // easier to handle this case. if(!global) { ...}
  500. module.exports = g;
  501. /***/ }),
  502. /* 8 */
  503. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  504. "use strict";
  505. __webpack_require__.r(__webpack_exports__);
  506. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  507. function _extends() {
  508. _extends = Object.assign || function (target) {
  509. for (var i = 1; i < arguments.length; i++) {
  510. var source = arguments[i];
  511. for (var key in source) {
  512. if (Object.prototype.hasOwnProperty.call(source, key)) {
  513. target[key] = source[key];
  514. }
  515. }
  516. }
  517. return target;
  518. };
  519. return _extends.apply(this, arguments);
  520. }
  521. // EXTERNAL MODULE: ./node_modules/@vue/babel-helper-vue-jsx-merge-props/dist/helper.js
  522. var helper = __webpack_require__(1);
  523. var helper_default = /*#__PURE__*/__webpack_require__.n(helper);
  524. // EXTERNAL MODULE: ./es/utils/index.js + 5 modules
  525. var utils = __webpack_require__(0);
  526. // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
  527. var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(2);
  528. var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
  529. // CONCATENATED MODULE: ./es/utils/functional.js
  530. var inheritKey = ['ref', 'style', 'class', 'attrs', 'nativeOn', 'directives', 'staticClass', 'staticStyle'];
  531. var mapInheritKey = {
  532. nativeOn: 'on'
  533. }; // inherit partial context, map nativeOn to on
  534. function inherit(context, inheritListeners) {
  535. var result = inheritKey.reduce(function (obj, key) {
  536. if (context.data[key]) {
  537. obj[mapInheritKey[key] || key] = context.data[key];
  538. }
  539. return obj;
  540. }, {});
  541. if (inheritListeners) {
  542. result.on = result.on || {};
  543. _extends(result.on, context.data.on);
  544. }
  545. return result;
  546. } // emit event
  547. function functional_emit(context, eventName) {
  548. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  549. args[_key - 2] = arguments[_key];
  550. }
  551. var listeners = context.listeners[eventName];
  552. if (listeners) {
  553. if (Array.isArray(listeners)) {
  554. listeners.forEach(function (listener) {
  555. listener.apply(void 0, args);
  556. });
  557. } else {
  558. listeners.apply(void 0, args);
  559. }
  560. }
  561. } // mount functional component
  562. function mount(Component, data) {
  563. var instance = new external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a({
  564. el: document.createElement('div'),
  565. props: Component.props,
  566. render: function render(h) {
  567. return h(Component, _extends({
  568. props: this.$props
  569. }, data));
  570. }
  571. });
  572. document.body.appendChild(instance.$el);
  573. return instance;
  574. }
  575. // CONCATENATED MODULE: ./es/mixins/popup/context.js
  576. var context_context = {
  577. zIndex: 2000,
  578. lockCount: 0,
  579. stack: [],
  580. get top() {
  581. return this.stack[this.stack.length - 1];
  582. }
  583. };
  584. // CONCATENATED MODULE: ./es/mixins/touch.js
  585. var MIN_DISTANCE = 10;
  586. function getDirection(x, y) {
  587. if (x > y && x > MIN_DISTANCE) {
  588. return 'horizontal';
  589. }
  590. if (y > x && y > MIN_DISTANCE) {
  591. return 'vertical';
  592. }
  593. return '';
  594. }
  595. var TouchMixin = {
  596. data: function data() {
  597. return {
  598. direction: ''
  599. };
  600. },
  601. methods: {
  602. touchStart: function touchStart(event) {
  603. this.resetTouchStatus();
  604. this.startX = event.touches[0].clientX;
  605. this.startY = event.touches[0].clientY;
  606. },
  607. touchMove: function touchMove(event) {
  608. var touch = event.touches[0];
  609. this.deltaX = touch.clientX - this.startX;
  610. this.deltaY = touch.clientY - this.startY;
  611. this.offsetX = Math.abs(this.deltaX);
  612. this.offsetY = Math.abs(this.deltaY);
  613. this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
  614. },
  615. resetTouchStatus: function resetTouchStatus() {
  616. this.direction = '';
  617. this.deltaX = 0;
  618. this.deltaY = 0;
  619. this.offsetX = 0;
  620. this.offsetY = 0;
  621. }
  622. }
  623. };
  624. // CONCATENATED MODULE: ./es/utils/event.js
  625. /* eslint-disable no-empty */
  626. /* eslint-disable getter-return */
  627. /* eslint-disable import/no-mutable-exports */
  628. var supportsPassive = false;
  629. if (!utils["h" /* isServer */]) {
  630. try {
  631. var opts = {};
  632. Object.defineProperty(opts, 'passive', {
  633. get: function get() {
  634. /* istanbul ignore next */
  635. supportsPassive = true;
  636. }
  637. });
  638. window.addEventListener('test-passive', null, opts);
  639. } catch (e) {}
  640. }
  641. function event_on(target, event, handler, passive) {
  642. if (passive === void 0) {
  643. passive = false;
  644. }
  645. if (!utils["h" /* isServer */]) {
  646. target.addEventListener(event, handler, supportsPassive ? {
  647. capture: false,
  648. passive: passive
  649. } : false);
  650. }
  651. }
  652. function off(target, event, handler) {
  653. if (!utils["h" /* isServer */]) {
  654. target.removeEventListener(event, handler);
  655. }
  656. }
  657. function event_stopPropagation(event) {
  658. event.stopPropagation();
  659. }
  660. function preventDefault(event, isStopPropagation) {
  661. /* istanbul ignore else */
  662. if (typeof event.cancelable !== 'boolean' || event.cancelable) {
  663. event.preventDefault();
  664. }
  665. if (isStopPropagation) {
  666. event_stopPropagation(event);
  667. }
  668. }
  669. // CONCATENATED MODULE: ./es/overlay/index.js
  670. // Types
  671. var _use = Object(utils["k" /* use */])('overlay'),
  672. sfc = _use[0],
  673. overlay_bem = _use[1];
  674. function Overlay(h, props, slots, ctx) {
  675. var style = _extends({
  676. zIndex: props.zIndex
  677. }, props.customStyle);
  678. return h("transition", {
  679. "attrs": {
  680. "name": "van-fade"
  681. }
  682. }, [h("div", helper_default()([{
  683. "directives": [{
  684. name: "show",
  685. value: props.visible
  686. }],
  687. "style": style,
  688. "class": [overlay_bem(), props.className],
  689. "on": {
  690. "touchmove": function touchmove(event) {
  691. preventDefault(event, true);
  692. }
  693. }
  694. }, inherit(ctx, true)]))]);
  695. }
  696. Overlay.props = {
  697. zIndex: Number,
  698. className: null,
  699. visible: Boolean,
  700. customStyle: Object
  701. };
  702. /* harmony default export */ var overlay = (sfc(Overlay));
  703. // CONCATENATED MODULE: ./es/mixins/popup/overlay.js
  704. var defaultConfig = {
  705. className: '',
  706. customStyle: {}
  707. };
  708. var overlay_overlay; // close popup when click overlay && closeOnClickOverlay is true
  709. function onClickOverlay() {
  710. if (context_context.top) {
  711. var vm = context_context.top.vm;
  712. vm.$emit('click-overlay');
  713. if (vm.closeOnClickOverlay) {
  714. if (vm.onClickOverlay) {
  715. vm.onClickOverlay();
  716. } else {
  717. vm.close();
  718. }
  719. }
  720. }
  721. }
  722. function updateOverlay() {
  723. if (!overlay_overlay) {
  724. overlay_overlay = mount(overlay, {
  725. on: {
  726. click: onClickOverlay
  727. }
  728. });
  729. }
  730. if (context_context.top) {
  731. var _context$top = context_context.top,
  732. vm = _context$top.vm,
  733. config = _context$top.config;
  734. var el = vm.$el;
  735. var target = el && el.parentNode ? el.parentNode : document.body;
  736. if (target) {
  737. target.appendChild(overlay_overlay.$el);
  738. }
  739. _extends(overlay_overlay, defaultConfig, config, {
  740. visible: true
  741. });
  742. } else {
  743. overlay_overlay.visible = false;
  744. }
  745. }
  746. function openOverlay(vm, config) {
  747. if (!context_context.stack.some(function (item) {
  748. return item.vm === vm;
  749. })) {
  750. context_context.stack.push({
  751. vm: vm,
  752. config: config
  753. });
  754. updateOverlay();
  755. }
  756. }
  757. function closeOverlay(vm) {
  758. var stack = context_context.stack;
  759. if (stack.length) {
  760. if (context_context.top.vm === vm) {
  761. stack.pop();
  762. updateOverlay();
  763. } else {
  764. context_context.stack = stack.filter(function (item) {
  765. return item.vm !== vm;
  766. });
  767. }
  768. }
  769. }
  770. // CONCATENATED MODULE: ./es/utils/scroll.js
  771. // get nearest scroll element
  772. // http://w3help.org/zh-cn/causes/SD9013
  773. // http://stackoverflow.com/questions/17016740/onscroll-function-is-not-working-for-chrome
  774. function getScrollEventTarget(element, rootParent) {
  775. if (rootParent === void 0) {
  776. rootParent = window;
  777. }
  778. var node = element;
  779. while (node && node.tagName !== 'HTML' && node.tagName !== 'BODY' && node.nodeType === 1 && node !== rootParent) {
  780. var _window$getComputedSt = window.getComputedStyle(node),
  781. overflowY = _window$getComputedSt.overflowY;
  782. if (overflowY === 'scroll' || overflowY === 'auto') {
  783. return node;
  784. }
  785. node = node.parentNode;
  786. }
  787. return rootParent;
  788. }
  789. function getScrollTop(element) {
  790. return 'scrollTop' in element ? element.scrollTop : element.pageYOffset;
  791. }
  792. function setScrollTop(element, value) {
  793. 'scrollTop' in element ? element.scrollTop = value : element.scrollTo(element.scrollX, value);
  794. }
  795. function getRootScrollTop() {
  796. return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
  797. } // get distance from element top to page top
  798. function getElementTop(element) {
  799. return (element === window ? 0 : element.getBoundingClientRect().top) + getScrollTop(window);
  800. }
  801. function getVisibleHeight(element) {
  802. return element === window ? element.innerHeight : element.getBoundingClientRect().height;
  803. }
  804. // CONCATENATED MODULE: ./es/mixins/popup/index.js
  805. var PopupMixin = {
  806. mixins: [TouchMixin],
  807. props: {
  808. // whether to show popup
  809. value: Boolean,
  810. // whether to show overlay
  811. overlay: Boolean,
  812. // overlay custom style
  813. overlayStyle: Object,
  814. // overlay custom class name
  815. overlayClass: String,
  816. // whether to close popup when click overlay
  817. closeOnClickOverlay: Boolean,
  818. // z-index
  819. zIndex: [String, Number],
  820. // return the mount node for popup
  821. getContainer: [String, Function],
  822. // prevent body scroll
  823. lockScroll: {
  824. type: Boolean,
  825. "default": true
  826. },
  827. // whether to lazy render
  828. lazyRender: {
  829. type: Boolean,
  830. "default": true
  831. }
  832. },
  833. data: function data() {
  834. return {
  835. inited: this.value
  836. };
  837. },
  838. computed: {
  839. shouldRender: function shouldRender() {
  840. return this.inited || !this.lazyRender;
  841. }
  842. },
  843. watch: {
  844. value: function value(val) {
  845. var type = val ? 'open' : 'close';
  846. this.inited = this.inited || this.value;
  847. this[type]();
  848. this.$emit(type);
  849. },
  850. getContainer: function getContainer() {
  851. this.move();
  852. },
  853. overlay: function overlay() {
  854. this.renderOverlay();
  855. }
  856. },
  857. mounted: function mounted() {
  858. if (this.getContainer) {
  859. this.move();
  860. }
  861. if (this.value) {
  862. this.open();
  863. }
  864. },
  865. activated: function activated() {
  866. /* istanbul ignore next */
  867. if (this.value) {
  868. this.open();
  869. }
  870. },
  871. beforeDestroy: function beforeDestroy() {
  872. this.close();
  873. if (this.getContainer && this.$parent && this.$parent.$el) {
  874. this.$parent.$el.appendChild(this.$el);
  875. }
  876. },
  877. deactivated: function deactivated() {
  878. /* istanbul ignore next */
  879. this.close();
  880. },
  881. methods: {
  882. open: function open() {
  883. /* istanbul ignore next */
  884. if (this.$isServer || this.opened) {
  885. return;
  886. } // cover default zIndex
  887. if (this.zIndex !== undefined) {
  888. context_context.zIndex = this.zIndex;
  889. }
  890. this.opened = true;
  891. this.renderOverlay();
  892. if (this.lockScroll) {
  893. event_on(document, 'touchstart', this.touchStart);
  894. event_on(document, 'touchmove', this.onTouchMove);
  895. if (!context_context.lockCount) {
  896. document.body.classList.add('van-overflow-hidden');
  897. }
  898. context_context.lockCount++;
  899. }
  900. },
  901. close: function close() {
  902. if (!this.opened) {
  903. return;
  904. }
  905. if (this.lockScroll) {
  906. context_context.lockCount--;
  907. off(document, 'touchstart', this.touchStart);
  908. off(document, 'touchmove', this.onTouchMove);
  909. if (!context_context.lockCount) {
  910. document.body.classList.remove('van-overflow-hidden');
  911. }
  912. }
  913. this.opened = false;
  914. closeOverlay(this);
  915. this.$emit('input', false);
  916. },
  917. move: function move() {
  918. var container;
  919. var getContainer = this.getContainer;
  920. if (getContainer) {
  921. container = typeof getContainer === 'string' ? document.querySelector(getContainer) : getContainer();
  922. } else if (this.$parent) {
  923. container = this.$parent.$el;
  924. }
  925. if (container && container !== this.$el.parentNode) {
  926. container.appendChild(this.$el);
  927. }
  928. if (this.overlay) {
  929. updateOverlay();
  930. }
  931. },
  932. onTouchMove: function onTouchMove(event) {
  933. this.touchMove(event);
  934. var direction = this.deltaY > 0 ? '10' : '01';
  935. var el = getScrollEventTarget(event.target, this.$el);
  936. var scrollHeight = el.scrollHeight,
  937. offsetHeight = el.offsetHeight,
  938. scrollTop = el.scrollTop;
  939. var status = '11';
  940. /* istanbul ignore next */
  941. if (scrollTop === 0) {
  942. status = offsetHeight >= scrollHeight ? '00' : '01';
  943. } else if (scrollTop + offsetHeight >= scrollHeight) {
  944. status = '10';
  945. }
  946. /* istanbul ignore next */
  947. if (status !== '11' && this.direction === 'vertical' && !(parseInt(status, 2) & parseInt(direction, 2))) {
  948. preventDefault(event, true);
  949. }
  950. },
  951. renderOverlay: function renderOverlay() {
  952. if (this.$isServer || !this.value) {
  953. return;
  954. }
  955. if (this.overlay) {
  956. openOverlay(this, {
  957. zIndex: context_context.zIndex++,
  958. className: this.overlayClass,
  959. customStyle: this.overlayStyle
  960. });
  961. } else {
  962. closeOverlay(this);
  963. }
  964. this.updateZIndex();
  965. },
  966. updateZIndex: function updateZIndex() {
  967. var _this = this;
  968. this.$nextTick(function () {
  969. _this.$el.style.zIndex = context_context.zIndex++;
  970. });
  971. }
  972. }
  973. };
  974. // CONCATENATED MODULE: ./es/info/index.js
  975. // Types
  976. var info_use = Object(utils["k" /* use */])('info'),
  977. info_sfc = info_use[0],
  978. info_bem = info_use[1];
  979. function info_Info(h, props, slots, ctx) {
  980. if (!Object(utils["d" /* isDef */])(props.info) || props.info === '') {
  981. return;
  982. }
  983. return h("div", helper_default()([{
  984. "class": info_bem()
  985. }, inherit(ctx, true)]), [props.info]);
  986. }
  987. info_Info.props = {
  988. info: [String, Number]
  989. };
  990. /* harmony default export */ var es_info = (info_sfc(info_Info));
  991. // CONCATENATED MODULE: ./es/utils/validate/src.js
  992. /**
  993. * Is image source
  994. */
  995. function isSrc(url) {
  996. return /^(((blob:)?https?:)?\/\/|data:image)/.test(url);
  997. }
  998. // CONCATENATED MODULE: ./es/icon/index.js
  999. // Types
  1000. var icon_use = Object(utils["k" /* use */])('icon'),
  1001. icon_sfc = icon_use[0];
  1002. function Icon(h, props, slots, ctx) {
  1003. var urlIcon = isSrc(props.name);
  1004. return h(props.tag, helper_default()([{
  1005. "class": [props.classPrefix, urlIcon ? 'van-icon--image' : props.classPrefix + "-" + props.name],
  1006. "style": {
  1007. color: props.color,
  1008. fontSize: props.size
  1009. }
  1010. }, inherit(ctx, true)]), [slots["default"] && slots["default"](), urlIcon && h("img", {
  1011. "attrs": {
  1012. "src": props.name
  1013. }
  1014. }), h(es_info, {
  1015. "attrs": {
  1016. "info": props.info
  1017. }
  1018. })]);
  1019. }
  1020. Icon.props = {
  1021. name: String,
  1022. size: String,
  1023. color: String,
  1024. info: [String, Number],
  1025. tag: {
  1026. type: String,
  1027. "default": 'i'
  1028. },
  1029. classPrefix: {
  1030. type: String,
  1031. "default": 'van-icon'
  1032. }
  1033. };
  1034. /* harmony default export */ var es_icon = (icon_sfc(Icon));
  1035. // CONCATENATED MODULE: ./es/loading/index.js
  1036. // Types
  1037. var loading_use = Object(utils["k" /* use */])('loading'),
  1038. loading_sfc = loading_use[0],
  1039. loading_bem = loading_use[1];
  1040. var DEFAULT_COLOR = '#c9c9c9';
  1041. function Loading(h, props, slots, ctx) {
  1042. var color = props.color,
  1043. size = props.size,
  1044. type = props.type;
  1045. var colorType = color === 'white' || color === 'black' ? color : '';
  1046. var style = {
  1047. color: color === 'black' ? DEFAULT_COLOR : color,
  1048. width: size,
  1049. height: size
  1050. };
  1051. var Spin = [];
  1052. if (type === 'spinner') {
  1053. for (var i = 0; i < 12; i++) {
  1054. Spin.push(h("i"));
  1055. }
  1056. }
  1057. var Circular = type === 'circular' && h("svg", {
  1058. "class": loading_bem('circular'),
  1059. "attrs": {
  1060. "viewBox": "25 25 50 50"
  1061. }
  1062. }, [h("circle", {
  1063. "attrs": {
  1064. "cx": "50",
  1065. "cy": "50",
  1066. "r": "20",
  1067. "fill": "none"
  1068. }
  1069. })]);
  1070. return h("div", helper_default()([{
  1071. "class": loading_bem([type, colorType]),
  1072. "style": style
  1073. }, inherit(ctx, true)]), [h("span", {
  1074. "class": loading_bem('spinner', type)
  1075. }, [Spin, Circular])]);
  1076. }
  1077. Loading.props = {
  1078. size: String,
  1079. type: {
  1080. type: String,
  1081. "default": 'circular'
  1082. },
  1083. color: {
  1084. type: String,
  1085. "default": DEFAULT_COLOR
  1086. }
  1087. };
  1088. /* harmony default export */ var es_loading = (loading_sfc(Loading));
  1089. // CONCATENATED MODULE: ./es/popup/index.js
  1090. var popup_use = Object(utils["k" /* use */])('popup'),
  1091. popup_sfc = popup_use[0],
  1092. popup_bem = popup_use[1];
  1093. /* harmony default export */ var popup = (popup_sfc({
  1094. mixins: [PopupMixin],
  1095. props: {
  1096. position: String,
  1097. transition: String,
  1098. overlay: {
  1099. type: Boolean,
  1100. "default": true
  1101. },
  1102. closeOnClickOverlay: {
  1103. type: Boolean,
  1104. "default": true
  1105. }
  1106. },
  1107. render: function render(h) {
  1108. var _this = this,
  1109. _bem;
  1110. if (!this.shouldRender) {
  1111. return;
  1112. }
  1113. var position = this.position;
  1114. var emit = function emit(event) {
  1115. return function () {
  1116. return _this.$emit(event);
  1117. };
  1118. };
  1119. var transitionName = this.transition || (position ? "van-popup-slide-" + position : 'van-fade');
  1120. return h("transition", {
  1121. "attrs": {
  1122. "name": transitionName
  1123. },
  1124. "on": {
  1125. "afterEnter": emit('opened'),
  1126. "afterLeave": emit('closed')
  1127. }
  1128. }, [h("div", {
  1129. "directives": [{
  1130. name: "show",
  1131. value: this.value
  1132. }],
  1133. "class": popup_bem((_bem = {}, _bem[position] = position, _bem))
  1134. }, [this.slots()])]);
  1135. }
  1136. }));
  1137. // CONCATENATED MODULE: ./es/actionsheet/index.js
  1138. // Types
  1139. var actionsheet_use = Object(utils["k" /* use */])('actionsheet'),
  1140. actionsheet_sfc = actionsheet_use[0],
  1141. actionsheet_bem = actionsheet_use[1];
  1142. function Actionsheet(h, props, slots, ctx) {
  1143. var title = props.title,
  1144. cancelText = props.cancelText;
  1145. var onCancel = function onCancel() {
  1146. functional_emit(ctx, 'input', false);
  1147. functional_emit(ctx, 'cancel');
  1148. };
  1149. var Header = function Header() {
  1150. return h("div", {
  1151. "class": [actionsheet_bem('header'), 'van-hairline--top-bottom']
  1152. }, [title, h(es_icon, {
  1153. "attrs": {
  1154. "name": "close"
  1155. },
  1156. "class": actionsheet_bem('close'),
  1157. "on": {
  1158. "click": onCancel
  1159. }
  1160. })]);
  1161. };
  1162. var Option = function Option(item, index) {
  1163. return h("div", {
  1164. "class": [actionsheet_bem('item', {
  1165. disabled: item.disabled || item.loading
  1166. }), item.className, 'van-hairline--top'],
  1167. "on": {
  1168. "click": function click(event) {
  1169. event.stopPropagation();
  1170. if (!item.disabled && !item.loading) {
  1171. if (item.callback) {
  1172. item.callback(item);
  1173. }
  1174. functional_emit(ctx, 'select', item, index);
  1175. }
  1176. }
  1177. }
  1178. }, [item.loading ? h(es_loading, {
  1179. "class": actionsheet_bem('loading'),
  1180. "attrs": {
  1181. "size": "20px"
  1182. }
  1183. }) : [h("span", {
  1184. "class": actionsheet_bem('name')
  1185. }, [item.name]), item.subname && h("span", {
  1186. "class": actionsheet_bem('subname')
  1187. }, [item.subname])]]);
  1188. };
  1189. return h(popup, helper_default()([{
  1190. "class": actionsheet_bem({
  1191. 'safe-area-inset-bottom': props.safeAreaInsetBottom
  1192. }),
  1193. "attrs": {
  1194. "value": props.value,
  1195. "position": "bottom",
  1196. "overlay": props.overlay,
  1197. "lazyRender": props.lazyRender,
  1198. "getContainer": props.getContainer,
  1199. "closeOnClickOverlay": props.closeOnClickOverlay
  1200. },
  1201. "on": {
  1202. "input": function input(value) {
  1203. functional_emit(ctx, 'input', value);
  1204. }
  1205. }
  1206. }, inherit(ctx)]), [title ? Header() : props.actions.map(Option), slots["default"] && h("div", {
  1207. "class": actionsheet_bem('content')
  1208. }, [slots["default"]()]), cancelText && h("div", {
  1209. "class": actionsheet_bem('cancel'),
  1210. "on": {
  1211. "click": onCancel
  1212. }
  1213. }, [cancelText])]);
  1214. }
  1215. Actionsheet.props = _extends({}, PopupMixin.props, {
  1216. title: String,
  1217. actions: Array,
  1218. cancelText: String,
  1219. safeAreaInsetBottom: Boolean,
  1220. overlay: {
  1221. type: Boolean,
  1222. "default": true
  1223. },
  1224. closeOnClickOverlay: {
  1225. type: Boolean,
  1226. "default": true
  1227. }
  1228. });
  1229. /* harmony default export */ var actionsheet = (actionsheet_sfc(Actionsheet));
  1230. // CONCATENATED MODULE: ./es/utils/validate/mobile.js
  1231. function isMobile(value) {
  1232. value = value.replace(/[^-|\d]/g, '');
  1233. return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
  1234. }
  1235. // EXTERNAL MODULE: ./es/utils/deep-assign.js
  1236. var deep_assign = __webpack_require__(5);
  1237. // CONCATENATED MODULE: ./es/utils/deep-clone.js
  1238. function deepClone(obj) {
  1239. if (Array.isArray(obj)) {
  1240. return obj.map(function (item) {
  1241. return deepClone(item);
  1242. });
  1243. }
  1244. if (typeof obj === 'object') {
  1245. return Object(deep_assign["a" /* deepAssign */])({}, obj);
  1246. }
  1247. return obj;
  1248. }
  1249. // CONCATENATED MODULE: ./es/picker/shared.js
  1250. var pickerProps = {
  1251. title: String,
  1252. loading: Boolean,
  1253. showToolbar: Boolean,
  1254. cancelButtonText: String,
  1255. confirmButtonText: String,
  1256. visibleItemCount: {
  1257. type: Number,
  1258. "default": 5
  1259. },
  1260. itemHeight: {
  1261. type: Number,
  1262. "default": 44
  1263. }
  1264. };
  1265. // CONCATENATED MODULE: ./es/picker/PickerColumn.js
  1266. var DEFAULT_DURATION = 200;
  1267. var PickerColumn_use = Object(utils["k" /* use */])('picker-column'),
  1268. PickerColumn_sfc = PickerColumn_use[0],
  1269. PickerColumn_bem = PickerColumn_use[1];
  1270. /* harmony default export */ var PickerColumn = (PickerColumn_sfc({
  1271. props: {
  1272. valueKey: String,
  1273. className: String,
  1274. itemHeight: Number,
  1275. defaultIndex: Number,
  1276. initialOptions: Array,
  1277. visibleItemCount: Number
  1278. },
  1279. data: function data() {
  1280. return {
  1281. startY: 0,
  1282. offset: 0,
  1283. duration: 0,
  1284. startOffset: 0,
  1285. options: deepClone(this.initialOptions),
  1286. currentIndex: this.defaultIndex
  1287. };
  1288. },
  1289. created: function created() {
  1290. this.$parent.children && this.$parent.children.push(this);
  1291. this.setIndex(this.currentIndex);
  1292. },
  1293. destroyed: function destroyed() {
  1294. var children = this.$parent.children;
  1295. children && children.splice(children.indexOf(this), 1);
  1296. },
  1297. watch: {
  1298. defaultIndex: function defaultIndex() {
  1299. this.setIndex(this.defaultIndex);
  1300. }
  1301. },
  1302. computed: {
  1303. count: function count() {
  1304. return this.options.length;
  1305. }
  1306. },
  1307. methods: {
  1308. onTouchStart: function onTouchStart(event) {
  1309. this.startY = event.touches[0].clientY;
  1310. this.startOffset = this.offset;
  1311. this.duration = 0;
  1312. },
  1313. onTouchMove: function onTouchMove(event) {
  1314. preventDefault(event);
  1315. var deltaY = event.touches[0].clientY - this.startY;
  1316. this.offset = Object(utils["j" /* range */])(this.startOffset + deltaY, -(this.count * this.itemHeight), this.itemHeight);
  1317. },
  1318. onTouchEnd: function onTouchEnd() {
  1319. if (this.offset !== this.startOffset) {
  1320. this.duration = DEFAULT_DURATION;
  1321. var index = Object(utils["j" /* range */])(Math.round(-this.offset / this.itemHeight), 0, this.count - 1);
  1322. this.setIndex(index, true);
  1323. }
  1324. },
  1325. adjustIndex: function adjustIndex(index) {
  1326. index = Object(utils["j" /* range */])(index, 0, this.count);
  1327. for (var i = index; i < this.count; i++) {
  1328. if (!this.isDisabled(this.options[i])) return i;
  1329. }
  1330. for (var _i = index - 1; _i >= 0; _i--) {
  1331. if (!this.isDisabled(this.options[_i])) return _i;
  1332. }
  1333. },
  1334. isDisabled: function isDisabled(option) {
  1335. return Object(utils["g" /* isObj */])(option) && option.disabled;
  1336. },
  1337. getOptionText: function getOptionText(option) {
  1338. return Object(utils["g" /* isObj */])(option) && this.valueKey in option ? option[this.valueKey] : option;
  1339. },
  1340. setIndex: function setIndex(index, userAction) {
  1341. index = this.adjustIndex(index) || 0;
  1342. this.offset = -index * this.itemHeight;
  1343. if (index !== this.currentIndex) {
  1344. this.currentIndex = index;
  1345. userAction && this.$emit('change', index);
  1346. }
  1347. },
  1348. setValue: function setValue(value) {
  1349. var options = this.options;
  1350. for (var i = 0; i < options.length; i++) {
  1351. if (this.getOptionText(options[i]) === value) {
  1352. return this.setIndex(i);
  1353. }
  1354. }
  1355. },
  1356. getValue: function getValue() {
  1357. return this.options[this.currentIndex];
  1358. }
  1359. },
  1360. render: function render(h) {
  1361. var _this = this;
  1362. var itemHeight = this.itemHeight,
  1363. visibleItemCount = this.visibleItemCount;
  1364. var columnStyle = {
  1365. height: itemHeight * visibleItemCount + 'px'
  1366. };
  1367. var baseOffset = itemHeight * (visibleItemCount - 1) / 2;
  1368. var wrapperStyle = {
  1369. transition: this.duration + "ms",
  1370. transform: "translate3d(0, " + (this.offset + baseOffset) + "px, 0)",
  1371. lineHeight: itemHeight + "px"
  1372. };
  1373. var optionStyle = {
  1374. height: itemHeight + "px"
  1375. };
  1376. return h("div", {
  1377. "style": columnStyle,
  1378. "class": [PickerColumn_bem(), this.className],
  1379. "on": {
  1380. "touchstart": this.onTouchStart,
  1381. "touchmove": this.onTouchMove,
  1382. "touchend": this.onTouchEnd,
  1383. "touchcancel": this.onTouchEnd
  1384. }
  1385. }, [h("ul", {
  1386. "style": wrapperStyle
  1387. }, [this.options.map(function (option, index) {
  1388. return h("li", {
  1389. "style": optionStyle,
  1390. "class": ['van-ellipsis', PickerColumn_bem('item', {
  1391. disabled: _this.isDisabled(option),
  1392. selected: index === _this.currentIndex
  1393. })],
  1394. "domProps": {
  1395. "innerHTML": _this.getOptionText(option)
  1396. },
  1397. "on": {
  1398. "click": function click() {
  1399. _this.setIndex(index, true);
  1400. }
  1401. }
  1402. });
  1403. })])]);
  1404. }
  1405. }));
  1406. // CONCATENATED MODULE: ./es/picker/index.js
  1407. var picker_use = Object(utils["k" /* use */])('picker'),
  1408. picker_sfc = picker_use[0],
  1409. picker_bem = picker_use[1],
  1410. t = picker_use[2];
  1411. /* harmony default export */ var es_picker = (picker_sfc({
  1412. props: _extends({}, pickerProps, {
  1413. columns: Array,
  1414. defaultIndex: {
  1415. type: Number,
  1416. "default": 0
  1417. },
  1418. valueKey: {
  1419. type: String,
  1420. "default": 'text'
  1421. }
  1422. }),
  1423. data: function data() {
  1424. return {
  1425. children: []
  1426. };
  1427. },
  1428. computed: {
  1429. simple: function simple() {
  1430. return this.columns.length && !this.columns[0].values;
  1431. }
  1432. },
  1433. watch: {
  1434. columns: function columns() {
  1435. this.setColumns();
  1436. }
  1437. },
  1438. methods: {
  1439. setColumns: function setColumns() {
  1440. var _this = this;
  1441. var columns = this.simple ? [{
  1442. values: this.columns
  1443. }] : this.columns;
  1444. columns.forEach(function (column, index) {
  1445. _this.setColumnValues(index, deepClone(column.values));
  1446. });
  1447. },
  1448. emit: function emit(event) {
  1449. if (this.simple) {
  1450. this.$emit(event, this.getColumnValue(0), this.getColumnIndex(0));
  1451. } else {
  1452. this.$emit(event, this.getValues(), this.getIndexes());
  1453. }
  1454. },
  1455. onChange: function onChange(columnIndex) {
  1456. if (this.simple) {
  1457. this.$emit('change', this, this.getColumnValue(0), this.getColumnIndex(0));
  1458. } else {
  1459. this.$emit('change', this, this.getValues(), columnIndex);
  1460. }
  1461. },
  1462. // get column instance by index
  1463. getColumn: function getColumn(index) {
  1464. return this.children[index];
  1465. },
  1466. // get column value by index
  1467. getColumnValue: function getColumnValue(index) {
  1468. var column = this.getColumn(index);
  1469. return column && column.getValue();
  1470. },
  1471. // set column value by index
  1472. setColumnValue: function setColumnValue(index, value) {
  1473. var column = this.getColumn(index);
  1474. column && column.setValue(value);
  1475. },
  1476. // get column option index by column index
  1477. getColumnIndex: function getColumnIndex(columnIndex) {
  1478. return (this.getColumn(columnIndex) || {}).currentIndex;
  1479. },
  1480. // set column option index by column index
  1481. setColumnIndex: function setColumnIndex(columnIndex, optionIndex) {
  1482. var column = this.getColumn(columnIndex);
  1483. column && column.setIndex(optionIndex);
  1484. },
  1485. // get options of column by index
  1486. getColumnValues: function getColumnValues(index) {
  1487. return (this.children[index] || {}).options;
  1488. },
  1489. // set options of column by index
  1490. setColumnValues: function setColumnValues(index, options) {
  1491. var column = this.children[index];
  1492. if (column && JSON.stringify(column.options) !== JSON.stringify(options)) {
  1493. column.options = options;
  1494. column.setIndex(0);
  1495. }
  1496. },
  1497. // get values of all columns
  1498. getValues: function getValues() {
  1499. return this.children.map(function (child) {
  1500. return child.getValue();
  1501. });
  1502. },
  1503. // set values of all columns
  1504. setValues: function setValues(values) {
  1505. var _this2 = this;
  1506. values.forEach(function (value, index) {
  1507. _this2.setColumnValue(index, value);
  1508. });
  1509. },
  1510. // get indexes of all columns
  1511. getIndexes: function getIndexes() {
  1512. return this.children.map(function (child) {
  1513. return child.currentIndex;
  1514. });
  1515. },
  1516. // set indexes of all columns
  1517. setIndexes: function setIndexes(indexes) {
  1518. var _this3 = this;
  1519. indexes.forEach(function (optionIndex, columnIndex) {
  1520. _this3.setColumnIndex(columnIndex, optionIndex);
  1521. });
  1522. },
  1523. onConfirm: function onConfirm() {
  1524. this.emit('confirm');
  1525. },
  1526. onCancel: function onCancel() {
  1527. this.emit('cancel');
  1528. }
  1529. },
  1530. render: function render(h) {
  1531. var _this4 = this;
  1532. var itemHeight = this.itemHeight;
  1533. var columns = this.simple ? [this.columns] : this.columns;
  1534. var frameStyle = {
  1535. height: itemHeight + "px"
  1536. };
  1537. var columnsStyle = {
  1538. height: itemHeight * this.visibleItemCount + "px"
  1539. };
  1540. var Toolbar = this.showToolbar && h("div", {
  1541. "class": ['van-hairline--top-bottom', picker_bem('toolbar')]
  1542. }, [this.slots() || [h("div", {
  1543. "class": picker_bem('cancel'),
  1544. "on": {
  1545. "click": this.onCancel
  1546. }
  1547. }, [this.cancelButtonText || t('cancel')]), this.slots('title') || this.title && h("div", {
  1548. "class": ['van-ellipsis', picker_bem('title')]
  1549. }, [this.title]), h("div", {
  1550. "class": picker_bem('confirm'),
  1551. "on": {
  1552. "click": this.onConfirm
  1553. }
  1554. }, [this.confirmButtonText || t('confirm')])]]);
  1555. return h("div", {
  1556. "class": picker_bem()
  1557. }, [Toolbar, this.loading ? h("div", {
  1558. "class": picker_bem('loading')
  1559. }, [h(es_loading)]) : h(), h("div", {
  1560. "class": picker_bem('columns'),
  1561. "style": columnsStyle,
  1562. "on": {
  1563. "touchmove": preventDefault
  1564. }
  1565. }, [columns.map(function (item, index) {
  1566. return h(PickerColumn, {
  1567. "attrs": {
  1568. "valueKey": _this4.valueKey,
  1569. "className": item.className,
  1570. "itemHeight": _this4.itemHeight,
  1571. "defaultIndex": item.defaultIndex || _this4.defaultIndex,
  1572. "visibleItemCount": _this4.visibleItemCount,
  1573. "initialOptions": _this4.simple ? item : item.values
  1574. },
  1575. "on": {
  1576. "change": function change() {
  1577. _this4.onChange(index);
  1578. }
  1579. }
  1580. });
  1581. }), h("div", {
  1582. "class": ['van-hairline--top-bottom', picker_bem('frame')],
  1583. "style": frameStyle
  1584. })])]);
  1585. }
  1586. }));
  1587. // CONCATENATED MODULE: ./es/area/index.js
  1588. var area_use = Object(utils["k" /* use */])('area'),
  1589. area_sfc = area_use[0],
  1590. area_bem = area_use[1];
  1591. /* harmony default export */ var es_area = (area_sfc({
  1592. props: _extends({}, pickerProps, {
  1593. value: String,
  1594. areaList: {
  1595. type: Object,
  1596. "default": function _default() {
  1597. return {};
  1598. }
  1599. },
  1600. columnsNum: {
  1601. type: [String, Number],
  1602. "default": 3
  1603. }
  1604. }),
  1605. data: function data() {
  1606. return {
  1607. code: this.value,
  1608. columns: [{
  1609. values: []
  1610. }, {
  1611. values: []
  1612. }, {
  1613. values: []
  1614. }]
  1615. };
  1616. },
  1617. computed: {
  1618. province: function province() {
  1619. return this.areaList.province_list || {};
  1620. },
  1621. city: function city() {
  1622. return this.areaList.city_list || {};
  1623. },
  1624. county: function county() {
  1625. return this.areaList.county_list || {};
  1626. },
  1627. displayColumns: function displayColumns() {
  1628. return this.columns.slice(0, +this.columnsNum);
  1629. }
  1630. },
  1631. watch: {
  1632. value: function value() {
  1633. this.code = this.value;
  1634. this.setValues();
  1635. },
  1636. areaList: {
  1637. deep: true,
  1638. handler: function handler() {
  1639. this.setValues();
  1640. }
  1641. }
  1642. },
  1643. mounted: function mounted() {
  1644. this.setValues();
  1645. },
  1646. methods: {
  1647. // get list by code
  1648. getList: function getList(type, code) {
  1649. var result = [];
  1650. if (type !== 'province' && !code) {
  1651. return result;
  1652. }
  1653. var list = this[type];
  1654. result = Object.keys(list).map(function (listCode) {
  1655. return {
  1656. code: listCode,
  1657. name: list[listCode]
  1658. };
  1659. });
  1660. if (code) {
  1661. // oversea code
  1662. if (code[0] === '9' && type === 'city') {
  1663. code = '9';
  1664. }
  1665. result = result.filter(function (item) {
  1666. return item.code.indexOf(code) === 0;
  1667. });
  1668. }
  1669. return result;
  1670. },
  1671. // get index by code
  1672. getIndex: function getIndex(type, code) {
  1673. var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
  1674. var list = this.getList(type, code.slice(0, compareNum - 2)); // oversea code
  1675. if (code[0] === '9' && type === 'province') {
  1676. compareNum = 1;
  1677. }
  1678. code = code.slice(0, compareNum);
  1679. for (var i = 0; i < list.length; i++) {
  1680. if (list[i].code.slice(0, compareNum) === code) {
  1681. return i;
  1682. }
  1683. }
  1684. return 0;
  1685. },
  1686. onChange: function onChange(picker, values, index) {
  1687. this.code = values[index].code;
  1688. this.setValues();
  1689. this.$emit('change', picker, picker.getValues(), index);
  1690. },
  1691. setValues: function setValues() {
  1692. var code = this.code || Object.keys(this.county)[0] || '';
  1693. var picker = this.$refs.picker;
  1694. var province = this.getList('province');
  1695. var city = this.getList('city', code.slice(0, 2));
  1696. if (!picker) {
  1697. return;
  1698. }
  1699. picker.setColumnValues(0, province);
  1700. picker.setColumnValues(1, city);
  1701. if (city.length && code.slice(2, 4) === '00') {
  1702. code = city[0].code;
  1703. }
  1704. picker.setColumnValues(2, this.getList('county', code.slice(0, 4)));
  1705. picker.setIndexes([this.getIndex('province', code), this.getIndex('city', code), this.getIndex('county', code)]);
  1706. },
  1707. getValues: function getValues() {
  1708. return this.$refs.picker ? this.$refs.picker.getValues().filter(function (value) {
  1709. return !!value;
  1710. }) : [];
  1711. },
  1712. getArea: function getArea() {
  1713. var values = this.getValues();
  1714. var area = {
  1715. code: '',
  1716. country: '',
  1717. province: '',
  1718. city: '',
  1719. county: ''
  1720. };
  1721. if (!values.length) {
  1722. return area;
  1723. }
  1724. var names = values.map(function (item) {
  1725. return item.name;
  1726. });
  1727. area.code = values[values.length - 1].code;
  1728. if (area.code[0] === '9') {
  1729. area.country = names[1] || '';
  1730. area.province = names[2] || '';
  1731. } else {
  1732. area.province = names[0] || '';
  1733. area.city = names[1] || '';
  1734. area.county = names[2] || '';
  1735. }
  1736. return area;
  1737. },
  1738. reset: function reset() {
  1739. this.code = '';
  1740. this.setValues();
  1741. }
  1742. },
  1743. render: function render(h) {
  1744. var on = _extends({}, this.$listeners, {
  1745. change: this.onChange
  1746. });
  1747. return h(es_picker, {
  1748. "ref": "picker",
  1749. "class": area_bem(),
  1750. "attrs": {
  1751. "showToolbar": true,
  1752. "valueKey": "name",
  1753. "title": this.title,
  1754. "loading": this.loading,
  1755. "columns": this.displayColumns,
  1756. "itemHeight": this.itemHeight,
  1757. "visibleItemCount": this.visibleItemCount,
  1758. "cancelButtonText": this.cancelButtonText,
  1759. "confirmButtonText": this.confirmButtonText
  1760. },
  1761. "on": _extends({}, on)
  1762. });
  1763. }
  1764. }));
  1765. // CONCATENATED MODULE: ./es/cell/shared.js
  1766. var cellProps = {
  1767. icon: String,
  1768. size: String,
  1769. center: Boolean,
  1770. isLink: Boolean,
  1771. required: Boolean,
  1772. titleStyle: null,
  1773. titleClass: null,
  1774. valueClass: null,
  1775. labelClass: null,
  1776. title: [String, Number],
  1777. value: [String, Number],
  1778. label: [String, Number],
  1779. border: {
  1780. type: Boolean,
  1781. "default": true
  1782. }
  1783. };
  1784. // CONCATENATED MODULE: ./es/utils/router.js
  1785. /**
  1786. * Vue Router support
  1787. */
  1788. function route(router, config) {
  1789. var to = config.to,
  1790. url = config.url,
  1791. replace = config.replace;
  1792. if (to && router) {
  1793. router[replace ? 'replace' : 'push'](to);
  1794. } else if (url) {
  1795. replace ? location.replace(url) : location.href = url;
  1796. }
  1797. }
  1798. function functionalRoute(context) {
  1799. route(context.parent && context.parent.$router, context.props);
  1800. }
  1801. var routeProps = {
  1802. url: String,
  1803. replace: Boolean,
  1804. to: [String, Object]
  1805. };
  1806. // CONCATENATED MODULE: ./es/cell/index.js
  1807. // Types
  1808. var cell_use = Object(utils["k" /* use */])('cell'),
  1809. cell_sfc = cell_use[0],
  1810. cell_bem = cell_use[1];
  1811. function Cell(h, props, slots, ctx) {
  1812. var icon = props.icon,
  1813. size = props.size,
  1814. title = props.title,
  1815. label = props.label,
  1816. value = props.value,
  1817. isLink = props.isLink,
  1818. arrowDirection = props.arrowDirection;
  1819. var showTitle = slots.title || Object(utils["d" /* isDef */])(title);
  1820. var showValue = slots["default"] || Object(utils["d" /* isDef */])(value);
  1821. var showLabel = slots.label || Object(utils["d" /* isDef */])(label);
  1822. var Label = showLabel && h("div", {
  1823. "class": [cell_bem('label'), props.labelClass]
  1824. }, [slots.label ? slots.label() : label]);
  1825. var Title = showTitle && h("div", {
  1826. "class": [cell_bem('title'), props.titleClass],
  1827. "style": props.titleStyle
  1828. }, [slots.title ? slots.title() : h("span", [title]), Label]);
  1829. var Value = showValue && h("div", {
  1830. "class": [cell_bem('value', {
  1831. alone: !slots.title && !title
  1832. }), props.valueClass]
  1833. }, [slots["default"] ? slots["default"]() : h("span", [value])]);
  1834. var LeftIcon = slots.icon ? slots.icon() : icon && h(es_icon, {
  1835. "class": cell_bem('left-icon'),
  1836. "attrs": {
  1837. "name": icon
  1838. }
  1839. });
  1840. var rightIconSlot = slots['right-icon'];
  1841. var RightIcon = rightIconSlot ? rightIconSlot() : isLink && h(es_icon, {
  1842. "class": cell_bem('right-icon'),
  1843. "attrs": {
  1844. "name": arrowDirection ? "arrow-" + arrowDirection : 'arrow'
  1845. }
  1846. });
  1847. var onClick = function onClick(event) {
  1848. functional_emit(ctx, 'click', event);
  1849. functionalRoute(ctx);
  1850. };
  1851. var classes = {
  1852. center: props.center,
  1853. required: props.required,
  1854. borderless: !props.border,
  1855. clickable: isLink || props.clickable
  1856. };
  1857. if (size) {
  1858. classes[size] = size;
  1859. }
  1860. return h("div", helper_default()([{
  1861. "class": cell_bem(classes),
  1862. "on": {
  1863. "click": onClick
  1864. }
  1865. }, inherit(ctx)]), [LeftIcon, Title, Value, RightIcon, slots.extra && slots.extra()]);
  1866. }
  1867. Cell.props = _extends({}, cellProps, routeProps, {
  1868. clickable: Boolean,
  1869. arrowDirection: String
  1870. });
  1871. /* harmony default export */ var cell = (cell_sfc(Cell));
  1872. // CONCATENATED MODULE: ./es/utils/validate/number.js
  1873. function isNumber(value) {
  1874. return /^\d+$/.test(value);
  1875. }
  1876. // CONCATENATED MODULE: ./es/field/index.js
  1877. var field_use = Object(utils["k" /* use */])('field'),
  1878. field_sfc = field_use[0],
  1879. field_bem = field_use[1];
  1880. /* harmony default export */ var field = (field_sfc({
  1881. inheritAttrs: false,
  1882. props: _extends({}, cellProps, {
  1883. error: Boolean,
  1884. leftIcon: String,
  1885. rightIcon: String,
  1886. readonly: Boolean,
  1887. clearable: Boolean,
  1888. labelWidth: [String, Number],
  1889. labelAlign: String,
  1890. inputAlign: String,
  1891. onIconClick: Function,
  1892. autosize: [Boolean, Object],
  1893. errorMessage: String,
  1894. errorMessageAlign: String,
  1895. type: {
  1896. type: String,
  1897. "default": 'text'
  1898. }
  1899. }),
  1900. data: function data() {
  1901. return {
  1902. focused: false
  1903. };
  1904. },
  1905. watch: {
  1906. value: function value() {
  1907. this.$nextTick(this.adjustSize);
  1908. }
  1909. },
  1910. mounted: function mounted() {
  1911. this.format();
  1912. this.$nextTick(this.adjustSize);
  1913. },
  1914. computed: {
  1915. showClear: function showClear() {
  1916. return this.clearable && this.focused && this.value !== '' && Object(utils["d" /* isDef */])(this.value) && !this.readonly;
  1917. },
  1918. listeners: function listeners() {
  1919. return _extends({}, this.$listeners, {
  1920. input: this.onInput,
  1921. keypress: this.onKeypress,
  1922. focus: this.onFocus,
  1923. blur: this.onBlur
  1924. });
  1925. },
  1926. labelStyle: function labelStyle() {
  1927. var labelWidth = this.labelWidth;
  1928. if (labelWidth) {
  1929. var width = isNumber(String(labelWidth)) ? labelWidth + "px" : labelWidth;
  1930. return {
  1931. maxWidth: width,
  1932. minWidth: width
  1933. };
  1934. }
  1935. }
  1936. },
  1937. methods: {
  1938. focus: function focus() {
  1939. this.$refs.input && this.$refs.input.focus();
  1940. },
  1941. blur: function blur() {
  1942. this.$refs.input && this.$refs.input.blur();
  1943. },
  1944. // native maxlength not work when type = number
  1945. format: function format(target) {
  1946. if (target === void 0) {
  1947. target = this.$refs.input;
  1948. }
  1949. var _target = target,
  1950. value = _target.value;
  1951. var maxlength = this.$attrs.maxlength;
  1952. if (this.type === 'number' && Object(utils["d" /* isDef */])(maxlength) && value.length > maxlength) {
  1953. value = value.slice(0, maxlength);
  1954. target.value = value;
  1955. }
  1956. return value;
  1957. },
  1958. onInput: function onInput(event) {
  1959. this.$emit('input', this.format(event.target));
  1960. },
  1961. onFocus: function onFocus(event) {
  1962. this.focused = true;
  1963. this.$emit('focus', event); // hack for safari
  1964. /* istanbul ignore if */
  1965. if (this.readonly) {
  1966. this.blur();
  1967. }
  1968. },
  1969. onBlur: function onBlur(event) {
  1970. this.focused = false;
  1971. this.$emit('blur', event); // Hack for iOS12 page scroll
  1972. // https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
  1973. /* istanbul ignore next */
  1974. if (Object(utils["e" /* isIOS */])()) {
  1975. window.scrollTo(0, getRootScrollTop());
  1976. }
  1977. },
  1978. onClickLeftIcon: function onClickLeftIcon() {
  1979. this.$emit('click-left-icon');
  1980. },
  1981. onClickRightIcon: function onClickRightIcon() {
  1982. // compatible old version
  1983. this.$emit('click-icon');
  1984. this.$emit('click-right-icon');
  1985. this.onIconClick && this.onIconClick();
  1986. },
  1987. onClear: function onClear(event) {
  1988. preventDefault(event);
  1989. this.$emit('input', '');
  1990. this.$emit('clear');
  1991. },
  1992. onKeypress: function onKeypress(event) {
  1993. if (this.type === 'number') {
  1994. var keyCode = event.keyCode;
  1995. var allowPoint = String(this.value).indexOf('.') === -1;
  1996. var isValidKey = keyCode >= 48 && keyCode <= 57 || keyCode === 46 && allowPoint || keyCode === 45;
  1997. if (!isValidKey) {
  1998. preventDefault(event);
  1999. }
  2000. } // trigger blur after click keyboard search button
  2001. /* istanbul ignore next */
  2002. if (this.type === 'search' && event.keyCode === 13) {
  2003. this.blur();
  2004. }
  2005. this.$emit('keypress', event);
  2006. },
  2007. adjustSize: function adjustSize() {
  2008. var input = this.$refs.input;
  2009. if (!(this.type === 'textarea' && this.autosize) || !input) {
  2010. return;
  2011. }
  2012. input.style.height = 'auto';
  2013. var height = input.scrollHeight;
  2014. if (Object(utils["g" /* isObj */])(this.autosize)) {
  2015. var _this$autosize = this.autosize,
  2016. maxHeight = _this$autosize.maxHeight,
  2017. minHeight = _this$autosize.minHeight;
  2018. if (maxHeight) {
  2019. height = Math.min(height, maxHeight);
  2020. }
  2021. if (minHeight) {
  2022. height = Math.max(height, minHeight);
  2023. }
  2024. }
  2025. if (height) {
  2026. input.style.height = height + 'px';
  2027. }
  2028. },
  2029. renderInput: function renderInput() {
  2030. var h = this.$createElement;
  2031. var inputProps = {
  2032. ref: 'input',
  2033. "class": field_bem('control', this.inputAlign),
  2034. domProps: {
  2035. value: this.value
  2036. },
  2037. attrs: _extends({}, this.$attrs, {
  2038. readonly: this.readonly
  2039. }),
  2040. on: this.listeners
  2041. };
  2042. if (this.type === 'textarea') {
  2043. return h("textarea", helper_default()([{}, inputProps]));
  2044. }
  2045. return h("input", helper_default()([{
  2046. "attrs": {
  2047. "type": this.type
  2048. }
  2049. }, inputProps]));
  2050. },
  2051. renderLeftIcon: function renderLeftIcon() {
  2052. var h = this.$createElement;
  2053. var showLeftIcon = this.slots('left-icon') || this.leftIcon;
  2054. if (showLeftIcon) {
  2055. return h("div", {
  2056. "class": field_bem('left-icon'),
  2057. "on": {
  2058. "click": this.onClickLeftIcon
  2059. }
  2060. }, [this.slots('left-icon') || h(es_icon, {
  2061. "attrs": {
  2062. "name": this.leftIcon
  2063. }
  2064. })]);
  2065. }
  2066. },
  2067. renderRightIcon: function renderRightIcon() {
  2068. var h = this.$createElement;
  2069. var slots = this.slots;
  2070. var showRightIcon = slots('right-icon') || slots('icon') || this.rightIcon || this.icon;
  2071. if (showRightIcon) {
  2072. return h("div", {
  2073. "class": field_bem('right-icon'),
  2074. "on": {
  2075. "click": this.onClickRightIcon
  2076. }
  2077. }, [slots('right-icon') || slots('icon') || h(es_icon, {
  2078. "attrs": {
  2079. "name": this.rightIcon || this.icon
  2080. }
  2081. })]);
  2082. }
  2083. }
  2084. },
  2085. render: function render(h) {
  2086. var _bem;
  2087. var slots = this.slots,
  2088. labelAlign = this.labelAlign;
  2089. var scopedSlots = {
  2090. icon: this.renderLeftIcon
  2091. };
  2092. if (slots('label')) {
  2093. scopedSlots.title = function () {
  2094. return slots('label');
  2095. };
  2096. }
  2097. return h(cell, {
  2098. "attrs": {
  2099. "icon": this.leftIcon,
  2100. "size": this.size,
  2101. "title": this.label,
  2102. "center": this.center,
  2103. "border": this.border,
  2104. "isLink": this.isLink,
  2105. "required": this.required,
  2106. "titleStyle": this.labelStyle,
  2107. "titleClass": field_bem('label', labelAlign)
  2108. },
  2109. "class": field_bem((_bem = {
  2110. error: this.error,
  2111. disabled: this.$attrs.disabled
  2112. }, _bem["label-" + labelAlign] = labelAlign, _bem['min-height'] = this.type === 'textarea' && !this.autosize, _bem)),
  2113. "scopedSlots": scopedSlots
  2114. }, [h("div", {
  2115. "class": field_bem('body')
  2116. }, [this.renderInput(), this.showClear && h(es_icon, {
  2117. "attrs": {
  2118. "name": "clear"
  2119. },
  2120. "class": field_bem('clear'),
  2121. "on": {
  2122. "touchstart": this.onClear
  2123. }
  2124. }), this.renderRightIcon(), slots('button') && h("div", {
  2125. "class": field_bem('button')
  2126. }, [slots('button')])]), this.errorMessage && h("div", {
  2127. "class": field_bem('error-message', this.errorMessageAlign)
  2128. }, [this.errorMessage])]);
  2129. }
  2130. }));
  2131. // CONCATENATED MODULE: ./es/toast/Toast.js
  2132. var Toast_use = Object(utils["k" /* use */])('toast'),
  2133. Toast_sfc = Toast_use[0],
  2134. Toast_bem = Toast_use[1];
  2135. var STYLE = ['success', 'fail', 'loading'];
  2136. /* harmony default export */ var Toast = (Toast_sfc({
  2137. mixins: [PopupMixin],
  2138. props: {
  2139. className: null,
  2140. forbidClick: Boolean,
  2141. message: [String, Number],
  2142. type: {
  2143. type: String,
  2144. "default": 'text'
  2145. },
  2146. loadingType: {
  2147. type: String,
  2148. "default": 'circular'
  2149. },
  2150. position: {
  2151. type: String,
  2152. "default": 'middle'
  2153. },
  2154. lockScroll: {
  2155. type: Boolean,
  2156. "default": false
  2157. }
  2158. },
  2159. data: function data() {
  2160. return {
  2161. clickable: false
  2162. };
  2163. },
  2164. mounted: function mounted() {
  2165. this.toggleClickale();
  2166. },
  2167. destroyed: function destroyed() {
  2168. this.toggleClickale();
  2169. },
  2170. watch: {
  2171. value: function value() {
  2172. this.toggleClickale();
  2173. },
  2174. forbidClick: function forbidClick() {
  2175. this.toggleClickale();
  2176. }
  2177. },
  2178. methods: {
  2179. toggleClickale: function toggleClickale() {
  2180. var clickable = this.value && this.forbidClick;
  2181. if (this.clickable !== clickable) {
  2182. this.clickable = clickable;
  2183. var action = clickable ? 'add' : 'remove';
  2184. document.body.classList[action]('van-toast--unclickable');
  2185. }
  2186. }
  2187. },
  2188. render: function render(h) {
  2189. var _this = this;
  2190. var type = this.type,
  2191. message = this.message;
  2192. var style = STYLE.indexOf(type) !== -1 ? 'default' : type;
  2193. var Content = function Content() {
  2194. switch (style) {
  2195. case 'text':
  2196. return h("div", [message]);
  2197. case 'html':
  2198. return h("div", {
  2199. "domProps": {
  2200. "innerHTML": message
  2201. }
  2202. });
  2203. default:
  2204. return [type === 'loading' ? h(es_loading, {
  2205. "attrs": {
  2206. "color": "white",
  2207. "type": _this.loadingType
  2208. }
  2209. }) : h(es_icon, {
  2210. "class": Toast_bem('icon'),
  2211. "attrs": {
  2212. "name": type
  2213. }
  2214. }), Object(utils["d" /* isDef */])(message) && h("div", {
  2215. "class": Toast_bem('text')
  2216. }, [message])];
  2217. }
  2218. };
  2219. return h("transition", {
  2220. "attrs": {
  2221. "name": "van-fade"
  2222. }
  2223. }, [h("div", {
  2224. "directives": [{
  2225. name: "show",
  2226. value: this.value
  2227. }],
  2228. "class": [Toast_bem([style, this.position]), this.className]
  2229. }, [Content()])]);
  2230. }
  2231. }));
  2232. // CONCATENATED MODULE: ./es/toast/index.js
  2233. var defaultOptions = {
  2234. type: 'text',
  2235. mask: false,
  2236. value: true,
  2237. message: '',
  2238. className: '',
  2239. onClose: null,
  2240. duration: 3000,
  2241. position: 'middle',
  2242. forbidClick: false,
  2243. loadingType: 'circular',
  2244. getContainer: 'body',
  2245. overlayStyle: null
  2246. };
  2247. var toast_parseOptions = function parseOptions(message) {
  2248. return Object(utils["g" /* isObj */])(message) ? message : {
  2249. message: message
  2250. };
  2251. };
  2252. var queue = [];
  2253. var multiple = false;
  2254. var currentOptions = _extends({}, defaultOptions);
  2255. function createInstance() {
  2256. /* istanbul ignore if */
  2257. if (utils["h" /* isServer */]) {
  2258. return {};
  2259. }
  2260. if (!queue.length || multiple || !Object(utils["f" /* isInDocument */])(queue[0].$el)) {
  2261. var toast = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(Toast))({
  2262. el: document.createElement('div')
  2263. });
  2264. queue.push(toast);
  2265. }
  2266. return queue[queue.length - 1];
  2267. } // transform toast options to popup props
  2268. function transformer(options) {
  2269. options.overlay = options.mask;
  2270. return options;
  2271. }
  2272. function toast_Toast(options) {
  2273. if (options === void 0) {
  2274. options = {};
  2275. }
  2276. var toast = createInstance(); // should add z-index if previous toast has not disappeared
  2277. if (toast.value) {
  2278. toast.updateZIndex();
  2279. }
  2280. options = _extends({}, currentOptions, toast_parseOptions(options), {
  2281. clear: function clear() {
  2282. toast.value = false;
  2283. if (options.onClose) {
  2284. options.onClose();
  2285. }
  2286. if (multiple && !utils["h" /* isServer */]) {
  2287. clearTimeout(toast.timer);
  2288. queue = queue.filter(function (item) {
  2289. return item !== toast;
  2290. });
  2291. var parent = toast.$el.parentNode;
  2292. if (parent) {
  2293. parent.removeChild(toast.$el);
  2294. }
  2295. toast.$destroy();
  2296. }
  2297. }
  2298. });
  2299. _extends(toast, transformer(options));
  2300. clearTimeout(toast.timer);
  2301. if (options.duration > 0) {
  2302. toast.timer = setTimeout(function () {
  2303. toast.clear();
  2304. }, options.duration);
  2305. }
  2306. return toast;
  2307. }
  2308. var toast_createMethod = function createMethod(type) {
  2309. return function (options) {
  2310. return toast_Toast(_extends({
  2311. type: type
  2312. }, toast_parseOptions(options)));
  2313. };
  2314. };
  2315. ['loading', 'success', 'fail'].forEach(function (method) {
  2316. toast_Toast[method] = toast_createMethod(method);
  2317. });
  2318. toast_Toast.clear = function (all) {
  2319. if (queue.length) {
  2320. if (all) {
  2321. queue.forEach(function (toast) {
  2322. toast.clear();
  2323. });
  2324. queue = [];
  2325. } else if (!multiple) {
  2326. queue[0].clear();
  2327. } else {
  2328. queue.shift().clear();
  2329. }
  2330. }
  2331. };
  2332. toast_Toast.setDefaultOptions = function (options) {
  2333. _extends(currentOptions, options);
  2334. };
  2335. toast_Toast.resetDefaultOptions = function () {
  2336. currentOptions = _extends({}, defaultOptions);
  2337. };
  2338. toast_Toast.allowMultiple = function (value) {
  2339. if (value === void 0) {
  2340. value = true;
  2341. }
  2342. multiple = value;
  2343. };
  2344. toast_Toast.install = function () {
  2345. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.use(Toast);
  2346. };
  2347. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype.$toast = toast_Toast;
  2348. /* harmony default export */ var es_toast = (toast_Toast);
  2349. // CONCATENATED MODULE: ./es/button/index.js
  2350. // Types
  2351. var button_use = Object(utils["k" /* use */])('button'),
  2352. button_sfc = button_use[0],
  2353. button_bem = button_use[1];
  2354. function Button(h, props, slots, ctx) {
  2355. var tag = props.tag,
  2356. type = props.type,
  2357. disabled = props.disabled,
  2358. loading = props.loading,
  2359. hairline = props.hairline,
  2360. loadingText = props.loadingText;
  2361. var onClick = function onClick(event) {
  2362. if (!loading && !disabled) {
  2363. functional_emit(ctx, 'click', event);
  2364. functionalRoute(ctx);
  2365. }
  2366. };
  2367. var onTouchstart = function onTouchstart(event) {
  2368. functional_emit(ctx, 'touchstart', event);
  2369. };
  2370. var classes = [button_bem([type, props.size, {
  2371. loading: loading,
  2372. disabled: disabled,
  2373. hairline: hairline,
  2374. block: props.block,
  2375. plain: props.plain,
  2376. round: props.round,
  2377. square: props.square,
  2378. 'bottom-action': props.bottomAction
  2379. }]), {
  2380. 'van-hairline--surround': hairline
  2381. }];
  2382. return h(tag, helper_default()([{
  2383. "class": classes,
  2384. "attrs": {
  2385. "type": props.nativeType,
  2386. "disabled": disabled
  2387. },
  2388. "on": {
  2389. "click": onClick,
  2390. "touchstart": onTouchstart
  2391. }
  2392. }, inherit(ctx)]), [loading ? [h(es_loading, {
  2393. "attrs": {
  2394. "size": props.loadingSize,
  2395. "color": type === 'default' ? undefined : ''
  2396. }
  2397. }), loadingText && h("span", {
  2398. "class": button_bem('loading-text')
  2399. }, [loadingText])] : h("span", {
  2400. "class": button_bem('text')
  2401. }, [slots["default"] ? slots["default"]() : props.text])]);
  2402. }
  2403. Button.props = _extends({}, routeProps, {
  2404. text: String,
  2405. block: Boolean,
  2406. plain: Boolean,
  2407. round: Boolean,
  2408. square: Boolean,
  2409. loading: Boolean,
  2410. hairline: Boolean,
  2411. disabled: Boolean,
  2412. nativeType: String,
  2413. loadingText: String,
  2414. bottomAction: Boolean,
  2415. tag: {
  2416. type: String,
  2417. "default": 'button'
  2418. },
  2419. type: {
  2420. type: String,
  2421. "default": 'default'
  2422. },
  2423. size: {
  2424. type: String,
  2425. "default": 'normal'
  2426. },
  2427. loadingSize: {
  2428. type: String,
  2429. "default": '20px'
  2430. }
  2431. });
  2432. /* harmony default export */ var es_button = (button_sfc(Button));
  2433. // CONCATENATED MODULE: ./es/dialog/Dialog.js
  2434. var Dialog_use = Object(utils["k" /* use */])('dialog'),
  2435. Dialog_sfc = Dialog_use[0],
  2436. Dialog_bem = Dialog_use[1],
  2437. Dialog_t = Dialog_use[2];
  2438. /* harmony default export */ var Dialog = (Dialog_sfc({
  2439. mixins: [PopupMixin],
  2440. props: {
  2441. title: String,
  2442. message: String,
  2443. className: null,
  2444. callback: Function,
  2445. beforeClose: Function,
  2446. messageAlign: String,
  2447. cancelButtonText: String,
  2448. cancelButtonColor: String,
  2449. confirmButtonText: String,
  2450. confirmButtonColor: String,
  2451. showCancelButton: Boolean,
  2452. showConfirmButton: {
  2453. type: Boolean,
  2454. "default": true
  2455. },
  2456. overlay: {
  2457. type: Boolean,
  2458. "default": true
  2459. },
  2460. closeOnClickOverlay: {
  2461. type: Boolean,
  2462. "default": false
  2463. }
  2464. },
  2465. data: function data() {
  2466. return {
  2467. loading: {
  2468. confirm: false,
  2469. cancel: false
  2470. }
  2471. };
  2472. },
  2473. methods: {
  2474. onClickOverlay: function onClickOverlay() {
  2475. this.handleAction('overlay');
  2476. },
  2477. handleAction: function handleAction(action) {
  2478. var _this = this;
  2479. this.$emit(action);
  2480. if (this.beforeClose) {
  2481. this.loading[action] = true;
  2482. this.beforeClose(action, function (state) {
  2483. if (state !== false) {
  2484. _this.onClose(action);
  2485. }
  2486. _this.loading[action] = false;
  2487. });
  2488. } else {
  2489. this.onClose(action);
  2490. }
  2491. },
  2492. onClose: function onClose(action) {
  2493. this.close();
  2494. if (this.callback) {
  2495. this.callback(action);
  2496. }
  2497. }
  2498. },
  2499. render: function render(h) {
  2500. var _bem,
  2501. _this2 = this;
  2502. if (!this.shouldRender) {
  2503. return;
  2504. }
  2505. var title = this.title,
  2506. message = this.message,
  2507. messageAlign = this.messageAlign;
  2508. var children = this.slots();
  2509. var Title = title && h("div", {
  2510. "class": Dialog_bem('header', {
  2511. isolated: !message && !children
  2512. })
  2513. }, [title]);
  2514. var Content = (children || message) && h("div", {
  2515. "class": Dialog_bem('content')
  2516. }, [children || h("div", {
  2517. "domProps": {
  2518. "innerHTML": message
  2519. },
  2520. "class": Dialog_bem('message', (_bem = {
  2521. 'has-title': title
  2522. }, _bem[messageAlign] = messageAlign, _bem))
  2523. })]);
  2524. var hasButtons = this.showCancelButton && this.showConfirmButton;
  2525. var ButtonGroup = h("div", {
  2526. "class": ['van-hairline--top', Dialog_bem('footer', {
  2527. buttons: hasButtons
  2528. })]
  2529. }, [this.showCancelButton && h(es_button, {
  2530. "attrs": {
  2531. "size": "large",
  2532. "loading": this.loading.cancel,
  2533. "text": this.cancelButtonText || Dialog_t('cancel')
  2534. },
  2535. "class": Dialog_bem('cancel'),
  2536. "style": {
  2537. color: this.cancelButtonColor
  2538. },
  2539. "on": {
  2540. "click": function click() {
  2541. _this2.handleAction('cancel');
  2542. }
  2543. }
  2544. }), this.showConfirmButton && h(es_button, {
  2545. "attrs": {
  2546. "size": "large",
  2547. "loading": this.loading.confirm,
  2548. "text": this.confirmButtonText || Dialog_t('confirm')
  2549. },
  2550. "class": [Dialog_bem('confirm'), {
  2551. 'van-hairline--left': hasButtons
  2552. }],
  2553. "style": {
  2554. color: this.confirmButtonColor
  2555. },
  2556. "on": {
  2557. "click": function click() {
  2558. _this2.handleAction('confirm');
  2559. }
  2560. }
  2561. })]);
  2562. return h("transition", {
  2563. "attrs": {
  2564. "name": "van-dialog-bounce"
  2565. }
  2566. }, [h("div", {
  2567. "directives": [{
  2568. name: "show",
  2569. value: this.value
  2570. }],
  2571. "class": [Dialog_bem(), this.className]
  2572. }, [Title, Content, ButtonGroup])]);
  2573. }
  2574. }));
  2575. // CONCATENATED MODULE: ./es/dialog/index.js
  2576. var dialog_instance;
  2577. function dialog_initInstance() {
  2578. if (dialog_instance) {
  2579. dialog_instance.$destroy();
  2580. }
  2581. dialog_instance = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(Dialog))({
  2582. el: document.createElement('div'),
  2583. // avoid missing animation when first rendered
  2584. propsData: {
  2585. lazyRender: false
  2586. }
  2587. });
  2588. dialog_instance.$on('input', function (value) {
  2589. dialog_instance.value = value;
  2590. });
  2591. }
  2592. function dialog_Dialog(options) {
  2593. /* istanbul ignore if */
  2594. if (utils["h" /* isServer */]) {
  2595. return Promise.resolve();
  2596. }
  2597. return new Promise(function (resolve, reject) {
  2598. if (!dialog_instance || !Object(utils["f" /* isInDocument */])(dialog_instance.$el)) {
  2599. dialog_initInstance();
  2600. }
  2601. _extends(dialog_instance, dialog_Dialog.currentOptions, options, {
  2602. resolve: resolve,
  2603. reject: reject
  2604. });
  2605. });
  2606. }
  2607. dialog_Dialog.defaultOptions = {
  2608. value: true,
  2609. title: '',
  2610. message: '',
  2611. overlay: true,
  2612. className: '',
  2613. lockScroll: true,
  2614. beforeClose: null,
  2615. messageAlign: '',
  2616. getContainer: 'body',
  2617. cancelButtonText: '',
  2618. cancelButtonColor: null,
  2619. confirmButtonText: '',
  2620. confirmButtonColor: null,
  2621. showConfirmButton: true,
  2622. showCancelButton: false,
  2623. closeOnClickOverlay: false,
  2624. callback: function callback(action) {
  2625. dialog_instance[action === 'confirm' ? 'resolve' : 'reject'](action);
  2626. }
  2627. };
  2628. dialog_Dialog.alert = dialog_Dialog;
  2629. dialog_Dialog.confirm = function (options) {
  2630. return dialog_Dialog(_extends({
  2631. showCancelButton: true
  2632. }, options));
  2633. };
  2634. dialog_Dialog.close = function () {
  2635. if (dialog_instance) {
  2636. dialog_instance.value = false;
  2637. }
  2638. };
  2639. dialog_Dialog.setDefaultOptions = function (options) {
  2640. _extends(dialog_Dialog.currentOptions, options);
  2641. };
  2642. dialog_Dialog.resetDefaultOptions = function () {
  2643. dialog_Dialog.currentOptions = _extends({}, dialog_Dialog.defaultOptions);
  2644. };
  2645. dialog_Dialog.resetDefaultOptions();
  2646. dialog_Dialog.install = function () {
  2647. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.use(Dialog);
  2648. };
  2649. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype.$dialog = dialog_Dialog;
  2650. /* harmony default export */ var dialog = (dialog_Dialog);
  2651. // CONCATENATED MODULE: ./es/address-edit/Detail.js
  2652. var Detail_use = Object(utils["k" /* use */])('address-edit-detail'),
  2653. Detail_sfc = Detail_use[0],
  2654. Detail_bem = Detail_use[1],
  2655. Detail_t = Detail_use[2];
  2656. var android = Object(utils["c" /* isAndroid */])();
  2657. /* harmony default export */ var Detail = (Detail_sfc({
  2658. props: {
  2659. value: String,
  2660. error: Boolean,
  2661. focused: Boolean,
  2662. detailRows: Number,
  2663. searchResult: Array,
  2664. showSearchResult: Boolean
  2665. },
  2666. methods: {
  2667. onSelect: function onSelect(express) {
  2668. this.$emit('select-search', express);
  2669. this.$emit('input', ((express.address || '') + " " + (express.name || '')).trim());
  2670. },
  2671. onFinish: function onFinish() {
  2672. this.$refs.field.blur();
  2673. },
  2674. renderFinish: function renderFinish() {
  2675. var h = this.$createElement;
  2676. var show = this.value && this.focused && android;
  2677. if (show) {
  2678. return h("div", {
  2679. "class": Detail_bem('finish'),
  2680. "on": {
  2681. "click": this.onFinish
  2682. }
  2683. }, [Detail_t('complete')]);
  2684. }
  2685. },
  2686. renderSearchResult: function renderSearchResult() {
  2687. var _this = this;
  2688. var h = this.$createElement;
  2689. var searchResult = this.searchResult;
  2690. var show = this.focused && searchResult && this.showSearchResult;
  2691. if (show) {
  2692. return searchResult.map(function (express) {
  2693. return h(cell, {
  2694. "key": express.name + express.address,
  2695. "attrs": {
  2696. "title": express.name,
  2697. "label": express.address,
  2698. "icon": "location-o",
  2699. "clickable": true
  2700. },
  2701. "on": {
  2702. "click": function click() {
  2703. _this.onSelect(express);
  2704. }
  2705. }
  2706. });
  2707. });
  2708. }
  2709. }
  2710. },
  2711. render: function render(h) {
  2712. return h(cell, {
  2713. "class": Detail_bem()
  2714. }, [h(field, {
  2715. "attrs": {
  2716. "autosize": true,
  2717. "rows": this.detailRows,
  2718. "clearable": !android,
  2719. "type": "textarea",
  2720. "maxlength": "200",
  2721. "value": this.value,
  2722. "error": this.error,
  2723. "label": Detail_t('label'),
  2724. "placeholder": Detail_t('placeholder')
  2725. },
  2726. "ref": "field",
  2727. "scopedSlots": {
  2728. icon: this.renderFinish
  2729. },
  2730. "on": _extends({}, this.$listeners)
  2731. }), this.renderSearchResult()]);
  2732. }
  2733. }));
  2734. // CONCATENATED MODULE: ./es/switch/shared.js
  2735. /**
  2736. * Common Switch Props
  2737. */
  2738. var switchProps = {
  2739. value: null,
  2740. loading: Boolean,
  2741. disabled: Boolean,
  2742. activeColor: String,
  2743. inactiveColor: String,
  2744. activeValue: {
  2745. type: null,
  2746. "default": true
  2747. },
  2748. inactiveValue: {
  2749. type: null,
  2750. "default": false
  2751. },
  2752. size: {
  2753. type: String,
  2754. "default": '30px'
  2755. }
  2756. };
  2757. // CONCATENATED MODULE: ./es/switch/index.js
  2758. // Types
  2759. var switch_use = Object(utils["k" /* use */])('switch'),
  2760. switch_sfc = switch_use[0],
  2761. switch_bem = switch_use[1];
  2762. function Switch(h, props, slots, ctx) {
  2763. var value = props.value,
  2764. loading = props.loading,
  2765. disabled = props.disabled,
  2766. activeValue = props.activeValue,
  2767. inactiveValue = props.inactiveValue;
  2768. var style = {
  2769. fontSize: props.size,
  2770. backgroundColor: value ? props.activeColor : props.inactiveColor
  2771. };
  2772. var onClick = function onClick() {
  2773. if (!disabled && !loading) {
  2774. var newValue = value === activeValue ? inactiveValue : activeValue;
  2775. functional_emit(ctx, 'input', newValue);
  2776. functional_emit(ctx, 'change', newValue);
  2777. }
  2778. };
  2779. return h("div", helper_default()([{
  2780. "class": switch_bem({
  2781. on: value === activeValue,
  2782. disabled: disabled
  2783. }),
  2784. "style": style,
  2785. "on": {
  2786. "click": onClick
  2787. }
  2788. }, inherit(ctx)]), [h("div", {
  2789. "class": switch_bem('node')
  2790. }, [loading && h(es_loading, {
  2791. "class": switch_bem('loading')
  2792. })])]);
  2793. }
  2794. Switch.props = switchProps;
  2795. /* harmony default export */ var es_switch = (switch_sfc(Switch));
  2796. // CONCATENATED MODULE: ./es/switch-cell/index.js
  2797. // Types
  2798. var switch_cell_use = Object(utils["k" /* use */])('switch-cell'),
  2799. switch_cell_sfc = switch_cell_use[0],
  2800. switch_cell_bem = switch_cell_use[1];
  2801. function SwitchCell(h, props, slots, ctx) {
  2802. return h(cell, helper_default()([{
  2803. "attrs": {
  2804. "center": true,
  2805. "title": props.title,
  2806. "border": props.border
  2807. },
  2808. "class": switch_cell_bem()
  2809. }, inherit(ctx)]), [h(es_switch, {
  2810. "props": _extends({}, props),
  2811. "on": _extends({}, ctx.listeners)
  2812. })]);
  2813. }
  2814. SwitchCell.props = _extends({}, switchProps, {
  2815. title: String,
  2816. border: Boolean,
  2817. size: {
  2818. type: String,
  2819. "default": '24px'
  2820. }
  2821. });
  2822. /* harmony default export */ var switch_cell = (switch_cell_sfc(SwitchCell));
  2823. // CONCATENATED MODULE: ./es/address-edit/index.js
  2824. var address_edit_use = Object(utils["k" /* use */])('address-edit'),
  2825. address_edit_sfc = address_edit_use[0],
  2826. address_edit_bem = address_edit_use[1],
  2827. address_edit_t = address_edit_use[2];
  2828. var defaultData = {
  2829. name: '',
  2830. tel: '',
  2831. country: '',
  2832. province: '',
  2833. city: '',
  2834. county: '',
  2835. areaCode: '',
  2836. postalCode: '',
  2837. addressDetail: '',
  2838. isDefault: false
  2839. };
  2840. /* harmony default export */ var address_edit = (address_edit_sfc({
  2841. props: {
  2842. areaList: Object,
  2843. isSaving: Boolean,
  2844. isDeleting: Boolean,
  2845. validator: Function,
  2846. showDelete: Boolean,
  2847. showPostal: Boolean,
  2848. searchResult: Array,
  2849. showSetDefault: Boolean,
  2850. showSearchResult: Boolean,
  2851. saveButtonText: String,
  2852. deleteButtonText: String,
  2853. showArea: {
  2854. type: Boolean,
  2855. "default": true
  2856. },
  2857. showDetail: {
  2858. type: Boolean,
  2859. "default": true
  2860. },
  2861. detailRows: {
  2862. type: Number,
  2863. "default": 1
  2864. },
  2865. addressInfo: {
  2866. type: Object,
  2867. "default": function _default() {
  2868. return _extends({}, defaultData);
  2869. }
  2870. },
  2871. telValidator: {
  2872. type: Function,
  2873. "default": isMobile
  2874. }
  2875. },
  2876. data: function data() {
  2877. return {
  2878. data: {},
  2879. showAreaPopup: false,
  2880. detailFocused: false,
  2881. errorInfo: {
  2882. tel: false,
  2883. name: false,
  2884. postalCode: false,
  2885. addressDetail: false
  2886. }
  2887. };
  2888. },
  2889. computed: {
  2890. areaListLoaded: function areaListLoaded() {
  2891. return Object(utils["g" /* isObj */])(this.areaList) && Object.keys(this.areaList).length;
  2892. },
  2893. areaText: function areaText() {
  2894. var _this$data = this.data,
  2895. country = _this$data.country,
  2896. province = _this$data.province,
  2897. city = _this$data.city,
  2898. county = _this$data.county,
  2899. areaCode = _this$data.areaCode;
  2900. if (areaCode) {
  2901. var arr = [country, province, city, county];
  2902. if (province && province === city) {
  2903. arr.splice(1, 1);
  2904. }
  2905. return arr.filter(function (text) {
  2906. return text;
  2907. }).join('/');
  2908. }
  2909. return '';
  2910. }
  2911. },
  2912. watch: {
  2913. addressInfo: {
  2914. handler: function handler(val) {
  2915. this.data = _extends({}, defaultData, val);
  2916. this.setAreaCode(val.areaCode);
  2917. },
  2918. deep: true,
  2919. immediate: true
  2920. },
  2921. areaList: function areaList() {
  2922. this.setAreaCode(this.data.areaCode);
  2923. }
  2924. },
  2925. methods: {
  2926. onFocus: function onFocus(key) {
  2927. this.errorInfo[key] = false;
  2928. this.detailFocused = key === 'addressDetail';
  2929. this.$emit('focus', key);
  2930. },
  2931. onChangeDetail: function onChangeDetail(val) {
  2932. this.data.addressDetail = val;
  2933. this.$emit('change-detail', val);
  2934. },
  2935. onAreaConfirm: function onAreaConfirm(values) {
  2936. this.showAreaPopup = false;
  2937. this.assignAreaValues();
  2938. this.$emit('change-area', values);
  2939. },
  2940. assignAreaValues: function assignAreaValues() {
  2941. var area = this.$refs.area;
  2942. if (area) {
  2943. var detail = area.getArea();
  2944. detail.areaCode = detail.code;
  2945. delete detail.code;
  2946. _extends(this.data, detail);
  2947. }
  2948. },
  2949. onSave: function onSave() {
  2950. var _this = this;
  2951. var items = ['name', 'tel', 'areaCode', 'addressDetail'];
  2952. if (this.showPostal) {
  2953. items.push('postalCode');
  2954. }
  2955. var isValid = items.every(function (item) {
  2956. var msg = _this.getErrorMessage(item);
  2957. if (msg) {
  2958. _this.errorInfo[item] = true;
  2959. es_toast(msg);
  2960. }
  2961. return !msg;
  2962. });
  2963. if (isValid && !this.isSaving) {
  2964. this.$emit('save', this.data);
  2965. }
  2966. },
  2967. getErrorMessage: function getErrorMessage(key) {
  2968. var value = String(this.data[key] || '').trim();
  2969. if (this.validator) {
  2970. var message = this.validator(key, value);
  2971. if (message) {
  2972. return message;
  2973. }
  2974. }
  2975. switch (key) {
  2976. case 'name':
  2977. return value ? '' : address_edit_t('nameEmpty');
  2978. case 'tel':
  2979. return this.telValidator(value) ? '' : address_edit_t('telInvalid');
  2980. case 'areaCode':
  2981. return value ? '' : address_edit_t('areaEmpty');
  2982. case 'addressDetail':
  2983. return value ? '' : address_edit_t('addressEmpty');
  2984. case 'postalCode':
  2985. return value && !/^\d{6}$/.test(value) ? address_edit_t('postalEmpty') : '';
  2986. }
  2987. },
  2988. onDelete: function onDelete() {
  2989. var _this2 = this;
  2990. dialog.confirm({
  2991. title: address_edit_t('confirmDelete')
  2992. }).then(function () {
  2993. _this2.$emit('delete', _this2.data);
  2994. })["catch"](function () {
  2995. _this2.$emit('cancel-delete', _this2.data);
  2996. });
  2997. },
  2998. // get values of area component
  2999. getArea: function getArea() {
  3000. return this.$refs.area ? this.$refs.area.getValues() : [];
  3001. },
  3002. // set area code to area component
  3003. setAreaCode: function setAreaCode(code) {
  3004. this.data.areaCode = code || '';
  3005. if (code) {
  3006. this.$nextTick(this.assignAreaValues);
  3007. }
  3008. },
  3009. setAddressDetail: function setAddressDetail(value) {
  3010. this.data.addressDetail = value;
  3011. },
  3012. onDetailBlur: function onDetailBlur() {
  3013. var _this3 = this; // await for click search event
  3014. setTimeout(function () {
  3015. _this3.detailFocused = false;
  3016. });
  3017. }
  3018. },
  3019. render: function render(h) {
  3020. var _this4 = this;
  3021. var data = this.data,
  3022. errorInfo = this.errorInfo;
  3023. var onFocus = function onFocus(name) {
  3024. return function () {
  3025. return _this4.onFocus(name);
  3026. };
  3027. }; // hide bottom field when use search && detail get focused
  3028. var hideBottomFields = this.searchResult.length && this.detailFocused;
  3029. return h("div", {
  3030. "class": address_edit_bem()
  3031. }, [h(field, {
  3032. "attrs": {
  3033. "clearable": true,
  3034. "label": address_edit_t('name'),
  3035. "placeholder": address_edit_t('namePlaceholder'),
  3036. "error": errorInfo.name
  3037. },
  3038. "on": {
  3039. "focus": onFocus('name')
  3040. },
  3041. "model": {
  3042. value: data.name,
  3043. callback: function callback($$v) {
  3044. data.name = $$v;
  3045. }
  3046. }
  3047. }), h(field, {
  3048. "attrs": {
  3049. "clearable": true,
  3050. "type": "tel",
  3051. "label": address_edit_t('tel'),
  3052. "placeholder": address_edit_t('telPlaceholder'),
  3053. "error": errorInfo.tel
  3054. },
  3055. "on": {
  3056. "focus": onFocus('tel')
  3057. },
  3058. "model": {
  3059. value: data.tel,
  3060. callback: function callback($$v) {
  3061. data.tel = $$v;
  3062. }
  3063. }
  3064. }), h(field, {
  3065. "directives": [{
  3066. name: "show",
  3067. value: this.showArea
  3068. }],
  3069. "attrs": {
  3070. "readonly": true,
  3071. "label": address_edit_t('area'),
  3072. "placeholder": address_edit_t('areaPlaceholder'),
  3073. "value": this.areaText
  3074. },
  3075. "on": {
  3076. "click": function click() {
  3077. _this4.showAreaPopup = true;
  3078. }
  3079. }
  3080. }), h(Detail, {
  3081. "directives": [{
  3082. name: "show",
  3083. value: this.showDetail
  3084. }],
  3085. "attrs": {
  3086. "focused": this.detailFocused,
  3087. "value": data.addressDetail,
  3088. "error": errorInfo.addressDetail,
  3089. "detailRows": this.detailRows,
  3090. "searchResult": this.searchResult,
  3091. "showSearchResult": this.showSearchResult
  3092. },
  3093. "on": {
  3094. "focus": onFocus('addressDetail'),
  3095. "blur": this.onDetailBlur,
  3096. "input": this.onChangeDetail,
  3097. "select-search": function selectSearch(event) {
  3098. _this4.$emit('select-search', event);
  3099. }
  3100. }
  3101. }), this.showPostal && h(field, {
  3102. "directives": [{
  3103. name: "show",
  3104. value: !hideBottomFields
  3105. }],
  3106. "attrs": {
  3107. "type": "tel",
  3108. "maxlength": "6",
  3109. "label": address_edit_t('postal'),
  3110. "placeholder": address_edit_t('postal'),
  3111. "error": errorInfo.postalCode
  3112. },
  3113. "on": {
  3114. "focus": onFocus('postalCode')
  3115. },
  3116. "model": {
  3117. value: data.postalCode,
  3118. callback: function callback($$v) {
  3119. data.postalCode = $$v;
  3120. }
  3121. }
  3122. }), this.slots(), this.showSetDefault && h(switch_cell, {
  3123. "directives": [{
  3124. name: "show",
  3125. value: !hideBottomFields
  3126. }],
  3127. "attrs": {
  3128. "title": address_edit_t('defaultAddress')
  3129. },
  3130. "on": {
  3131. "change": function change(event) {
  3132. _this4.$emit('change-default', event);
  3133. }
  3134. },
  3135. "model": {
  3136. value: data.isDefault,
  3137. callback: function callback($$v) {
  3138. data.isDefault = $$v;
  3139. }
  3140. }
  3141. }), h("div", {
  3142. "directives": [{
  3143. name: "show",
  3144. value: !hideBottomFields
  3145. }],
  3146. "class": address_edit_bem('buttons')
  3147. }, [h(es_button, {
  3148. "attrs": {
  3149. "block": true,
  3150. "loading": this.isSaving,
  3151. "type": "danger",
  3152. "text": this.saveButtonText || address_edit_t('save')
  3153. },
  3154. "on": {
  3155. "click": this.onSave
  3156. }
  3157. }), this.showDelete && h(es_button, {
  3158. "attrs": {
  3159. "block": true,
  3160. "loading": this.isDeleting,
  3161. "text": this.deleteButtonText || address_edit_t('delete')
  3162. },
  3163. "on": {
  3164. "click": this.onDelete
  3165. }
  3166. })]), h(popup, {
  3167. "attrs": {
  3168. "position": "bottom",
  3169. "lazyRender": false,
  3170. "getContainer": "body"
  3171. },
  3172. "model": {
  3173. value: _this4.showAreaPopup,
  3174. callback: function callback($$v) {
  3175. _this4.showAreaPopup = $$v;
  3176. }
  3177. }
  3178. }, [h(es_area, {
  3179. "ref": "area",
  3180. "attrs": {
  3181. "loading": !this.areaListLoaded,
  3182. "value": data.areaCode,
  3183. "areaList": this.areaList
  3184. },
  3185. "on": {
  3186. "confirm": this.onAreaConfirm,
  3187. "cancel": function cancel() {
  3188. _this4.showAreaPopup = false;
  3189. }
  3190. }
  3191. })])]);
  3192. }
  3193. }));
  3194. // CONCATENATED MODULE: ./es/radio-group/index.js
  3195. var radio_group_use = Object(utils["k" /* use */])('radio-group'),
  3196. radio_group_sfc = radio_group_use[0],
  3197. radio_group_bem = radio_group_use[1];
  3198. /* harmony default export */ var radio_group = (radio_group_sfc({
  3199. props: {
  3200. value: null,
  3201. disabled: Boolean
  3202. },
  3203. watch: {
  3204. value: function value(_value) {
  3205. this.$emit('change', _value);
  3206. }
  3207. },
  3208. render: function render(h) {
  3209. return h("div", {
  3210. "class": radio_group_bem()
  3211. }, [this.slots()]);
  3212. }
  3213. }));
  3214. // CONCATENATED MODULE: ./es/mixins/find-parent.js
  3215. /**
  3216. * find parent component by name
  3217. */
  3218. var FindParentMixin = {
  3219. data: function data() {
  3220. return {
  3221. parent: null
  3222. };
  3223. },
  3224. methods: {
  3225. findParent: function findParent(name) {
  3226. var parent = this.$parent;
  3227. while (parent) {
  3228. if (parent.$options.name === name) {
  3229. this.parent = parent;
  3230. break;
  3231. }
  3232. parent = parent.$parent;
  3233. }
  3234. }
  3235. }
  3236. };
  3237. // CONCATENATED MODULE: ./es/mixins/checkbox.js
  3238. /**
  3239. * Common part of Checkbox & Radio
  3240. */
  3241. var checkbox_CheckboxMixin = function CheckboxMixin(parent, bem) {
  3242. return {
  3243. mixins: [FindParentMixin],
  3244. props: {
  3245. name: null,
  3246. value: null,
  3247. disabled: Boolean,
  3248. checkedColor: String,
  3249. labelPosition: String,
  3250. labelDisabled: Boolean,
  3251. shape: {
  3252. type: String,
  3253. "default": 'round'
  3254. }
  3255. },
  3256. created: function created() {
  3257. this.findParent(parent);
  3258. },
  3259. computed: {
  3260. isDisabled: function isDisabled() {
  3261. return this.parent && this.parent.disabled || this.disabled;
  3262. },
  3263. iconStyle: function iconStyle() {
  3264. var checkedColor = this.checkedColor;
  3265. if (checkedColor && this.checked && !this.isDisabled) {
  3266. return {
  3267. borderColor: checkedColor,
  3268. backgroundColor: checkedColor
  3269. };
  3270. }
  3271. }
  3272. },
  3273. render: function render(h) {
  3274. var _this = this;
  3275. var slots = this.slots,
  3276. checked = this.checked;
  3277. var CheckIcon = slots('icon', {
  3278. checked: checked
  3279. }) || h(es_icon, {
  3280. "attrs": {
  3281. "name": "success"
  3282. },
  3283. "style": this.iconStyle
  3284. });
  3285. var Label = slots() && h("span", {
  3286. "class": bem('label', [this.labelPosition, {
  3287. disabled: this.isDisabled
  3288. }]),
  3289. "on": {
  3290. "click": this.onClickLabel
  3291. }
  3292. }, [slots()]);
  3293. return h("div", {
  3294. "class": bem(),
  3295. "on": {
  3296. "click": function click(event) {
  3297. _this.$emit('click', event);
  3298. }
  3299. }
  3300. }, [h("div", {
  3301. "class": bem('icon', [this.shape, {
  3302. disabled: this.isDisabled,
  3303. checked: checked
  3304. }]),
  3305. "on": {
  3306. "click": this.onClickIcon
  3307. }
  3308. }, [CheckIcon]), Label]);
  3309. }
  3310. };
  3311. };
  3312. // CONCATENATED MODULE: ./es/radio/index.js
  3313. var radio_use = Object(utils["k" /* use */])('radio'),
  3314. radio_sfc = radio_use[0],
  3315. radio_bem = radio_use[1];
  3316. /* harmony default export */ var es_radio = (radio_sfc({
  3317. mixins: [checkbox_CheckboxMixin('van-radio-group', radio_bem)],
  3318. computed: {
  3319. currentValue: {
  3320. get: function get() {
  3321. return this.parent ? this.parent.value : this.value;
  3322. },
  3323. set: function set(val) {
  3324. (this.parent || this).$emit('input', val);
  3325. }
  3326. },
  3327. checked: function checked() {
  3328. return this.currentValue === this.name;
  3329. }
  3330. },
  3331. methods: {
  3332. onClickIcon: function onClickIcon() {
  3333. if (!this.isDisabled) {
  3334. this.currentValue = this.name;
  3335. }
  3336. },
  3337. onClickLabel: function onClickLabel() {
  3338. if (!this.isDisabled && !this.labelDisabled) {
  3339. this.currentValue = this.name;
  3340. }
  3341. }
  3342. }
  3343. }));
  3344. // CONCATENATED MODULE: ./es/address-list/Item.js
  3345. // Types
  3346. var Item_use = Object(utils["k" /* use */])('address-item'),
  3347. Item_sfc = Item_use[0],
  3348. Item_bem = Item_use[1];
  3349. function AddressItem(h, props, slots, ctx) {
  3350. var disabled = props.disabled,
  3351. switchable = props.switchable;
  3352. var onSelect = function onSelect() {
  3353. if (props.switchable) {
  3354. functional_emit(ctx, 'select');
  3355. }
  3356. };
  3357. var renderRightIcon = function renderRightIcon() {
  3358. return h(es_icon, {
  3359. "attrs": {
  3360. "name": "edit"
  3361. },
  3362. "class": Item_bem('edit'),
  3363. "on": {
  3364. "click": function click(event) {
  3365. event.stopPropagation();
  3366. functional_emit(ctx, 'edit');
  3367. }
  3368. }
  3369. });
  3370. };
  3371. var renderContent = function renderContent() {
  3372. var data = props.data;
  3373. var Info = [h("div", {
  3374. "class": Item_bem('name')
  3375. }, [data.name + "\uFF0C" + data.tel]), h("div", {
  3376. "class": Item_bem('address')
  3377. }, [data.address])];
  3378. return props.switchable ? h(es_radio, {
  3379. "attrs": {
  3380. "name": data.id
  3381. },
  3382. "on": {
  3383. "click": onSelect
  3384. }
  3385. }, [Info]) : Info;
  3386. };
  3387. return h(cell, helper_default()([{
  3388. "class": Item_bem({
  3389. disabled: disabled,
  3390. unswitchable: !switchable
  3391. }),
  3392. "attrs": {
  3393. "valueClass": Item_bem('value'),
  3394. "isLink": !disabled && switchable
  3395. },
  3396. "scopedSlots": {
  3397. "default": renderContent,
  3398. 'right-icon': renderRightIcon
  3399. },
  3400. "on": {
  3401. "click": onSelect
  3402. }
  3403. }, inherit(ctx)]));
  3404. }
  3405. AddressItem.props = {
  3406. data: Object,
  3407. disabled: Boolean,
  3408. switchable: Boolean
  3409. };
  3410. /* harmony default export */ var Item = (Item_sfc(AddressItem));
  3411. // CONCATENATED MODULE: ./es/address-list/index.js
  3412. // Types
  3413. var address_list_use = Object(utils["k" /* use */])('address-list'),
  3414. address_list_sfc = address_list_use[0],
  3415. address_list_bem = address_list_use[1],
  3416. address_list_t = address_list_use[2];
  3417. function AddressList(h, props, slots, ctx) {
  3418. var getList = function getList(list, disabled) {
  3419. return list.map(function (item, index) {
  3420. return h(Item, {
  3421. "attrs": {
  3422. "data": item,
  3423. "disabled": disabled,
  3424. "switchable": props.switchable && !disabled
  3425. },
  3426. "key": item.id,
  3427. "on": {
  3428. "select": function select() {
  3429. functional_emit(ctx, disabled ? 'select-disabled' : 'select', item, index);
  3430. },
  3431. "edit": function edit() {
  3432. functional_emit(ctx, disabled ? 'edit-disabled' : 'edit', item, index);
  3433. }
  3434. }
  3435. });
  3436. });
  3437. };
  3438. var List = getList(props.list);
  3439. var DisabledList = getList(props.disabledList, true);
  3440. return h("div", helper_default()([{
  3441. "class": address_list_bem()
  3442. }, inherit(ctx)]), [slots.top && slots.top(), h(radio_group, {
  3443. "attrs": {
  3444. "value": props.value
  3445. },
  3446. "on": {
  3447. "input": function input(event) {
  3448. functional_emit(ctx, 'input', event);
  3449. }
  3450. }
  3451. }, [List]), props.disabledText && h("div", {
  3452. "class": address_list_bem('disabled-text')
  3453. }, [props.disabledText]), DisabledList, slots["default"] && slots["default"](), h(es_button, {
  3454. "attrs": {
  3455. "square": true,
  3456. "size": "large",
  3457. "type": "danger",
  3458. "text": props.addButtonText || address_list_t('add')
  3459. },
  3460. "class": address_list_bem('add'),
  3461. "on": {
  3462. "click": function click() {
  3463. functional_emit(ctx, 'add');
  3464. }
  3465. }
  3466. })]);
  3467. }
  3468. AddressList.props = {
  3469. list: Array,
  3470. disabledList: Array,
  3471. disabledText: String,
  3472. addButtonText: String,
  3473. value: [String, Number],
  3474. switchable: {
  3475. type: Boolean,
  3476. "default": true
  3477. }
  3478. };
  3479. /* harmony default export */ var address_list = (address_list_sfc(AddressList));
  3480. // CONCATENATED MODULE: ./es/badge/index.js
  3481. var badge_use = Object(utils["k" /* use */])('badge'),
  3482. badge_sfc = badge_use[0],
  3483. badge_bem = badge_use[1];
  3484. /* harmony default export */ var badge = (badge_sfc({
  3485. props: {
  3486. url: String,
  3487. info: [String, Number],
  3488. title: String
  3489. },
  3490. inject: ['vanBadgeGroup'],
  3491. created: function created() {
  3492. this.parent.badges.push(this);
  3493. },
  3494. beforeDestroy: function beforeDestroy() {
  3495. var _this = this;
  3496. this.parent.badges = this.parent.badges.filter(function (item) {
  3497. return item !== _this;
  3498. });
  3499. },
  3500. computed: {
  3501. parent: function parent() {
  3502. if (false) {}
  3503. return this.vanBadgeGroup;
  3504. },
  3505. select: function select() {
  3506. return this.parent.badges.indexOf(this) === +this.parent.activeKey;
  3507. }
  3508. },
  3509. methods: {
  3510. onClick: function onClick() {
  3511. var index = this.parent.badges.indexOf(this);
  3512. this.$emit('click', index);
  3513. this.parent.$emit('change', index);
  3514. }
  3515. },
  3516. render: function render(h) {
  3517. return h("a", {
  3518. "attrs": {
  3519. "href": this.url
  3520. },
  3521. "class": [badge_bem({
  3522. select: this.select
  3523. }), 'van-hairline'],
  3524. "on": {
  3525. "click": this.onClick
  3526. }
  3527. }, [h("div", {
  3528. "class": badge_bem('text')
  3529. }, [this.title, h(es_info, {
  3530. "attrs": {
  3531. "info": this.info
  3532. },
  3533. "class": badge_bem('info')
  3534. })])]);
  3535. }
  3536. }));
  3537. // CONCATENATED MODULE: ./es/badge-group/index.js
  3538. var badge_group_use = Object(utils["k" /* use */])('badge-group'),
  3539. badge_group_sfc = badge_group_use[0],
  3540. badge_group_bem = badge_group_use[1];
  3541. /* harmony default export */ var badge_group = (badge_group_sfc({
  3542. props: {
  3543. activeKey: {
  3544. type: [Number, String],
  3545. "default": 0
  3546. }
  3547. },
  3548. provide: function provide() {
  3549. return {
  3550. vanBadgeGroup: this
  3551. };
  3552. },
  3553. data: function data() {
  3554. return {
  3555. badges: []
  3556. };
  3557. },
  3558. render: function render(h) {
  3559. return h("div", {
  3560. "class": [badge_group_bem(), 'van-hairline--top-bottom']
  3561. }, [this.slots()]);
  3562. }
  3563. }));
  3564. // CONCATENATED MODULE: ./es/utils/color.js
  3565. var RED = '#f44';
  3566. var BLUE = '#1989fa';
  3567. var GREEN = '#07c160';
  3568. var WHITE = '#fff';
  3569. var GRAY_DARK = '#969799';
  3570. // CONCATENATED MODULE: ./es/tag/index.js
  3571. // Types
  3572. var tag_use = Object(utils["k" /* use */])('tag'),
  3573. tag_sfc = tag_use[0],
  3574. tag_bem = tag_use[1];
  3575. var COLOR_MAP = {
  3576. danger: RED,
  3577. primary: BLUE,
  3578. success: GREEN
  3579. };
  3580. function Tag(h, props, slots, ctx) {
  3581. var _style;
  3582. var type = props.type,
  3583. mark = props.mark,
  3584. plain = props.plain,
  3585. round = props.round,
  3586. size = props.size;
  3587. var color = props.color || type && COLOR_MAP[type] || GRAY_DARK;
  3588. var key = plain ? 'color' : 'backgroundColor';
  3589. var style = (_style = {}, _style[key] = color, _style);
  3590. if (props.textColor) {
  3591. style.color = props.textColor;
  3592. }
  3593. var classes = {
  3594. mark: mark,
  3595. plain: plain,
  3596. round: round
  3597. };
  3598. if (size) {
  3599. classes[size] = size;
  3600. }
  3601. return h("span", helper_default()([{
  3602. "style": style,
  3603. "class": [tag_bem(classes), {
  3604. 'van-hairline--surround': plain
  3605. }]
  3606. }, inherit(ctx, true)]), [slots["default"] && slots["default"]()]);
  3607. }
  3608. Tag.props = {
  3609. size: String,
  3610. type: String,
  3611. mark: Boolean,
  3612. color: String,
  3613. plain: Boolean,
  3614. round: Boolean,
  3615. textColor: String
  3616. };
  3617. /* harmony default export */ var es_tag = (tag_sfc(Tag));
  3618. // CONCATENATED MODULE: ./es/card/index.js
  3619. // Types
  3620. var card_use = Object(utils["k" /* use */])('card'),
  3621. card_sfc = card_use[0],
  3622. card_bem = card_use[1];
  3623. function Card(h, props, slots, ctx) {
  3624. var thumb = props.thumb;
  3625. var showThumb = slots.thumb || thumb;
  3626. var showTag = slots.tag || props.tag;
  3627. var showNum = slots.num || Object(utils["d" /* isDef */])(props.num);
  3628. var showPrice = slots.price || Object(utils["d" /* isDef */])(props.price);
  3629. var showOriginPrice = slots['origin-price'] || Object(utils["d" /* isDef */])(props.originPrice);
  3630. var showBottom = showNum || showPrice || showOriginPrice;
  3631. var Thumb = showThumb && h("a", {
  3632. "attrs": {
  3633. "href": props.thumbLink
  3634. },
  3635. "class": card_bem('thumb')
  3636. }, [slots.thumb ? slots.thumb() : props.lazyLoad ? h("img", {
  3637. "class": card_bem('img'),
  3638. "directives": [{
  3639. name: "lazy",
  3640. value: thumb
  3641. }]
  3642. }) : h("img", {
  3643. "class": card_bem('img'),
  3644. "attrs": {
  3645. "src": thumb
  3646. }
  3647. }), showTag && h("div", {
  3648. "class": card_bem('tag')
  3649. }, [slots.tag ? slots.tag() : h(es_tag, {
  3650. "attrs": {
  3651. "mark": true,
  3652. "type": "danger"
  3653. }
  3654. }, [props.tag])])]);
  3655. var Title = slots.title ? slots.title() : props.title && h("div", {
  3656. "class": card_bem('title')
  3657. }, [props.title]);
  3658. var Desc = slots.desc ? slots.desc() : props.desc && h("div", {
  3659. "class": [card_bem('desc'), 'van-ellipsis']
  3660. }, [props.desc]);
  3661. var Price = showPrice && h("div", {
  3662. "class": card_bem('price')
  3663. }, [slots.price ? slots.price() : props.currency + " " + props.price]);
  3664. var OriginPrice = showOriginPrice && h("div", {
  3665. "class": card_bem('origin-price')
  3666. }, [slots['origin-price'] ? slots['origin-price']() : props.currency + " " + props.originPrice]);
  3667. var Num = showNum && h("div", {
  3668. "class": card_bem('num')
  3669. }, [slots.num ? slots.num() : "x " + props.num]);
  3670. var Footer = slots.footer && h("div", {
  3671. "class": card_bem('footer')
  3672. }, [slots.footer()]);
  3673. return h("div", helper_default()([{
  3674. "class": card_bem()
  3675. }, inherit(ctx, true)]), [h("div", {
  3676. "class": card_bem('header')
  3677. }, [Thumb, h("div", {
  3678. "class": card_bem('content', {
  3679. centered: props.centered
  3680. })
  3681. }, [Title, Desc, slots.tags && slots.tags(), showBottom && h("div", {
  3682. "class": "van-card__bottom"
  3683. }, [Price, OriginPrice, Num])])]), Footer]);
  3684. }
  3685. Card.props = {
  3686. tag: String,
  3687. desc: String,
  3688. thumb: String,
  3689. title: String,
  3690. centered: Boolean,
  3691. lazyLoad: Boolean,
  3692. thumbLink: String,
  3693. num: [Number, String],
  3694. price: [Number, String],
  3695. originPrice: [Number, String],
  3696. currency: {
  3697. type: String,
  3698. "default": '¥'
  3699. }
  3700. };
  3701. /* harmony default export */ var card = (card_sfc(Card));
  3702. // CONCATENATED MODULE: ./es/cell-group/index.js
  3703. // Types
  3704. var cell_group_use = Object(utils["k" /* use */])('cell-group'),
  3705. cell_group_sfc = cell_group_use[0],
  3706. cell_group_bem = cell_group_use[1];
  3707. function CellGroup(h, props, slots, ctx) {
  3708. var Group = h("div", helper_default()([{
  3709. "class": [cell_group_bem(), {
  3710. 'van-hairline--top-bottom': props.border
  3711. }]
  3712. }, inherit(ctx, true)]), [slots["default"] && slots["default"]()]);
  3713. if (props.title) {
  3714. return h("div", [h("div", {
  3715. "class": cell_group_bem('title')
  3716. }, [props.title]), Group]);
  3717. }
  3718. return Group;
  3719. }
  3720. CellGroup.props = {
  3721. title: String,
  3722. border: {
  3723. type: Boolean,
  3724. "default": true
  3725. }
  3726. };
  3727. /* harmony default export */ var cell_group = (cell_group_sfc(CellGroup));
  3728. // CONCATENATED MODULE: ./es/checkbox/index.js
  3729. var checkbox_use = Object(utils["k" /* use */])('checkbox'),
  3730. checkbox_sfc = checkbox_use[0],
  3731. checkbox_bem = checkbox_use[1];
  3732. /* harmony default export */ var es_checkbox = (checkbox_sfc({
  3733. mixins: [checkbox_CheckboxMixin('van-checkbox-group', checkbox_bem)],
  3734. computed: {
  3735. checked: {
  3736. get: function get() {
  3737. return this.parent ? this.parent.value.indexOf(this.name) !== -1 : this.value;
  3738. },
  3739. set: function set(val) {
  3740. if (this.parent) {
  3741. this.setParentValue(val);
  3742. } else {
  3743. this.$emit('input', val);
  3744. }
  3745. }
  3746. }
  3747. },
  3748. watch: {
  3749. value: function value(val) {
  3750. this.$emit('change', val);
  3751. }
  3752. },
  3753. methods: {
  3754. toggle: function toggle() {
  3755. var _this = this;
  3756. var checked = !this.checked; // When toggle method is called multiple times at the same time,
  3757. // only the last call is valid.
  3758. // This is a hack for usage inside Cell.
  3759. clearTimeout(this.toggleTask);
  3760. this.toggleTask = setTimeout(function () {
  3761. _this.checked = checked;
  3762. });
  3763. },
  3764. onClickIcon: function onClickIcon() {
  3765. if (!this.isDisabled) {
  3766. this.toggle();
  3767. }
  3768. },
  3769. onClickLabel: function onClickLabel() {
  3770. if (!this.isDisabled && !this.labelDisabled) {
  3771. this.toggle();
  3772. }
  3773. },
  3774. setParentValue: function setParentValue(val) {
  3775. var parent = this.parent;
  3776. var value = parent.value.slice();
  3777. if (val) {
  3778. if (parent.max && value.length >= parent.max) {
  3779. return;
  3780. }
  3781. /* istanbul ignore else */
  3782. if (value.indexOf(this.name) === -1) {
  3783. value.push(this.name);
  3784. parent.$emit('input', value);
  3785. }
  3786. } else {
  3787. var index = value.indexOf(this.name);
  3788. /* istanbul ignore else */
  3789. if (index !== -1) {
  3790. value.splice(index, 1);
  3791. parent.$emit('input', value);
  3792. }
  3793. }
  3794. }
  3795. }
  3796. }));
  3797. // CONCATENATED MODULE: ./es/checkbox-group/index.js
  3798. var checkbox_group_use = Object(utils["k" /* use */])('checkbox-group'),
  3799. checkbox_group_sfc = checkbox_group_use[0],
  3800. checkbox_group_bem = checkbox_group_use[1];
  3801. /* harmony default export */ var checkbox_group = (checkbox_group_sfc({
  3802. props: {
  3803. max: Number,
  3804. value: Array,
  3805. disabled: Boolean
  3806. },
  3807. watch: {
  3808. value: function value(val) {
  3809. this.$emit('change', val);
  3810. }
  3811. },
  3812. render: function render(h) {
  3813. return h("div", {
  3814. "class": checkbox_group_bem()
  3815. }, [this.slots()]);
  3816. }
  3817. }));
  3818. // EXTERNAL MODULE: ./es/utils/raf.js
  3819. var raf = __webpack_require__(3);
  3820. // CONCATENATED MODULE: ./es/circle/index.js
  3821. var circle_use = Object(utils["k" /* use */])('circle'),
  3822. circle_sfc = circle_use[0],
  3823. circle_bem = circle_use[1];
  3824. var PERIMETER = 3140;
  3825. var PATH = 'M 530 530 m -500, 0 a 500, 500 0 1, 1 1000, 0 a 500, 500 0 1, 1 -1000, 0';
  3826. function circle_format(rate) {
  3827. return Math.min(Math.max(rate, 0), 100);
  3828. }
  3829. /* harmony default export */ var circle = (circle_sfc({
  3830. props: {
  3831. text: String,
  3832. value: Number,
  3833. speed: Number,
  3834. size: {
  3835. type: String,
  3836. "default": '100px'
  3837. },
  3838. fill: {
  3839. type: String,
  3840. "default": 'none'
  3841. },
  3842. rate: {
  3843. type: Number,
  3844. "default": 100
  3845. },
  3846. layerColor: {
  3847. type: String,
  3848. "default": WHITE
  3849. },
  3850. color: {
  3851. type: String,
  3852. "default": BLUE
  3853. },
  3854. strokeWidth: {
  3855. type: Number,
  3856. "default": 40
  3857. },
  3858. clockwise: {
  3859. type: Boolean,
  3860. "default": true
  3861. }
  3862. },
  3863. computed: {
  3864. style: function style() {
  3865. return {
  3866. width: this.size,
  3867. height: this.size
  3868. };
  3869. },
  3870. layerStyle: function layerStyle() {
  3871. var offset = PERIMETER * (100 - this.value) / 100;
  3872. offset = this.clockwise ? offset : PERIMETER * 2 - offset;
  3873. return {
  3874. stroke: "" + this.color,
  3875. strokeDashoffset: offset + "px",
  3876. strokeWidth: this.strokeWidth + 1 + "px"
  3877. };
  3878. },
  3879. hoverStyle: function hoverStyle() {
  3880. return {
  3881. fill: "" + this.fill,
  3882. stroke: "" + this.layerColor,
  3883. strokeWidth: this.strokeWidth + "px"
  3884. };
  3885. }
  3886. },
  3887. watch: {
  3888. rate: {
  3889. handler: function handler() {
  3890. this.startTime = Date.now();
  3891. this.startRate = this.value;
  3892. this.endRate = circle_format(this.rate);
  3893. this.increase = this.endRate > this.startRate;
  3894. this.duration = Math.abs((this.startRate - this.endRate) * 1000 / this.speed);
  3895. if (this.speed) {
  3896. Object(raf["a" /* cancel */])(this.rafId);
  3897. this.rafId = Object(raf["b" /* raf */])(this.animate);
  3898. } else {
  3899. this.$emit('input', this.endRate);
  3900. }
  3901. },
  3902. immediate: true
  3903. }
  3904. },
  3905. methods: {
  3906. animate: function animate() {
  3907. var now = Date.now();
  3908. var progress = Math.min((now - this.startTime) / this.duration, 1);
  3909. var rate = progress * (this.endRate - this.startRate) + this.startRate;
  3910. this.$emit('input', circle_format(parseFloat(rate.toFixed(1))));
  3911. if (this.increase ? rate < this.endRate : rate > this.endRate) {
  3912. this.rafId = Object(raf["b" /* raf */])(this.animate);
  3913. }
  3914. }
  3915. },
  3916. render: function render(h) {
  3917. return h("div", {
  3918. "class": circle_bem(),
  3919. "style": this.style
  3920. }, [h("svg", {
  3921. "attrs": {
  3922. "viewBox": "0 0 1060 1060"
  3923. }
  3924. }, [h("path", {
  3925. "class": circle_bem('hover'),
  3926. "style": this.hoverStyle,
  3927. "attrs": {
  3928. "d": PATH
  3929. }
  3930. }), h("path", {
  3931. "class": circle_bem('layer'),
  3932. "style": this.layerStyle,
  3933. "attrs": {
  3934. "d": PATH
  3935. }
  3936. })]), this.slots() || this.text && h("div", {
  3937. "class": circle_bem('text')
  3938. }, [this.text])]);
  3939. }
  3940. }));
  3941. // CONCATENATED MODULE: ./es/col/index.js
  3942. var col_use = Object(utils["k" /* use */])('col'),
  3943. col_sfc = col_use[0],
  3944. col_bem = col_use[1];
  3945. /* harmony default export */ var col = (col_sfc({
  3946. props: {
  3947. span: [Number, String],
  3948. offset: [Number, String],
  3949. tag: {
  3950. type: String,
  3951. "default": 'div'
  3952. }
  3953. },
  3954. computed: {
  3955. gutter: function gutter() {
  3956. return this.$parent && Number(this.$parent.gutter) || 0;
  3957. },
  3958. style: function style() {
  3959. var padding = this.gutter / 2 + "px";
  3960. return this.gutter ? {
  3961. paddingLeft: padding,
  3962. paddingRight: padding
  3963. } : {};
  3964. }
  3965. },
  3966. render: function render(h) {
  3967. var _bem;
  3968. var span = this.span,
  3969. offset = this.offset;
  3970. return h(this.tag, {
  3971. "class": col_bem((_bem = {}, _bem[span] = span, _bem["offset-" + offset] = offset, _bem)),
  3972. "style": this.style
  3973. }, [this.slots()]);
  3974. }
  3975. }));
  3976. // CONCATENATED MODULE: ./es/collapse/index.js
  3977. var collapse_use = Object(utils["k" /* use */])('collapse'),
  3978. collapse_sfc = collapse_use[0],
  3979. collapse_bem = collapse_use[1];
  3980. /* harmony default export */ var collapse = (collapse_sfc({
  3981. props: {
  3982. accordion: Boolean,
  3983. value: [String, Number, Array],
  3984. border: {
  3985. type: Boolean,
  3986. "default": true
  3987. }
  3988. },
  3989. data: function data() {
  3990. return {
  3991. items: []
  3992. };
  3993. },
  3994. methods: {
  3995. "switch": function _switch(name, expanded) {
  3996. if (!this.accordion) {
  3997. name = expanded ? this.value.concat(name) : this.value.filter(function (activeName) {
  3998. return activeName !== name;
  3999. });
  4000. }
  4001. this.$emit('change', name);
  4002. this.$emit('input', name);
  4003. }
  4004. },
  4005. render: function render(h) {
  4006. return h("div", {
  4007. "class": [collapse_bem(), {
  4008. 'van-hairline--top-bottom': this.border
  4009. }]
  4010. }, [this.slots()]);
  4011. }
  4012. }));
  4013. // CONCATENATED MODULE: ./es/collapse-item/index.js
  4014. var collapse_item_use = Object(utils["k" /* use */])('collapse-item'),
  4015. collapse_item_sfc = collapse_item_use[0],
  4016. collapse_item_bem = collapse_item_use[1];
  4017. var CELL_SLOTS = ['title', 'icon', 'right-icon'];
  4018. /* harmony default export */ var collapse_item = (collapse_item_sfc({
  4019. mixins: [FindParentMixin],
  4020. props: _extends({}, cellProps, {
  4021. name: [String, Number],
  4022. disabled: Boolean,
  4023. isLink: {
  4024. type: Boolean,
  4025. "default": true
  4026. }
  4027. }),
  4028. data: function data() {
  4029. return {
  4030. show: null,
  4031. inited: null
  4032. };
  4033. },
  4034. computed: {
  4035. items: function items() {
  4036. return this.parent.items;
  4037. },
  4038. index: function index() {
  4039. return this.items.indexOf(this);
  4040. },
  4041. currentName: function currentName() {
  4042. return Object(utils["d" /* isDef */])(this.name) ? this.name : this.index;
  4043. },
  4044. expanded: function expanded() {
  4045. var _this = this;
  4046. if (!this.parent) {
  4047. return null;
  4048. }
  4049. var value = this.parent.value;
  4050. return this.parent.accordion ? value === this.currentName : value.some(function (name) {
  4051. return name === _this.currentName;
  4052. });
  4053. }
  4054. },
  4055. created: function created() {
  4056. this.findParent('van-collapse');
  4057. this.items.push(this);
  4058. this.show = this.expanded;
  4059. this.inited = this.expanded;
  4060. },
  4061. destroyed: function destroyed() {
  4062. this.items.splice(this.index, 1);
  4063. },
  4064. watch: {
  4065. expanded: function expanded(_expanded, prev) {
  4066. var _this2 = this;
  4067. if (prev === null) {
  4068. return;
  4069. }
  4070. if (_expanded) {
  4071. this.show = true;
  4072. this.inited = true;
  4073. }
  4074. Object(raf["b" /* raf */])(function () {
  4075. var _this2$$refs = _this2.$refs,
  4076. content = _this2$$refs.content,
  4077. wrapper = _this2$$refs.wrapper;
  4078. if (!content || !wrapper) {
  4079. return;
  4080. }
  4081. var clientHeight = content.clientHeight;
  4082. if (clientHeight) {
  4083. var contentHeight = clientHeight + "px";
  4084. wrapper.style.height = _expanded ? 0 : contentHeight;
  4085. Object(raf["b" /* raf */])(function () {
  4086. wrapper.style.height = _expanded ? contentHeight : 0;
  4087. });
  4088. } else {
  4089. _this2.onTransitionEnd();
  4090. }
  4091. });
  4092. }
  4093. },
  4094. methods: {
  4095. onClick: function onClick() {
  4096. if (this.disabled) {
  4097. return;
  4098. }
  4099. var parent = this.parent;
  4100. var name = parent.accordion && this.currentName === parent.value ? '' : this.currentName;
  4101. var expanded = !this.expanded;
  4102. this.parent["switch"](name, expanded);
  4103. },
  4104. onTransitionEnd: function onTransitionEnd() {
  4105. if (!this.expanded) {
  4106. this.show = false;
  4107. } else {
  4108. this.$refs.wrapper.style.height = null;
  4109. }
  4110. }
  4111. },
  4112. render: function render(h) {
  4113. var _this3 = this;
  4114. var titleSlots = CELL_SLOTS.reduce(function (slots, name) {
  4115. if (_this3.slots(name)) {
  4116. slots[name] = function () {
  4117. return _this3.slots(name);
  4118. };
  4119. }
  4120. return slots;
  4121. }, {});
  4122. if (this.slots('value')) {
  4123. titleSlots["default"] = function () {
  4124. return _this3.slots('value');
  4125. };
  4126. }
  4127. var Title = h(cell, {
  4128. "class": collapse_item_bem('title', {
  4129. disabled: this.disabled,
  4130. expanded: this.expanded
  4131. }),
  4132. "on": {
  4133. "click": this.onClick
  4134. },
  4135. "scopedSlots": titleSlots,
  4136. "props": _extends({}, this.$props)
  4137. });
  4138. var Content = this.inited && h("div", {
  4139. "directives": [{
  4140. name: "show",
  4141. value: this.show
  4142. }],
  4143. "ref": "wrapper",
  4144. "class": collapse_item_bem('wrapper'),
  4145. "on": {
  4146. "transitionend": this.onTransitionEnd
  4147. }
  4148. }, [h("div", {
  4149. "ref": "content",
  4150. "class": collapse_item_bem('content')
  4151. }, [this.slots()])]);
  4152. return h("div", {
  4153. "class": [collapse_item_bem(), {
  4154. 'van-hairline--top': this.index
  4155. }]
  4156. }, [Title, Content]);
  4157. }
  4158. }));
  4159. // CONCATENATED MODULE: ./es/contact-card/index.js
  4160. // Types
  4161. var contact_card_use = Object(utils["k" /* use */])('contact-card'),
  4162. contact_card_sfc = contact_card_use[0],
  4163. contact_card_bem = contact_card_use[1],
  4164. contact_card_t = contact_card_use[2];
  4165. function ContactCard(h, props, slots, ctx) {
  4166. var type = props.type,
  4167. editable = props.editable;
  4168. return h(cell, helper_default()([{
  4169. "attrs": {
  4170. "center": true,
  4171. "border": false,
  4172. "isLink": editable,
  4173. "valueClass": contact_card_bem('value'),
  4174. "icon": type === 'edit' ? 'contact' : 'add-square'
  4175. },
  4176. "class": contact_card_bem([type]),
  4177. "on": {
  4178. "click": function click(event) {
  4179. if (editable) {
  4180. functional_emit(ctx, 'click', event);
  4181. }
  4182. }
  4183. }
  4184. }, inherit(ctx)]), [type === 'add' ? props.addText || contact_card_t('addText') : [h("div", [contact_card_t('name') + "\uFF1A" + props.name]), h("div", [contact_card_t('tel') + "\uFF1A" + props.tel])]]);
  4185. }
  4186. ContactCard.props = {
  4187. tel: String,
  4188. name: String,
  4189. addText: String,
  4190. editable: {
  4191. type: Boolean,
  4192. "default": true
  4193. },
  4194. type: {
  4195. type: String,
  4196. "default": 'add'
  4197. }
  4198. };
  4199. /* harmony default export */ var contact_card = (contact_card_sfc(ContactCard));
  4200. // CONCATENATED MODULE: ./es/contact-edit/index.js
  4201. var contact_edit_use = Object(utils["k" /* use */])('contact-edit'),
  4202. contact_edit_sfc = contact_edit_use[0],
  4203. contact_edit_bem = contact_edit_use[1],
  4204. contact_edit_t = contact_edit_use[2];
  4205. var defaultContact = {
  4206. tel: '',
  4207. name: ''
  4208. };
  4209. /* harmony default export */ var contact_edit = (contact_edit_sfc({
  4210. props: {
  4211. isEdit: Boolean,
  4212. isSaving: Boolean,
  4213. isDeleting: Boolean,
  4214. contactInfo: {
  4215. type: Object,
  4216. "default": function _default() {
  4217. return _extends({}, defaultContact);
  4218. }
  4219. },
  4220. telValidator: {
  4221. type: Function,
  4222. "default": isMobile
  4223. }
  4224. },
  4225. data: function data() {
  4226. return {
  4227. data: _extends({}, defaultContact, this.contactInfo),
  4228. errorInfo: {
  4229. name: false,
  4230. tel: false
  4231. }
  4232. };
  4233. },
  4234. watch: {
  4235. contactInfo: function contactInfo(val) {
  4236. this.data = _extends({}, defaultContact, val);
  4237. }
  4238. },
  4239. methods: {
  4240. onFocus: function onFocus(key) {
  4241. this.errorInfo[key] = false;
  4242. },
  4243. getErrorMessageByKey: function getErrorMessageByKey(key) {
  4244. var value = this.data[key].trim();
  4245. switch (key) {
  4246. case 'name':
  4247. return value ? '' : contact_edit_t('nameEmpty');
  4248. case 'tel':
  4249. return this.telValidator(value) ? '' : contact_edit_t('telInvalid');
  4250. }
  4251. },
  4252. onSave: function onSave() {
  4253. var _this = this;
  4254. var isValid = ['name', 'tel'].every(function (item) {
  4255. var msg = _this.getErrorMessageByKey(item);
  4256. if (msg) {
  4257. _this.errorInfo[item] = true;
  4258. es_toast(msg);
  4259. }
  4260. return !msg;
  4261. });
  4262. if (isValid && !this.isSaving) {
  4263. this.$emit('save', this.data);
  4264. }
  4265. },
  4266. onDelete: function onDelete() {
  4267. var _this2 = this;
  4268. dialog.confirm({
  4269. message: contact_edit_t('confirmDelete')
  4270. }).then(function () {
  4271. _this2.$emit('delete', _this2.data);
  4272. });
  4273. }
  4274. },
  4275. render: function render(h) {
  4276. var _this3 = this;
  4277. var data = this.data,
  4278. errorInfo = this.errorInfo;
  4279. var onFocus = function onFocus(name) {
  4280. return function () {
  4281. return _this3.onFocus(name);
  4282. };
  4283. };
  4284. return h("div", {
  4285. "class": contact_edit_bem()
  4286. }, [h(field, {
  4287. "attrs": {
  4288. "clearable": true,
  4289. "maxlength": "30",
  4290. "label": contact_edit_t('name'),
  4291. "placeholder": contact_edit_t('nameEmpty'),
  4292. "error": errorInfo.name
  4293. },
  4294. "on": {
  4295. "focus": onFocus('name')
  4296. },
  4297. "model": {
  4298. value: data.name,
  4299. callback: function callback($$v) {
  4300. data.name = $$v;
  4301. }
  4302. }
  4303. }), h(field, {
  4304. "attrs": {
  4305. "clearable": true,
  4306. "type": "tel",
  4307. "label": contact_edit_t('tel'),
  4308. "placeholder": contact_edit_t('telEmpty'),
  4309. "error": errorInfo.tel
  4310. },
  4311. "on": {
  4312. "focus": onFocus('tel')
  4313. },
  4314. "model": {
  4315. value: data.tel,
  4316. callback: function callback($$v) {
  4317. data.tel = $$v;
  4318. }
  4319. }
  4320. }), h("div", {
  4321. "class": contact_edit_bem('buttons')
  4322. }, [h(es_button, {
  4323. "attrs": {
  4324. "block": true,
  4325. "type": "danger",
  4326. "text": contact_edit_t('save'),
  4327. "loading": this.isSaving
  4328. },
  4329. "on": {
  4330. "click": this.onSave
  4331. }
  4332. }), this.isEdit && h(es_button, {
  4333. "attrs": {
  4334. "block": true,
  4335. "text": contact_edit_t('delete'),
  4336. "loading": this.isDeleting
  4337. },
  4338. "on": {
  4339. "click": this.onDelete
  4340. }
  4341. })])]);
  4342. }
  4343. }));
  4344. // CONCATENATED MODULE: ./es/contact-list/index.js
  4345. // Types
  4346. var contact_list_use = Object(utils["k" /* use */])('contact-list'),
  4347. contact_list_sfc = contact_list_use[0],
  4348. contact_list_bem = contact_list_use[1],
  4349. contact_list_t = contact_list_use[2];
  4350. function ContactList(h, props, slots, ctx) {
  4351. var List = props.list.map(function (item, index) {
  4352. var onClick = function onClick() {
  4353. functional_emit(ctx, 'input', item.id);
  4354. functional_emit(ctx, 'select', item, index);
  4355. };
  4356. return h(cell, {
  4357. "key": item.id,
  4358. "attrs": {
  4359. "isLink": true,
  4360. "valueClass": contact_list_bem('item-value')
  4361. },
  4362. "class": contact_list_bem('item'),
  4363. "scopedSlots": {
  4364. "default": function _default() {
  4365. return h(es_radio, {
  4366. "attrs": {
  4367. "name": item.id
  4368. },
  4369. "on": {
  4370. "click": onClick
  4371. }
  4372. }, [h("div", {
  4373. "class": contact_list_bem('name')
  4374. }, [item.name + "\uFF0C" + item.tel])]);
  4375. },
  4376. 'right-icon': function rightIcon() {
  4377. return h(es_icon, {
  4378. "attrs": {
  4379. "name": "edit"
  4380. },
  4381. "class": contact_list_bem('edit'),
  4382. "on": {
  4383. "click": function click(event) {
  4384. event.stopPropagation();
  4385. functional_emit(ctx, 'edit', item, index);
  4386. }
  4387. }
  4388. });
  4389. }
  4390. },
  4391. "on": {
  4392. "click": onClick
  4393. }
  4394. });
  4395. });
  4396. return h("div", helper_default()([{
  4397. "class": contact_list_bem()
  4398. }, inherit(ctx)]), [h(radio_group, {
  4399. "attrs": {
  4400. "value": props.value
  4401. },
  4402. "class": contact_list_bem('group')
  4403. }, [List]), h(es_button, {
  4404. "attrs": {
  4405. "square": true,
  4406. "size": "large",
  4407. "type": "danger",
  4408. "text": props.addText || contact_list_t('addText')
  4409. },
  4410. "class": contact_list_bem('add'),
  4411. "on": {
  4412. "click": function click() {
  4413. functional_emit(ctx, 'add');
  4414. }
  4415. }
  4416. })]);
  4417. }
  4418. ContactList.props = {
  4419. value: null,
  4420. list: Array,
  4421. addText: String
  4422. };
  4423. /* harmony default export */ var contact_list = (contact_list_sfc(ContactList));
  4424. // CONCATENATED MODULE: ./es/coupon/index.js
  4425. var coupon_use = Object(utils["k" /* use */])('coupon'),
  4426. coupon_sfc = coupon_use[0],
  4427. coupon_bem = coupon_use[1],
  4428. coupon_t = coupon_use[2];
  4429. function padZero(num) {
  4430. return (num < 10 ? '0' : '') + num;
  4431. }
  4432. function getDate(timeStamp) {
  4433. var date = new Date(timeStamp * 1000);
  4434. return date.getFullYear() + "." + padZero(date.getMonth() + 1) + "." + padZero(date.getDate());
  4435. }
  4436. function formatDiscount(discount) {
  4437. return (discount / 10).toFixed(discount % 10 === 0 ? 0 : 1);
  4438. }
  4439. function formatAmount(amount) {
  4440. return (amount / 100).toFixed(amount % 100 === 0 ? 0 : amount % 10 === 0 ? 1 : 2);
  4441. }
  4442. /* harmony default export */ var es_coupon = (coupon_sfc({
  4443. props: {
  4444. coupon: Object,
  4445. chosen: Boolean,
  4446. disabled: Boolean,
  4447. currency: {
  4448. type: String,
  4449. "default": '¥'
  4450. }
  4451. },
  4452. computed: {
  4453. validPeriod: function validPeriod() {
  4454. return coupon_t('valid') + "\uFF1A" + getDate(this.coupon.startAt) + " - " + getDate(this.coupon.endAt);
  4455. },
  4456. faceAmount: function faceAmount() {
  4457. var coupon = this.coupon;
  4458. if (coupon.valueDesc) {
  4459. return coupon.valueDesc + "<span>" + (coupon.unitDesc || '') + "</span>";
  4460. }
  4461. return coupon.denominations ? "<span>" + this.currency + "</span> " + formatAmount(this.coupon.denominations) : coupon.discount ? coupon_t('discount', formatDiscount(this.coupon.discount)) : '';
  4462. },
  4463. conditionMessage: function conditionMessage() {
  4464. var condition = this.coupon.originCondition;
  4465. condition = condition % 100 === 0 ? Math.round(condition / 100) : (condition / 100).toFixed(2);
  4466. return condition === 0 ? coupon_t('unlimited') : coupon_t('condition', condition);
  4467. }
  4468. },
  4469. render: function render(h) {
  4470. var coupon = this.coupon,
  4471. disabled = this.disabled;
  4472. var description = disabled && coupon.reason || coupon.description;
  4473. return h("div", {
  4474. "class": coupon_bem({
  4475. disabled: disabled
  4476. })
  4477. }, [h("div", {
  4478. "class": coupon_bem('content')
  4479. }, [h("div", {
  4480. "class": coupon_bem('head')
  4481. }, [h("h2", {
  4482. "domProps": {
  4483. "innerHTML": this.faceAmount
  4484. }
  4485. }), h("p", [this.coupon.condition || this.conditionMessage])]), h("div", {
  4486. "class": coupon_bem('body')
  4487. }, [h("h2", [coupon.name]), h("p", [this.validPeriod]), this.chosen && h(es_checkbox, {
  4488. "attrs": {
  4489. "value": true
  4490. },
  4491. "class": coupon_bem('corner')
  4492. })])]), description && h("p", {
  4493. "class": coupon_bem('description')
  4494. }, [description])]);
  4495. }
  4496. }));
  4497. // CONCATENATED MODULE: ./es/coupon-cell/index.js
  4498. // Types
  4499. var coupon_cell_use = Object(utils["k" /* use */])('coupon-cell'),
  4500. coupon_cell_sfc = coupon_cell_use[0],
  4501. coupon_cell_bem = coupon_cell_use[1],
  4502. coupon_cell_t = coupon_cell_use[2];
  4503. function formatValue(props) {
  4504. var coupons = props.coupons,
  4505. chosenCoupon = props.chosenCoupon,
  4506. currency = props.currency;
  4507. var coupon = coupons[chosenCoupon];
  4508. if (coupon) {
  4509. var value = coupon.denominations || coupon.value;
  4510. return "-" + currency + (value / 100).toFixed(2);
  4511. }
  4512. return coupons.length === 0 ? coupon_cell_t('tips') : coupon_cell_t('count', coupons.length);
  4513. }
  4514. function CouponCell(h, props, slots, ctx) {
  4515. var valueClass = props.coupons[props.chosenCoupon] ? 'van-coupon-cell--selected' : '';
  4516. var value = formatValue(props);
  4517. return h(cell, helper_default()([{
  4518. "class": coupon_cell_bem(),
  4519. "attrs": {
  4520. "value": value,
  4521. "title": props.title || coupon_cell_t('title'),
  4522. "border": props.border,
  4523. "isLink": props.editable,
  4524. "valueClass": valueClass
  4525. }
  4526. }, inherit(ctx, true)]));
  4527. }
  4528. CouponCell.model = {
  4529. prop: 'chosenCoupon'
  4530. };
  4531. CouponCell.props = {
  4532. title: String,
  4533. coupons: Array,
  4534. currency: {
  4535. type: String,
  4536. "default": '¥'
  4537. },
  4538. border: {
  4539. type: Boolean,
  4540. "default": true
  4541. },
  4542. editable: {
  4543. type: Boolean,
  4544. "default": true
  4545. },
  4546. chosenCoupon: {
  4547. type: Number,
  4548. "default": -1
  4549. }
  4550. };
  4551. /* harmony default export */ var coupon_cell = (coupon_cell_sfc(CouponCell));
  4552. // CONCATENATED MODULE: ./es/tab/index.js
  4553. /* eslint-disable object-shorthand */
  4554. var tab_use = Object(utils["k" /* use */])('tab'),
  4555. tab_sfc = tab_use[0],
  4556. tab_bem = tab_use[1];
  4557. /* harmony default export */ var es_tab = (tab_sfc({
  4558. mixins: [FindParentMixin],
  4559. props: {
  4560. title: String,
  4561. disabled: Boolean
  4562. },
  4563. data: function data() {
  4564. return {
  4565. inited: false
  4566. };
  4567. },
  4568. computed: {
  4569. index: function index() {
  4570. return this.parent.tabs.indexOf(this);
  4571. },
  4572. selected: function selected() {
  4573. return this.index === this.parent.curActive;
  4574. }
  4575. },
  4576. watch: {
  4577. 'parent.curActive': function parentCurActive() {
  4578. this.inited = this.inited || this.selected;
  4579. },
  4580. title: function title() {
  4581. this.parent.setLine();
  4582. }
  4583. },
  4584. created: function created() {
  4585. this.findParent('van-tabs');
  4586. },
  4587. mounted: function mounted() {
  4588. var tabs = this.parent.tabs;
  4589. var index = this.parent.slots().indexOf(this.$vnode);
  4590. tabs.splice(index === -1 ? tabs.length : index, 0, this);
  4591. if (this.slots('title')) {
  4592. this.parent.renderTitle(this.$refs.title, this.index);
  4593. }
  4594. },
  4595. beforeDestroy: function beforeDestroy() {
  4596. this.parent.tabs.splice(this.index, 1);
  4597. },
  4598. render: function render(h) {
  4599. var slots = this.slots;
  4600. var shouldRender = this.inited || !this.parent.lazyRender;
  4601. return h("div", {
  4602. "directives": [{
  4603. name: "show",
  4604. value: this.selected || this.parent.animated
  4605. }],
  4606. "class": tab_bem('pane')
  4607. }, [shouldRender ? slots() : h(), slots('title') && h("div", {
  4608. "ref": "title"
  4609. }, [slots('title')])]);
  4610. }
  4611. }));
  4612. // CONCATENATED MODULE: ./es/tabs/index.js
  4613. var tabs_use = Object(utils["k" /* use */])('tabs'),
  4614. tabs_sfc = tabs_use[0],
  4615. tabs_bem = tabs_use[1];
  4616. var tabBem = Object(utils["k" /* use */])('tab')[1];
  4617. /* harmony default export */ var es_tabs = (tabs_sfc({
  4618. mixins: [TouchMixin],
  4619. model: {
  4620. prop: 'active'
  4621. },
  4622. props: {
  4623. color: String,
  4624. sticky: Boolean,
  4625. animated: Boolean,
  4626. offsetTop: Number,
  4627. swipeable: Boolean,
  4628. background: String,
  4629. titleActiveColor: String,
  4630. titleInactiveColor: String,
  4631. ellipsis: {
  4632. type: Boolean,
  4633. "default": true
  4634. },
  4635. lazyRender: {
  4636. type: Boolean,
  4637. "default": true
  4638. },
  4639. lineWidth: {
  4640. type: Number,
  4641. "default": null
  4642. },
  4643. lineHeight: {
  4644. type: Number,
  4645. "default": null
  4646. },
  4647. active: {
  4648. type: [Number, String],
  4649. "default": 0
  4650. },
  4651. type: {
  4652. type: String,
  4653. "default": 'line'
  4654. },
  4655. duration: {
  4656. type: Number,
  4657. "default": 0.3
  4658. },
  4659. swipeThreshold: {
  4660. type: Number,
  4661. "default": 4
  4662. }
  4663. },
  4664. data: function data() {
  4665. return {
  4666. tabs: [],
  4667. position: '',
  4668. curActive: null,
  4669. lineStyle: {
  4670. backgroundColor: this.color
  4671. },
  4672. events: {
  4673. resize: false,
  4674. sticky: false,
  4675. swipeable: false
  4676. }
  4677. };
  4678. },
  4679. computed: {
  4680. // whether the nav is scrollable
  4681. scrollable: function scrollable() {
  4682. return this.tabs.length > this.swipeThreshold || !this.ellipsis;
  4683. },
  4684. wrapStyle: function wrapStyle() {
  4685. switch (this.position) {
  4686. case 'top':
  4687. return {
  4688. top: this.offsetTop + 'px',
  4689. position: 'fixed'
  4690. };
  4691. case 'bottom':
  4692. return {
  4693. top: 'auto',
  4694. bottom: 0
  4695. };
  4696. default:
  4697. return null;
  4698. }
  4699. },
  4700. navStyle: function navStyle() {
  4701. return {
  4702. borderColor: this.color,
  4703. background: this.background
  4704. };
  4705. },
  4706. trackStyle: function trackStyle() {
  4707. if (this.animated) {
  4708. return {
  4709. left: -1 * this.curActive * 100 + "%",
  4710. transitionDuration: this.duration + "s"
  4711. };
  4712. }
  4713. }
  4714. },
  4715. watch: {
  4716. active: function active(val) {
  4717. if (val !== this.curActive) {
  4718. this.correctActive(val);
  4719. }
  4720. },
  4721. color: function color() {
  4722. this.setLine();
  4723. },
  4724. tabs: function tabs() {
  4725. this.correctActive(this.curActive || this.active);
  4726. this.scrollIntoView();
  4727. this.setLine();
  4728. },
  4729. curActive: function curActive() {
  4730. this.scrollIntoView();
  4731. this.setLine(); // scroll to correct position
  4732. if (this.position === 'top' || this.position === 'bottom') {
  4733. setScrollTop(window, getElementTop(this.$el) - this.offsetTop);
  4734. }
  4735. },
  4736. sticky: function sticky() {
  4737. this.handlers(true);
  4738. },
  4739. swipeable: function swipeable() {
  4740. this.handlers(true);
  4741. }
  4742. },
  4743. mounted: function mounted() {
  4744. this.onShow();
  4745. },
  4746. activated: function activated() {
  4747. this.onShow();
  4748. this.setLine();
  4749. },
  4750. deactivated: function deactivated() {
  4751. this.handlers(false);
  4752. },
  4753. beforeDestroy: function beforeDestroy() {
  4754. this.handlers(false);
  4755. },
  4756. methods: {
  4757. onShow: function onShow() {
  4758. var _this = this;
  4759. this.$nextTick(function () {
  4760. _this.inited = true;
  4761. _this.handlers(true);
  4762. _this.scrollIntoView(true);
  4763. });
  4764. },
  4765. // whether to bind sticky listener
  4766. handlers: function handlers(bind) {
  4767. var events = this.events;
  4768. var sticky = this.sticky && bind;
  4769. var swipeable = this.swipeable && bind; // listen to window resize event
  4770. if (events.resize !== bind) {
  4771. events.resize = bind;
  4772. (bind ? event_on : off)(window, 'resize', this.setLine, true);
  4773. } // listen to scroll event
  4774. if (events.sticky !== sticky) {
  4775. events.sticky = sticky;
  4776. this.scrollEl = this.scrollEl || getScrollEventTarget(this.$el);
  4777. (sticky ? event_on : off)(this.scrollEl, 'scroll', this.onScroll, true);
  4778. this.onScroll();
  4779. } // listen to touch event
  4780. if (events.swipeable !== swipeable) {
  4781. events.swipeable = swipeable;
  4782. var content = this.$refs.content;
  4783. var action = swipeable ? event_on : off;
  4784. action(content, 'touchstart', this.touchStart);
  4785. action(content, 'touchmove', this.touchMove);
  4786. action(content, 'touchend', this.onTouchEnd);
  4787. action(content, 'touchcancel', this.onTouchEnd);
  4788. }
  4789. },
  4790. // watch swipe touch end
  4791. onTouchEnd: function onTouchEnd() {
  4792. var direction = this.direction,
  4793. deltaX = this.deltaX,
  4794. curActive = this.curActive;
  4795. var minSwipeDistance = 50;
  4796. /* istanbul ignore else */
  4797. if (direction === 'horizontal' && this.offsetX >= minSwipeDistance) {
  4798. /* istanbul ignore else */
  4799. if (deltaX > 0 && curActive !== 0) {
  4800. this.setCurActive(curActive - 1);
  4801. } else if (deltaX < 0 && curActive !== this.tabs.length - 1) {
  4802. this.setCurActive(curActive + 1);
  4803. }
  4804. }
  4805. },
  4806. // adjust tab position
  4807. onScroll: function onScroll() {
  4808. var scrollTop = getScrollTop(window) + this.offsetTop;
  4809. var elTopToPageTop = getElementTop(this.$el);
  4810. var elBottomToPageTop = elTopToPageTop + this.$el.offsetHeight - this.$refs.wrap.offsetHeight;
  4811. if (scrollTop > elBottomToPageTop) {
  4812. this.position = 'bottom';
  4813. } else if (scrollTop > elTopToPageTop) {
  4814. this.position = 'top';
  4815. } else {
  4816. this.position = '';
  4817. }
  4818. var scrollParams = {
  4819. scrollTop: scrollTop,
  4820. isFixed: this.position === 'top'
  4821. };
  4822. this.$emit('scroll', scrollParams);
  4823. },
  4824. // update nav bar style
  4825. setLine: function setLine() {
  4826. var _this2 = this;
  4827. var shouldAnimate = this.inited;
  4828. this.$nextTick(function () {
  4829. var tabs = _this2.$refs.tabs;
  4830. if (!tabs || !tabs[_this2.curActive] || _this2.type !== 'line') {
  4831. return;
  4832. }
  4833. var tab = tabs[_this2.curActive];
  4834. var lineWidth = _this2.lineWidth,
  4835. lineHeight = _this2.lineHeight;
  4836. var width = Object(utils["d" /* isDef */])(lineWidth) ? lineWidth : tab.offsetWidth / 2;
  4837. var left = tab.offsetLeft + (tab.offsetWidth - width) / 2;
  4838. var lineStyle = {
  4839. width: width + "px",
  4840. backgroundColor: _this2.color,
  4841. transform: "translateX(" + left + "px)"
  4842. };
  4843. if (shouldAnimate) {
  4844. lineStyle.transitionDuration = _this2.duration + "s";
  4845. }
  4846. if (Object(utils["d" /* isDef */])(lineHeight)) {
  4847. var height = lineHeight + "px";
  4848. lineStyle.height = height;
  4849. lineStyle.borderRadius = height;
  4850. }
  4851. _this2.lineStyle = lineStyle;
  4852. });
  4853. },
  4854. // correct the value of active
  4855. correctActive: function correctActive(active) {
  4856. active = +active;
  4857. var exist = this.tabs.some(function (tab) {
  4858. return tab.index === active;
  4859. });
  4860. var defaultActive = (this.tabs[0] || {}).index || 0;
  4861. this.setCurActive(exist ? active : defaultActive);
  4862. },
  4863. setCurActive: function setCurActive(active) {
  4864. active = this.findAvailableTab(active, active < this.curActive);
  4865. if (Object(utils["d" /* isDef */])(active) && active !== this.curActive) {
  4866. this.$emit('input', active);
  4867. if (this.curActive !== null) {
  4868. this.$emit('change', active, this.tabs[active].title);
  4869. }
  4870. this.curActive = active;
  4871. }
  4872. },
  4873. findAvailableTab: function findAvailableTab(active, reverse) {
  4874. var diff = reverse ? -1 : 1;
  4875. var index = active;
  4876. while (index >= 0 && index < this.tabs.length) {
  4877. if (!this.tabs[index].disabled) {
  4878. return index;
  4879. }
  4880. index += diff;
  4881. }
  4882. },
  4883. // emit event when clicked
  4884. onClick: function onClick(index) {
  4885. var _this$tabs$index = this.tabs[index],
  4886. title = _this$tabs$index.title,
  4887. disabled = _this$tabs$index.disabled;
  4888. if (disabled) {
  4889. this.$emit('disabled', index, title);
  4890. } else {
  4891. this.setCurActive(index);
  4892. this.$emit('click', index, title);
  4893. }
  4894. },
  4895. // scroll active tab into view
  4896. scrollIntoView: function scrollIntoView(immediate) {
  4897. var tabs = this.$refs.tabs;
  4898. if (!this.scrollable || !tabs || !tabs[this.curActive]) {
  4899. return;
  4900. }
  4901. var nav = this.$refs.nav;
  4902. var scrollLeft = nav.scrollLeft,
  4903. navWidth = nav.offsetWidth;
  4904. var _tabs$this$curActive = tabs[this.curActive],
  4905. offsetLeft = _tabs$this$curActive.offsetLeft,
  4906. tabWidth = _tabs$this$curActive.offsetWidth;
  4907. this.scrollTo(nav, scrollLeft, offsetLeft - (navWidth - tabWidth) / 2, immediate);
  4908. },
  4909. // animate the scrollLeft of nav
  4910. scrollTo: function scrollTo(el, from, to, immediate) {
  4911. if (immediate) {
  4912. el.scrollLeft += to - from;
  4913. return;
  4914. }
  4915. var count = 0;
  4916. var frames = Math.round(this.duration * 1000 / 16);
  4917. var animate = function animate() {
  4918. el.scrollLeft += (to - from) / frames;
  4919. /* istanbul ignore next */
  4920. if (++count < frames) {
  4921. Object(raf["b" /* raf */])(animate);
  4922. }
  4923. };
  4924. animate();
  4925. },
  4926. // render title slot of child tab
  4927. renderTitle: function renderTitle(el, index) {
  4928. var _this3 = this;
  4929. this.$nextTick(function () {
  4930. var title = _this3.$refs.title[index];
  4931. title.parentNode.replaceChild(el, title);
  4932. });
  4933. },
  4934. getTabStyle: function getTabStyle(item, index) {
  4935. var style = {};
  4936. var color = this.color;
  4937. var active = index === this.curActive;
  4938. var isCard = this.type === 'card'; // theme color
  4939. if (color) {
  4940. if (!item.disabled && isCard && !active) {
  4941. style.color = color;
  4942. }
  4943. if (!item.disabled && isCard && active) {
  4944. style.backgroundColor = color;
  4945. }
  4946. if (isCard) {
  4947. style.borderColor = color;
  4948. }
  4949. }
  4950. var titleColor = active ? this.titleActiveColor : this.titleInactiveColor;
  4951. if (titleColor) {
  4952. style.color = titleColor;
  4953. }
  4954. if (this.scrollable && this.ellipsis) {
  4955. style.flexBasis = 88 / this.swipeThreshold + '%';
  4956. }
  4957. return style;
  4958. }
  4959. },
  4960. render: function render(h) {
  4961. var _this4 = this;
  4962. var type = this.type,
  4963. ellipsis = this.ellipsis,
  4964. animated = this.animated,
  4965. scrollable = this.scrollable;
  4966. var Nav = this.tabs.map(function (tab, index) {
  4967. return h("div", {
  4968. "ref": "tabs",
  4969. "refInFor": true,
  4970. "class": tabBem({
  4971. active: index === _this4.curActive,
  4972. disabled: tab.disabled,
  4973. complete: !ellipsis
  4974. }),
  4975. "style": _this4.getTabStyle(tab, index),
  4976. "on": {
  4977. "click": function click() {
  4978. _this4.onClick(index);
  4979. }
  4980. }
  4981. }, [h("span", {
  4982. "ref": "title",
  4983. "refInFor": true,
  4984. "class": {
  4985. 'van-ellipsis': ellipsis
  4986. }
  4987. }, [tab.title])]);
  4988. });
  4989. return h("div", {
  4990. "class": tabs_bem([type])
  4991. }, [h("div", {
  4992. "ref": "wrap",
  4993. "style": this.wrapStyle,
  4994. "class": [tabs_bem('wrap', {
  4995. scrollable: scrollable
  4996. }), {
  4997. 'van-hairline--top-bottom': type === 'line'
  4998. }]
  4999. }, [h("div", {
  5000. "ref": "nav",
  5001. "class": tabs_bem('nav', [type]),
  5002. "style": this.navStyle
  5003. }, [this.slots('nav-left'), type === 'line' && h("div", {
  5004. "class": tabs_bem('line'),
  5005. "style": this.lineStyle
  5006. }), Nav, this.slots('nav-right')])]), h("div", {
  5007. "ref": "content",
  5008. "class": tabs_bem('content', {
  5009. animated: animated
  5010. })
  5011. }, [animated ? h("div", {
  5012. "class": tabs_bem('track'),
  5013. "style": this.trackStyle
  5014. }, [this.slots()]) : this.slots()])]);
  5015. }
  5016. }));
  5017. // CONCATENATED MODULE: ./es/coupon-list/index.js
  5018. var coupon_list_use = Object(utils["k" /* use */])('coupon-list'),
  5019. coupon_list_sfc = coupon_list_use[0],
  5020. coupon_list_bem = coupon_list_use[1],
  5021. coupon_list_t = coupon_list_use[2];
  5022. var EMPTY_IMAGE = 'https://img.yzcdn.cn/vant/coupon-empty.png';
  5023. /* harmony default export */ var coupon_list = (coupon_list_sfc({
  5024. model: {
  5025. prop: 'code'
  5026. },
  5027. props: {
  5028. code: String,
  5029. coupons: Array,
  5030. disabledCoupons: Array,
  5031. closeButtonText: String,
  5032. inputPlaceholder: String,
  5033. exchangeButtonText: String,
  5034. exchangeButtonLoading: Boolean,
  5035. exchangeButtonDisabled: Boolean,
  5036. exchangeMinLength: {
  5037. type: Number,
  5038. "default": 1
  5039. },
  5040. chosenCoupon: {
  5041. type: Number,
  5042. "default": -1
  5043. },
  5044. displayedCouponIndex: {
  5045. type: Number,
  5046. "default": -1
  5047. },
  5048. showExchangeBar: {
  5049. type: Boolean,
  5050. "default": true
  5051. },
  5052. showCloseButton: {
  5053. type: Boolean,
  5054. "default": true
  5055. },
  5056. currency: {
  5057. type: String,
  5058. "default": '¥'
  5059. }
  5060. },
  5061. data: function data() {
  5062. return {
  5063. tab: 0,
  5064. winHeight: window.innerHeight,
  5065. currentCode: this.code || ''
  5066. };
  5067. },
  5068. computed: {
  5069. buttonDisabled: function buttonDisabled() {
  5070. return !this.exchangeButtonLoading && (this.exchangeButtonDisabled || !this.currentCode || this.currentCode.length < this.exchangeMinLength);
  5071. },
  5072. title: function title() {
  5073. return coupon_list_t('enable') + " (" + this.coupons.length + ")";
  5074. },
  5075. disabledTitle: function disabledTitle() {
  5076. return coupon_list_t('disabled') + " (" + this.disabledCoupons.length + ")";
  5077. },
  5078. listStyle: function listStyle() {
  5079. return {
  5080. height: this.winHeight - (this.showExchangeBar ? 140 : 94) + 'px'
  5081. };
  5082. }
  5083. },
  5084. watch: {
  5085. code: function code(_code) {
  5086. this.currentCode = _code;
  5087. },
  5088. currentCode: function currentCode(code) {
  5089. this.$emit('input', code);
  5090. },
  5091. displayedCouponIndex: function displayedCouponIndex(val) {
  5092. this.scrollToShowCoupon(val);
  5093. }
  5094. },
  5095. mounted: function mounted() {
  5096. this.scrollToShowCoupon(this.displayedCouponIndex);
  5097. },
  5098. methods: {
  5099. onClickExchangeButton: function onClickExchangeButton() {
  5100. this.$emit('exchange', this.currentCode); // auto clear currentCode when not use vModel
  5101. if (!this.code) {
  5102. this.currentCode = '';
  5103. }
  5104. },
  5105. // scroll to show specific coupon
  5106. scrollToShowCoupon: function scrollToShowCoupon(index) {
  5107. var _this = this;
  5108. if (index === -1) {
  5109. return;
  5110. }
  5111. this.$nextTick(function () {
  5112. var _this$$refs = _this.$refs,
  5113. card = _this$$refs.card,
  5114. list = _this$$refs.list;
  5115. /* istanbul ignore next */
  5116. if (list && card && card[index]) {
  5117. list.scrollTop = card[index].$el.offsetTop - 100;
  5118. }
  5119. });
  5120. },
  5121. renderEmpty: function renderEmpty() {
  5122. var h = this.$createElement;
  5123. return h("div", {
  5124. "class": coupon_list_bem('empty')
  5125. }, [h("img", {
  5126. "attrs": {
  5127. "src": EMPTY_IMAGE
  5128. }
  5129. }), h("p", [coupon_list_t('empty')])]);
  5130. },
  5131. renderExchangeButton: function renderExchangeButton() {
  5132. var h = this.$createElement;
  5133. return h(es_button, {
  5134. "attrs": {
  5135. "size": "small",
  5136. "type": "danger",
  5137. "text": this.exchangeButtonText || coupon_list_t('exchange'),
  5138. "loading": this.exchangeButtonLoading,
  5139. "disabled": this.buttonDisabled
  5140. },
  5141. "class": coupon_list_bem('exchange'),
  5142. "on": {
  5143. "click": this.onClickExchangeButton
  5144. }
  5145. });
  5146. }
  5147. },
  5148. render: function render(h) {
  5149. var _this2 = this;
  5150. var ExchangeBar = this.showExchangeBar && h(field, {
  5151. "attrs": {
  5152. "clearable": true,
  5153. "border": false,
  5154. "placeholder": this.inputPlaceholder || coupon_list_t('placeholder'),
  5155. "maxlength": "20"
  5156. },
  5157. "class": coupon_list_bem('field'),
  5158. "scopedSlots": {
  5159. button: this.renderExchangeButton
  5160. },
  5161. "model": {
  5162. value: _this2.currentCode,
  5163. callback: function callback($$v) {
  5164. _this2.currentCode = $$v;
  5165. }
  5166. }
  5167. });
  5168. var onChange = function onChange(index) {
  5169. return function () {
  5170. return _this2.$emit('change', index);
  5171. };
  5172. };
  5173. var CouponTab = h(es_tab, {
  5174. "attrs": {
  5175. "title": this.title
  5176. }
  5177. }, [h("div", {
  5178. "class": coupon_list_bem('list'),
  5179. "style": this.listStyle
  5180. }, [this.coupons.map(function (coupon, index) {
  5181. return h(es_coupon, {
  5182. "ref": "card",
  5183. "key": coupon.id,
  5184. "attrs": {
  5185. "coupon": coupon,
  5186. "currency": _this2.currency,
  5187. "chosen": index === _this2.chosenCoupon
  5188. },
  5189. "nativeOn": {
  5190. "click": onChange(index)
  5191. }
  5192. });
  5193. }), !this.coupons.length && this.renderEmpty()])]);
  5194. var DisabledCouponTab = h(es_tab, {
  5195. "attrs": {
  5196. "title": this.disabledTitle
  5197. }
  5198. }, [h("div", {
  5199. "class": coupon_list_bem('list'),
  5200. "style": this.listStyle
  5201. }, [this.disabledCoupons.map(function (coupon) {
  5202. return h(es_coupon, {
  5203. "attrs": {
  5204. "disabled": true,
  5205. "coupon": coupon,
  5206. "currency": _this2.currency
  5207. },
  5208. "key": coupon.id
  5209. });
  5210. }), !this.disabledCoupons.length && this.renderEmpty()])]);
  5211. return h("div", {
  5212. "class": coupon_list_bem()
  5213. }, [ExchangeBar, h(es_tabs, {
  5214. "class": coupon_list_bem('tab'),
  5215. "attrs": {
  5216. "line-width": 120
  5217. },
  5218. "model": {
  5219. value: _this2.tab,
  5220. callback: function callback($$v) {
  5221. _this2.tab = $$v;
  5222. }
  5223. }
  5224. }, [CouponTab, DisabledCouponTab]), h(es_button, {
  5225. "directives": [{
  5226. name: "show",
  5227. value: this.showCloseButton
  5228. }],
  5229. "attrs": {
  5230. "size": "large",
  5231. "text": this.closeButtonText || coupon_list_t('close')
  5232. },
  5233. "class": coupon_list_bem('close'),
  5234. "on": {
  5235. "click": onChange(-1)
  5236. }
  5237. })]);
  5238. }
  5239. }));
  5240. // CONCATENATED MODULE: ./es/datetime-picker/utils.js
  5241. function isValidDate(date) {
  5242. return Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime());
  5243. }
  5244. function utils_padZero(val) {
  5245. return ("00" + val).slice(-2);
  5246. }
  5247. function times(n, iteratee) {
  5248. var index = -1;
  5249. var result = Array(n);
  5250. while (++index < n) {
  5251. result[index] = iteratee(index);
  5252. }
  5253. return result;
  5254. }
  5255. function getTrueValue(formattedValue) {
  5256. if (!formattedValue) return;
  5257. while (isNaN(parseInt(formattedValue, 10))) {
  5258. formattedValue = formattedValue.slice(1);
  5259. }
  5260. return parseInt(formattedValue, 10);
  5261. }
  5262. function getMonthEndDay(year, month) {
  5263. return 32 - new Date(year, month - 1, 32).getDate();
  5264. }
  5265. // CONCATENATED MODULE: ./es/datetime-picker/index.js
  5266. var datetime_picker_use = Object(utils["k" /* use */])('datetime-picker'),
  5267. datetime_picker_sfc = datetime_picker_use[0],
  5268. datetime_picker_bem = datetime_picker_use[1];
  5269. var currentYear = new Date().getFullYear();
  5270. /* harmony default export */ var datetime_picker = (datetime_picker_sfc({
  5271. props: _extends({}, pickerProps, {
  5272. value: null,
  5273. minHour: Number,
  5274. minMinute: Number,
  5275. type: {
  5276. type: String,
  5277. "default": 'datetime'
  5278. },
  5279. showToolbar: {
  5280. type: Boolean,
  5281. "default": true
  5282. },
  5283. format: {
  5284. type: String,
  5285. "default": 'YYYY.MM.DD HH时 mm分'
  5286. },
  5287. formatter: {
  5288. type: Function,
  5289. "default": function _default(type, value) {
  5290. return value;
  5291. }
  5292. },
  5293. minDate: {
  5294. type: Date,
  5295. "default": function _default() {
  5296. return new Date(currentYear - 10, 0, 1);
  5297. },
  5298. validator: isValidDate
  5299. },
  5300. maxDate: {
  5301. type: Date,
  5302. "default": function _default() {
  5303. return new Date(currentYear + 10, 11, 31);
  5304. },
  5305. validator: isValidDate
  5306. },
  5307. maxHour: {
  5308. type: Number,
  5309. "default": 23
  5310. },
  5311. maxMinute: {
  5312. type: Number,
  5313. "default": 59
  5314. }
  5315. }),
  5316. data: function data() {
  5317. return {
  5318. innerValue: this.correctValue(this.value)
  5319. };
  5320. },
  5321. watch: {
  5322. value: function value(val) {
  5323. val = this.correctValue(val);
  5324. var isEqual = this.type === 'time' ? val === this.innerValue : val.valueOf() === this.innerValue.valueOf();
  5325. if (!isEqual) {
  5326. this.innerValue = val;
  5327. if (this.type === 'time') {
  5328. this.updateColumnValue(val);
  5329. }
  5330. }
  5331. },
  5332. innerValue: function innerValue(val) {
  5333. this.$emit('input', val);
  5334. },
  5335. columns: function columns() {
  5336. this.updateColumnValue(this.innerValue);
  5337. }
  5338. },
  5339. computed: {
  5340. ranges: function ranges() {
  5341. if (this.type === 'time') {
  5342. return [{
  5343. type: 'hour',
  5344. range: [this.minHour, this.maxHour]
  5345. }, {
  5346. type: 'minute',
  5347. range: [this.minMinute, this.maxMinute]
  5348. }];
  5349. }
  5350. var _this$getBoundary = this.getBoundary('max', this.innerValue),
  5351. maxYear = _this$getBoundary.maxYear,
  5352. maxDate = _this$getBoundary.maxDate,
  5353. maxMonth = _this$getBoundary.maxMonth,
  5354. maxHour = _this$getBoundary.maxHour,
  5355. maxMinute = _this$getBoundary.maxMinute;
  5356. var _this$getBoundary2 = this.getBoundary('min', this.innerValue),
  5357. minYear = _this$getBoundary2.minYear,
  5358. minDate = _this$getBoundary2.minDate,
  5359. minMonth = _this$getBoundary2.minMonth,
  5360. minHour = _this$getBoundary2.minHour,
  5361. minMinute = _this$getBoundary2.minMinute;
  5362. var result = [{
  5363. type: 'year',
  5364. range: [minYear, maxYear]
  5365. }, {
  5366. type: 'month',
  5367. range: [minMonth, maxMonth]
  5368. }, {
  5369. type: 'day',
  5370. range: [minDate, maxDate]
  5371. }, {
  5372. type: 'hour',
  5373. range: [minHour, maxHour]
  5374. }, {
  5375. type: 'minute',
  5376. range: [minMinute, maxMinute]
  5377. }];
  5378. if (this.type === 'date') result.splice(3, 2);
  5379. if (this.type === 'year-month') result.splice(2, 3);
  5380. return result;
  5381. },
  5382. columns: function columns() {
  5383. var _this = this;
  5384. var results = this.ranges.map(function (_ref) {
  5385. var type = _ref.type,
  5386. rangeArr = _ref.range;
  5387. var values = times(rangeArr[1] - rangeArr[0] + 1, function (index) {
  5388. var value = rangeArr[0] + index;
  5389. value = value < 10 ? "0" + value : "" + value;
  5390. return _this.formatter(type, value);
  5391. });
  5392. return {
  5393. values: values
  5394. };
  5395. });
  5396. return results;
  5397. }
  5398. },
  5399. mounted: function mounted() {
  5400. this.updateColumnValue(this.innerValue);
  5401. },
  5402. methods: {
  5403. correctValue: function correctValue(value) {
  5404. // validate value
  5405. var isDateType = this.type !== 'time';
  5406. if (isDateType && !isValidDate(value)) {
  5407. value = this.minDate;
  5408. } else if (!value) {
  5409. var minHour = this.minHour;
  5410. value = (minHour > 10 ? minHour : '0' + minHour) + ":00";
  5411. } // time type
  5412. if (!isDateType) {
  5413. var _value$split = value.split(':'),
  5414. hour = _value$split[0],
  5415. minute = _value$split[1];
  5416. hour = utils_padZero(Object(utils["j" /* range */])(hour, this.minHour, this.maxHour));
  5417. minute = utils_padZero(Object(utils["j" /* range */])(minute, this.minMinute, this.maxMinute));
  5418. return hour + ":" + minute;
  5419. } // date type
  5420. value = Math.max(value, this.minDate.getTime());
  5421. value = Math.min(value, this.maxDate.getTime());
  5422. return new Date(value);
  5423. },
  5424. getBoundary: function getBoundary(type, value) {
  5425. var _ref2;
  5426. var boundary = this[type + "Date"];
  5427. var year = boundary.getFullYear();
  5428. var month = 1;
  5429. var date = 1;
  5430. var hour = 0;
  5431. var minute = 0;
  5432. if (type === 'max') {
  5433. month = 12;
  5434. date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
  5435. hour = 23;
  5436. minute = 59;
  5437. }
  5438. if (value.getFullYear() === year) {
  5439. month = boundary.getMonth() + 1;
  5440. if (value.getMonth() + 1 === month) {
  5441. date = boundary.getDate();
  5442. if (value.getDate() === date) {
  5443. hour = boundary.getHours();
  5444. if (value.getHours() === hour) {
  5445. minute = boundary.getMinutes();
  5446. }
  5447. }
  5448. }
  5449. }
  5450. return _ref2 = {}, _ref2[type + "Year"] = year, _ref2[type + "Month"] = month, _ref2[type + "Date"] = date, _ref2[type + "Hour"] = hour, _ref2[type + "Minute"] = minute, _ref2;
  5451. },
  5452. onConfirm: function onConfirm() {
  5453. this.$emit('confirm', this.innerValue);
  5454. },
  5455. onChange: function onChange(picker) {
  5456. var _this2 = this;
  5457. var value;
  5458. if (this.type === 'time') {
  5459. var indexes = picker.getIndexes();
  5460. value = indexes[0] + this.minHour + ":" + (indexes[1] + this.minMinute);
  5461. } else {
  5462. var values = picker.getValues();
  5463. var year = getTrueValue(values[0]);
  5464. var month = getTrueValue(values[1]);
  5465. var maxDate = getMonthEndDay(year, month);
  5466. var date = getTrueValue(values[2]);
  5467. if (this.type === 'year-month') {
  5468. date = 1;
  5469. }
  5470. date = date > maxDate ? maxDate : date;
  5471. var hour = 0;
  5472. var minute = 0;
  5473. if (this.type === 'datetime') {
  5474. hour = getTrueValue(values[3]);
  5475. minute = getTrueValue(values[4]);
  5476. }
  5477. value = new Date(year, month - 1, date, hour, minute);
  5478. }
  5479. this.innerValue = this.correctValue(value);
  5480. this.$nextTick(function () {
  5481. _this2.$nextTick(function () {
  5482. _this2.$emit('change', picker);
  5483. });
  5484. });
  5485. },
  5486. updateColumnValue: function updateColumnValue(value) {
  5487. var _this3 = this;
  5488. var values = [];
  5489. var formatter = this.formatter;
  5490. if (this.type === 'time') {
  5491. var pair = value.split(':');
  5492. values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
  5493. } else {
  5494. values = [formatter('year', "" + value.getFullYear()), formatter('month', utils_padZero(value.getMonth() + 1)), formatter('day', utils_padZero(value.getDate()))];
  5495. if (this.type === 'datetime') {
  5496. values.push(formatter('hour', utils_padZero(value.getHours())), formatter('minute', utils_padZero(value.getMinutes())));
  5497. }
  5498. if (this.type === 'year-month') {
  5499. values = values.slice(0, 2);
  5500. }
  5501. }
  5502. this.$nextTick(function () {
  5503. _this3.$refs.picker.setValues(values);
  5504. });
  5505. }
  5506. },
  5507. render: function render(h) {
  5508. var _this4 = this;
  5509. var props = {};
  5510. Object.keys(pickerProps).forEach(function (key) {
  5511. props[key] = _this4[key];
  5512. });
  5513. return h(es_picker, {
  5514. "class": datetime_picker_bem(),
  5515. "ref": "picker",
  5516. "attrs": {
  5517. "columns": this.columns
  5518. },
  5519. "on": {
  5520. "change": this.onChange,
  5521. "confirm": this.onConfirm,
  5522. "cancel": function cancel() {
  5523. _this4.$emit('cancel');
  5524. }
  5525. },
  5526. "props": _extends({}, props)
  5527. });
  5528. }
  5529. }));
  5530. // CONCATENATED MODULE: ./es/goods-action/index.js
  5531. // Types
  5532. var goods_action_use = Object(utils["k" /* use */])('goods-action'),
  5533. goods_action_sfc = goods_action_use[0],
  5534. goods_action_bem = goods_action_use[1];
  5535. function GoodsAction(h, props, slots, ctx) {
  5536. return h("div", helper_default()([{
  5537. "class": goods_action_bem({
  5538. 'safe-area-inset-bottom': props.safeAreaInsetBottom
  5539. })
  5540. }, inherit(ctx, true)]), [slots["default"] && slots["default"]()]);
  5541. }
  5542. GoodsAction.props = {
  5543. safeAreaInsetBottom: Boolean
  5544. };
  5545. /* harmony default export */ var goods_action = (goods_action_sfc(GoodsAction));
  5546. // CONCATENATED MODULE: ./es/goods-action-big-btn/index.js
  5547. // Types
  5548. var goods_action_big_btn_use = Object(utils["k" /* use */])('goods-action-big-btn'),
  5549. goods_action_big_btn_sfc = goods_action_big_btn_use[0],
  5550. goods_action_big_btn_bem = goods_action_big_btn_use[1];
  5551. function GoodsActionBigBtn(h, props, slots, ctx) {
  5552. var onClick = function onClick(event) {
  5553. functional_emit(ctx, 'click', event);
  5554. functionalRoute(ctx);
  5555. };
  5556. return h(es_button, helper_default()([{
  5557. "attrs": {
  5558. "square": true,
  5559. "size": "large",
  5560. "loading": props.loading,
  5561. "disabled": props.disabled,
  5562. "type": props.primary ? 'danger' : 'warning'
  5563. },
  5564. "class": goods_action_big_btn_bem(),
  5565. "on": {
  5566. "click": onClick
  5567. }
  5568. }, inherit(ctx)]), [slots["default"] ? slots["default"]() : props.text]);
  5569. }
  5570. GoodsActionBigBtn.props = _extends({}, routeProps, {
  5571. text: String,
  5572. primary: Boolean,
  5573. loading: Boolean,
  5574. disabled: Boolean
  5575. });
  5576. /* harmony default export */ var goods_action_big_btn = (goods_action_big_btn_sfc(GoodsActionBigBtn));
  5577. // CONCATENATED MODULE: ./es/goods-action-mini-btn/index.js
  5578. // Types
  5579. var goods_action_mini_btn_use = Object(utils["k" /* use */])('goods-action-mini-btn'),
  5580. goods_action_mini_btn_sfc = goods_action_mini_btn_use[0],
  5581. goods_action_mini_btn_bem = goods_action_mini_btn_use[1];
  5582. function GoodsActionMiniBtn(h, props, slots, ctx) {
  5583. var onClick = function onClick(event) {
  5584. functional_emit(ctx, 'click', event);
  5585. functionalRoute(ctx);
  5586. };
  5587. return h("div", helper_default()([{
  5588. "class": [goods_action_mini_btn_bem(), 'van-hairline'],
  5589. "on": {
  5590. "click": onClick
  5591. }
  5592. }, inherit(ctx)]), [h(es_icon, {
  5593. "class": [goods_action_mini_btn_bem('icon'), props.iconClass],
  5594. "attrs": {
  5595. "tag": "div",
  5596. "info": props.info,
  5597. "name": props.icon
  5598. }
  5599. }), slots["default"] ? slots["default"]() : props.text]);
  5600. }
  5601. GoodsActionMiniBtn.props = _extends({}, routeProps, {
  5602. text: String,
  5603. icon: String,
  5604. info: [String, Number],
  5605. iconClass: null
  5606. });
  5607. /* harmony default export */ var goods_action_mini_btn = (goods_action_mini_btn_sfc(GoodsActionMiniBtn));
  5608. // CONCATENATED MODULE: ./es/swipe/index.js
  5609. var swipe_use = Object(utils["k" /* use */])('swipe'),
  5610. swipe_sfc = swipe_use[0],
  5611. swipe_bem = swipe_use[1];
  5612. /* harmony default export */ var swipe = (swipe_sfc({
  5613. mixins: [TouchMixin],
  5614. props: {
  5615. width: Number,
  5616. height: Number,
  5617. autoplay: Number,
  5618. vertical: Boolean,
  5619. initialSwipe: Number,
  5620. indicatorColor: String,
  5621. loop: {
  5622. type: Boolean,
  5623. "default": true
  5624. },
  5625. touchable: {
  5626. type: Boolean,
  5627. "default": true
  5628. },
  5629. showIndicators: {
  5630. type: Boolean,
  5631. "default": true
  5632. },
  5633. duration: {
  5634. type: Number,
  5635. "default": 500
  5636. }
  5637. },
  5638. data: function data() {
  5639. return {
  5640. computedWidth: 0,
  5641. computedHeight: 0,
  5642. offset: 0,
  5643. active: 0,
  5644. deltaX: 0,
  5645. deltaY: 0,
  5646. swipes: [],
  5647. swiping: false
  5648. };
  5649. },
  5650. mounted: function mounted() {
  5651. this.initialize();
  5652. if (!this.$isServer) {
  5653. event_on(window, 'resize', this.onResize, true);
  5654. }
  5655. },
  5656. activated: function activated() {
  5657. if (this.rendered) {
  5658. this.initialize();
  5659. }
  5660. this.rendered = true;
  5661. },
  5662. destroyed: function destroyed() {
  5663. this.clear();
  5664. if (!this.$isServer) {
  5665. off(window, 'resize', this.onResize, true);
  5666. }
  5667. },
  5668. watch: {
  5669. swipes: function swipes() {
  5670. this.initialize();
  5671. },
  5672. initialSwipe: function initialSwipe() {
  5673. this.initialize();
  5674. },
  5675. autoplay: function autoplay(_autoplay) {
  5676. if (!_autoplay) {
  5677. this.clear();
  5678. } else {
  5679. this.autoPlay();
  5680. }
  5681. }
  5682. },
  5683. computed: {
  5684. count: function count() {
  5685. return this.swipes.length;
  5686. },
  5687. delta: function delta() {
  5688. return this.vertical ? this.deltaY : this.deltaX;
  5689. },
  5690. size: function size() {
  5691. return this[this.vertical ? 'computedHeight' : 'computedWidth'];
  5692. },
  5693. trackSize: function trackSize() {
  5694. return this.count * this.size;
  5695. },
  5696. activeIndicator: function activeIndicator() {
  5697. return (this.active + this.count) % this.count;
  5698. },
  5699. isCorrectDirection: function isCorrectDirection() {
  5700. var expect = this.vertical ? 'vertical' : 'horizontal';
  5701. return this.direction === expect;
  5702. },
  5703. trackStyle: function trackStyle() {
  5704. var _ref;
  5705. var mainAxis = this.vertical ? 'height' : 'width';
  5706. var crossAxis = this.vertical ? 'width' : 'height';
  5707. return _ref = {}, _ref[mainAxis] = this.trackSize + "px", _ref[crossAxis] = this[crossAxis] ? this[crossAxis] + "px" : '', _ref.transitionDuration = (this.swiping ? 0 : this.duration) + "ms", _ref.transform = "translate" + (this.vertical ? 'Y' : 'X') + "(" + this.offset + "px)", _ref;
  5708. },
  5709. indicatorStyle: function indicatorStyle() {
  5710. return {
  5711. backgroundColor: this.indicatorColor
  5712. };
  5713. }
  5714. },
  5715. methods: {
  5716. // initialize swipe position
  5717. initialize: function initialize(active) {
  5718. if (active === void 0) {
  5719. active = this.initialSwipe;
  5720. }
  5721. clearTimeout(this.timer);
  5722. if (this.$el) {
  5723. var rect = this.$el.getBoundingClientRect();
  5724. this.computedWidth = this.width || rect.width;
  5725. this.computedHeight = this.height || rect.height;
  5726. }
  5727. this.swiping = true;
  5728. this.active = active;
  5729. this.offset = this.count > 1 ? -this.size * this.active : 0;
  5730. this.swipes.forEach(function (swipe) {
  5731. swipe.offset = 0;
  5732. });
  5733. this.autoPlay();
  5734. },
  5735. onResize: function onResize() {
  5736. this.initialize(this.activeIndicator);
  5737. },
  5738. onTouchStart: function onTouchStart(event) {
  5739. if (!this.touchable) return;
  5740. this.clear();
  5741. this.swiping = true;
  5742. this.touchStart(event);
  5743. this.correctPosition();
  5744. },
  5745. onTouchMove: function onTouchMove(event) {
  5746. if (!this.touchable || !this.swiping) return;
  5747. this.touchMove(event);
  5748. if (this.isCorrectDirection) {
  5749. preventDefault(event, true);
  5750. this.move({
  5751. offset: Math.min(Math.max(this.delta, -this.size), this.size)
  5752. });
  5753. }
  5754. },
  5755. onTouchEnd: function onTouchEnd() {
  5756. if (!this.touchable || !this.swiping) return;
  5757. if (this.delta && this.isCorrectDirection) {
  5758. var offset = this.vertical ? this.offsetY : this.offsetX;
  5759. this.move({
  5760. pace: offset > 0 ? this.delta > 0 ? -1 : 1 : 0,
  5761. emitChange: true
  5762. });
  5763. }
  5764. this.swiping = false;
  5765. this.autoPlay();
  5766. },
  5767. move: function move(_ref2) {
  5768. var _ref2$pace = _ref2.pace,
  5769. pace = _ref2$pace === void 0 ? 0 : _ref2$pace,
  5770. _ref2$offset = _ref2.offset,
  5771. offset = _ref2$offset === void 0 ? 0 : _ref2$offset,
  5772. emitChange = _ref2.emitChange;
  5773. var delta = this.delta,
  5774. active = this.active,
  5775. count = this.count,
  5776. swipes = this.swipes,
  5777. trackSize = this.trackSize;
  5778. var atFirst = active === 0;
  5779. var atLast = active === count - 1;
  5780. var outOfBounds = !this.loop && (atFirst && (offset > 0 || pace < 0) || atLast && (offset < 0 || pace > 0));
  5781. if (outOfBounds || count <= 1) {
  5782. return;
  5783. }
  5784. if (swipes[0]) {
  5785. swipes[0].offset = atLast && (delta < 0 || pace > 0) ? trackSize : 0;
  5786. }
  5787. if (swipes[count - 1]) {
  5788. swipes[count - 1].offset = atFirst && (delta > 0 || pace < 0) ? -trackSize : 0;
  5789. }
  5790. if (pace && active + pace >= -1 && active + pace <= count) {
  5791. this.active += pace;
  5792. if (emitChange) {
  5793. this.$emit('change', this.activeIndicator);
  5794. }
  5795. }
  5796. this.offset = Math.round(offset - this.active * this.size);
  5797. },
  5798. swipeTo: function swipeTo(index) {
  5799. var _this = this;
  5800. this.swiping = true;
  5801. this.resetTouchStatus();
  5802. this.correctPosition();
  5803. setTimeout(function () {
  5804. _this.swiping = false;
  5805. _this.move({
  5806. pace: index % _this.count - _this.active,
  5807. emitChange: true
  5808. });
  5809. }, 30);
  5810. },
  5811. correctPosition: function correctPosition() {
  5812. if (this.active <= -1) {
  5813. this.move({
  5814. pace: this.count
  5815. });
  5816. }
  5817. if (this.active >= this.count) {
  5818. this.move({
  5819. pace: -this.count
  5820. });
  5821. }
  5822. },
  5823. clear: function clear() {
  5824. clearTimeout(this.timer);
  5825. },
  5826. autoPlay: function autoPlay() {
  5827. var _this2 = this;
  5828. var autoplay = this.autoplay;
  5829. if (autoplay && this.count > 1) {
  5830. this.clear();
  5831. this.timer = setTimeout(function () {
  5832. _this2.swiping = true;
  5833. _this2.resetTouchStatus();
  5834. _this2.correctPosition();
  5835. setTimeout(function () {
  5836. _this2.swiping = false;
  5837. _this2.move({
  5838. pace: 1,
  5839. emitChange: true
  5840. });
  5841. _this2.autoPlay();
  5842. }, 30);
  5843. }, autoplay);
  5844. }
  5845. }
  5846. },
  5847. render: function render(h) {
  5848. var _this3 = this;
  5849. var count = this.count,
  5850. activeIndicator = this.activeIndicator;
  5851. var Indicator = this.slots('indicator') || this.showIndicators && count > 1 && h("div", {
  5852. "class": swipe_bem('indicators', {
  5853. vertical: this.vertical
  5854. })
  5855. }, [Array.apply(void 0, Array(count)).map(function (empty, index) {
  5856. return h("i", {
  5857. "class": swipe_bem('indicator', {
  5858. active: index === activeIndicator
  5859. }),
  5860. "style": index === activeIndicator ? _this3.indicatorStyle : null
  5861. });
  5862. })]);
  5863. return h("div", {
  5864. "class": swipe_bem()
  5865. }, [h("div", {
  5866. "ref": "track",
  5867. "style": this.trackStyle,
  5868. "class": swipe_bem('track'),
  5869. "on": {
  5870. "touchstart": this.onTouchStart,
  5871. "touchmove": this.onTouchMove,
  5872. "touchend": this.onTouchEnd,
  5873. "touchcancel": this.onTouchEnd
  5874. }
  5875. }, [this.slots()]), Indicator]);
  5876. }
  5877. }));
  5878. // CONCATENATED MODULE: ./es/swipe-item/index.js
  5879. var swipe_item_use = Object(utils["k" /* use */])('swipe-item'),
  5880. swipe_item_sfc = swipe_item_use[0],
  5881. swipe_item_bem = swipe_item_use[1];
  5882. /* harmony default export */ var swipe_item = (swipe_item_sfc({
  5883. data: function data() {
  5884. return {
  5885. offset: 0
  5886. };
  5887. },
  5888. beforeCreate: function beforeCreate() {
  5889. this.$parent.swipes.push(this);
  5890. },
  5891. destroyed: function destroyed() {
  5892. this.$parent.swipes.splice(this.$parent.swipes.indexOf(this), 1);
  5893. },
  5894. render: function render(h) {
  5895. var _this$$parent = this.$parent,
  5896. vertical = _this$$parent.vertical,
  5897. computedWidth = _this$$parent.computedWidth,
  5898. computedHeight = _this$$parent.computedHeight;
  5899. var style = {
  5900. width: computedWidth + 'px',
  5901. height: vertical ? computedHeight + 'px' : '100%',
  5902. transform: "translate" + (vertical ? 'Y' : 'X') + "(" + this.offset + "px)"
  5903. };
  5904. return h("div", {
  5905. "class": swipe_item_bem(),
  5906. "style": style,
  5907. "on": _extends({}, this.$listeners)
  5908. }, [this.slots()]);
  5909. }
  5910. }));
  5911. // CONCATENATED MODULE: ./es/image-preview/ImagePreview.js
  5912. var ImagePreview_use = Object(utils["k" /* use */])('image-preview'),
  5913. ImagePreview_sfc = ImagePreview_use[0],
  5914. ImagePreview_bem = ImagePreview_use[1];
  5915. function getDistance(touches) {
  5916. return Math.sqrt(Math.abs((touches[0].clientX - touches[1].clientX) * (touches[0].clientY - touches[1].clientY)));
  5917. }
  5918. /* harmony default export */ var image_preview_ImagePreview = (ImagePreview_sfc({
  5919. mixins: [PopupMixin, TouchMixin],
  5920. props: {
  5921. images: Array,
  5922. className: null,
  5923. lazyLoad: Boolean,
  5924. asyncClose: Boolean,
  5925. startPosition: Number,
  5926. showIndicators: Boolean,
  5927. loop: {
  5928. type: Boolean,
  5929. "default": true
  5930. },
  5931. overlay: {
  5932. type: Boolean,
  5933. "default": true
  5934. },
  5935. showIndex: {
  5936. type: Boolean,
  5937. "default": true
  5938. },
  5939. minZoom: {
  5940. type: Number,
  5941. "default": 1 / 3
  5942. },
  5943. maxZoom: {
  5944. type: Number,
  5945. "default": 3
  5946. },
  5947. overlayClass: {
  5948. type: String,
  5949. "default": 'van-image-preview__overlay'
  5950. },
  5951. closeOnClickOverlay: {
  5952. type: Boolean,
  5953. "default": true
  5954. }
  5955. },
  5956. data: function data() {
  5957. return {
  5958. scale: 1,
  5959. moveX: 0,
  5960. moveY: 0,
  5961. moving: false,
  5962. zooming: false,
  5963. active: 0
  5964. };
  5965. },
  5966. computed: {
  5967. imageStyle: function imageStyle() {
  5968. var scale = this.scale;
  5969. var style = {
  5970. transition: this.zooming || this.moving ? '' : '.3s all'
  5971. };
  5972. if (scale !== 1) {
  5973. style.transform = "scale3d(" + scale + ", " + scale + ", 1) translate(" + this.moveX / scale + "px, " + this.moveY / scale + "px)";
  5974. }
  5975. return style;
  5976. }
  5977. },
  5978. watch: {
  5979. value: function value() {
  5980. this.active = this.startPosition;
  5981. },
  5982. startPosition: function startPosition(active) {
  5983. this.active = active;
  5984. }
  5985. },
  5986. methods: {
  5987. onWrapperTouchStart: function onWrapperTouchStart() {
  5988. this.touchStartTime = new Date();
  5989. },
  5990. onWrapperTouchEnd: function onWrapperTouchEnd(event) {
  5991. preventDefault(event);
  5992. var deltaTime = new Date() - this.touchStartTime;
  5993. var _ref = this.$refs.swipe || {},
  5994. _ref$offsetX = _ref.offsetX,
  5995. offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,
  5996. _ref$offsetY = _ref.offsetY,
  5997. offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY; // prevent long tap to close component
  5998. if (deltaTime < 300 && offsetX < 10 && offsetY < 10) {
  5999. var index = this.active;
  6000. this.resetScale();
  6001. this.$emit('close', {
  6002. index: index,
  6003. url: this.images[index]
  6004. });
  6005. if (!this.asyncClose) {
  6006. this.$emit('input', false);
  6007. }
  6008. }
  6009. },
  6010. startMove: function startMove(event) {
  6011. var image = event.currentTarget;
  6012. var rect = image.getBoundingClientRect();
  6013. var winWidth = window.innerWidth;
  6014. var winHeight = window.innerHeight;
  6015. this.touchStart(event);
  6016. this.moving = true;
  6017. this.startMoveX = this.moveX;
  6018. this.startMoveY = this.moveY;
  6019. this.maxMoveX = Math.max(0, (rect.width - winWidth) / 2);
  6020. this.maxMoveY = Math.max(0, (rect.height - winHeight) / 2);
  6021. },
  6022. startZoom: function startZoom(event) {
  6023. this.moving = false;
  6024. this.zooming = true;
  6025. this.startScale = this.scale;
  6026. this.startDistance = getDistance(event.touches);
  6027. },
  6028. onTouchStart: function onTouchStart(event) {
  6029. var touches = event.touches;
  6030. var _ref2 = this.$refs.swipe || {},
  6031. _ref2$offsetX = _ref2.offsetX,
  6032. offsetX = _ref2$offsetX === void 0 ? 0 : _ref2$offsetX;
  6033. if (touches.length === 1 && this.scale !== 1) {
  6034. this.startMove(event);
  6035. }
  6036. /* istanbul ignore else */
  6037. else if (touches.length === 2 && !offsetX) {
  6038. this.startZoom(event);
  6039. }
  6040. },
  6041. onTouchMove: function onTouchMove(event) {
  6042. var touches = event.touches;
  6043. if (this.moving || this.zooming) {
  6044. preventDefault(event, true);
  6045. }
  6046. if (this.moving) {
  6047. this.touchMove(event);
  6048. var moveX = this.deltaX + this.startMoveX;
  6049. var moveY = this.deltaY + this.startMoveY;
  6050. this.moveX = Object(utils["j" /* range */])(moveX, -this.maxMoveX, this.maxMoveX);
  6051. this.moveY = Object(utils["j" /* range */])(moveY, -this.maxMoveY, this.maxMoveY);
  6052. }
  6053. if (this.zooming && touches.length === 2) {
  6054. var distance = getDistance(touches);
  6055. var scale = this.startScale * distance / this.startDistance;
  6056. this.scale = Object(utils["j" /* range */])(scale, this.minZoom, this.maxZoom);
  6057. }
  6058. },
  6059. onTouchEnd: function onTouchEnd(event) {
  6060. /* istanbul ignore else */
  6061. if (this.moving || this.zooming) {
  6062. var stopPropagation = true;
  6063. if (this.moving && this.startMoveX === this.moveX && this.startMoveY === this.moveY) {
  6064. stopPropagation = false;
  6065. }
  6066. if (!event.touches.length) {
  6067. this.moving = false;
  6068. this.zooming = false;
  6069. this.startMoveX = 0;
  6070. this.startMoveY = 0;
  6071. this.startScale = 1;
  6072. if (this.scale < 1) {
  6073. this.resetScale();
  6074. }
  6075. }
  6076. if (stopPropagation) {
  6077. preventDefault(event, true);
  6078. }
  6079. }
  6080. },
  6081. onChange: function onChange(active) {
  6082. this.resetScale();
  6083. this.active = active;
  6084. this.$emit('change', active);
  6085. },
  6086. resetScale: function resetScale() {
  6087. this.scale = 1;
  6088. this.moveX = 0;
  6089. this.moveY = 0;
  6090. }
  6091. },
  6092. render: function render(h) {
  6093. var _this = this;
  6094. if (!this.value) {
  6095. return;
  6096. }
  6097. var active = this.active,
  6098. images = this.images;
  6099. var Index = this.showIndex && h("div", {
  6100. "class": ImagePreview_bem('index')
  6101. }, [this.slots('index') || active + 1 + "/" + images.length]);
  6102. var Images = h(swipe, {
  6103. "ref": "swipe",
  6104. "attrs": {
  6105. "loop": this.loop,
  6106. "indicatorColor": "white",
  6107. "initialSwipe": this.startPosition,
  6108. "showIndicators": this.showIndicators
  6109. },
  6110. "on": {
  6111. "change": this.onChange
  6112. }
  6113. }, [images.map(function (image, index) {
  6114. var props = {
  6115. "class": ImagePreview_bem('image'),
  6116. style: index === active ? _this.imageStyle : null,
  6117. on: {
  6118. touchstart: _this.onTouchStart,
  6119. touchmove: _this.onTouchMove,
  6120. touchend: _this.onTouchEnd,
  6121. touchcancel: _this.onTouchEnd
  6122. }
  6123. };
  6124. return h(swipe_item, [_this.lazyLoad ? h("img", helper_default()([{
  6125. "directives": [{
  6126. name: "lazy",
  6127. value: image
  6128. }]
  6129. }, props])) : h("img", helper_default()([{
  6130. "attrs": {
  6131. "src": image
  6132. }
  6133. }, props]))]);
  6134. })]);
  6135. return h("transition", {
  6136. "attrs": {
  6137. "name": "van-fade"
  6138. }
  6139. }, [h("div", {
  6140. "class": [ImagePreview_bem(), this.className],
  6141. "on": {
  6142. "touchstart": this.onWrapperTouchStart,
  6143. "touchend": this.onWrapperTouchEnd,
  6144. "touchcancel": this.onWrapperTouchEnd
  6145. }
  6146. }, [Index, Images])]);
  6147. }
  6148. }));
  6149. // CONCATENATED MODULE: ./es/image-preview/index.js
  6150. var image_preview_instance;
  6151. var image_preview_defaultConfig = {
  6152. images: [],
  6153. loop: true,
  6154. value: true,
  6155. minZoom: 1 / 3,
  6156. maxZoom: 3,
  6157. className: '',
  6158. lazyLoad: false,
  6159. showIndex: true,
  6160. asyncClose: false,
  6161. startPosition: 0,
  6162. showIndicators: false
  6163. };
  6164. var image_preview_initInstance = function initInstance() {
  6165. image_preview_instance = new (external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.extend(image_preview_ImagePreview))({
  6166. el: document.createElement('div')
  6167. });
  6168. document.body.appendChild(image_preview_instance.$el);
  6169. };
  6170. var es_image_preview_ImagePreview = function ImagePreview(images, startPosition) {
  6171. if (startPosition === void 0) {
  6172. startPosition = 0;
  6173. }
  6174. /* istanbul ignore if */
  6175. if (utils["h" /* isServer */]) {
  6176. return;
  6177. }
  6178. if (!image_preview_instance) {
  6179. image_preview_initInstance();
  6180. }
  6181. var options = Array.isArray(images) ? {
  6182. images: images,
  6183. startPosition: startPosition
  6184. } : images;
  6185. _extends(image_preview_instance, image_preview_defaultConfig, options);
  6186. image_preview_instance.$once('input', function (show) {
  6187. image_preview_instance.value = show;
  6188. });
  6189. if (options.onClose) {
  6190. image_preview_instance.$once('close', options.onClose);
  6191. }
  6192. return image_preview_instance;
  6193. };
  6194. es_image_preview_ImagePreview.install = function () {
  6195. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.use(image_preview_ImagePreview);
  6196. };
  6197. /* harmony default export */ var image_preview = (es_image_preview_ImagePreview);
  6198. // EXTERNAL MODULE: ./node_modules/vue-lazyload/vue-lazyload.js
  6199. var vue_lazyload = __webpack_require__(6);
  6200. var vue_lazyload_default = /*#__PURE__*/__webpack_require__.n(vue_lazyload);
  6201. // CONCATENATED MODULE: ./es/lazyload/index.js
  6202. /* harmony default export */ var lazyload = (vue_lazyload_default.a);
  6203. // CONCATENATED MODULE: ./es/list/index.js
  6204. var list_use = Object(utils["k" /* use */])('list'),
  6205. list_sfc = list_use[0],
  6206. list_bem = list_use[1],
  6207. list_t = list_use[2];
  6208. /* harmony default export */ var es_list = (list_sfc({
  6209. model: {
  6210. prop: 'loading'
  6211. },
  6212. props: {
  6213. error: Boolean,
  6214. loading: Boolean,
  6215. finished: Boolean,
  6216. errorText: String,
  6217. loadingText: String,
  6218. finishedText: String,
  6219. immediateCheck: {
  6220. type: Boolean,
  6221. "default": true
  6222. },
  6223. offset: {
  6224. type: Number,
  6225. "default": 300
  6226. },
  6227. direction: {
  6228. type: String,
  6229. "default": 'down'
  6230. }
  6231. },
  6232. mounted: function mounted() {
  6233. this.scroller = getScrollEventTarget(this.$el);
  6234. this.handler(true);
  6235. if (this.immediateCheck) {
  6236. this.$nextTick(this.check);
  6237. }
  6238. },
  6239. destroyed: function destroyed() {
  6240. this.handler(false);
  6241. },
  6242. activated: function activated() {
  6243. this.handler(true);
  6244. },
  6245. deactivated: function deactivated() {
  6246. this.handler(false);
  6247. },
  6248. watch: {
  6249. loading: function loading() {
  6250. this.$nextTick(this.check);
  6251. },
  6252. finished: function finished() {
  6253. this.$nextTick(this.check);
  6254. }
  6255. },
  6256. methods: {
  6257. check: function check() {
  6258. if (this.loading || this.finished || this.error) {
  6259. return;
  6260. }
  6261. var el = this.$el;
  6262. var scroller = this.scroller;
  6263. var scrollerHeight = getVisibleHeight(scroller);
  6264. /* istanbul ignore next */
  6265. if (!scrollerHeight || window.getComputedStyle(el).display === 'none' || el.offsetParent === null) {
  6266. return;
  6267. }
  6268. var offset = this.offset,
  6269. direction = this.direction;
  6270. function isReachEdge() {
  6271. if (el === scroller) {
  6272. var scrollTop = getScrollTop(el);
  6273. if (direction === 'up') {
  6274. return scrollTop <= offset;
  6275. }
  6276. var targetBottom = scrollTop + scrollerHeight;
  6277. return scroller.scrollHeight - targetBottom <= offset;
  6278. }
  6279. if (direction === 'up') {
  6280. return getScrollTop(scroller) - getElementTop(el) <= offset;
  6281. }
  6282. var elBottom = getElementTop(el) + getVisibleHeight(el) - getElementTop(scroller);
  6283. return elBottom - scrollerHeight <= offset;
  6284. }
  6285. if (isReachEdge()) {
  6286. this.$emit('input', true);
  6287. this.$emit('load');
  6288. }
  6289. },
  6290. clickErrorText: function clickErrorText() {
  6291. this.$emit('update:error', false);
  6292. this.$nextTick(this.check);
  6293. },
  6294. handler: function handler(bind) {
  6295. /* istanbul ignore else */
  6296. if (this.binded !== bind) {
  6297. this.binded = bind;
  6298. (bind ? event_on : off)(this.scroller, 'scroll', this.check);
  6299. }
  6300. }
  6301. },
  6302. render: function render(h) {
  6303. return h("div", {
  6304. "class": list_bem()
  6305. }, [this.direction === 'down' && this.slots(), this.loading && h("div", {
  6306. "class": list_bem('loading'),
  6307. "key": "loading"
  6308. }, [this.slots('loading') || [h(es_loading, {
  6309. "class": list_bem('loading-icon')
  6310. }), h("span", {
  6311. "class": list_bem('loading-text')
  6312. }, [this.loadingText || list_t('loading')])]]), this.finished && this.finishedText && h("div", {
  6313. "class": list_bem('finished-text')
  6314. }, [this.finishedText]), this.error && this.errorText && h("div", {
  6315. "on": {
  6316. "click": this.clickErrorText
  6317. },
  6318. "class": list_bem('error-text')
  6319. }, [this.errorText]), this.direction === 'up' && this.slots()]);
  6320. }
  6321. }));
  6322. // EXTERNAL MODULE: ./es/locale/index.js + 1 modules
  6323. var locale = __webpack_require__(4);
  6324. // CONCATENATED MODULE: ./es/nav-bar/index.js
  6325. // Types
  6326. var nav_bar_use = Object(utils["k" /* use */])('nav-bar'),
  6327. nav_bar_sfc = nav_bar_use[0],
  6328. nav_bar_bem = nav_bar_use[1];
  6329. function NavBar(h, props, slots, ctx) {
  6330. return h("div", helper_default()([{
  6331. "class": [nav_bar_bem({
  6332. fixed: props.fixed
  6333. }), {
  6334. 'van-hairline--bottom': props.border
  6335. }],
  6336. "style": {
  6337. zIndex: props.zIndex
  6338. }
  6339. }, inherit(ctx)]), [h("div", {
  6340. "class": nav_bar_bem('left'),
  6341. "on": {
  6342. "click": ctx.listeners['click-left'] || utils["i" /* noop */]
  6343. }
  6344. }, [slots.left ? slots.left() : [props.leftArrow && h(es_icon, {
  6345. "class": nav_bar_bem('arrow'),
  6346. "attrs": {
  6347. "name": "arrow-left"
  6348. }
  6349. }), props.leftText && h("span", {
  6350. "class": nav_bar_bem('text')
  6351. }, [props.leftText])]]), h("div", {
  6352. "class": [nav_bar_bem('title'), 'van-ellipsis']
  6353. }, [slots.title ? slots.title() : props.title]), h("div", {
  6354. "class": nav_bar_bem('right'),
  6355. "on": {
  6356. "click": ctx.listeners['click-right'] || utils["i" /* noop */]
  6357. }
  6358. }, [slots.right ? slots.right() : props.rightText && h("span", {
  6359. "class": nav_bar_bem('text')
  6360. }, [props.rightText])])]);
  6361. }
  6362. NavBar.props = {
  6363. title: String,
  6364. fixed: Boolean,
  6365. leftText: String,
  6366. rightText: String,
  6367. leftArrow: Boolean,
  6368. border: {
  6369. type: Boolean,
  6370. "default": true
  6371. },
  6372. zIndex: {
  6373. type: Number,
  6374. "default": 1
  6375. }
  6376. };
  6377. /* harmony default export */ var nav_bar = (nav_bar_sfc(NavBar));
  6378. // CONCATENATED MODULE: ./es/notice-bar/index.js
  6379. var notice_bar_use = Object(utils["k" /* use */])('notice-bar'),
  6380. notice_bar_sfc = notice_bar_use[0],
  6381. notice_bar_bem = notice_bar_use[1];
  6382. /* harmony default export */ var notice_bar = (notice_bar_sfc({
  6383. props: {
  6384. text: String,
  6385. mode: String,
  6386. color: String,
  6387. leftIcon: String,
  6388. wrapable: Boolean,
  6389. background: String,
  6390. delay: {
  6391. type: [String, Number],
  6392. "default": 1
  6393. },
  6394. scrollable: {
  6395. type: Boolean,
  6396. "default": true
  6397. },
  6398. speed: {
  6399. type: Number,
  6400. "default": 50
  6401. }
  6402. },
  6403. data: function data() {
  6404. return {
  6405. wrapWidth: 0,
  6406. firstRound: true,
  6407. duration: 0,
  6408. offsetWidth: 0,
  6409. showNoticeBar: true,
  6410. animationClass: ''
  6411. };
  6412. },
  6413. watch: {
  6414. text: {
  6415. handler: function handler() {
  6416. var _this = this;
  6417. this.$nextTick(function () {
  6418. var _this$$refs = _this.$refs,
  6419. wrap = _this$$refs.wrap,
  6420. content = _this$$refs.content;
  6421. if (!wrap || !content) {
  6422. return;
  6423. }
  6424. var wrapWidth = wrap.getBoundingClientRect().width;
  6425. var offsetWidth = content.getBoundingClientRect().width;
  6426. if (_this.scrollable && offsetWidth > wrapWidth) {
  6427. _this.wrapWidth = wrapWidth;
  6428. _this.offsetWidth = offsetWidth;
  6429. _this.duration = offsetWidth / _this.speed;
  6430. _this.animationClass = notice_bar_bem('play');
  6431. }
  6432. });
  6433. },
  6434. immediate: true
  6435. }
  6436. },
  6437. methods: {
  6438. onClickIcon: function onClickIcon() {
  6439. if (this.mode === 'closeable') {
  6440. this.showNoticeBar = false;
  6441. this.$emit('close');
  6442. }
  6443. },
  6444. onAnimationEnd: function onAnimationEnd() {
  6445. var _this2 = this;
  6446. this.firstRound = false;
  6447. this.$nextTick(function () {
  6448. _this2.duration = (_this2.offsetWidth + _this2.wrapWidth) / _this2.speed;
  6449. _this2.animationClass = notice_bar_bem('play--infinite');
  6450. });
  6451. }
  6452. },
  6453. render: function render(h) {
  6454. var _this3 = this;
  6455. var mode = this.mode;
  6456. var iconName = mode === 'closeable' ? 'cross' : mode === 'link' ? 'arrow' : '';
  6457. var barStyle = {
  6458. color: this.color,
  6459. background: this.background
  6460. };
  6461. var contentStyle = {
  6462. paddingLeft: this.firstRound ? 0 : this.wrapWidth + 'px',
  6463. animationDelay: (this.firstRound ? this.delay : 0) + 's',
  6464. animationDuration: this.duration + 's'
  6465. };
  6466. return h("div", {
  6467. "directives": [{
  6468. name: "show",
  6469. value: this.showNoticeBar
  6470. }],
  6471. "class": notice_bar_bem({
  6472. withicon: mode,
  6473. wrapable: this.wrapable
  6474. }),
  6475. "style": barStyle,
  6476. "on": {
  6477. "click": function click() {
  6478. _this3.$emit('click');
  6479. }
  6480. }
  6481. }, [this.leftIcon && h(es_icon, {
  6482. "class": notice_bar_bem('left-icon'),
  6483. "attrs": {
  6484. "name": this.leftIcon
  6485. }
  6486. }), h("div", {
  6487. "ref": "wrap",
  6488. "class": notice_bar_bem('wrap')
  6489. }, [h("div", {
  6490. "ref": "content",
  6491. "class": [notice_bar_bem('content'), this.animationClass, {
  6492. 'van-ellipsis': !this.scrollable && !this.wrapable
  6493. }],
  6494. "style": contentStyle,
  6495. "on": {
  6496. "animationend": this.onAnimationEnd,
  6497. "webkitAnimationEnd": this.onAnimationEnd
  6498. }
  6499. }, [this.slots() || this.text])]), iconName && h(es_icon, {
  6500. "class": notice_bar_bem('right-icon'),
  6501. "attrs": {
  6502. "name": iconName
  6503. },
  6504. "on": {
  6505. "click": this.onClickIcon
  6506. }
  6507. })]);
  6508. }
  6509. }));
  6510. // CONCATENATED MODULE: ./es/notify/Notify.js
  6511. // Types
  6512. var Notify_use = Object(utils["k" /* use */])('notify'),
  6513. Notify_sfc = Notify_use[0],
  6514. Notify_bem = Notify_use[1];
  6515. function Notify(h, props, slots, ctx) {
  6516. var style = {
  6517. color: props.color,
  6518. background: props.background
  6519. };
  6520. return h(popup, helper_default()([{
  6521. "attrs": {
  6522. "value": props.value,
  6523. "position": "top",
  6524. "overlay": false,
  6525. "lockScroll": false
  6526. },
  6527. "style": style,
  6528. "class": [Notify_bem(), props.className],
  6529. "on": {
  6530. "input": function input(value) {
  6531. functional_emit(ctx, 'input', value);
  6532. }
  6533. }
  6534. }, inherit(ctx)]), [props.message]);
  6535. }
  6536. Notify.props = _extends({}, PopupMixin.props, {
  6537. className: null,
  6538. message: [String, Number],
  6539. color: {
  6540. type: String,
  6541. "default": WHITE
  6542. },
  6543. background: {
  6544. type: String,
  6545. "default": RED
  6546. },
  6547. duration: {
  6548. type: Number,
  6549. "default": 3000
  6550. }
  6551. });
  6552. /* harmony default export */ var notify_Notify = (Notify_sfc(Notify));
  6553. // CONCATENATED MODULE: ./es/notify/index.js
  6554. var timer;
  6555. var notify_instance;
  6556. function notify_parseOptions(message) {
  6557. return Object(utils["g" /* isObj */])(message) ? message : {
  6558. message: message
  6559. };
  6560. }
  6561. function es_notify_Notify(options) {
  6562. /* istanbul ignore if */
  6563. if (utils["h" /* isServer */]) {
  6564. return;
  6565. }
  6566. if (!notify_instance) {
  6567. notify_instance = mount(notify_Notify);
  6568. }
  6569. options = _extends({}, es_notify_Notify.currentOptions, notify_parseOptions(options));
  6570. _extends(notify_instance, options);
  6571. clearTimeout(timer);
  6572. if (options.duration && options.duration > 0) {
  6573. timer = setTimeout(es_notify_Notify.clear, options.duration);
  6574. }
  6575. return notify_instance;
  6576. }
  6577. function notify_defaultOptions() {
  6578. return {
  6579. value: true,
  6580. message: '',
  6581. color: WHITE,
  6582. background: RED,
  6583. duration: 3000,
  6584. className: ''
  6585. };
  6586. }
  6587. es_notify_Notify.clear = function () {
  6588. if (notify_instance) {
  6589. notify_instance.value = false;
  6590. }
  6591. };
  6592. es_notify_Notify.currentOptions = notify_defaultOptions();
  6593. es_notify_Notify.setDefaultOptions = function (options) {
  6594. _extends(es_notify_Notify.currentOptions, options);
  6595. };
  6596. es_notify_Notify.resetDefaultOptions = function () {
  6597. es_notify_Notify.currentOptions = notify_defaultOptions();
  6598. };
  6599. es_notify_Notify.install = function () {
  6600. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.use(notify_Notify);
  6601. };
  6602. external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype.$notify = es_notify_Notify;
  6603. /* harmony default export */ var notify = (es_notify_Notify);
  6604. // CONCATENATED MODULE: ./es/number-keyboard/Key.js
  6605. var Key_use = Object(utils["k" /* use */])('key'),
  6606. Key_sfc = Key_use[0],
  6607. Key_bem = Key_use[1];
  6608. /* harmony default export */ var Key = (Key_sfc({
  6609. props: {
  6610. type: Array,
  6611. text: [String, Number]
  6612. },
  6613. data: function data() {
  6614. return {
  6615. active: false
  6616. };
  6617. },
  6618. computed: {
  6619. className: function className() {
  6620. var types = this.type.slice(0);
  6621. this.active && types.push('active');
  6622. return Key_bem(types);
  6623. }
  6624. },
  6625. methods: {
  6626. onFocus: function onFocus() {
  6627. this.active = true;
  6628. this.$emit('press', this.text);
  6629. },
  6630. onBlur: function onBlur(event) {
  6631. preventDefault(event, true);
  6632. this.active = false;
  6633. }
  6634. },
  6635. render: function render(h) {
  6636. var onBlur = this.onBlur;
  6637. return h("i", {
  6638. "class": ['van-hairline', this.className],
  6639. "on": {
  6640. "touchstart": this.onFocus,
  6641. "touchmove": onBlur,
  6642. "touchend": onBlur,
  6643. "touchcancel": onBlur
  6644. }
  6645. }, [this.text]);
  6646. }
  6647. }));
  6648. // CONCATENATED MODULE: ./es/number-keyboard/index.js
  6649. var number_keyboard_use = Object(utils["k" /* use */])('number-keyboard'),
  6650. number_keyboard_sfc = number_keyboard_use[0],
  6651. number_keyboard_bem = number_keyboard_use[1],
  6652. number_keyboard_t = number_keyboard_use[2];
  6653. var CLOSE_KEY_TYPE = ['blue', 'big'];
  6654. var DELETE_KEY_TYPE = ['delete', 'big', 'gray'];
  6655. /* harmony default export */ var number_keyboard = (number_keyboard_sfc({
  6656. props: {
  6657. show: Boolean,
  6658. title: String,
  6659. closeButtonText: String,
  6660. deleteButtonText: String,
  6661. safeAreaInsetBottom: Boolean,
  6662. theme: {
  6663. type: String,
  6664. "default": 'default'
  6665. },
  6666. extraKey: {
  6667. type: String,
  6668. "default": ''
  6669. },
  6670. zIndex: {
  6671. type: Number,
  6672. "default": 100
  6673. },
  6674. transition: {
  6675. type: Boolean,
  6676. "default": true
  6677. },
  6678. showDeleteKey: {
  6679. type: Boolean,
  6680. "default": true
  6681. },
  6682. hideOnClickOutside: {
  6683. type: Boolean,
  6684. "default": true
  6685. }
  6686. },
  6687. mounted: function mounted() {
  6688. this.handler(true);
  6689. },
  6690. destroyed: function destroyed() {
  6691. this.handler(false);
  6692. },
  6693. activated: function activated() {
  6694. this.handler(true);
  6695. },
  6696. deactivated: function deactivated() {
  6697. this.handler(false);
  6698. },
  6699. watch: {
  6700. show: function show() {
  6701. if (!this.transition) {
  6702. this.$emit(this.show ? 'show' : 'hide');
  6703. }
  6704. }
  6705. },
  6706. computed: {
  6707. keys: function keys() {
  6708. var keys = [];
  6709. for (var i = 1; i <= 9; i++) {
  6710. keys.push({
  6711. text: i
  6712. });
  6713. }
  6714. switch (this.theme) {
  6715. case 'default':
  6716. keys.push({
  6717. text: this.extraKey,
  6718. type: ['gray']
  6719. }, {
  6720. text: 0
  6721. }, {
  6722. text: this.deleteText,
  6723. type: ['gray', 'delete']
  6724. });
  6725. break;
  6726. case 'custom':
  6727. keys.push({
  6728. text: 0,
  6729. type: ['middle']
  6730. }, {
  6731. text: this.extraKey
  6732. });
  6733. break;
  6734. }
  6735. return keys;
  6736. },
  6737. deleteText: function deleteText() {
  6738. return this.deleteButtonText || number_keyboard_t('delete');
  6739. }
  6740. },
  6741. methods: {
  6742. handler: function handler(action) {
  6743. /* istanbul ignore if */
  6744. if (this.$isServer) {
  6745. return;
  6746. }
  6747. if (action !== this.handlerStatus && this.hideOnClickOutside) {
  6748. this.handlerStatus = action;
  6749. document.body[(action ? 'add' : 'remove') + 'EventListener']('touchstart', this.onBlur);
  6750. }
  6751. },
  6752. onBlur: function onBlur() {
  6753. this.$emit('blur');
  6754. },
  6755. onClose: function onClose() {
  6756. this.$emit('close');
  6757. this.onBlur();
  6758. },
  6759. onAnimationEnd: function onAnimationEnd() {
  6760. this.$emit(this.show ? 'show' : 'hide');
  6761. },
  6762. onPress: function onPress(text) {
  6763. if (text === '') {
  6764. return;
  6765. }
  6766. if (text === this.deleteText) {
  6767. this.$emit('delete');
  6768. } else if (text === this.closeButtonText) {
  6769. this.onClose();
  6770. } else {
  6771. this.$emit('input', text);
  6772. }
  6773. }
  6774. },
  6775. render: function render(h) {
  6776. var title = this.title,
  6777. theme = this.theme,
  6778. onPress = this.onPress,
  6779. closeButtonText = this.closeButtonText;
  6780. var titleLeftSlot = this.slots('title-left');
  6781. var showTitleClose = closeButtonText && theme === 'default';
  6782. var showTitle = title || showTitleClose || titleLeftSlot;
  6783. return h("transition", {
  6784. "attrs": {
  6785. "name": this.transition ? 'van-slide-up' : ''
  6786. }
  6787. }, [h("div", {
  6788. "directives": [{
  6789. name: "show",
  6790. value: this.show
  6791. }],
  6792. "style": {
  6793. zIndex: this.zIndex
  6794. },
  6795. "class": number_keyboard_bem([theme, {
  6796. 'safe-area-inset-bottom': this.safeAreaInsetBottom
  6797. }]),
  6798. "on": {
  6799. "touchstart": event_stopPropagation,
  6800. "animationend": this.onAnimationEnd,
  6801. "webkitAnimationEnd": this.onAnimationEnd
  6802. }
  6803. }, [showTitle && h("div", {
  6804. "class": [number_keyboard_bem('title'), 'van-hairline--top']
  6805. }, [titleLeftSlot && h("span", {
  6806. "class": number_keyboard_bem('title-left')
  6807. }, [titleLeftSlot]), title && h("span", [title]), showTitleClose && h("span", {
  6808. "class": number_keyboard_bem('close'),
  6809. "on": {
  6810. "click": this.onClose
  6811. }
  6812. }, [closeButtonText])]), h("div", {
  6813. "class": number_keyboard_bem('body')
  6814. }, [this.keys.map(function (key) {
  6815. return h(Key, {
  6816. "key": key.text,
  6817. "attrs": {
  6818. "text": key.text,
  6819. "type": key.type
  6820. },
  6821. "on": {
  6822. "press": onPress
  6823. }
  6824. });
  6825. })]), theme === 'custom' && h("div", {
  6826. "class": number_keyboard_bem('sidebar')
  6827. }, [h(Key, {
  6828. "attrs": {
  6829. "text": this.deleteText,
  6830. "type": DELETE_KEY_TYPE
  6831. },
  6832. "on": {
  6833. "press": onPress
  6834. }
  6835. }), h(Key, {
  6836. "attrs": {
  6837. "text": closeButtonText,
  6838. "type": CLOSE_KEY_TYPE
  6839. },
  6840. "on": {
  6841. "press": onPress
  6842. }
  6843. })])])]);
  6844. }
  6845. }));
  6846. // CONCATENATED MODULE: ./es/pagination/index.js
  6847. var pagination_use = Object(utils["k" /* use */])('pagination'),
  6848. pagination_sfc = pagination_use[0],
  6849. pagination_bem = pagination_use[1],
  6850. pagination_t = pagination_use[2];
  6851. function makePage(number, text, active) {
  6852. return {
  6853. number: number,
  6854. text: text,
  6855. active: active
  6856. };
  6857. }
  6858. /* harmony default export */ var pagination = (pagination_sfc({
  6859. props: {
  6860. value: Number,
  6861. prevText: String,
  6862. nextText: String,
  6863. pageCount: Number,
  6864. totalItems: Number,
  6865. forceEllipses: Boolean,
  6866. mode: {
  6867. type: String,
  6868. "default": 'multi'
  6869. },
  6870. itemsPerPage: {
  6871. type: Number,
  6872. "default": 10
  6873. },
  6874. showPageSize: {
  6875. type: Number,
  6876. "default": 5
  6877. }
  6878. },
  6879. computed: {
  6880. count: function count() {
  6881. var count = this.pageCount || Math.ceil(this.totalItems / this.itemsPerPage);
  6882. return Math.max(1, count);
  6883. },
  6884. pages: function pages() {
  6885. var pages = [];
  6886. var pageCount = this.count;
  6887. if (this.mode !== 'multi') {
  6888. return pages;
  6889. } // Default page limits
  6890. var startPage = 1;
  6891. var endPage = pageCount;
  6892. var isMaxSized = this.showPageSize !== undefined && this.showPageSize < pageCount; // recompute if showPageSize
  6893. if (isMaxSized) {
  6894. // Current page is displayed in the middle of the visible ones
  6895. startPage = Math.max(this.value - Math.floor(this.showPageSize / 2), 1);
  6896. endPage = startPage + this.showPageSize - 1; // Adjust if limit is exceeded
  6897. if (endPage > pageCount) {
  6898. endPage = pageCount;
  6899. startPage = endPage - this.showPageSize + 1;
  6900. }
  6901. } // Add page number links
  6902. for (var number = startPage; number <= endPage; number++) {
  6903. var page = makePage(number, number, number === this.value);
  6904. pages.push(page);
  6905. } // Add links to move between page sets
  6906. if (isMaxSized && this.showPageSize > 0 && this.forceEllipses) {
  6907. if (startPage > 1) {
  6908. var previousPageSet = makePage(startPage - 1, '...', false);
  6909. pages.unshift(previousPageSet);
  6910. }
  6911. if (endPage < pageCount) {
  6912. var nextPageSet = makePage(endPage + 1, '...', false);
  6913. pages.push(nextPageSet);
  6914. }
  6915. }
  6916. return pages;
  6917. }
  6918. },
  6919. watch: {
  6920. value: {
  6921. handler: function handler(page) {
  6922. this.select(page || this.value);
  6923. },
  6924. immediate: true
  6925. }
  6926. },
  6927. methods: {
  6928. select: function select(page) {
  6929. page = Math.min(this.count, Math.max(1, page));
  6930. if (this.value !== page) {
  6931. this.$emit('input', page);
  6932. this.$emit('change', page);
  6933. }
  6934. }
  6935. },
  6936. render: function render(h) {
  6937. var _this = this;
  6938. var value = this.value;
  6939. var simple = this.mode !== 'multi';
  6940. var onSelect = function onSelect(value) {
  6941. return function () {
  6942. _this.select(value);
  6943. };
  6944. };
  6945. return h("ul", {
  6946. "class": pagination_bem({
  6947. simple: simple
  6948. })
  6949. }, [h("li", {
  6950. "class": [pagination_bem('item', {
  6951. disabled: value === 1
  6952. }), pagination_bem('prev'), 'van-hairline'],
  6953. "on": {
  6954. "click": onSelect(value - 1)
  6955. }
  6956. }, [this.prevText || pagination_t('prev')]), this.pages.map(function (page) {
  6957. return h("li", {
  6958. "class": [pagination_bem('item', {
  6959. active: page.active
  6960. }), pagination_bem('page'), 'van-hairline'],
  6961. "on": {
  6962. "click": onSelect(page.number)
  6963. }
  6964. }, [page.text]);
  6965. }), simple && h("li", {
  6966. "class": pagination_bem('page-desc')
  6967. }, [this.slots('pageDesc') || value + "/" + this.count]), h("li", {
  6968. "class": [pagination_bem('item', {
  6969. disabled: value === this.count
  6970. }), pagination_bem('next'), 'van-hairline'],
  6971. "on": {
  6972. "click": onSelect(value + 1)
  6973. }
  6974. }, [this.nextText || pagination_t('next')])]);
  6975. }
  6976. }));
  6977. // CONCATENATED MODULE: ./es/panel/index.js
  6978. // Types
  6979. var panel_use = Object(utils["k" /* use */])('panel'),
  6980. panel_sfc = panel_use[0],
  6981. panel_bem = panel_use[1];
  6982. function Panel(h, props, slots, ctx) {
  6983. var Content = function Content() {
  6984. return [slots.header ? slots.header() : h(cell, {
  6985. "attrs": {
  6986. "icon": props.icon,
  6987. "label": props.desc,
  6988. "title": props.title,
  6989. "value": props.status,
  6990. "valueClass": panel_bem('header-value')
  6991. },
  6992. "class": panel_bem('header')
  6993. }), h("div", {
  6994. "class": panel_bem('content')
  6995. }, [slots["default"] && slots["default"]()]), slots.footer && h("div", {
  6996. "class": [panel_bem('footer'), 'van-hairline--top']
  6997. }, [slots.footer()])];
  6998. };
  6999. return h(cell_group, helper_default()([{
  7000. "class": panel_bem(),
  7001. "scopedSlots": {
  7002. "default": Content
  7003. }
  7004. }, inherit(ctx, true)]));
  7005. }
  7006. Panel.props = {
  7007. icon: String,
  7008. desc: String,
  7009. title: String,
  7010. status: String
  7011. };
  7012. /* harmony default export */ var panel = (panel_sfc(Panel));
  7013. // CONCATENATED MODULE: ./es/password-input/index.js
  7014. // Types
  7015. var password_input_use = Object(utils["k" /* use */])('password-input'),
  7016. password_input_sfc = password_input_use[0],
  7017. password_input_bem = password_input_use[1];
  7018. function PasswordInput(h, props, slots, ctx) {
  7019. var info = props.errorInfo || props.info;
  7020. var Points = [];
  7021. for (var i = 0; i < props.length; i++) {
  7022. var _char = props.value[i];
  7023. Points.push(h("li", {
  7024. "class": "van-hairline"
  7025. }, [props.mask ? h("i", {
  7026. "style": {
  7027. visibility: _char ? 'visible' : 'hidden'
  7028. }
  7029. }) : _char]));
  7030. }
  7031. return h("div", {
  7032. "class": password_input_bem()
  7033. }, [h("ul", helper_default()([{
  7034. "class": [password_input_bem('security'), 'van-hairline--surround'],
  7035. "on": {
  7036. "touchstart": function touchstart(event) {
  7037. event.stopPropagation();
  7038. functional_emit(ctx, 'focus', event);
  7039. }
  7040. }
  7041. }, inherit(ctx, true)]), [Points]), info && h("div", {
  7042. "class": password_input_bem(props.errorInfo ? 'error-info' : 'info')
  7043. }, [info])]);
  7044. }
  7045. PasswordInput.props = {
  7046. info: String,
  7047. errorInfo: String,
  7048. mask: {
  7049. type: Boolean,
  7050. "default": true
  7051. },
  7052. value: {
  7053. type: String,
  7054. "default": ''
  7055. },
  7056. length: {
  7057. type: Number,
  7058. "default": 6
  7059. }
  7060. };
  7061. /* harmony default export */ var password_input = (password_input_sfc(PasswordInput));
  7062. // CONCATENATED MODULE: ./es/progress/index.js
  7063. var progress_use = Object(utils["k" /* use */])('progress'),
  7064. progress_sfc = progress_use[0],
  7065. progress_bem = progress_use[1];
  7066. /* harmony default export */ var es_progress = (progress_sfc({
  7067. props: {
  7068. inactive: Boolean,
  7069. pivotText: String,
  7070. pivotColor: String,
  7071. percentage: {
  7072. type: Number,
  7073. required: true,
  7074. validator: function validator(value) {
  7075. return value >= 0 && value <= 100;
  7076. }
  7077. },
  7078. showPivot: {
  7079. type: Boolean,
  7080. "default": true
  7081. },
  7082. color: {
  7083. type: String,
  7084. "default": BLUE
  7085. },
  7086. textColor: {
  7087. type: String,
  7088. "default": WHITE
  7089. }
  7090. },
  7091. data: function data() {
  7092. return {
  7093. pivotWidth: 0,
  7094. progressWidth: 0
  7095. };
  7096. },
  7097. mounted: function mounted() {
  7098. this.getWidth();
  7099. },
  7100. watch: {
  7101. showPivot: function showPivot() {
  7102. this.getWidth();
  7103. },
  7104. pivotText: function pivotText() {
  7105. this.getWidth();
  7106. }
  7107. },
  7108. methods: {
  7109. getWidth: function getWidth() {
  7110. var _this = this;
  7111. this.$nextTick(function () {
  7112. _this.progressWidth = _this.$el.offsetWidth;
  7113. _this.pivotWidth = _this.$refs.pivot ? _this.$refs.pivot.offsetWidth : 0;
  7114. });
  7115. }
  7116. },
  7117. render: function render(h) {
  7118. var pivotText = this.pivotText,
  7119. percentage = this.percentage;
  7120. var text = Object(utils["d" /* isDef */])(pivotText) ? pivotText : percentage + '%';
  7121. var showPivot = this.showPivot && text;
  7122. var background = this.inactive ? '#cacaca' : this.color;
  7123. var pivotStyle = {
  7124. color: this.textColor,
  7125. background: this.pivotColor || background
  7126. };
  7127. var portionStyle = {
  7128. background: background,
  7129. width: (this.progressWidth - this.pivotWidth) * percentage / 100 + 'px'
  7130. };
  7131. return h("div", {
  7132. "class": progress_bem()
  7133. }, [h("span", {
  7134. "class": progress_bem('portion', {
  7135. 'with-pivot': showPivot
  7136. }),
  7137. "style": portionStyle
  7138. }, [showPivot && h("span", {
  7139. "ref": "pivot",
  7140. "style": pivotStyle,
  7141. "class": progress_bem('pivot')
  7142. }, [text])])]);
  7143. }
  7144. }));
  7145. // CONCATENATED MODULE: ./es/pull-refresh/index.js
  7146. var pull_refresh_use = Object(utils["k" /* use */])('pull-refresh'),
  7147. pull_refresh_sfc = pull_refresh_use[0],
  7148. pull_refresh_bem = pull_refresh_use[1],
  7149. pull_refresh_t = pull_refresh_use[2];
  7150. var TEXT_STATUS = ['pulling', 'loosing', 'success'];
  7151. /* harmony default export */ var pull_refresh = (pull_refresh_sfc({
  7152. mixins: [TouchMixin],
  7153. props: {
  7154. disabled: Boolean,
  7155. successText: String,
  7156. pullingText: String,
  7157. loosingText: String,
  7158. loadingText: String,
  7159. value: {
  7160. type: Boolean,
  7161. required: true
  7162. },
  7163. successDuration: {
  7164. type: Number,
  7165. "default": 500
  7166. },
  7167. animationDuration: {
  7168. type: Number,
  7169. "default": 300
  7170. },
  7171. headHeight: {
  7172. type: Number,
  7173. "default": 50
  7174. }
  7175. },
  7176. data: function data() {
  7177. return {
  7178. status: 'normal',
  7179. height: 0,
  7180. duration: 0
  7181. };
  7182. },
  7183. computed: {
  7184. untouchable: function untouchable() {
  7185. return this.status === 'loading' || this.status === 'success' || this.disabled;
  7186. }
  7187. },
  7188. watch: {
  7189. value: function value(loading) {
  7190. var _this = this;
  7191. this.duration = this.animationDuration;
  7192. if (!loading && this.successText) {
  7193. this.status = 'success';
  7194. setTimeout(function () {
  7195. _this.setStatus(0);
  7196. }, this.successDuration);
  7197. } else {
  7198. this.setStatus(loading ? this.headHeight : 0, loading);
  7199. }
  7200. }
  7201. },
  7202. mounted: function mounted() {
  7203. this.scrollEl = getScrollEventTarget(this.$el);
  7204. },
  7205. methods: {
  7206. onTouchStart: function onTouchStart(event) {
  7207. if (!this.untouchable && this.getCeiling()) {
  7208. this.duration = 0;
  7209. this.touchStart(event);
  7210. }
  7211. },
  7212. onTouchMove: function onTouchMove(event) {
  7213. if (this.untouchable) {
  7214. return;
  7215. }
  7216. this.touchMove(event);
  7217. if (!this.ceiling && this.getCeiling()) {
  7218. this.duration = 0;
  7219. this.startY = event.touches[0].clientY;
  7220. this.deltaY = 0;
  7221. }
  7222. if (this.ceiling && this.deltaY >= 0) {
  7223. if (this.direction === 'vertical') {
  7224. this.setStatus(this.ease(this.deltaY));
  7225. preventDefault(event);
  7226. }
  7227. }
  7228. },
  7229. onTouchEnd: function onTouchEnd() {
  7230. if (!this.untouchable && this.ceiling && this.deltaY) {
  7231. this.duration = this.animationDuration;
  7232. if (this.status === 'loosing') {
  7233. this.setStatus(this.headHeight, true);
  7234. this.$emit('input', true);
  7235. this.$emit('refresh');
  7236. } else {
  7237. this.setStatus(0);
  7238. }
  7239. }
  7240. },
  7241. getCeiling: function getCeiling() {
  7242. this.ceiling = getScrollTop(this.scrollEl) === 0;
  7243. return this.ceiling;
  7244. },
  7245. ease: function ease(height) {
  7246. var headHeight = this.headHeight;
  7247. return height < headHeight ? height : height < headHeight * 2 ? Math.round(headHeight + (height - headHeight) / 2) : Math.round(headHeight * 1.5 + (height - headHeight * 2) / 4);
  7248. },
  7249. setStatus: function setStatus(height, isLoading) {
  7250. this.height = height;
  7251. var status = isLoading ? 'loading' : height === 0 ? 'normal' : height < this.headHeight ? 'pulling' : 'loosing';
  7252. if (status !== this.status) {
  7253. this.status = status;
  7254. }
  7255. }
  7256. },
  7257. render: function render(h) {
  7258. var status = this.status;
  7259. var text = this[status + "Text"] || pull_refresh_t(status);
  7260. var style = {
  7261. transition: this.duration + "ms",
  7262. transform: this.height ? "translate3d(0," + this.height + "px, 0)" : ''
  7263. };
  7264. var Status = this.slots(status) || [TEXT_STATUS.indexOf(status) !== -1 && h("div", {
  7265. "class": pull_refresh_bem('text')
  7266. }, [text]), status === 'loading' && h("div", {
  7267. "class": pull_refresh_bem('loading')
  7268. }, [h(es_loading), h("span", [text])])];
  7269. return h("div", {
  7270. "class": pull_refresh_bem()
  7271. }, [h("div", {
  7272. "class": pull_refresh_bem('track'),
  7273. "style": style,
  7274. "on": {
  7275. "touchstart": this.onTouchStart,
  7276. "touchmove": this.onTouchMove,
  7277. "touchend": this.onTouchEnd,
  7278. "touchcancel": this.onTouchEnd
  7279. }
  7280. }, [h("div", {
  7281. "class": pull_refresh_bem('head')
  7282. }, [Status]), this.slots()])]);
  7283. }
  7284. }));
  7285. // CONCATENATED MODULE: ./es/rate/index.js
  7286. /* eslint-disable prefer-spread */
  7287. // Types
  7288. var rate_use = Object(utils["k" /* use */])('rate'),
  7289. rate_sfc = rate_use[0],
  7290. rate_bem = rate_use[1];
  7291. function getRateStatus(value, index, allowHalf) {
  7292. if (value >= index) {
  7293. return 'full';
  7294. }
  7295. if (value + 0.5 >= index && allowHalf) {
  7296. return 'half';
  7297. }
  7298. return 'void';
  7299. }
  7300. function Rate(h, props, slots, ctx) {
  7301. var icon = props.icon,
  7302. size = props.size,
  7303. color = props.color,
  7304. voidIcon = props.voidIcon,
  7305. readonly = props.readonly,
  7306. disabled = props.disabled,
  7307. voidColor = props.voidColor,
  7308. disabledColor = props.disabledColor;
  7309. var list = [];
  7310. for (var i = 1; i <= props.count; i++) {
  7311. list.push(getRateStatus(props.value, i, props.allowHalf));
  7312. }
  7313. function onSelect(index) {
  7314. if (!disabled && !readonly) {
  7315. functional_emit(ctx, 'input', index);
  7316. functional_emit(ctx, 'change', index);
  7317. }
  7318. }
  7319. function onTouchMove(event) {
  7320. if (readonly || disabled || !document.elementFromPoint) {
  7321. return;
  7322. }
  7323. preventDefault(event);
  7324. var _event$touches$ = event.touches[0],
  7325. clientX = _event$touches$.clientX,
  7326. clientY = _event$touches$.clientY;
  7327. var target = document.elementFromPoint(clientX, clientY);
  7328. if (target && target.dataset) {
  7329. var score = target.dataset.score;
  7330. /* istanbul ignore else */
  7331. if (score) {
  7332. onSelect(+score);
  7333. }
  7334. }
  7335. }
  7336. function renderStar(status, index) {
  7337. var isFull = status === 'full';
  7338. var isVoid = status === 'void';
  7339. return h("div", {
  7340. "key": index,
  7341. "class": rate_bem('item')
  7342. }, [h(es_icon, {
  7343. "attrs": {
  7344. "name": isFull ? icon : voidIcon,
  7345. "size": size + "px",
  7346. "data-score": index + 1,
  7347. "color": disabled ? disabledColor : isFull ? color : voidColor
  7348. },
  7349. "class": rate_bem('icon'),
  7350. "on": {
  7351. "click": function click() {
  7352. onSelect(index + 1);
  7353. }
  7354. }
  7355. }), props.allowHalf && h(es_icon, {
  7356. "attrs": {
  7357. "name": isVoid ? voidIcon : icon,
  7358. "size": size + "px",
  7359. "data-score": index + 0.5,
  7360. "color": disabled ? disabledColor : isVoid ? voidColor : color
  7361. },
  7362. "class": rate_bem('icon', 'half'),
  7363. "on": {
  7364. "click": function click() {
  7365. onSelect(index + 0.5);
  7366. }
  7367. }
  7368. })]);
  7369. }
  7370. return h("div", helper_default()([{
  7371. "class": rate_bem()
  7372. }, inherit(ctx), {
  7373. "on": {
  7374. "touchmove": onTouchMove
  7375. }
  7376. }]), [list.map(function (status, index) {
  7377. return renderStar(status, index);
  7378. })]);
  7379. }
  7380. Rate.props = {
  7381. value: Number,
  7382. readonly: Boolean,
  7383. disabled: Boolean,
  7384. allowHalf: Boolean,
  7385. size: {
  7386. type: Number,
  7387. "default": 20
  7388. },
  7389. icon: {
  7390. type: String,
  7391. "default": 'star'
  7392. },
  7393. voidIcon: {
  7394. type: String,
  7395. "default": 'star-o'
  7396. },
  7397. color: {
  7398. type: String,
  7399. "default": '#ffd21e'
  7400. },
  7401. voidColor: {
  7402. type: String,
  7403. "default": '#c7c7c7'
  7404. },
  7405. disabledColor: {
  7406. type: String,
  7407. "default": '#bdbdbd'
  7408. },
  7409. count: {
  7410. type: Number,
  7411. "default": 5
  7412. }
  7413. };
  7414. /* harmony default export */ var es_rate = (rate_sfc(Rate));
  7415. // CONCATENATED MODULE: ./es/row/index.js
  7416. var row_use = Object(utils["k" /* use */])('row'),
  7417. row_sfc = row_use[0],
  7418. row_bem = row_use[1];
  7419. /* harmony default export */ var row = (row_sfc({
  7420. props: {
  7421. type: String,
  7422. align: String,
  7423. justify: String,
  7424. tag: {
  7425. type: String,
  7426. "default": 'div'
  7427. },
  7428. gutter: {
  7429. type: [Number, String],
  7430. "default": 0
  7431. }
  7432. },
  7433. render: function render(h) {
  7434. var _bem;
  7435. var align = this.align,
  7436. justify = this.justify;
  7437. var flex = this.type === 'flex';
  7438. var margin = "-" + Number(this.gutter) / 2 + "px";
  7439. var style = this.gutter ? {
  7440. marginLeft: margin,
  7441. marginRight: margin
  7442. } : {};
  7443. return h(this.tag, {
  7444. "style": style,
  7445. "class": row_bem((_bem = {
  7446. flex: flex
  7447. }, _bem["align-" + align] = flex && align, _bem["justify-" + justify] = flex && justify, _bem))
  7448. }, [this.slots()]);
  7449. }
  7450. }));
  7451. // CONCATENATED MODULE: ./es/search/index.js
  7452. // Types
  7453. var search_use = Object(utils["k" /* use */])('search'),
  7454. search_sfc = search_use[0],
  7455. search_bem = search_use[1],
  7456. search_t = search_use[2];
  7457. function Search(h, props, slots, ctx) {
  7458. var Label = function Label() {
  7459. if (!slots.label && !props.label) {
  7460. return null;
  7461. }
  7462. return h("div", {
  7463. "class": search_bem('label')
  7464. }, [slots.label ? slots.label() : props.label]);
  7465. };
  7466. var Action = function Action() {
  7467. if (!props.showAction) {
  7468. return null;
  7469. }
  7470. var onCancel = function onCancel() {
  7471. functional_emit(ctx, 'input', '');
  7472. functional_emit(ctx, 'cancel');
  7473. };
  7474. return h("div", {
  7475. "class": search_bem('action')
  7476. }, [slots.action ? slots.action() : h("div", {
  7477. "on": {
  7478. "click": onCancel
  7479. }
  7480. }, [search_t('cancel')])]);
  7481. };
  7482. var fieldData = {
  7483. attrs: ctx.data.attrs,
  7484. on: _extends({}, ctx.listeners, {
  7485. input: function input(value) {
  7486. functional_emit(ctx, 'input', value);
  7487. },
  7488. keypress: function keypress(event) {
  7489. // press enter
  7490. if (event.keyCode === 13) {
  7491. preventDefault(event);
  7492. functional_emit(ctx, 'search', props.value);
  7493. }
  7494. functional_emit(ctx, 'keypress', event);
  7495. }
  7496. })
  7497. };
  7498. var inheritData = inherit(ctx);
  7499. delete inheritData.attrs;
  7500. return h("div", helper_default()([{
  7501. "class": search_bem({
  7502. 'show-action': props.showAction
  7503. }),
  7504. "style": {
  7505. background: props.background
  7506. }
  7507. }, inheritData]), [h("div", {
  7508. "class": search_bem('content', props.shape)
  7509. }, [Label(), h(field, helper_default()([{
  7510. "attrs": {
  7511. "clearable": true,
  7512. "type": "search",
  7513. "value": props.value,
  7514. "border": false,
  7515. "leftIcon": "search"
  7516. },
  7517. "scopedSlots": {
  7518. 'left-icon': slots['left-icon']
  7519. }
  7520. }, fieldData]))]), Action()]);
  7521. }
  7522. Search.props = {
  7523. value: String,
  7524. label: String,
  7525. showAction: Boolean,
  7526. shape: {
  7527. type: String,
  7528. "default": 'square'
  7529. },
  7530. background: {
  7531. type: String,
  7532. "default": '#fff'
  7533. }
  7534. };
  7535. /* harmony default export */ var search = (search_sfc(Search));
  7536. // CONCATENATED MODULE: ./es/sku/components/SkuHeader.js
  7537. // Types
  7538. var SkuHeader_use = Object(utils["k" /* use */])('sku-header'),
  7539. SkuHeader_sfc = SkuHeader_use[0],
  7540. SkuHeader_bem = SkuHeader_use[1];
  7541. function getSkuImg(sku, selectedSku) {
  7542. var id = selectedSku.s1;
  7543. if (id) {
  7544. // skuImg 挂载在 skuTree 中 s1 上
  7545. var treeItem = sku.tree.filter(function (item) {
  7546. return item.k_s === 's1';
  7547. })[0] || {};
  7548. if (treeItem.v) {
  7549. var matchedSku = treeItem.v.filter(function (skuValue) {
  7550. return skuValue.id === id;
  7551. })[0];
  7552. if (matchedSku) {
  7553. return matchedSku.imgUrl || matchedSku.img_url;
  7554. }
  7555. }
  7556. }
  7557. }
  7558. function SkuHeader(h, props, slots, ctx) {
  7559. var sku = props.sku,
  7560. goods = props.goods,
  7561. skuEventBus = props.skuEventBus,
  7562. selectedSku = props.selectedSku;
  7563. var goodsImg = getSkuImg(sku, selectedSku) || goods.picture;
  7564. var previewImage = function previewImage() {
  7565. skuEventBus.$emit('sku:previewImage', goodsImg);
  7566. };
  7567. return h("div", helper_default()([{
  7568. "class": [SkuHeader_bem(), 'van-hairline--bottom']
  7569. }, inherit(ctx)]), [h("div", {
  7570. "class": SkuHeader_bem('img-wrap'),
  7571. "on": {
  7572. "click": previewImage
  7573. }
  7574. }, [h("img", {
  7575. "attrs": {
  7576. "src": goodsImg
  7577. }
  7578. })]), h("div", {
  7579. "class": SkuHeader_bem('goods-info')
  7580. }, [h("div", {
  7581. "class": "van-sku__goods-name van-ellipsis"
  7582. }, [goods.title]), slots["default"] && slots["default"](), h(es_icon, {
  7583. "attrs": {
  7584. "name": "close"
  7585. },
  7586. "class": "van-sku__close-icon",
  7587. "on": {
  7588. "click": function click() {
  7589. skuEventBus.$emit('sku:close');
  7590. }
  7591. }
  7592. })])]);
  7593. }
  7594. SkuHeader.props = {
  7595. sku: Object,
  7596. goods: Object,
  7597. skuEventBus: Object,
  7598. selectedSku: Object
  7599. };
  7600. /* harmony default export */ var components_SkuHeader = (SkuHeader_sfc(SkuHeader));
  7601. // CONCATENATED MODULE: ./es/sku/components/SkuRow.js
  7602. // Types
  7603. var SkuRow_use = Object(utils["k" /* use */])('sku-row'),
  7604. SkuRow_sfc = SkuRow_use[0],
  7605. SkuRow_bem = SkuRow_use[1];
  7606. function SkuRow(h, props, slots, ctx) {
  7607. return h("div", helper_default()([{
  7608. "class": SkuRow_bem()
  7609. }, inherit(ctx)]), [h("div", {
  7610. "class": SkuRow_bem('title')
  7611. }, [props.skuRow.k, "\uFF1A"]), slots["default"] && slots["default"]()]);
  7612. }
  7613. SkuRow.props = {
  7614. skuRow: Object
  7615. };
  7616. /* harmony default export */ var components_SkuRow = (SkuRow_sfc(SkuRow));
  7617. // CONCATENATED MODULE: ./es/sku/constants.js
  7618. var LIMIT_TYPE = {
  7619. QUOTA_LIMIT: 0,
  7620. STOCK_LIMIT: 1
  7621. };
  7622. var UNSELECTED_SKU_VALUE_ID = '';
  7623. /* harmony default export */ var constants = ({
  7624. LIMIT_TYPE: LIMIT_TYPE,
  7625. UNSELECTED_SKU_VALUE_ID: UNSELECTED_SKU_VALUE_ID
  7626. });
  7627. // CONCATENATED MODULE: ./es/sku/utils/skuHelper.js
  7628. /*
  7629. normalize sku tree
  7630. [
  7631. {
  7632. count: 2,
  7633. k: "品种", // 规格名称 skuKeyName
  7634. k_id: "1200", // skuKeyId
  7635. k_s: "s1" // skuKeyStr
  7636. v: [ // skuValues
  7637. { // skuValue
  7638. id: "1201", // skuValueId
  7639. name: "萌" // 具体的规格值 skuValueName
  7640. }, {
  7641. id: "973",
  7642. name: "帅"
  7643. }
  7644. ]
  7645. },
  7646. ...
  7647. ]
  7648. |
  7649. v
  7650. {
  7651. s1: [{
  7652. id: "1201",
  7653. name: "萌"
  7654. }, {
  7655. id: "973",
  7656. name: "帅"
  7657. }],
  7658. ...
  7659. }
  7660. */
  7661. var normalizeSkuTree = function normalizeSkuTree(skuTree) {
  7662. var normalizedTree = {};
  7663. skuTree.forEach(function (treeItem) {
  7664. normalizedTree[treeItem.k_s] = treeItem.v;
  7665. });
  7666. return normalizedTree;
  7667. }; // 判断是否所有的sku都已经选中
  7668. var skuHelper_isAllSelected = function isAllSelected(skuTree, selectedSku) {
  7669. // 筛选selectedSku对象中key值不为空的值
  7670. var selected = Object.keys(selectedSku).filter(function (skuKeyStr) {
  7671. return selectedSku[skuKeyStr] !== UNSELECTED_SKU_VALUE_ID;
  7672. });
  7673. return skuTree.length === selected.length;
  7674. }; // 根据已选择的 sku 获取 skuComb
  7675. var getSkuComb = function getSkuComb(skuList, selectedSku) {
  7676. var skuComb = skuList.filter(function (item) {
  7677. return Object.keys(selectedSku).every(function (skuKeyStr) {
  7678. return String(item[skuKeyStr]) === String(selectedSku[skuKeyStr]);
  7679. });
  7680. });
  7681. return skuComb[0];
  7682. }; // 获取已选择的sku名称
  7683. var skuHelper_getSelectedSkuValues = function getSelectedSkuValues(skuTree, selectedSku) {
  7684. var normalizedTree = normalizeSkuTree(skuTree);
  7685. return Object.keys(selectedSku).reduce(function (selectedValues, skuKeyStr) {
  7686. var skuValues = normalizedTree[skuKeyStr];
  7687. var skuValueId = selectedSku[skuKeyStr];
  7688. if (skuValueId !== UNSELECTED_SKU_VALUE_ID) {
  7689. var skuValue = skuValues.filter(function (value) {
  7690. return value.id === skuValueId;
  7691. })[0];
  7692. skuValue && selectedValues.push(skuValue);
  7693. }
  7694. return selectedValues;
  7695. }, []);
  7696. }; // 判断sku是否可选
  7697. var skuHelper_isSkuChoosable = function isSkuChoosable(skuList, selectedSku, skuToChoose) {
  7698. var _extends2;
  7699. var key = skuToChoose.key,
  7700. valueId = skuToChoose.valueId; // 先假设sku已选中,拼入已选中sku对象中
  7701. var matchedSku = _extends({}, selectedSku, (_extends2 = {}, _extends2[key] = valueId, _extends2)); // 再判断剩余sku是否全部不可选,若不可选则当前sku不可选中
  7702. var skusToCheck = Object.keys(matchedSku).filter(function (skuKey) {
  7703. return matchedSku[skuKey] !== UNSELECTED_SKU_VALUE_ID;
  7704. });
  7705. var filteredSku = skuList.filter(function (sku) {
  7706. return skusToCheck.every(function (skuKey) {
  7707. return String(matchedSku[skuKey]) === String(sku[skuKey]);
  7708. });
  7709. });
  7710. var stock = filteredSku.reduce(function (total, sku) {
  7711. total += sku.stock_num;
  7712. return total;
  7713. }, 0);
  7714. return stock > 0;
  7715. };
  7716. /* harmony default export */ var skuHelper = ({
  7717. normalizeSkuTree: normalizeSkuTree,
  7718. getSkuComb: getSkuComb,
  7719. getSelectedSkuValues: skuHelper_getSelectedSkuValues,
  7720. isAllSelected: skuHelper_isAllSelected,
  7721. isSkuChoosable: skuHelper_isSkuChoosable
  7722. });
  7723. // CONCATENATED MODULE: ./es/sku/components/SkuRowItem.js
  7724. var SkuRowItem_use = Object(utils["k" /* use */])('sku-row-item'),
  7725. SkuRowItem_sfc = SkuRowItem_use[0];
  7726. /* harmony default export */ var SkuRowItem = (SkuRowItem_sfc({
  7727. props: {
  7728. skuList: Array,
  7729. skuValue: Object,
  7730. skuKeyStr: String,
  7731. skuEventBus: Object,
  7732. selectedSku: Object
  7733. },
  7734. computed: {
  7735. choosable: function choosable() {
  7736. return skuHelper_isSkuChoosable(this.skuList, this.selectedSku, {
  7737. key: this.skuKeyStr,
  7738. valueId: this.skuValue.id
  7739. });
  7740. }
  7741. },
  7742. methods: {
  7743. onSelect: function onSelect() {
  7744. if (this.choosable) {
  7745. this.skuEventBus.$emit('sku:select', _extends({}, this.skuValue, {
  7746. skuKeyStr: this.skuKeyStr
  7747. }));
  7748. }
  7749. }
  7750. },
  7751. render: function render(h) {
  7752. var choosed = this.skuValue.id === this.selectedSku[this.skuKeyStr];
  7753. return h("span", {
  7754. "class": ['van-sku-row__item', {
  7755. 'van-sku-row__item--active': choosed,
  7756. 'van-sku-row__item--disabled': !this.choosable
  7757. }],
  7758. "on": {
  7759. "click": this.onSelect
  7760. }
  7761. }, [this.skuValue.name]);
  7762. }
  7763. }));
  7764. // CONCATENATED MODULE: ./es/stepper/index.js
  7765. var stepper_use = Object(utils["k" /* use */])('stepper'),
  7766. stepper_sfc = stepper_use[0],
  7767. stepper_bem = stepper_use[1];
  7768. /* harmony default export */ var stepper = (stepper_sfc({
  7769. props: {
  7770. value: null,
  7771. integer: Boolean,
  7772. disabled: Boolean,
  7773. inputWidth: String,
  7774. asyncChange: Boolean,
  7775. disableInput: Boolean,
  7776. min: {
  7777. type: [String, Number],
  7778. "default": 1
  7779. },
  7780. max: {
  7781. type: [String, Number],
  7782. "default": Infinity
  7783. },
  7784. step: {
  7785. type: [String, Number],
  7786. "default": 1
  7787. },
  7788. defaultValue: {
  7789. type: [String, Number],
  7790. "default": 1
  7791. }
  7792. },
  7793. data: function data() {
  7794. var value = this.range(Object(utils["d" /* isDef */])(this.value) ? this.value : this.defaultValue);
  7795. if (value !== +this.value) {
  7796. this.$emit('input', value);
  7797. }
  7798. return {
  7799. currentValue: value
  7800. };
  7801. },
  7802. computed: {
  7803. minusDisabled: function minusDisabled() {
  7804. return this.disabled || this.currentValue <= this.min;
  7805. },
  7806. plusDisabled: function plusDisabled() {
  7807. return this.disabled || this.currentValue >= this.max;
  7808. }
  7809. },
  7810. watch: {
  7811. value: function value(val) {
  7812. if (val !== this.currentValue) {
  7813. this.currentValue = this.format(val);
  7814. }
  7815. },
  7816. currentValue: function currentValue(val) {
  7817. this.$emit('input', val);
  7818. this.$emit('change', val);
  7819. }
  7820. },
  7821. methods: {
  7822. // filter illegal characters
  7823. format: function format(value) {
  7824. value = String(value).replace(/[^0-9.-]/g, '');
  7825. return value === '' ? 0 : this.integer ? Math.floor(value) : +value;
  7826. },
  7827. // limit value range
  7828. range: function range(value) {
  7829. return Math.max(Math.min(this.max, this.format(value)), this.min);
  7830. },
  7831. onInput: function onInput(event) {
  7832. var value = event.target.value;
  7833. var formatted = this.format(value);
  7834. if (!this.asyncChange) {
  7835. if (+value !== formatted) {
  7836. event.target.value = formatted;
  7837. }
  7838. this.currentValue = formatted;
  7839. } else {
  7840. event.target.value = this.currentValue;
  7841. this.$emit('input', formatted);
  7842. this.$emit('change', formatted);
  7843. }
  7844. },
  7845. onChange: function onChange(type) {
  7846. if (this[type + "Disabled"]) {
  7847. this.$emit('overlimit', type);
  7848. return;
  7849. }
  7850. var diff = type === 'minus' ? -this.step : +this.step;
  7851. var value = Math.round((this.currentValue + diff) * 100) / 100;
  7852. if (!this.asyncChange) {
  7853. this.currentValue = this.range(value);
  7854. } else {
  7855. this.$emit('input', value);
  7856. this.$emit('change', value);
  7857. }
  7858. this.$emit(type);
  7859. },
  7860. onFocus: function onFocus(event) {
  7861. this.$emit('focus', event);
  7862. },
  7863. onBlur: function onBlur(event) {
  7864. this.currentValue = this.range(this.currentValue);
  7865. this.$emit('blur', event); // fix edge case when input is empty and min is 0
  7866. if (this.currentValue === 0) {
  7867. event.target.value = this.currentValue;
  7868. }
  7869. }
  7870. },
  7871. render: function render(h) {
  7872. var _this = this;
  7873. var onChange = function onChange(type) {
  7874. return function () {
  7875. _this.onChange(type);
  7876. };
  7877. };
  7878. return h("div", {
  7879. "class": stepper_bem()
  7880. }, [h("button", {
  7881. "class": stepper_bem('minus', {
  7882. disabled: this.minusDisabled
  7883. }),
  7884. "on": {
  7885. "click": onChange('minus')
  7886. }
  7887. }), h("input", {
  7888. "attrs": {
  7889. "type": "number",
  7890. "disabled": this.disabled || this.disableInput
  7891. },
  7892. "class": stepper_bem('input'),
  7893. "domProps": {
  7894. "value": this.currentValue
  7895. },
  7896. "style": {
  7897. width: this.inputWidth
  7898. },
  7899. "on": {
  7900. "input": this.onInput,
  7901. "focus": this.onFocus,
  7902. "blur": this.onBlur
  7903. }
  7904. }), h("button", {
  7905. "class": stepper_bem('plus', {
  7906. disabled: this.plusDisabled
  7907. }),
  7908. "on": {
  7909. "click": onChange('plus')
  7910. }
  7911. })]);
  7912. }
  7913. }));
  7914. // CONCATENATED MODULE: ./es/sku/components/SkuStepper.js
  7915. var SkuStepper_use = Object(utils["k" /* use */])('sku-stepper'),
  7916. SkuStepper_sfc = SkuStepper_use[0];
  7917. var QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT,
  7918. STOCK_LIMIT = LIMIT_TYPE.STOCK_LIMIT;
  7919. /* harmony default export */ var SkuStepper = (SkuStepper_sfc({
  7920. props: {
  7921. quota: Number,
  7922. quotaUsed: Number,
  7923. hideStock: Boolean,
  7924. skuEventBus: Object,
  7925. skuStockNum: Number,
  7926. selectedSku: Object,
  7927. selectedNum: Number,
  7928. stepperTitle: String,
  7929. hideQuotaText: Boolean,
  7930. selectedSkuComb: Object,
  7931. disableStepperInput: Boolean,
  7932. customStepperConfig: Object
  7933. },
  7934. data: function data() {
  7935. return {
  7936. currentNum: this.selectedNum,
  7937. // 购买限制类型: 限购/库存
  7938. limitType: STOCK_LIMIT
  7939. };
  7940. },
  7941. watch: {
  7942. currentNum: function currentNum(num) {
  7943. this.skuEventBus.$emit('sku:numChange', num);
  7944. },
  7945. stepperLimit: function stepperLimit(limit) {
  7946. if (limit < this.currentNum) {
  7947. this.currentNum = limit;
  7948. }
  7949. }
  7950. },
  7951. computed: {
  7952. stock: function stock() {
  7953. var stockNum = this.customStepperConfig.stockNum;
  7954. if (stockNum !== undefined) {
  7955. return stockNum;
  7956. }
  7957. if (this.selectedSkuComb) {
  7958. return this.selectedSkuComb.stock_num;
  7959. }
  7960. return this.skuStockNum;
  7961. },
  7962. stockText: function stockText() {
  7963. var stockFormatter = this.customStepperConfig.stockFormatter;
  7964. if (stockFormatter) return stockFormatter(this.stock);
  7965. return "\u5269\u4F59" + this.stock + "\u4EF6";
  7966. },
  7967. quotaText: function quotaText() {
  7968. var _this$customStepperCo = this.customStepperConfig,
  7969. quotaText = _this$customStepperCo.quotaText,
  7970. hideQuotaText = _this$customStepperCo.hideQuotaText;
  7971. if (hideQuotaText) return '';
  7972. var text = '';
  7973. if (quotaText) {
  7974. text = quotaText;
  7975. } else if (this.quota > 0) {
  7976. text = "\u6BCF\u4EBA\u9650\u8D2D" + this.quota + "\u4EF6";
  7977. }
  7978. return text;
  7979. },
  7980. stepperLimit: function stepperLimit() {
  7981. var quotaLimit = this.quota - this.quotaUsed;
  7982. var limit; // 无限购时直接取库存,有限购时取限购数和库存数中小的那个
  7983. if (this.quota > 0 && quotaLimit <= this.stock) {
  7984. // 修正负的limit
  7985. limit = quotaLimit < 0 ? 0 : quotaLimit;
  7986. this.limitType = QUOTA_LIMIT;
  7987. } else {
  7988. limit = this.stock;
  7989. this.limitType = STOCK_LIMIT;
  7990. }
  7991. return limit;
  7992. }
  7993. },
  7994. methods: {
  7995. setCurrentNum: function setCurrentNum(num) {
  7996. this.currentNum = num;
  7997. },
  7998. onOverLimit: function onOverLimit(action) {
  7999. this.skuEventBus.$emit('sku:overLimit', {
  8000. action: action,
  8001. limitType: this.limitType,
  8002. quota: this.quota,
  8003. quotaUsed: this.quotaUsed
  8004. });
  8005. },
  8006. onChange: function onChange(currentValue) {
  8007. var handleStepperChange = this.customStepperConfig.handleStepperChange;
  8008. handleStepperChange && handleStepperChange(currentValue);
  8009. this.$emit('change', currentValue);
  8010. }
  8011. },
  8012. render: function render(h) {
  8013. var _this = this;
  8014. return h("div", {
  8015. "class": "van-sku-stepper-stock"
  8016. }, [h("div", {
  8017. "class": "van-sku-stepper-container"
  8018. }, [h("div", {
  8019. "class": "van-sku__stepper-title"
  8020. }, [this.stepperTitle || '购买数量', "\uFF1A"]), h(stepper, {
  8021. "class": "van-sku__stepper",
  8022. "attrs": {
  8023. "max": this.stepperLimit,
  8024. "disableInput": this.disableStepperInput
  8025. },
  8026. "on": {
  8027. "overlimit": this.onOverLimit,
  8028. "change": this.onChange
  8029. },
  8030. "model": {
  8031. value: _this.currentNum,
  8032. callback: function callback($$v) {
  8033. _this.currentNum = $$v;
  8034. }
  8035. }
  8036. })]), !this.hideStock && h("div", {
  8037. "class": "van-sku__stock"
  8038. }, [this.stockText]), !this.hideQuotaText && this.quotaText && h("div", {
  8039. "class": "van-sku__quota"
  8040. }, [this.quotaText])]);
  8041. }
  8042. }));
  8043. // CONCATENATED MODULE: ./es/utils/validate/email.js
  8044. /* eslint-disable */
  8045. function isEmail(value) {
  8046. var reg = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
  8047. return reg.test(value);
  8048. }
  8049. // CONCATENATED MODULE: ./es/uploader/index.js
  8050. var uploader_use = Object(utils["k" /* use */])('uploader'),
  8051. uploader_sfc = uploader_use[0],
  8052. uploader_bem = uploader_use[1];
  8053. /* harmony default export */ var uploader = (uploader_sfc({
  8054. inheritAttrs: false,
  8055. props: {
  8056. disabled: Boolean,
  8057. beforeRead: Function,
  8058. afterRead: Function,
  8059. accept: {
  8060. type: String,
  8061. "default": 'image/*'
  8062. },
  8063. resultType: {
  8064. type: String,
  8065. "default": 'dataUrl'
  8066. },
  8067. maxSize: {
  8068. type: Number,
  8069. "default": Number.MAX_VALUE
  8070. }
  8071. },
  8072. computed: {
  8073. detail: function detail() {
  8074. return {
  8075. name: this.$attrs.name || ''
  8076. };
  8077. }
  8078. },
  8079. methods: {
  8080. onChange: function onChange(event) {
  8081. var _this = this;
  8082. var files = event.target.files;
  8083. if (this.disabled || !files.length) {
  8084. return;
  8085. }
  8086. files = files.length === 1 ? files[0] : [].slice.call(files, 0);
  8087. if (!files || this.beforeRead && !this.beforeRead(files, this.detail)) {
  8088. this.resetInput();
  8089. return;
  8090. }
  8091. if (Array.isArray(files)) {
  8092. Promise.all(files.map(this.readFile)).then(function (contents) {
  8093. var oversize = false;
  8094. var payload = files.map(function (file, index) {
  8095. if (file.size > _this.maxSize) {
  8096. oversize = true;
  8097. }
  8098. return {
  8099. file: files[index],
  8100. content: contents[index]
  8101. };
  8102. });
  8103. _this.onAfterRead(payload, oversize);
  8104. });
  8105. } else {
  8106. this.readFile(files).then(function (content) {
  8107. _this.onAfterRead({
  8108. file: files,
  8109. content: content
  8110. }, files.size > _this.maxSize);
  8111. });
  8112. }
  8113. },
  8114. readFile: function readFile(file) {
  8115. var _this2 = this;
  8116. return new Promise(function (resolve) {
  8117. var reader = new FileReader();
  8118. reader.onload = function (event) {
  8119. resolve(event.target.result);
  8120. };
  8121. if (_this2.resultType === 'dataUrl') {
  8122. reader.readAsDataURL(file);
  8123. } else if (_this2.resultType === 'text') {
  8124. reader.readAsText(file);
  8125. }
  8126. });
  8127. },
  8128. onAfterRead: function onAfterRead(files, oversize) {
  8129. if (oversize) {
  8130. this.$emit('oversize', files);
  8131. } else {
  8132. this.afterRead && this.afterRead(files, this.detail);
  8133. }
  8134. this.resetInput();
  8135. },
  8136. resetInput: function resetInput() {
  8137. if (this.$refs.input) {
  8138. this.$refs.input.value = '';
  8139. }
  8140. }
  8141. },
  8142. render: function render(h) {
  8143. var accept = this.accept,
  8144. disabled = this.disabled;
  8145. return h("div", {
  8146. "class": uploader_bem()
  8147. }, [this.slots(), h("input", {
  8148. "attrs": _extends({}, this.$attrs, {
  8149. "type": "file",
  8150. "accept": accept,
  8151. "disabled": disabled
  8152. }),
  8153. "ref": "input",
  8154. "class": uploader_bem('input'),
  8155. "on": {
  8156. "change": this.onChange
  8157. }
  8158. })]);
  8159. }
  8160. }));
  8161. // CONCATENATED MODULE: ./es/sku/components/SkuImgUploader.js
  8162. var SkuImgUploader_use = Object(utils["k" /* use */])('sku-img-uploader'),
  8163. SkuImgUploader_sfc = SkuImgUploader_use[0],
  8164. SkuImgUploader_bem = SkuImgUploader_use[1];
  8165. /* harmony default export */ var SkuImgUploader = (SkuImgUploader_sfc({
  8166. props: {
  8167. value: String,
  8168. uploadImg: Function,
  8169. maxSize: {
  8170. type: Number,
  8171. "default": 6
  8172. }
  8173. },
  8174. data: function data() {
  8175. return {
  8176. // 正在上传的图片 base64
  8177. paddingImg: ''
  8178. };
  8179. },
  8180. computed: {
  8181. imgList: function imgList() {
  8182. return this.value && !this.paddingImg ? [this.value] : [];
  8183. }
  8184. },
  8185. methods: {
  8186. afterReadFile: function afterReadFile(file) {
  8187. var _this = this; // 上传文件
  8188. this.paddingImg = file.content;
  8189. this.uploadImg(file.file, file.content).then(function (img) {
  8190. _this.$emit('input', img);
  8191. _this.$nextTick(function () {
  8192. _this.paddingImg = '';
  8193. });
  8194. })["catch"](function () {
  8195. _this.paddingImg = '';
  8196. });
  8197. },
  8198. onOversize: function onOversize() {
  8199. this.$toast("\u6700\u5927\u53EF\u4E0A\u4F20\u56FE\u7247\u4E3A" + this.maxSize + "MB\uFF0C\u8BF7\u5C1D\u8BD5\u538B\u7F29\u56FE\u7247\u5C3A\u5BF8");
  8200. }
  8201. },
  8202. render: function render(h) {
  8203. var _this2 = this;
  8204. var imgList = this.imgList,
  8205. paddingImg = this.paddingImg;
  8206. var ImageList = (paddingImg || imgList.length > 0) && h("div", {
  8207. "class": "van-clearfix"
  8208. }, [imgList.map(function (img) {
  8209. return h("div", {
  8210. "class": SkuImgUploader_bem('img')
  8211. }, [h("img", {
  8212. "attrs": {
  8213. "src": img
  8214. }
  8215. }), h(es_icon, {
  8216. "attrs": {
  8217. "name": "clear"
  8218. },
  8219. "class": SkuImgUploader_bem('delete'),
  8220. "on": {
  8221. "click": function click() {
  8222. _this2.$emit('input', '');
  8223. }
  8224. }
  8225. })]);
  8226. }), paddingImg && h("div", {
  8227. "class": SkuImgUploader_bem('img')
  8228. }, [h("img", {
  8229. "attrs": {
  8230. "src": paddingImg
  8231. }
  8232. }), h(es_loading, {
  8233. "attrs": {
  8234. "type": "spinner"
  8235. },
  8236. "class": SkuImgUploader_bem('uploading')
  8237. })])]);
  8238. return h("div", {
  8239. "class": SkuImgUploader_bem()
  8240. }, [h(uploader, {
  8241. "attrs": {
  8242. "disabled": !!paddingImg,
  8243. "afterRead": this.afterReadFile,
  8244. "maxSize": this.maxSize * 1024 * 1024
  8245. },
  8246. "on": {
  8247. "oversize": this.onOversize
  8248. }
  8249. }, [h("div", {
  8250. "class": SkuImgUploader_bem('header')
  8251. }, [paddingImg ? h("div", ["\u6B63\u5728\u4E0A\u4F20..."]) : [h(es_icon, {
  8252. "attrs": {
  8253. "name": "photograph"
  8254. }
  8255. }), h("span", {
  8256. "class": "label"
  8257. }, [this.value ? '重拍' : '拍照', " \u6216 "]), h(es_icon, {
  8258. "attrs": {
  8259. "name": "photo"
  8260. }
  8261. }), h("span", {
  8262. "class": "label"
  8263. }, [this.value ? '重新选择照片' : '选择照片'])]])]), ImageList]);
  8264. }
  8265. }));
  8266. // CONCATENATED MODULE: ./es/sku/components/SkuMessages.js
  8267. var SkuMessages_use = Object(utils["k" /* use */])('sku-messages'),
  8268. SkuMessages_sfc = SkuMessages_use[0],
  8269. SkuMessages_bem = SkuMessages_use[1];
  8270. var PLACEHOLDER = {
  8271. id_no: '输入身份证号码',
  8272. text: '输入文本',
  8273. tel: '输入数字',
  8274. email: '输入邮箱',
  8275. date: '点击选择日期',
  8276. time: '点击选择时间',
  8277. textarea: '点击填写段落文本',
  8278. mobile: '输入手机号码'
  8279. };
  8280. /* harmony default export */ var SkuMessages = (SkuMessages_sfc({
  8281. props: {
  8282. messages: Array,
  8283. messageConfig: Object,
  8284. goodsId: [Number, String]
  8285. },
  8286. data: function data() {
  8287. return {
  8288. messageValues: this.resetMessageValues(this.messages)
  8289. };
  8290. },
  8291. watch: {
  8292. messages: function messages(val) {
  8293. this.messageValues = this.resetMessageValues(val);
  8294. }
  8295. },
  8296. methods: {
  8297. resetMessageValues: function resetMessageValues(messages) {
  8298. return (messages || []).map(function () {
  8299. return {
  8300. value: ''
  8301. };
  8302. });
  8303. },
  8304. getType: function getType(message) {
  8305. if (+message.multiple === 1) {
  8306. return 'textarea';
  8307. }
  8308. if (message.type === 'id_no') {
  8309. return 'text';
  8310. }
  8311. return message.datetime > 0 ? 'datetime-local' : message.type;
  8312. },
  8313. getMessages: function getMessages() {
  8314. var _this = this;
  8315. var messages = {};
  8316. this.messageValues.forEach(function (item, index) {
  8317. var value = item.value;
  8318. if (_this.messages[index].datetime > 0) {
  8319. value = value.replace(/T/g, ' ');
  8320. }
  8321. messages["message_" + index] = value;
  8322. });
  8323. return messages;
  8324. },
  8325. getCartMessages: function getCartMessages() {
  8326. var _this2 = this;
  8327. var messages = {};
  8328. this.messageValues.forEach(function (item, index) {
  8329. var value = item.value;
  8330. var message = _this2.messages[index];
  8331. if (message.datetime > 0) {
  8332. value = value.replace(/T/g, ' ');
  8333. }
  8334. messages[message.name] = value;
  8335. });
  8336. return messages;
  8337. },
  8338. getPlaceholder: function getPlaceholder(message) {
  8339. var type = +message.multiple === 1 ? 'textarea' : message.type;
  8340. var map = this.messageConfig.placeholderMap || {};
  8341. return map[type] || PLACEHOLDER[type];
  8342. },
  8343. validateMessages: function validateMessages() {
  8344. var values = this.messageValues;
  8345. for (var i = 0; i < values.length; i++) {
  8346. var value = values[i].value;
  8347. var message = this.messages[i];
  8348. if (value === '') {
  8349. // 必填字段的校验
  8350. if (String(message.required) === '1') {
  8351. // eslint-disable-line
  8352. var textType = message.type === 'image' ? '请上传' : '请填写';
  8353. return textType + message.name;
  8354. }
  8355. } else {
  8356. if (message.type === 'tel' && !isNumber(value)) {
  8357. return '请填写正确的数字格式留言';
  8358. }
  8359. if (message.type === 'mobile' && !/^\d{6,20}$/.test(value)) {
  8360. return '手机号长度为6-20位数字';
  8361. }
  8362. if (message.type === 'email' && !isEmail(value)) {
  8363. return '请填写正确的邮箱';
  8364. }
  8365. if (message.type === 'id_no' && (value.length < 15 || value.length > 18)) {
  8366. return '请填写正确的身份证号码';
  8367. }
  8368. }
  8369. }
  8370. }
  8371. },
  8372. render: function render(h) {
  8373. var _this3 = this;
  8374. return h(cell_group, {
  8375. "class": SkuMessages_bem()
  8376. }, [this.messages.map(function (message, index) {
  8377. return message.type === 'image' ? h(cell, {
  8378. "class": SkuMessages_bem('image-cell'),
  8379. "attrs": {
  8380. "label": "仅限一张",
  8381. "title": message.name,
  8382. "required": String(message.required) === '1'
  8383. },
  8384. "key": _this3.goodsId + "-" + index
  8385. }, [h(SkuImgUploader, {
  8386. "attrs": {
  8387. "uploadImg": _this3.messageConfig.uploadImg,
  8388. "maxSize": _this3.messageConfig.uploadMaxSize
  8389. },
  8390. "model": {
  8391. value: _this3.messageValues[index].value,
  8392. callback: function callback($$v) {
  8393. _this3.messageValues[index].value = $$v;
  8394. }
  8395. }
  8396. })]) : h(field, {
  8397. "attrs": {
  8398. "maxlength": "200",
  8399. "label": message.name,
  8400. "required": String(message.required) === '1',
  8401. "placeholder": _this3.getPlaceholder(message),
  8402. "type": _this3.getType(message)
  8403. },
  8404. "key": _this3.goodsId + "-" + index,
  8405. "model": {
  8406. value: _this3.messageValues[index].value,
  8407. callback: function callback($$v) {
  8408. _this3.messageValues[index].value = $$v;
  8409. }
  8410. }
  8411. });
  8412. })]);
  8413. }
  8414. }));
  8415. // CONCATENATED MODULE: ./es/sku/components/SkuActions.js
  8416. // Types
  8417. var SkuActions_use = Object(utils["k" /* use */])('sku-actions'),
  8418. SkuActions_sfc = SkuActions_use[0],
  8419. SkuActions_bem = SkuActions_use[1];
  8420. function SkuActions(h, props, slots, ctx) {
  8421. var emit = function emit(name) {
  8422. return function () {
  8423. props.skuEventBus.$emit(name);
  8424. };
  8425. };
  8426. return h("div", helper_default()([{
  8427. "class": SkuActions_bem()
  8428. }, inherit(ctx)]), [props.showAddCartBtn && h(es_button, {
  8429. "attrs": {
  8430. "bottomAction": true,
  8431. "text": "加入购物车"
  8432. },
  8433. "on": {
  8434. "click": emit('sku:addCart')
  8435. }
  8436. }), h(es_button, {
  8437. "attrs": {
  8438. "type": "primary",
  8439. "bottomAction": true,
  8440. "text": props.buyText || '立即购买'
  8441. },
  8442. "on": {
  8443. "click": emit('sku:buy')
  8444. }
  8445. })]);
  8446. }
  8447. SkuActions.props = {
  8448. buyText: String,
  8449. skuEventBus: Object,
  8450. showAddCartBtn: Boolean
  8451. };
  8452. /* harmony default export */ var components_SkuActions = (SkuActions_sfc(SkuActions));
  8453. // CONCATENATED MODULE: ./es/sku/Sku.js
  8454. /* eslint-disable camelcase */
  8455. var Sku_use = Object(utils["k" /* use */])('sku'),
  8456. Sku_sfc = Sku_use[0];
  8457. var Sku_QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT;
  8458. /* harmony default export */ var Sku = (Sku_sfc({
  8459. props: {
  8460. sku: Object,
  8461. goods: Object,
  8462. quota: Number,
  8463. value: Boolean,
  8464. buyText: String,
  8465. quotaUsed: Number,
  8466. goodsId: [Number, String],
  8467. hideStock: Boolean,
  8468. hideQuotaText: Boolean,
  8469. stepperTitle: String,
  8470. getContainer: Function,
  8471. customSkuValidator: Function,
  8472. closeOnClickOverlay: Boolean,
  8473. disableStepperInput: Boolean,
  8474. resetStepperOnHide: Boolean,
  8475. resetSelectedSkuOnHide: Boolean,
  8476. initialSku: {
  8477. type: Object,
  8478. "default": function _default() {
  8479. return {};
  8480. }
  8481. },
  8482. showSoldoutSku: {
  8483. type: Boolean,
  8484. "default": true
  8485. },
  8486. showAddCartBtn: {
  8487. type: Boolean,
  8488. "default": true
  8489. },
  8490. bodyOffsetTop: {
  8491. type: Number,
  8492. "default": 200
  8493. },
  8494. messageConfig: {
  8495. type: Object,
  8496. "default": function _default() {
  8497. return {
  8498. placeholderMap: {},
  8499. uploadImg: function uploadImg() {
  8500. return Promise.resolve();
  8501. },
  8502. uploadMaxSize: 5
  8503. };
  8504. }
  8505. },
  8506. customStepperConfig: {
  8507. type: Object,
  8508. "default": function _default() {
  8509. return {};
  8510. }
  8511. }
  8512. },
  8513. data: function data() {
  8514. return {
  8515. selectedSku: {},
  8516. selectedNum: 1,
  8517. show: this.value
  8518. };
  8519. },
  8520. watch: {
  8521. show: function show(val) {
  8522. this.$emit('input', val);
  8523. if (!val) {
  8524. var selectedSkuValues = skuHelper_getSelectedSkuValues(this.sku.tree, this.selectedSku);
  8525. this.$emit('sku-close', {
  8526. selectedSkuValues: selectedSkuValues,
  8527. selectedNum: this.selectedNum,
  8528. selectedSkuComb: this.selectedSkuComb
  8529. });
  8530. if (this.resetStepperOnHide) {
  8531. this.resetStepper();
  8532. }
  8533. if (this.resetSelectedSkuOnHide) {
  8534. this.resetSelectedSku(this.skuTree);
  8535. }
  8536. }
  8537. },
  8538. value: function value(val) {
  8539. this.show = val;
  8540. },
  8541. skuTree: function skuTree(val) {
  8542. this.resetSelectedSku(val);
  8543. }
  8544. },
  8545. computed: {
  8546. skuGroupClass: function skuGroupClass() {
  8547. return ['van-sku-group-container', 'van-hairline--bottom', {
  8548. 'van-sku-group-container--hide-soldout': !this.showSoldoutSku
  8549. }];
  8550. },
  8551. bodyStyle: function bodyStyle() {
  8552. if (this.$isServer) {
  8553. return;
  8554. } // header高度82px, sku actions高度50px,如果改动了样式自己传下bodyOffsetTop调整下
  8555. var maxHeight = window.innerHeight - this.bodyOffsetTop;
  8556. return {
  8557. maxHeight: maxHeight + 'px'
  8558. };
  8559. },
  8560. isSkuCombSelected: function isSkuCombSelected() {
  8561. return skuHelper_isAllSelected(this.sku.tree, this.selectedSku);
  8562. },
  8563. isSkuEmpty: function isSkuEmpty() {
  8564. return Object.keys(this.sku).length === 0;
  8565. },
  8566. hasSku: function hasSku() {
  8567. return !this.sku.none_sku;
  8568. },
  8569. selectedSkuComb: function selectedSkuComb() {
  8570. if (!this.hasSku) {
  8571. return {
  8572. id: this.sku.collection_id,
  8573. price: Math.round(this.sku.price * 100),
  8574. stock_num: this.sku.stock_num
  8575. };
  8576. }
  8577. if (this.isSkuCombSelected) {
  8578. return getSkuComb(this.sku.list, this.selectedSku);
  8579. }
  8580. return null;
  8581. },
  8582. price: function price() {
  8583. if (this.selectedSkuComb) {
  8584. return (this.selectedSkuComb.price / 100).toFixed(2);
  8585. } // sku.price是一个格式化好的价格区间
  8586. return this.sku.price;
  8587. },
  8588. skuTree: function skuTree() {
  8589. return this.sku.tree || [];
  8590. },
  8591. imageList: function imageList() {
  8592. var imageList = [this.goods.picture];
  8593. if (this.skuTree.length > 0) {
  8594. var treeItem = this.skuTree.filter(function (item) {
  8595. return item.k_s === 's1';
  8596. })[0] || {};
  8597. if (!treeItem.v) {
  8598. return;
  8599. }
  8600. treeItem.v.forEach(function (vItem) {
  8601. var img = vItem.imgUrl || vItem.img_url;
  8602. if (img) {
  8603. imageList.push(img);
  8604. }
  8605. });
  8606. }
  8607. return imageList;
  8608. }
  8609. },
  8610. created: function created() {
  8611. var skuEventBus = new external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a();
  8612. this.skuEventBus = skuEventBus;
  8613. skuEventBus.$on('sku:close', this.onClose);
  8614. skuEventBus.$on('sku:select', this.onSelect);
  8615. skuEventBus.$on('sku:numChange', this.onNumChange);
  8616. skuEventBus.$on('sku:previewImage', this.onPreviewImage);
  8617. skuEventBus.$on('sku:overLimit', this.onOverLimit);
  8618. skuEventBus.$on('sku:addCart', this.onAddCart);
  8619. skuEventBus.$on('sku:buy', this.onBuy);
  8620. this.resetStepper();
  8621. this.resetSelectedSku(this.skuTree); // 组件初始化后的钩子,抛出skuEventBus
  8622. this.$emit('after-sku-create', skuEventBus);
  8623. },
  8624. methods: {
  8625. resetStepper: function resetStepper() {
  8626. var skuStepper = this.$refs.skuStepper;
  8627. var selectedNum = this.initialSku.selectedNum;
  8628. var num = Object(utils["d" /* isDef */])(selectedNum) ? selectedNum : 1;
  8629. if (skuStepper) {
  8630. skuStepper.setCurrentNum(num);
  8631. } else {
  8632. this.selectedNum = num;
  8633. }
  8634. },
  8635. resetSelectedSku: function resetSelectedSku(skuTree) {
  8636. var _this = this;
  8637. this.selectedSku = {}; // 重置 selectedSku
  8638. skuTree.forEach(function (item) {
  8639. _this.selectedSku[item.k_s] = _this.initialSku[item.k_s] || UNSELECTED_SKU_VALUE_ID;
  8640. }); // 只有一个 sku 规格值时默认选中
  8641. skuTree.forEach(function (item) {
  8642. var key = item.k_s;
  8643. var valueId = item.v[0].id;
  8644. if (item.v.length === 1 && skuHelper_isSkuChoosable(_this.sku.list, _this.selectedSku, {
  8645. key: key,
  8646. valueId: valueId
  8647. })) {
  8648. _this.selectedSku[key] = valueId;
  8649. }
  8650. });
  8651. },
  8652. getSkuMessages: function getSkuMessages() {
  8653. return this.$refs.skuMessages ? this.$refs.skuMessages.getMessages() : {};
  8654. },
  8655. getSkuCartMessages: function getSkuCartMessages() {
  8656. return this.$refs.skuMessages ? this.$refs.skuMessages.getCartMessages() : {};
  8657. },
  8658. validateSkuMessages: function validateSkuMessages() {
  8659. return this.$refs.skuMessages ? this.$refs.skuMessages.validateMessages() : '';
  8660. },
  8661. validateSku: function validateSku() {
  8662. if (this.selectedNum === 0) {
  8663. return '商品已经无法购买啦';
  8664. }
  8665. if (this.isSkuCombSelected) {
  8666. return this.validateSkuMessages();
  8667. } // 自定义sku校验
  8668. if (this.customSkuValidator) {
  8669. var err = this.customSkuValidator(this);
  8670. if (err) return err;
  8671. }
  8672. return '请先选择商品规格';
  8673. },
  8674. onClose: function onClose() {
  8675. this.show = false;
  8676. },
  8677. onSelect: function onSelect(skuValue) {
  8678. var _extends2, _extends3; // 点击已选中的sku时则取消选中
  8679. this.selectedSku = this.selectedSku[skuValue.skuKeyStr] === skuValue.id ? _extends({}, this.selectedSku, (_extends2 = {}, _extends2[skuValue.skuKeyStr] = UNSELECTED_SKU_VALUE_ID, _extends2)) : _extends({}, this.selectedSku, (_extends3 = {}, _extends3[skuValue.skuKeyStr] = skuValue.id, _extends3));
  8680. this.$emit('sku-selected', {
  8681. skuValue: skuValue,
  8682. selectedSku: this.selectedSku,
  8683. selectedSkuComb: this.selectedSkuComb
  8684. });
  8685. },
  8686. onNumChange: function onNumChange(num) {
  8687. this.selectedNum = num;
  8688. },
  8689. onPreviewImage: function onPreviewImage(indexImage) {
  8690. var _this2 = this;
  8691. var index = this.imageList.findIndex(function (image) {
  8692. return image === indexImage;
  8693. });
  8694. var cbParams = {
  8695. index: index,
  8696. imageList: this.imageList,
  8697. indexImage: indexImage
  8698. };
  8699. this.$emit('preview-on', cbParams);
  8700. image_preview({
  8701. images: this.imageList,
  8702. startPosition: index,
  8703. onClose: function onClose() {
  8704. _this2.$emit('preview-close', cbParams);
  8705. }
  8706. });
  8707. },
  8708. onOverLimit: function onOverLimit(data) {
  8709. var action = data.action,
  8710. limitType = data.limitType,
  8711. quota = data.quota,
  8712. quotaUsed = data.quotaUsed;
  8713. var handleOverLimit = this.customStepperConfig.handleOverLimit;
  8714. if (handleOverLimit) {
  8715. handleOverLimit(data);
  8716. return;
  8717. }
  8718. if (action === 'minus') {
  8719. es_toast('至少选择一件');
  8720. } else if (action === 'plus') {
  8721. if (limitType === Sku_QUOTA_LIMIT) {
  8722. var msg = "\u9650\u8D2D" + quota + "\u4EF6";
  8723. if (quotaUsed > 0) msg += "\uFF0C" + ("\u4F60\u5DF2\u8D2D\u4E70" + quotaUsed + "\u4EF6");
  8724. es_toast(msg);
  8725. } else {
  8726. es_toast('库存不足');
  8727. }
  8728. }
  8729. },
  8730. onAddCart: function onAddCart() {
  8731. this.onBuyOrAddCart('add-cart');
  8732. },
  8733. onBuy: function onBuy() {
  8734. this.onBuyOrAddCart('buy-clicked');
  8735. },
  8736. onBuyOrAddCart: function onBuyOrAddCart(type) {
  8737. var error = this.validateSku();
  8738. if (error) {
  8739. es_toast(error);
  8740. } else {
  8741. this.$emit(type, this.getSkuData());
  8742. }
  8743. },
  8744. getSkuData: function getSkuData() {
  8745. return {
  8746. goodsId: this.goodsId,
  8747. selectedNum: this.selectedNum,
  8748. selectedSkuComb: this.selectedSkuComb,
  8749. messages: this.getSkuMessages(),
  8750. cartMessages: this.getSkuCartMessages()
  8751. };
  8752. }
  8753. },
  8754. render: function render(h) {
  8755. var _this3 = this;
  8756. if (this.isSkuEmpty) {
  8757. return;
  8758. }
  8759. var sku = this.sku,
  8760. goods = this.goods,
  8761. price = this.price,
  8762. skuEventBus = this.skuEventBus,
  8763. selectedSku = this.selectedSku,
  8764. selectedNum = this.selectedNum,
  8765. stepperTitle = this.stepperTitle,
  8766. hideQuotaText = this.hideQuotaText,
  8767. selectedSkuComb = this.selectedSkuComb;
  8768. var slotsProps = {
  8769. price: price,
  8770. selectedNum: selectedNum,
  8771. skuEventBus: skuEventBus,
  8772. selectedSku: selectedSku,
  8773. selectedSkuComb: selectedSkuComb
  8774. };
  8775. var slots = function slots(name) {
  8776. return _this3.slots(name, slotsProps);
  8777. };
  8778. var Header = slots('sku-header') || h(components_SkuHeader, {
  8779. "attrs": {
  8780. "sku": sku,
  8781. "goods": goods,
  8782. "skuEventBus": skuEventBus,
  8783. "selectedSku": selectedSku
  8784. }
  8785. }, [slots('sku-header-price') || h("div", {
  8786. "class": "van-sku__goods-price"
  8787. }, [h("span", {
  8788. "class": "van-sku__price-symbol"
  8789. }, ["\uFFE5"]), h("span", {
  8790. "class": "van-sku__price-num"
  8791. }, [price])])]);
  8792. var Group = slots('sku-group') || this.hasSku && h("div", {
  8793. "class": this.skuGroupClass
  8794. }, [this.skuTree.map(function (skuTreeItem) {
  8795. return h(components_SkuRow, {
  8796. "attrs": {
  8797. "skuRow": skuTreeItem
  8798. }
  8799. }, [skuTreeItem.v.map(function (skuValue) {
  8800. return h(SkuRowItem, {
  8801. "attrs": {
  8802. "skuList": sku.list,
  8803. "skuValue": skuValue,
  8804. "selectedSku": selectedSku,
  8805. "skuEventBus": skuEventBus,
  8806. "skuKeyStr": skuTreeItem.k_s
  8807. }
  8808. });
  8809. })]);
  8810. })]);
  8811. var Stepper = slots('sku-stepper') || h(SkuStepper, {
  8812. "ref": "skuStepper",
  8813. "attrs": {
  8814. "quota": this.quota,
  8815. "hideStock": this.hideStock,
  8816. "quotaUsed": this.quotaUsed,
  8817. "skuEventBus": skuEventBus,
  8818. "selectedNum": selectedNum,
  8819. "selectedSku": selectedSku,
  8820. "stepperTitle": stepperTitle,
  8821. "skuStockNum": sku.stock_num,
  8822. "hideQuotaText": hideQuotaText,
  8823. "selectedSkuComb": selectedSkuComb,
  8824. "disableStepperInput": this.disableStepperInput,
  8825. "customStepperConfig": this.customStepperConfig
  8826. },
  8827. "on": {
  8828. "change": function change(event) {
  8829. _this3.$emit('stepper-change', event);
  8830. }
  8831. }
  8832. });
  8833. var Messages = slots('sku-messages') || h(SkuMessages, {
  8834. "ref": "skuMessages",
  8835. "attrs": {
  8836. "goodsId": this.goodsId,
  8837. "messageConfig": this.messageConfig,
  8838. "messages": sku.messages
  8839. }
  8840. });
  8841. var Actions = slots('sku-actions') || h(components_SkuActions, {
  8842. "attrs": {
  8843. "buyText": this.buyText,
  8844. "skuEventBus": skuEventBus,
  8845. "showAddCartBtn": this.showAddCartBtn
  8846. }
  8847. });
  8848. return h(popup, {
  8849. "attrs": {
  8850. "position": "bottom",
  8851. "getContainer": this.getContainer,
  8852. "closeOnClickOverlay": this.closeOnClickOverlay
  8853. },
  8854. "class": "van-sku-container",
  8855. "model": {
  8856. value: _this3.show,
  8857. callback: function callback($$v) {
  8858. _this3.show = $$v;
  8859. }
  8860. }
  8861. }, [Header, h("div", {
  8862. "class": "van-sku-body",
  8863. "style": this.bodyStyle
  8864. }, [slots('sku-body-top'), Group, slots('extra-sku-group'), Stepper, Messages]), Actions]);
  8865. }
  8866. }));
  8867. // CONCATENATED MODULE: ./es/sku/index.js
  8868. Sku.SkuActions = components_SkuActions;
  8869. Sku.SkuHeader = components_SkuHeader;
  8870. Sku.SkuMessages = SkuMessages;
  8871. Sku.SkuStepper = SkuStepper;
  8872. Sku.SkuRow = components_SkuRow;
  8873. Sku.SkuRowItem = SkuRowItem;
  8874. Sku.skuHelper = skuHelper;
  8875. Sku.skuConstants = constants;
  8876. /* harmony default export */ var es_sku = (Sku);
  8877. // CONCATENATED MODULE: ./es/slider/index.js
  8878. var slider_use = Object(utils["k" /* use */])('slider'),
  8879. slider_sfc = slider_use[0],
  8880. slider_bem = slider_use[1];
  8881. /* harmony default export */ var slider = (slider_sfc({
  8882. mixins: [TouchMixin],
  8883. props: {
  8884. min: Number,
  8885. value: Number,
  8886. disabled: Boolean,
  8887. vertical: Boolean,
  8888. activeColor: String,
  8889. inactiveColor: String,
  8890. max: {
  8891. type: Number,
  8892. "default": 100
  8893. },
  8894. step: {
  8895. type: Number,
  8896. "default": 1
  8897. },
  8898. barHeight: {
  8899. type: String,
  8900. "default": '2px'
  8901. }
  8902. },
  8903. methods: {
  8904. onTouchStart: function onTouchStart(event) {
  8905. if (this.disabled) return;
  8906. this.touchStart(event);
  8907. this.startValue = this.format(this.value);
  8908. },
  8909. onTouchMove: function onTouchMove(event) {
  8910. preventDefault(event, true);
  8911. if (this.disabled) return;
  8912. this.touchMove(event);
  8913. var rect = this.$el.getBoundingClientRect();
  8914. var delta = this.vertical ? this.deltaY : this.deltaX;
  8915. var total = this.vertical ? rect.height : rect.width;
  8916. var diff = delta / total * 100;
  8917. this.newValue = this.startValue + diff;
  8918. this.updateValue(this.newValue);
  8919. },
  8920. onTouchEnd: function onTouchEnd() {
  8921. if (this.disabled) return;
  8922. this.updateValue(this.newValue, true);
  8923. },
  8924. onClick: function onClick(event) {
  8925. event.stopPropagation();
  8926. if (this.disabled) return;
  8927. var rect = this.$el.getBoundingClientRect();
  8928. var delta = this.vertical ? event.clientY - rect.top : event.clientX - rect.left;
  8929. var total = this.vertical ? rect.height : rect.width;
  8930. var value = delta / total * 100;
  8931. this.updateValue(value, true);
  8932. },
  8933. updateValue: function updateValue(value, end) {
  8934. value = this.format(value);
  8935. this.$emit('input', value);
  8936. if (end) {
  8937. this.$emit('change', value);
  8938. }
  8939. },
  8940. format: function format(value) {
  8941. return Math.round(Math.max(this.min, Math.min(value, this.max)) / this.step) * this.step;
  8942. }
  8943. },
  8944. render: function render(h) {
  8945. var _barStyle;
  8946. var vertical = this.vertical;
  8947. var style = {
  8948. background: this.inactiveColor
  8949. };
  8950. var mainAxis = vertical ? 'height' : 'width';
  8951. var crossAxis = vertical ? 'width' : 'height';
  8952. var barStyle = (_barStyle = {}, _barStyle[mainAxis] = this.format(this.value) + "%", _barStyle[crossAxis] = this.barHeight, _barStyle.background = this.activeColor, _barStyle);
  8953. return h("div", {
  8954. "style": style,
  8955. "class": slider_bem({
  8956. disabled: this.disabled,
  8957. vertical: vertical
  8958. }),
  8959. "on": {
  8960. "click": this.onClick
  8961. }
  8962. }, [h("div", {
  8963. "class": slider_bem('bar'),
  8964. "style": barStyle
  8965. }, [h("div", {
  8966. "class": slider_bem('button-wrapper'),
  8967. "on": {
  8968. "touchstart": this.onTouchStart,
  8969. "touchmove": this.onTouchMove,
  8970. "touchend": this.onTouchEnd,
  8971. "touchcancel": this.onTouchEnd
  8972. }
  8973. }, [this.slots('button') || h("div", {
  8974. "class": slider_bem('button')
  8975. })])])]);
  8976. }
  8977. }));
  8978. // CONCATENATED MODULE: ./es/step/index.js
  8979. var step_use = Object(utils["k" /* use */])('step'),
  8980. step_sfc = step_use[0],
  8981. step_bem = step_use[1];
  8982. /* harmony default export */ var step = (step_sfc({
  8983. beforeCreate: function beforeCreate() {
  8984. var steps = this.$parent.steps;
  8985. var index = this.$parent.slots().indexOf(this.$vnode);
  8986. steps.splice(index === -1 ? steps.length : index, 0, this);
  8987. },
  8988. beforeDestroy: function beforeDestroy() {
  8989. var index = this.$parent.steps.indexOf(this);
  8990. if (index > -1) {
  8991. this.$parent.steps.splice(index, 1);
  8992. }
  8993. },
  8994. computed: {
  8995. status: function status() {
  8996. var index = this.$parent.steps.indexOf(this);
  8997. var active = this.$parent.active;
  8998. if (index < active) {
  8999. return 'finish';
  9000. }
  9001. if (index === active) {
  9002. return 'process';
  9003. }
  9004. }
  9005. },
  9006. render: function render(h) {
  9007. var _ref;
  9008. var status = this.status;
  9009. var _this$$parent = this.$parent,
  9010. activeIcon = _this$$parent.activeIcon,
  9011. activeColor = _this$$parent.activeColor,
  9012. direction = _this$$parent.direction;
  9013. var titleStyle = status === 'process' && {
  9014. color: activeColor
  9015. };
  9016. return h("div", {
  9017. "class": ['van-hairline', step_bem([direction, (_ref = {}, _ref[status] = status, _ref)])]
  9018. }, [h("div", {
  9019. "class": step_bem('title'),
  9020. "style": titleStyle
  9021. }, [this.slots()]), h("div", {
  9022. "class": step_bem('circle-container')
  9023. }, [status !== 'process' ? h("i", {
  9024. "class": step_bem('circle')
  9025. }) : this.slots('active-icon') || h(es_icon, {
  9026. "attrs": {
  9027. "name": activeIcon
  9028. },
  9029. "style": {
  9030. color: activeColor
  9031. }
  9032. })]), h("div", {
  9033. "class": step_bem('line')
  9034. })]);
  9035. }
  9036. }));
  9037. // CONCATENATED MODULE: ./es/steps/index.js
  9038. var steps_use = Object(utils["k" /* use */])('steps'),
  9039. steps_sfc = steps_use[0],
  9040. steps_bem = steps_use[1];
  9041. /* harmony default export */ var steps = (steps_sfc({
  9042. props: {
  9043. icon: String,
  9044. title: String,
  9045. active: Number,
  9046. iconClass: String,
  9047. description: String,
  9048. direction: {
  9049. type: String,
  9050. "default": 'horizontal'
  9051. },
  9052. activeColor: {
  9053. type: String,
  9054. "default": GREEN
  9055. },
  9056. activeIcon: {
  9057. type: String,
  9058. "default": 'checked'
  9059. }
  9060. },
  9061. data: function data() {
  9062. return {
  9063. steps: []
  9064. };
  9065. },
  9066. render: function render(h) {
  9067. var icon = this.icon,
  9068. title = this.title,
  9069. description = this.description,
  9070. slots = this.slots;
  9071. var StatusIcon = (slots('icon') || icon) && h("div", {
  9072. "class": steps_bem('icon')
  9073. }, [slots('icon') || h(es_icon, {
  9074. "attrs": {
  9075. "name": icon
  9076. },
  9077. "class": this.iconClass
  9078. })]);
  9079. var StatusMessage = h("div", {
  9080. "class": steps_bem('message')
  9081. }, [h("div", {
  9082. "class": steps_bem('title')
  9083. }, [title]), h("div", {
  9084. "class": [steps_bem('desc'), 'van-ellipsis']
  9085. }, [description])]);
  9086. return h("div", {
  9087. "class": steps_bem([this.direction])
  9088. }, [(title || description) && h("div", {
  9089. "class": steps_bem('status')
  9090. }, [StatusIcon, StatusMessage, slots('message-extra')]), h("div", {
  9091. "class": steps_bem('items', {
  9092. alone: !title && !description
  9093. })
  9094. }, [slots()])]);
  9095. }
  9096. }));
  9097. // CONCATENATED MODULE: ./es/submit-bar/index.js
  9098. // Types
  9099. var submit_bar_use = Object(utils["k" /* use */])('submit-bar'),
  9100. submit_bar_sfc = submit_bar_use[0],
  9101. submit_bar_bem = submit_bar_use[1],
  9102. submit_bar_t = submit_bar_use[2];
  9103. function SubmitBar(h, props, slots, ctx) {
  9104. var tip = props.tip,
  9105. price = props.price;
  9106. var hasPrice = typeof price === 'number';
  9107. return h("div", helper_default()([{
  9108. "class": submit_bar_bem({
  9109. 'safe-area-inset-bottom': props.safeAreaInsetBottom
  9110. })
  9111. }, inherit(ctx)]), [slots.top && slots.top(), (slots.tip || tip) && h("div", {
  9112. "class": submit_bar_bem('tip')
  9113. }, [tip, slots.tip && slots.tip()]), h("div", {
  9114. "class": submit_bar_bem('bar')
  9115. }, [slots["default"] && slots["default"](), h("div", {
  9116. "class": submit_bar_bem('text')
  9117. }, [hasPrice && [h("span", [props.label || submit_bar_t('label')]), h("span", {
  9118. "class": submit_bar_bem('price')
  9119. }, [props.currency + " " + (price / 100).toFixed(props.decimalLength)])]]), h(es_button, {
  9120. "attrs": {
  9121. "square": true,
  9122. "size": "large",
  9123. "type": props.buttonType,
  9124. "loading": props.loading,
  9125. "disabled": props.disabled,
  9126. "text": props.loading ? '' : props.buttonText
  9127. },
  9128. "on": {
  9129. "click": function click() {
  9130. functional_emit(ctx, 'submit');
  9131. }
  9132. }
  9133. })])]);
  9134. }
  9135. SubmitBar.props = {
  9136. tip: String,
  9137. label: String,
  9138. loading: Boolean,
  9139. disabled: Boolean,
  9140. buttonText: String,
  9141. safeAreaInsetBottom: Boolean,
  9142. price: {
  9143. type: Number,
  9144. "default": null
  9145. },
  9146. decimalLength: {
  9147. type: Number,
  9148. "default": 2
  9149. },
  9150. currency: {
  9151. type: String,
  9152. "default": '¥'
  9153. },
  9154. buttonType: {
  9155. type: String,
  9156. "default": 'danger'
  9157. }
  9158. };
  9159. /* harmony default export */ var submit_bar = (submit_bar_sfc(SubmitBar));
  9160. // CONCATENATED MODULE: ./es/mixins/click-outside.js
  9161. var click_outside_ClickOutsideMixin = function ClickOutsideMixin(config) {
  9162. return {
  9163. mounted: function mounted() {
  9164. var _this = this;
  9165. config.handler = function (event) {
  9166. if (!_this.$el.contains(event.target)) {
  9167. _this[config.method]();
  9168. }
  9169. };
  9170. event_on(document, config.event, config.handler);
  9171. },
  9172. beforeDestroy: function beforeDestroy() {
  9173. off(document, config.event, config.handler);
  9174. }
  9175. };
  9176. };
  9177. // CONCATENATED MODULE: ./es/swipe-cell/index.js
  9178. var swipe_cell_use = Object(utils["k" /* use */])('swipe-cell'),
  9179. swipe_cell_sfc = swipe_cell_use[0],
  9180. swipe_cell_bem = swipe_cell_use[1];
  9181. var THRESHOLD = 0.15;
  9182. /* harmony default export */ var swipe_cell = (swipe_cell_sfc({
  9183. mixins: [TouchMixin, click_outside_ClickOutsideMixin({
  9184. event: 'touchstart',
  9185. method: 'onClick'
  9186. })],
  9187. props: {
  9188. onClose: Function,
  9189. disabled: Boolean,
  9190. leftWidth: Number,
  9191. rightWidth: Number
  9192. },
  9193. data: function data() {
  9194. return {
  9195. offset: 0,
  9196. dragging: false
  9197. };
  9198. },
  9199. methods: {
  9200. open: function open(position) {
  9201. var offset = position === 'left' ? this.leftWidth : -this.rightWidth;
  9202. this.swipeMove(offset);
  9203. this.resetSwipeStatus();
  9204. },
  9205. close: function close() {
  9206. this.offset = 0;
  9207. },
  9208. resetSwipeStatus: function resetSwipeStatus() {
  9209. this.swiping = false;
  9210. this.opened = true;
  9211. },
  9212. swipeMove: function swipeMove(offset) {
  9213. if (offset === void 0) {
  9214. offset = 0;
  9215. }
  9216. this.offset = Object(utils["j" /* range */])(offset, -this.rightWidth, this.leftWidth);
  9217. if (this.offset) {
  9218. this.swiping = true;
  9219. } else {
  9220. this.opened = false;
  9221. }
  9222. },
  9223. swipeLeaveTransition: function swipeLeaveTransition(direction) {
  9224. var offset = this.offset,
  9225. leftWidth = this.leftWidth,
  9226. rightWidth = this.rightWidth;
  9227. var threshold = this.opened ? 1 - THRESHOLD : THRESHOLD; // right
  9228. if (direction === 'right' && -offset > rightWidth * threshold && rightWidth > 0) {
  9229. this.open('right'); // left
  9230. } else if (direction === 'left' && offset > leftWidth * threshold && leftWidth > 0) {
  9231. this.open('left'); // reset
  9232. } else {
  9233. this.swipeMove(0);
  9234. }
  9235. },
  9236. startDrag: function startDrag(event) {
  9237. if (this.disabled) {
  9238. return;
  9239. }
  9240. this.dragging = true;
  9241. this.startOffset = this.offset;
  9242. this.touchStart(event);
  9243. },
  9244. onDrag: function onDrag(event) {
  9245. if (this.disabled) {
  9246. return;
  9247. }
  9248. this.touchMove(event);
  9249. if (this.direction === 'horizontal') {
  9250. preventDefault(event);
  9251. this.swipeMove(this.deltaX + this.startOffset);
  9252. }
  9253. },
  9254. endDrag: function endDrag() {
  9255. if (this.disabled) {
  9256. return;
  9257. }
  9258. this.dragging = false;
  9259. if (this.swiping) {
  9260. this.swipeLeaveTransition(this.offset > 0 ? 'left' : 'right');
  9261. }
  9262. },
  9263. onClick: function onClick(position) {
  9264. if (position === void 0) {
  9265. position = 'outside';
  9266. }
  9267. this.$emit('click', position);
  9268. if (!this.offset) {
  9269. return;
  9270. }
  9271. if (this.onClose) {
  9272. this.onClose(position, this);
  9273. } else {
  9274. this.swipeMove(0);
  9275. }
  9276. }
  9277. },
  9278. render: function render(h) {
  9279. var _this = this;
  9280. var onClick = function onClick(position, stop) {
  9281. return function (event) {
  9282. if (stop) {
  9283. event.stopPropagation();
  9284. }
  9285. _this.onClick(position);
  9286. };
  9287. };
  9288. var wrapperStyle = {
  9289. transform: "translate3d(" + this.offset + "px, 0, 0)",
  9290. transition: this.dragging ? 'none' : '.6s cubic-bezier(0.18, 0.89, 0.32, 1)'
  9291. };
  9292. return h("div", {
  9293. "class": swipe_cell_bem(),
  9294. "on": {
  9295. "click": onClick('cell'),
  9296. "touchstart": this.startDrag,
  9297. "touchmove": this.onDrag,
  9298. "touchend": this.endDrag,
  9299. "touchcancel": this.endDrag
  9300. }
  9301. }, [h("div", {
  9302. "class": swipe_cell_bem('wrapper'),
  9303. "style": wrapperStyle,
  9304. "on": {
  9305. "transitionend": function transitionend() {
  9306. _this.swiping = false;
  9307. }
  9308. }
  9309. }, [this.leftWidth ? h("div", {
  9310. "class": swipe_cell_bem('left'),
  9311. "on": {
  9312. "click": onClick('left', true)
  9313. }
  9314. }, [this.slots('left')]) : null, this.slots(), this.rightWidth ? h("div", {
  9315. "class": swipe_cell_bem('right'),
  9316. "on": {
  9317. "click": onClick('right', true)
  9318. }
  9319. }, [this.slots('right')]) : null])]);
  9320. }
  9321. }));
  9322. // CONCATENATED MODULE: ./es/tabbar/index.js
  9323. var tabbar_use = Object(utils["k" /* use */])('tabbar'),
  9324. tabbar_sfc = tabbar_use[0],
  9325. tabbar_bem = tabbar_use[1];
  9326. /* harmony default export */ var tabbar = (tabbar_sfc({
  9327. data: function data() {
  9328. return {
  9329. items: []
  9330. };
  9331. },
  9332. props: {
  9333. value: Number,
  9334. activeColor: String,
  9335. safeAreaInsetBottom: Boolean,
  9336. fixed: {
  9337. type: Boolean,
  9338. "default": true
  9339. },
  9340. zIndex: {
  9341. type: Number,
  9342. "default": 1
  9343. }
  9344. },
  9345. watch: {
  9346. items: function items() {
  9347. this.setActiveItem();
  9348. },
  9349. value: function value() {
  9350. this.setActiveItem();
  9351. }
  9352. },
  9353. methods: {
  9354. setActiveItem: function setActiveItem() {
  9355. var _this = this;
  9356. this.items.forEach(function (item, index) {
  9357. item.active = index === _this.value;
  9358. });
  9359. },
  9360. onChange: function onChange(active) {
  9361. if (active !== this.value) {
  9362. this.$emit('input', active);
  9363. this.$emit('change', active);
  9364. }
  9365. }
  9366. },
  9367. render: function render(h) {
  9368. return h("div", {
  9369. "style": {
  9370. zIndex: this.zIndex
  9371. },
  9372. "class": ['van-hairline--top-bottom', tabbar_bem({
  9373. fixed: this.fixed,
  9374. 'safe-area-inset-bottom': this.safeAreaInsetBottom
  9375. })]
  9376. }, [this.slots()]);
  9377. }
  9378. }));
  9379. // CONCATENATED MODULE: ./es/tabbar-item/index.js
  9380. var tabbar_item_use = Object(utils["k" /* use */])('tabbar-item'),
  9381. tabbar_item_sfc = tabbar_item_use[0],
  9382. tabbar_item_bem = tabbar_item_use[1];
  9383. /* harmony default export */ var tabbar_item = (tabbar_item_sfc({
  9384. props: _extends({}, routeProps, {
  9385. icon: String,
  9386. dot: Boolean,
  9387. info: [String, Number]
  9388. }),
  9389. data: function data() {
  9390. return {
  9391. active: false
  9392. };
  9393. },
  9394. beforeCreate: function beforeCreate() {
  9395. this.$parent.items.push(this);
  9396. },
  9397. destroyed: function destroyed() {
  9398. this.$parent.items.splice(this.$parent.items.indexOf(this), 1);
  9399. },
  9400. methods: {
  9401. onClick: function onClick(event) {
  9402. this.$parent.onChange(this.$parent.items.indexOf(this));
  9403. this.$emit('click', event);
  9404. route(this.$router, this);
  9405. }
  9406. },
  9407. render: function render(h) {
  9408. var icon = this.icon,
  9409. slots = this.slots,
  9410. active = this.active;
  9411. var style = active ? {
  9412. color: this.$parent.activeColor
  9413. } : null;
  9414. return h("div", {
  9415. "class": tabbar_item_bem({
  9416. active: active
  9417. }),
  9418. "style": style,
  9419. "on": {
  9420. "click": this.onClick
  9421. }
  9422. }, [h("div", {
  9423. "class": tabbar_item_bem('icon', {
  9424. dot: this.dot
  9425. })
  9426. }, [slots('icon', {
  9427. active: active
  9428. }) || icon && h(es_icon, {
  9429. "attrs": {
  9430. "name": icon
  9431. }
  9432. }), h(es_info, {
  9433. "attrs": {
  9434. "info": this.info
  9435. }
  9436. })]), h("div", {
  9437. "class": tabbar_item_bem('text')
  9438. }, [slots('default', {
  9439. active: active
  9440. })])]);
  9441. }
  9442. }));
  9443. // CONCATENATED MODULE: ./es/tree-select/index.js
  9444. // Types
  9445. var tree_select_use = Object(utils["k" /* use */])('tree-select'),
  9446. tree_select_sfc = tree_select_use[0],
  9447. tree_select_bem = tree_select_use[1];
  9448. function TreeSelect(h, props, slots, ctx) {
  9449. var height = props.height,
  9450. items = props.items,
  9451. mainActiveIndex = props.mainActiveIndex,
  9452. activeId = props.activeId;
  9453. var selectedItem = items[mainActiveIndex] || {};
  9454. var subItems = selectedItem.children || [];
  9455. return h("div", helper_default()([{
  9456. "class": tree_select_bem(),
  9457. "style": {
  9458. height: height + "px"
  9459. }
  9460. }, inherit(ctx)]), [h("div", {
  9461. "class": tree_select_bem('nav')
  9462. }, [items.map(function (item, index) {
  9463. return h("div", {
  9464. "key": index,
  9465. "class": ['van-ellipsis', tree_select_bem('nitem', {
  9466. active: mainActiveIndex === index,
  9467. disabled: item.disabled
  9468. })],
  9469. "on": {
  9470. "click": function click() {
  9471. if (!item.disabled) {
  9472. functional_emit(ctx, 'navclick', index);
  9473. }
  9474. }
  9475. }
  9476. }, [item.text]);
  9477. })]), h("div", {
  9478. "class": tree_select_bem('content')
  9479. }, [subItems.map(function (item) {
  9480. return h("div", {
  9481. "key": item.id,
  9482. "class": ['van-ellipsis', tree_select_bem('item', {
  9483. active: activeId === item.id,
  9484. disabled: item.disabled
  9485. })],
  9486. "on": {
  9487. "click": function click() {
  9488. if (!item.disabled) {
  9489. functional_emit(ctx, 'itemclick', item);
  9490. }
  9491. }
  9492. }
  9493. }, [item.text, activeId === item.id && h(es_icon, {
  9494. "attrs": {
  9495. "name": "checked",
  9496. "size": "16px"
  9497. },
  9498. "class": tree_select_bem('selected')
  9499. })]);
  9500. })])]);
  9501. }
  9502. TreeSelect.props = {
  9503. items: Array,
  9504. mainActiveIndex: Number,
  9505. activeId: {
  9506. type: [Number, String],
  9507. "default": 0
  9508. },
  9509. height: {
  9510. type: Number,
  9511. "default": 300
  9512. }
  9513. };
  9514. /* harmony default export */ var tree_select = (tree_select_sfc(TreeSelect));
  9515. // CONCATENATED MODULE: ./es/waterfall/directive.js
  9516. /* eslint-disable no-underscore-dangle */
  9517. var CONTEXT = '@@Waterfall';
  9518. var OFFSET = 300; // 处理滚动函数
  9519. function handleScrollEvent() {
  9520. var element = this.el;
  9521. var scrollEventTarget = this.scrollEventTarget; // 已被禁止的滚动处理
  9522. if (this.disabled) return;
  9523. var targetScrollTop = getScrollTop(scrollEventTarget);
  9524. var targetVisibleHeight = getVisibleHeight(scrollEventTarget); // 滚动元素可视区域下边沿到滚动元素元素最顶上 距离
  9525. var targetBottom = targetScrollTop + targetVisibleHeight; // 如果无元素高度,考虑为元素隐藏,直接返回
  9526. if (!targetVisibleHeight) return; // 判断是否到了底
  9527. var needLoadMoreToLower = false;
  9528. if (element === scrollEventTarget) {
  9529. needLoadMoreToLower = scrollEventTarget.scrollHeight - targetBottom < this.offset;
  9530. } else {
  9531. var elementBottom = getElementTop(element) - getElementTop(scrollEventTarget) + getVisibleHeight(element);
  9532. needLoadMoreToLower = elementBottom - targetVisibleHeight < this.offset;
  9533. }
  9534. if (needLoadMoreToLower) {
  9535. this.cb.lower && this.cb.lower({
  9536. target: scrollEventTarget,
  9537. top: targetScrollTop
  9538. });
  9539. } // 判断是否到了顶
  9540. var needLoadMoreToUpper = false;
  9541. if (element === scrollEventTarget) {
  9542. needLoadMoreToUpper = targetScrollTop < this.offset;
  9543. } else {
  9544. var elementTop = getElementTop(element) - getElementTop(scrollEventTarget);
  9545. needLoadMoreToUpper = elementTop + this.offset > 0;
  9546. }
  9547. if (needLoadMoreToUpper) {
  9548. this.cb.upper && this.cb.upper({
  9549. target: scrollEventTarget,
  9550. top: targetScrollTop
  9551. });
  9552. }
  9553. } // 绑定事件到元素上
  9554. // 读取基本的控制变量
  9555. function doBindEvent() {
  9556. var _this = this;
  9557. if (this.el[CONTEXT].binded) {
  9558. return;
  9559. }
  9560. this.el[CONTEXT].binded = true;
  9561. this.scrollEventListener = handleScrollEvent.bind(this);
  9562. this.scrollEventTarget = getScrollEventTarget(this.el);
  9563. var disabledExpr = this.el.getAttribute('waterfall-disabled');
  9564. var disabled = false;
  9565. if (disabledExpr) {
  9566. this.vm.$watch(disabledExpr, function (value) {
  9567. _this.disabled = value;
  9568. _this.scrollEventListener();
  9569. });
  9570. disabled = Boolean(this.vm[disabledExpr]);
  9571. }
  9572. this.disabled = disabled;
  9573. var offset = this.el.getAttribute('waterfall-offset');
  9574. this.offset = Number(offset) || OFFSET;
  9575. event_on(this.scrollEventTarget, 'scroll', this.scrollEventListener, true);
  9576. this.scrollEventListener();
  9577. } // 绑定事件
  9578. function startBind(el) {
  9579. var context = el[CONTEXT];
  9580. context.vm.$nextTick(function () {
  9581. doBindEvent.call(el[CONTEXT]);
  9582. });
  9583. } // 确认何时绑事件监听函数
  9584. function doCheckStartBind(el) {
  9585. var context = el[CONTEXT];
  9586. if (context.vm._isMounted) {
  9587. startBind(el);
  9588. } else {
  9589. context.vm.$on('hook:mounted', function () {
  9590. startBind(el);
  9591. });
  9592. }
  9593. }
  9594. /* harmony default export */ var directive = (function (type) {
  9595. return {
  9596. bind: function bind(el, binding, vnode) {
  9597. if (!el[CONTEXT]) {
  9598. el[CONTEXT] = {
  9599. el: el,
  9600. vm: vnode.context,
  9601. cb: {}
  9602. };
  9603. }
  9604. el[CONTEXT].cb[type] = binding.value;
  9605. doCheckStartBind(el);
  9606. },
  9607. update: function update(el) {
  9608. var context = el[CONTEXT];
  9609. context.scrollEventListener && context.scrollEventListener();
  9610. },
  9611. unbind: function unbind(el) {
  9612. var context = el[CONTEXT];
  9613. if (context.scrollEventTarget) {
  9614. off(context.scrollEventTarget, 'scroll', context.scrollEventListener);
  9615. }
  9616. }
  9617. };
  9618. });
  9619. // CONCATENATED MODULE: ./es/waterfall/index.js
  9620. directive.install = function (Vue) {
  9621. if (false) {}
  9622. Vue.directive('WaterfallLower', directive('lower'));
  9623. Vue.directive('WaterfallUpper', directive('upper'));
  9624. };
  9625. /* harmony default export */ var waterfall = (directive);
  9626. // CONCATENATED MODULE: ./es/index.js
  9627. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  9628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
  9629. /* concated harmony reexport Actionsheet */__webpack_require__.d(__webpack_exports__, "Actionsheet", function() { return actionsheet; });
  9630. /* concated harmony reexport AddressEdit */__webpack_require__.d(__webpack_exports__, "AddressEdit", function() { return address_edit; });
  9631. /* concated harmony reexport AddressList */__webpack_require__.d(__webpack_exports__, "AddressList", function() { return address_list; });
  9632. /* concated harmony reexport Area */__webpack_require__.d(__webpack_exports__, "Area", function() { return es_area; });
  9633. /* concated harmony reexport Badge */__webpack_require__.d(__webpack_exports__, "Badge", function() { return badge; });
  9634. /* concated harmony reexport BadgeGroup */__webpack_require__.d(__webpack_exports__, "BadgeGroup", function() { return badge_group; });
  9635. /* concated harmony reexport Button */__webpack_require__.d(__webpack_exports__, "Button", function() { return es_button; });
  9636. /* concated harmony reexport Card */__webpack_require__.d(__webpack_exports__, "Card", function() { return card; });
  9637. /* concated harmony reexport Cell */__webpack_require__.d(__webpack_exports__, "Cell", function() { return cell; });
  9638. /* concated harmony reexport CellGroup */__webpack_require__.d(__webpack_exports__, "CellGroup", function() { return cell_group; });
  9639. /* concated harmony reexport Checkbox */__webpack_require__.d(__webpack_exports__, "Checkbox", function() { return es_checkbox; });
  9640. /* concated harmony reexport CheckboxGroup */__webpack_require__.d(__webpack_exports__, "CheckboxGroup", function() { return checkbox_group; });
  9641. /* concated harmony reexport Circle */__webpack_require__.d(__webpack_exports__, "Circle", function() { return circle; });
  9642. /* concated harmony reexport Col */__webpack_require__.d(__webpack_exports__, "Col", function() { return col; });
  9643. /* concated harmony reexport Collapse */__webpack_require__.d(__webpack_exports__, "Collapse", function() { return collapse; });
  9644. /* concated harmony reexport CollapseItem */__webpack_require__.d(__webpack_exports__, "CollapseItem", function() { return collapse_item; });
  9645. /* concated harmony reexport ContactCard */__webpack_require__.d(__webpack_exports__, "ContactCard", function() { return contact_card; });
  9646. /* concated harmony reexport ContactEdit */__webpack_require__.d(__webpack_exports__, "ContactEdit", function() { return contact_edit; });
  9647. /* concated harmony reexport ContactList */__webpack_require__.d(__webpack_exports__, "ContactList", function() { return contact_list; });
  9648. /* concated harmony reexport Coupon */__webpack_require__.d(__webpack_exports__, "Coupon", function() { return es_coupon; });
  9649. /* concated harmony reexport CouponCell */__webpack_require__.d(__webpack_exports__, "CouponCell", function() { return coupon_cell; });
  9650. /* concated harmony reexport CouponList */__webpack_require__.d(__webpack_exports__, "CouponList", function() { return coupon_list; });
  9651. /* concated harmony reexport DatetimePicker */__webpack_require__.d(__webpack_exports__, "DatetimePicker", function() { return datetime_picker; });
  9652. /* concated harmony reexport Dialog */__webpack_require__.d(__webpack_exports__, "Dialog", function() { return dialog; });
  9653. /* concated harmony reexport Field */__webpack_require__.d(__webpack_exports__, "Field", function() { return field; });
  9654. /* concated harmony reexport GoodsAction */__webpack_require__.d(__webpack_exports__, "GoodsAction", function() { return goods_action; });
  9655. /* concated harmony reexport GoodsActionBigBtn */__webpack_require__.d(__webpack_exports__, "GoodsActionBigBtn", function() { return goods_action_big_btn; });
  9656. /* concated harmony reexport GoodsActionMiniBtn */__webpack_require__.d(__webpack_exports__, "GoodsActionMiniBtn", function() { return goods_action_mini_btn; });
  9657. /* concated harmony reexport Icon */__webpack_require__.d(__webpack_exports__, "Icon", function() { return es_icon; });
  9658. /* concated harmony reexport ImagePreview */__webpack_require__.d(__webpack_exports__, "ImagePreview", function() { return image_preview; });
  9659. /* concated harmony reexport Info */__webpack_require__.d(__webpack_exports__, "Info", function() { return es_info; });
  9660. /* concated harmony reexport Lazyload */__webpack_require__.d(__webpack_exports__, "Lazyload", function() { return lazyload; });
  9661. /* concated harmony reexport List */__webpack_require__.d(__webpack_exports__, "List", function() { return es_list; });
  9662. /* concated harmony reexport Loading */__webpack_require__.d(__webpack_exports__, "Loading", function() { return es_loading; });
  9663. /* concated harmony reexport Locale */__webpack_require__.d(__webpack_exports__, "Locale", function() { return locale["a" /* default */]; });
  9664. /* concated harmony reexport NavBar */__webpack_require__.d(__webpack_exports__, "NavBar", function() { return nav_bar; });
  9665. /* concated harmony reexport NoticeBar */__webpack_require__.d(__webpack_exports__, "NoticeBar", function() { return notice_bar; });
  9666. /* concated harmony reexport Notify */__webpack_require__.d(__webpack_exports__, "Notify", function() { return notify; });
  9667. /* concated harmony reexport NumberKeyboard */__webpack_require__.d(__webpack_exports__, "NumberKeyboard", function() { return number_keyboard; });
  9668. /* concated harmony reexport Overlay */__webpack_require__.d(__webpack_exports__, "Overlay", function() { return overlay; });
  9669. /* concated harmony reexport Pagination */__webpack_require__.d(__webpack_exports__, "Pagination", function() { return pagination; });
  9670. /* concated harmony reexport Panel */__webpack_require__.d(__webpack_exports__, "Panel", function() { return panel; });
  9671. /* concated harmony reexport PasswordInput */__webpack_require__.d(__webpack_exports__, "PasswordInput", function() { return password_input; });
  9672. /* concated harmony reexport Picker */__webpack_require__.d(__webpack_exports__, "Picker", function() { return es_picker; });
  9673. /* concated harmony reexport Popup */__webpack_require__.d(__webpack_exports__, "Popup", function() { return popup; });
  9674. /* concated harmony reexport Progress */__webpack_require__.d(__webpack_exports__, "Progress", function() { return es_progress; });
  9675. /* concated harmony reexport PullRefresh */__webpack_require__.d(__webpack_exports__, "PullRefresh", function() { return pull_refresh; });
  9676. /* concated harmony reexport Radio */__webpack_require__.d(__webpack_exports__, "Radio", function() { return es_radio; });
  9677. /* concated harmony reexport RadioGroup */__webpack_require__.d(__webpack_exports__, "RadioGroup", function() { return radio_group; });
  9678. /* concated harmony reexport Rate */__webpack_require__.d(__webpack_exports__, "Rate", function() { return es_rate; });
  9679. /* concated harmony reexport Row */__webpack_require__.d(__webpack_exports__, "Row", function() { return row; });
  9680. /* concated harmony reexport Search */__webpack_require__.d(__webpack_exports__, "Search", function() { return search; });
  9681. /* concated harmony reexport Sku */__webpack_require__.d(__webpack_exports__, "Sku", function() { return es_sku; });
  9682. /* concated harmony reexport Slider */__webpack_require__.d(__webpack_exports__, "Slider", function() { return slider; });
  9683. /* concated harmony reexport Step */__webpack_require__.d(__webpack_exports__, "Step", function() { return step; });
  9684. /* concated harmony reexport Stepper */__webpack_require__.d(__webpack_exports__, "Stepper", function() { return stepper; });
  9685. /* concated harmony reexport Steps */__webpack_require__.d(__webpack_exports__, "Steps", function() { return steps; });
  9686. /* concated harmony reexport SubmitBar */__webpack_require__.d(__webpack_exports__, "SubmitBar", function() { return submit_bar; });
  9687. /* concated harmony reexport Swipe */__webpack_require__.d(__webpack_exports__, "Swipe", function() { return swipe; });
  9688. /* concated harmony reexport SwipeCell */__webpack_require__.d(__webpack_exports__, "SwipeCell", function() { return swipe_cell; });
  9689. /* concated harmony reexport SwipeItem */__webpack_require__.d(__webpack_exports__, "SwipeItem", function() { return swipe_item; });
  9690. /* concated harmony reexport Switch */__webpack_require__.d(__webpack_exports__, "Switch", function() { return es_switch; });
  9691. /* concated harmony reexport SwitchCell */__webpack_require__.d(__webpack_exports__, "SwitchCell", function() { return switch_cell; });
  9692. /* concated harmony reexport Tab */__webpack_require__.d(__webpack_exports__, "Tab", function() { return es_tab; });
  9693. /* concated harmony reexport Tabbar */__webpack_require__.d(__webpack_exports__, "Tabbar", function() { return tabbar; });
  9694. /* concated harmony reexport TabbarItem */__webpack_require__.d(__webpack_exports__, "TabbarItem", function() { return tabbar_item; });
  9695. /* concated harmony reexport Tabs */__webpack_require__.d(__webpack_exports__, "Tabs", function() { return es_tabs; });
  9696. /* concated harmony reexport Tag */__webpack_require__.d(__webpack_exports__, "Tag", function() { return es_tag; });
  9697. /* concated harmony reexport Toast */__webpack_require__.d(__webpack_exports__, "Toast", function() { return es_toast; });
  9698. /* concated harmony reexport TreeSelect */__webpack_require__.d(__webpack_exports__, "TreeSelect", function() { return tree_select; });
  9699. /* concated harmony reexport Uploader */__webpack_require__.d(__webpack_exports__, "Uploader", function() { return uploader; });
  9700. /* concated harmony reexport Waterfall */__webpack_require__.d(__webpack_exports__, "Waterfall", function() { return waterfall; });
  9701. /* eslint-disable */
  9702. // This file is auto gererated by build/build-entry.js
  9703. var version = '1.6.19';
  9704. var components = [actionsheet, address_edit, address_list, es_area, badge, badge_group, es_button, card, cell, cell_group, es_checkbox, checkbox_group, circle, col, collapse, collapse_item, contact_card, contact_edit, contact_list, es_coupon, coupon_cell, coupon_list, datetime_picker, dialog, field, goods_action, goods_action_big_btn, goods_action_mini_btn, es_icon, image_preview, es_info, es_list, es_loading, nav_bar, notice_bar, notify, number_keyboard, overlay, pagination, panel, password_input, es_picker, popup, es_progress, pull_refresh, es_radio, radio_group, es_rate, row, search, es_sku, slider, step, stepper, steps, submit_bar, swipe, swipe_cell, swipe_item, es_switch, switch_cell, es_tab, tabbar, tabbar_item, es_tabs, es_tag, es_toast, tree_select, uploader];
  9705. var install = function install(Vue) {
  9706. components.forEach(function (Component) {
  9707. Vue.use(Component);
  9708. });
  9709. };
  9710. /* istanbul ignore if */
  9711. if (typeof window !== 'undefined' && window.Vue) {
  9712. install(window.Vue);
  9713. }
  9714. /* harmony default export */ var es = __webpack_exports__["default"] = ({
  9715. install: install,
  9716. version: version
  9717. });
  9718. /***/ })
  9719. /******/ ]);
  9720. });